rip Docker, long live systemd
This commit is contained in:
parent
b7116cb13f
commit
7c4bb9acca
15 changed files with 184 additions and 201 deletions
10
tools/systemd/ttvdrops-backup.service
Normal file
10
tools/systemd/ttvdrops-backup.service
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=TTVDrops database backup
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ttvdrops
|
||||
Group=ttvdrops
|
||||
WorkingDirectory=/home/ttvdrops/ttvdrops
|
||||
EnvironmentFile=/home/ttvdrops/ttvdrops/.env
|
||||
ExecStart=/usr/bin/uv run python manage.py backup_db
|
||||
9
tools/systemd/ttvdrops-backup.timer
Normal file
9
tools/systemd/ttvdrops-backup.timer
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Nightly TTVDrops database backup
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 02:15:00
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
12
tools/systemd/ttvdrops-import-drops.service
Normal file
12
tools/systemd/ttvdrops-import-drops.service
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=TTVDrops import drops from pending directory
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ttvdrops
|
||||
Group=ttvdrops
|
||||
WorkingDirectory=/home/ttvdrops/ttvdrops
|
||||
EnvironmentFile=/home/ttvdrops/ttvdrops/.env
|
||||
ExecStart=/usr/bin/uv run python manage.py better_import_drops /mnt/fourteen/Data/Responses/pending
|
||||
-ExecStartPost=/usr/bin/uv run python manage.py download_box_art
|
||||
-ExecStartPost=/usr/bin/uv run python manage.py download_campaign_images
|
||||
10
tools/systemd/ttvdrops-import-drops.timer
Normal file
10
tools/systemd/ttvdrops-import-drops.timer
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=Frequent TTVDrops import drops timer
|
||||
|
||||
[Timer]
|
||||
OnBootSec=0
|
||||
OnUnitActiveSec=1min
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
32
tools/systemd/ttvdrops.service
Normal file
32
tools/systemd/ttvdrops.service
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
[Unit]
|
||||
Description=TTVDrops
|
||||
Requires=ttvdrops.socket
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=ttvdrops
|
||||
Group=ttvdrops
|
||||
WorkingDirectory=/home/ttvdrops/ttvdrops
|
||||
EnvironmentFile=/home/ttvdrops/ttvdrops/.env
|
||||
RuntimeDirectory=ttvdrops
|
||||
UMask=0077
|
||||
ExecStart=/usr/bin/uv run gunicorn config.wsgi:application --bind unix:/run/ttvdrops/ttvdrops.sock --workers 13 --name ttvdrops --max-requests-jitter 50 --max-requests 1200
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
ProtectSystem=full
|
||||
ProtectHome=no
|
||||
ReadWritePaths=/home/ttvdrops/ttvdrops /run/ttvdrops /mnt/fourteen/Data/Responses
|
||||
PrivateDevices=yes
|
||||
CapabilityBoundingSet=
|
||||
AmbientCapabilities=
|
||||
RestrictRealtime=yes
|
||||
LockPersonality=yes
|
||||
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
11
tools/systemd/ttvdrops.socket
Normal file
11
tools/systemd/ttvdrops.socket
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=TTVDrops Socket
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/ttvdrops/ttvdrops.sock
|
||||
SocketUser=ttvdrops
|
||||
SocketGroup=ttvdrops
|
||||
SocketMode=0660
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue