rip Docker, long live systemd

This commit is contained in:
Joakim Hellsén 2026-02-21 06:05:07 +01:00
commit 7c4bb9acca
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
15 changed files with 184 additions and 201 deletions

View 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

View file

@ -0,0 +1,9 @@
[Unit]
Description=Nightly TTVDrops database backup
[Timer]
OnCalendar=*-*-* 02:15:00
Persistent=true
[Install]
WantedBy=timers.target

View 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

View file

@ -0,0 +1,10 @@
[Unit]
Description=Frequent TTVDrops import drops timer
[Timer]
OnBootSec=0
OnUnitActiveSec=1min
Persistent=true
[Install]
WantedBy=timers.target

View 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

View 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