# cocoon configuration options
command_user="cocoon:cocoon" # user:group
directory="/var/lib/cocoon"
supervisor="supervise-daemon"
error_log="/var/log/cocoon.log"

## BEGIN environment variables
set -a # enable auto-export variables

# Server configuration
COCOON_ADDR=":8080"
COCOON_DB_NAME="$directory/cocoon.db"
COCOON_LOG_LEVEL="info" # debug, info, warn, error

# Required settings
COCOON_DID="did:web:your-domain.com"
COCOON_HOSTNAME="your-domain.com"
COCOON_CONTACT_EMAIL="you@example.com"
COCOON_ROTATION_KEY_PATH="$directory/rotation.key" # Generate with: cocoon create-rotation-key
COCOON_JWK_PATH="$directory/jwk.key" # Generate with: cocoon create-private-jwk
COCOON_ADMIN_PASSWORD="" # Generate with: openssl rand -hex 16
COCOON_SESSION_SECRET="" # Generate with: openssl rand -hex 32
COCOON_RELAYS="https://bsky.network"

# Optional: SMTP settings for email
#COCOON_SMTP_USER="your-smtp-username"
#COCOON_SMTP_PASS="your-smtp-password"
#COCOON_SMTP_HOST="smtp.example.com"
#COCOON_SMTP_PORT="587"
#COCOON_SMTP_EMAIL="noreply@example.com"
#COCOON_SMTP_NAME="Cocoon PDS"

# Optional: S3 configuration
# S3 configuration (works with AWS S3, MinIO, Cloudflare R2, etc.)
#COCOON_S3_REGION="us-east-1"
#COCOON_S3_BUCKET="your-bucket"
#COCOON_S3_ENDPOINT="https://s3.amazonaws.com"
#COCOON_S3_ACCESS_KEY="your-access-key"
#COCOON_S3_SECRET_KEY="your-secret-key"
# Enable S3 backups (SQLite databases only - hourly backups)
#COCOON_S3_BACKUPS_ENABLED=true
# Enable S3 for blob storage (images, videos, etc.)
# When enabled, blobs are stored in S3 instead of the database
#COCOON_S3_BLOBSTORE_ENABLED=true
# Optional: CDN/public URL for blob redirects
# When set, com.atproto.sync.getBlob redirects to this URL instead of proxying
#COCOON_S3_CDN_URL="https://cdn.example.com"

# Optional: Fallback proxy
#COCOON_FALLBACK_PROXY=""

set +a # disable auto-export variables (don't remove!)
## END environment variables
