# The Noderunners Download Bot: core. # # install -m 0755 bin/core /usr/local/bin/dlbot-core # useradd --system --home-dir /var/lib/dlbot --create-home dlbot # install -d -m 0750 -o dlbot -g dlbot /etc/dlbot # install -m 0640 -o dlbot -g dlbot .env /etc/dlbot/core.env # systemctl enable --now dlbot-core # # Paths in core.env should be absolute, for example # DB_DSN=/var/lib/dlbot/dlbot.db # STORAGE_LOCAL_DIR=/var/lib/dlbot/files # WORKER_TEMP_DIR=/var/lib/dlbot/tmp [Unit] Description=The Noderunners Download Bot (core) Documentation=https://github.com/noderunners/dlbot After=network-online.target Wants=network-online.target [Service] Type=simple User=dlbot Group=dlbot WorkingDirectory=/var/lib/dlbot EnvironmentFile=/etc/dlbot/core.env ExecStart=/usr/local/bin/dlbot-core Restart=on-failure RestartSec=5 # The core hands running jobs back to the queue on SIGTERM. TimeoutStopSec=30 KillSignal=SIGTERM # Hardening. The core only writes below /var/lib/dlbot. NoNewPrivileges=true ProtectSystem=strict ProtectHome=true PrivateTmp=true PrivateDevices=true ProtectKernelTunables=true ProtectKernelModules=true ProtectControlGroups=true RestrictSUIDSGID=true LockPersonality=true ReadWritePaths=/var/lib/dlbot UMask=0027 [Install] WantedBy=multi-user.target