-
Notifications
You must be signed in to change notification settings - Fork 0
Server Installation
This page covers a first-time production server install. It avoids secrets and uses placeholder names where values are private.
Use an Ubuntu server with a regular deployment user. The common production path is:
/home/ubuntu/discord-screenshot-botInstall normal system basics such as Python, Git, build tools, and Nginx/Certbot if the installer does not handle them for your environment.
Use the project repository or the official release installer. If working from source, the app should end up at:
cd /home/ubuntu/discord-screenshot-botThe main files on the server are:
bot.pydashboard.pyconfig.pydatabase_migrations.pydatabase_backend.pyconfig.jsonscripts/systemd/nginx/media/
From the app directory:
cd /home/ubuntu/discord-screenshot-bot
bash scripts/install_ubuntu.shDedicated service user option:
cd /home/ubuntu/discord-screenshot-bot
SDAC_APP_USER=sdac SDAC_CREATE_APP_USER=1 bash scripts/install_ubuntu.shThe installer should set up the Python environment, service files, database prerequisites, and initial dashboard owner flow depending on the installed version.
Production commonly uses:
/etc/sdac-bot/sdac.env
Document variable names only. Add real values on the server, not in the wiki:
DISCORD_TOKEN=
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
DISCORD_REDIRECT_URI=
SDAC_ADMIN_KEY=
SDAC_PUBLIC_BASE_URL=
SDAC_MEDIA_PUBLIC_BASE_URL=
SDAC_DATABASE_URL=
Only DISCORD_TOKEN is required for the bot to log in. OAuth variables are required for Discord OAuth login. SDAC_DATABASE_URL is experimental and only needed for PostgreSQL testing.
The app user needs access to:
- The app directory.
-
config.json. -
sdac.db. -
media/. - Backup directories.
- The env file.
The env file should not be world-writable. Avoid printing its contents in logs or screenshots.
Run migrations after install or update:
cd /home/ubuntu/discord-screenshot-bot
venv/bin/python scripts/migrate_database.py --db sdac.dbExpected services:
sdac-bot.servicesdac-dashboard.service
Useful commands:
sudo systemctl daemon-reload
sudo systemctl enable sdac-bot
sudo systemctl enable sdac-dashboard
sudo systemctl restart sdac-bot
sudo systemctl restart sdac-dashboard
sudo systemctl status sdac-bot --no-pager
sudo systemctl status sdac-dashboard --no-pagerIf using a public dashboard domain:
cd /home/ubuntu/discord-screenshot-bot
SDAC_DOMAIN=YOUR_DOMAIN bash scripts/install_nginx_site.sh
sudo certbot --nginx -d YOUR_DOMAIN --cert-name YOUR_DOMAIN --key-type rsa
sudo certbot renew --dry-runAfter HTTPS is active, OAuth redirect URLs should use the public HTTPS URL.
If the installer did not create the first owner account, create/reset one from the server shell:
cd /home/ubuntu/discord-screenshot-bot
venv/bin/python scripts/reset_admin_login.py --username owner --role ownerCreate an admin with an email and Discord link:
venv/bin/python scripts/reset_admin_login.py --username alex --email alex@example.com --discord-user-id 123456789012345678 --role adminUse example values in docs only. Do not publish real private account details unless they are intentionally public.
If sdac-update is not installed yet, install it from the latest official release installer/update script. After it is installed:
sdac-update latest-officialUseful aliases:
sdac-update "Version 3"
sdac-update latest-experimental
sdac-update 3.1.0Local health:
curl http://127.0.0.1:5000/healthPublic health:
curl -I https://YOUR_DOMAIN/healthService logs:
journalctl -u sdac-bot -n 80 --no-pager
journalctl -u sdac-dashboard -n 80 --no-pager
journalctl -u nginx -n 80 --no-pagerAfter the server is installed:
- Continue to Bot Setup.
- Then continue to Dashboard Setup.
- Then configure Maintenance and Backups.