[Unit] Description=Signal Twitter Video Bot After=network.target docker.service Requires=docker.service [Service] Type=simple User=YOUR_USER WorkingDirectory=/home/YOUR_USER/signal-bot # The bot's own Signal number (the account it's linked to as a device). Environment=SIGNAL_PHONE_NUMBER=+15551234567 Environment=SIGNAL_SERVICE=127.0.0.1:8080 # Optional: comma-separated numbers allowed to run /cookies (admin command). # Environment=BOT_ADMINS=+15551234567 # Optional: enable /force, which hosts oversized videos as temporary links. # The bot rsyncs the file (over SSH) into a web-served directory and posts the URL; # an hourly job deletes anything older than 24h and evicts oldest past 10 GB. # Leave unset to disable /force. All three of REMOTE/REMOTE_DIR/BASE_URL are required. # Environment=FORCE_REMOTE=user@webhost # ssh target that can write the docroot # Environment=FORCE_REMOTE_DIR=/var/www/site/media # docroot on that host # Environment=FORCE_BASE_URL=https://site/media # public URL serving that docroot # Environment=FORCE_SSH_PORT=22 # ssh port (default 22) # Environment=FORCE_SSH_KEY=/home/YOUR_USER/.ssh/id_ed25519 # ssh identity (optional) ExecStart=/home/YOUR_USER/signal-bot/venv/bin/python bot.py # always (not on-failure): the bot's library swallows exceptions in its own run # loop and never exits non-zero even when wedged, so on-failure would never bounce it. Restart=always RestartSec=10 [Install] WantedBy=multi-user.target