Skip to content

Docker Secrets

solyto uses Docker secrets to manage sensitive credentials. Passwords, API keys, and tokens are stored as files in the ./secrets/ directory and mounted into containers at runtime. This keeps secrets out of environment variables and version control.

Each secret is a plain text file in ./secrets/. The filename is the secret name:

secrets/
app_key
db_user
db_password
ai_api_key
...

Laravel and other services read secrets using the _FILE suffix convention. For example, DB_PASSWORD_FILE=/run/secrets/db_password tells Laravel to read the database password from that file instead of from an environment variable.

Docker Compose mounts these files as read-only into containers under /run/secrets/.

These 7 secrets must be present for solyto to start:

SecretDescriptionUsed by
app_keyLaravel encryption key (format: base64:...)api, queue
db_userMariaDB application userapi, queue, mariadb
db_passwordMariaDB application passwordapi, queue, mariadb
dav_db_userPostgreSQL DAV userdav, postgres
dav_db_passwordPostgreSQL DAV passworddav, postgres
mariadb_root_passwordMariaDB root passwordmariadb
postgres_root_passwordPostgreSQL superuser passwordpostgres

The MariaDB user and password are provided by db_user / db_password (the same credentials the API uses).

These 11 secrets enable optional features. Create empty files or omit them if not needed:

SecretDescriptionEnables
solyto_bot_webhook_tokenTelegram bot webhook tokenTelegram Bot
solyto_bot_telegram_tokenTelegram bot API tokenTelegram Bot
hardcover_api_keyHardcover book API keyBook metadata imports
ai_api_keyAI provider API keyLibrary recommendations
mailgun_secretMailgun API keyEmail notifications
vapid_public_keyWeb Push public keyBrowser push notifications
vapid_private_keyWeb Push private keyBrowser push notifications
bgg_api_keyBoardGameGeek API keyGame metadata
tmdb_access_tokenTMDB API access tokenMovie metadata
imgproxy_keyImgproxy authentication keyImage processing via imgproxy
imgproxy_saltImgproxy URL signing saltImage processing via imgproxy

The setup script generates all required secrets automatically:

Terminal window
curl -fsSL "https://raw.githubusercontent.com/solyto/selfhosted/main/setup.sh?$(date +%s)" | bash

If you need to regenerate a secret manually:

Terminal window
# Random hex password (32 bytes)
openssl rand -hex 32 > secrets/db_password
# Laravel app key
echo "base64:$(openssl rand -base64 32)" > secrets/app_key
# Simple username
echo "solyto" > secrets/db_user
# API key (paste your own)
echo "sk-your-openai-key-here" > secrets/ai_api_key
  • Never commit secrets to version control — the secrets/ directory should be in .gitignore
  • File permissions — restrict access to secret files: chmod 600 secrets/*
  • Backups — back up your secrets/ directory securely. If you lose these files, you may need to reset database credentials
  • Rotation — to rotate a secret, update the file and restart the affected services with docker compose up -d

If a service fails to start, check that the required secret files exist and are readable:

Terminal window
ls -la secrets/
docker compose logs api

Common issues include missing files, empty files, or trailing newlines in secret files.