GGlyphDocs

configuration

Environment Variables

Every variable in .env.example, what it does, and what to set it to.

Glyph reads its configuration from environment variables, defined in a .env file at the project root. The shipped .env.example is the source of truth for every supported variable.

Database

VariableDefaultRequiredDescription
MYSQL_ROOT_PASSWORDchangeme_rootYesRoot password for the MySQL container. Used for administrative tasks like backups.
MYSQL_PASSWORDchangemeYesPassword for the glyph MySQL user that the backend connects with.

The MySQL container is named db in docker-compose.yml. The database itself is glyph, the user is glyph. Connection string is built automatically as:

mysql+pymysql://glyph:${MYSQL_PASSWORD}@db:3306/glyph

Choose long random passwords. The changeme* defaults are placeholders only.

Security

VariableDefaultRequiredDescription
SECRET_KEYplaceholderYesSecret used for signing JWT tokens AND encrypting stored Personal Access Tokens. 64 characters minimum.

Generate a secure value with:

python3 -c "import secrets; print(secrets.token_hex(32))"

Changing SECRET_KEY invalidates every existing session AND every stored PAT. Users will be signed out and connected GitHub/GitLab accounts must be reconnected. Pick a value at install and never rotate without a plan.

JWT tokens are signed with HS256 and expire after 7 days.

VariableDefaultRequiredDescription
MEILISEARCH_KEYchangeme_meili_master_keyYesMaster key for the Meilisearch container. Used by the backend to authenticate.

The Meilisearch container is named meilisearch. The backend connects to http://meilisearch:7700. The port is not exposed outside the Docker network.

GitHub OAuth

These are optional - only needed if you want users to sign into Glyph using GitHub OAuth (separate from connecting personal accounts via PAT).

VariableDefaultRequiredDescription
GITHUB_CLIENT_IDemptyNoClient ID from your GitHub OAuth App.
GITHUB_CLIENT_SECRETemptyNoSecret from your GitHub OAuth App.

See GitHub OAuth for setup.

GitLab OAuth

Same pattern as GitHub.

VariableDefaultRequiredDescription
GITLAB_CLIENT_IDemptyNoApplication ID from your GitLab OAuth App.
GITLAB_CLIENT_SECRETemptyNoSecret from your GitLab OAuth App.

See GitLab OAuth for setup.

Email

At least one provider is needed to send invitation emails. Without any, Glyph still creates invitations but you must share the link manually.

Provider priority (highest first): Resend → SendGrid → Mailgun → SMTP. The first non-empty configuration wins.

SMTP (generic)

VariableDefaultDescription
SMTP_HOSTemptyHostname of the SMTP server.
SMTP_PORT587TCP port. STARTTLS is used unless port is 465 (implicit TLS).
SMTP_USERemptySMTP username.
SMTP_PASSWORDemptySMTP password (or app-specific password).

Resend

VariableDescription
RESEND_API_KEYAPI key from resend.com. Recommended for new setups.

SendGrid

VariableDescription
SENDGRID_API_KEYAPI key from sendgrid.com.

Mailgun

VariableDescription
MAILGUN_API_KEYAPI key from mailgun.com.
MAILGUN_DOMAINMailgun sending domain. Both key and domain required.

Sender address

VariableDefaultDescription
EMAIL_FROMnoreply@glyph.appThe "From" address used by every provider. Use a domain you own and is verified with your provider.

See Email Providers for end-to-end setup.

URLs

VariableDefaultDescription
FRONTEND_URLhttp://localhost:3000Public URL of the frontend. Used in invitation emails.
NEXT_PUBLIC_API_URLhttp://localhost:8000Public URL of the backend, used by the browser.
APP_URLhttp://localhost:8000Public URL of the backend. Used for OAuth redirects.
CORS_ORIGINShttp://localhost:3000Comma-separated list of allowed origins for CORS.

For production behind a reverse proxy, set all four to your public HTTPS URLs. See Reverse Proxy.

Internal (no need to edit)

These are set in docker-compose.yml and shouldn't normally be changed:

VariableDefaultDescription
DATA_DIR/dataWhere the backend stores cloned repositories. Backed by volumes/data.
MEILISEARCH_URLhttp://meilisearch:7700Internal URL of the Meilisearch container.
DATABASE_URLcomputedBuilt from MYSQL_PASSWORD automatically.

Verifying

After editing .env, restart the stack:

docker compose -f docker-compose.prod.yml up -d

Check the backend logs to confirm it started cleanly:

docker compose logs backend

If a required variable is missing, the backend exits with a clear error.