Server deployment
Running BeaconAuth as a standalone server.
Run locally
beacon serveSet configuration via environment variables or CLI flags. See the Configuration page.
Database setup
Run migrations and manage users with the CLI:
beacon migrate --database-url sqlite://./beacon_auth.db
beacon create-user --username admin --password your_secure_password
beacon list-users
beacon delete-user --username adminDocker Compose (production)
version: "3.8"
services:
beaconauth:
image: ghcr.io/summpot/beacon_auth:latest
ports:
- "8080:8080"
volumes:
- ./data:/app/data
environment:
DATABASE_URL: sqlite:///app/data/beacon_auth.db
BIND_ADDRESS: 0.0.0.0:8080
JWT_EXPIRATION: 7200
BASE_URL: https://auth.example.com
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
MICROSOFT_CLIENT_ID: ${MICROSOFT_CLIENT_ID}
MICROSOFT_CLIENT_SECRET: ${MICROSOFT_CLIENT_SECRET}
MICROSOFT_TENANT: ${MICROSOFT_TENANT}
restart: unless-stoppedStart the service:
docker-compose up -dReverse proxy (Nginx)
server {
listen 80;
server_name auth.example.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}For HTTPS, use Let's Encrypt:
certbot --nginx -d auth.example.com