Skip to content

Configuration

Chuck edited this page Nov 13, 2026 · 4 revisions

Glint is configured entirely through environment variables. It reads them once, at startup, and exits with an error if anything required is missing or invalid — so a bad setting shows up when you deploy, not on the first webhook.


Where the values come from

How you run Glint Where to put the variables
From source (npm start, npm run dev) webhook-receiver/.env — loaded automatically with dotenv
docker run --env-file <file> or -e NAME=value
Docker Compose env_file: or environment: in docker-compose.yml — see Deployment
systemd EnvironmentFile= in the unit

Variables already set in the process environment take precedence over .env; Glint never overrides them. A .env file is not copied into the Docker image (it is excluded by .dockerignore), so in a container the values must be passed in at runtime.


Reference

At least one of WEBHOOK_SECRET or WEBHOOK_SIGNING_TOKEN must be set.

Variable Required Default Description
GITLAB_BASE_URL Yes — Base URL of your GitLab instance, e.g. https://gitlab.example.com. No trailing slash; Glint appends /api/v4/….
GITLAB_TOKEN Yes — GitLab access token with api scope. Sent as the PRIVATE-TOKEN header.
ANTHROPIC_API_KEY Yes — Anthropic API key used for every summary and release note.
WEBHOOK_SECRET One of¹ — Legacy shared secret, compared with GitLab's X-Gitlab-Token header.
WEBHOOK_SIGNING_TOKEN One of¹ — GitLab signing token (whsec_…, GitLab 19.0+). Enables HMAC-SHA256 verification with replay protection.
ANTHROPIC_MODEL No claude-sonnet-4-6 Claude model ID used for both features.
GITLAB_CA_FILE No — Path to a PEM CA certificate or bundle to trust for GitLab, in addition to the public CAs. Checked at startup.
GITLAB_REJECT_UNAUTHORIZED No true Set to false to turn off TLS verification for GitLab. Last resort only.
PORT No 3000 Port the HTTP server listens on.

¹ If both are set, only the signing token is checked; requests that carry only X-Gitlab-Token are rejected. Configure GitLab to match.


Details

GitLab token

Glint uses the token to read MR details and diffs, read releases, compare tags, post MR comments and update release descriptions. It needs the api scope (there is no narrower scope that allows writing comments).

Because api is broad, limit where the token works rather than what it can do:

  • Project or group access token — scoped to one project or group, and its comments appear under a bot identity. Requires the role to comment and edit releases (Developer or above).
  • Dedicated bot user with a personal access token — add the user only to the projects you want reviewed.
  • Avoid a personal token of an administrator or of your own account; anyone who obtains it gets everything you can access.

Comments are posted as whichever user owns the token.

Webhook authentication

Mode Set GitLab field Checks
Signing token (recommended) WEBHOOK_SIGNING_TOKEN Signing token HMAC-SHA256 over the message ID, timestamp and raw body (Standard Webhooks); rejects requests more than 5 minutes old
Legacy secret WEBHOOK_SECRET Secret token Constant-time comparison with X-Gitlab-Token

The signing token can be pasted with or without its whsec_ prefix. See GitLab Webhook Setup.

Model

ANTHROPIC_MODEL accepts any Claude model ID your API key can use. Both features ask for at most 1,024 output tokens, so a faster, cheaper model is usually enough for summaries. Check Anthropic's models overview for current IDs; an ID your key can't use makes every request fail with an error in the log.

TLS

Leave GITLAB_REJECT_UNAUTHORIZED unset. If your GitLab certificate is signed by a private CA, set GITLAB_CA_FILE instead — see Private CA and TLS. Startup fails if the file can't be read or contains no -----BEGIN CERTIFICATE----- block.

Port

In Docker, keep PORT at 3000: the image's health check and the Compose port mapping both expect the container to listen on 3000. Change the host side of the mapping instead (-p 8080:3000).


Example .env

PORT=3000
GITLAB_BASE_URL=https://gitlab.example.com
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx

# Recommended on GitLab 19.0+
WEBHOOK_SIGNING_TOKEN=whsec_xxxxxxxxxxxxxxxxxxxx
# Older GitLab versions
# WEBHOOK_SECRET=your-webhook-secret

ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxx
# ANTHROPIC_MODEL=claude-sonnet-4-6

# Private or self-signed CA for GitLab
# GITLAB_CA_FILE=/path/to/ca.crt

The repository ships the same template as webhook-receiver/.env.example.


Startup errors

Message Meaning
Missing required environment variable: GITLAB_TOKEN A required variable is unset or empty.
At least one of WEBHOOK_SECRET or WEBHOOK_SIGNING_TOKEN must be set No webhook authentication configured.
GITLAB_CA_FILE: cannot read "/certs/ca.crt": ENOENT The CA file path is wrong, or the file isn't mounted into the container.
GITLAB_CA_FILE: "/certs/ca.crt" does not contain a PEM certificate The file exists but isn't PEM (for example a DER .cer). Convert it with openssl x509 -inform der -in ca.cer -out ca.crt.

Clone this wiki locally