Skip to content

Configuration

Chuck edited this page Nov 15, 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.
LOG_LEVEL No info fatal, error, warn, info, debug, trace or silent. Since v0.1.18; see Logging.

¹ 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).

Logging

Since v0.1.18 Glint logs with pino: one JSON object per line on stdout. Earlier versions printed plain text such as [webhook] Posted AI summary to MR !42, so update anything that parses or greps the old format when you upgrade.

Each line has level, time (ISO 8601), service (glint) and msg, plus fields for the event being handled: event (merge_request or release), projectId, mrIid or tag, and durationMs when processing finishes. Failures carry an error field with a one-line description (method, path, status, message). Request headers are never logged, so GITLAB_TOKEN stays out of the logs.

{"level":"info","time":"2026-11-14T20:15:02.311Z","service":"glint","event":"merge_request","projectId":12,"mrIid":42,"durationMs":8423,"msg":"Posted AI summary"}
LOG_LEVEL Logs
warn Only problems: rejected webhooks (bad token or signature, invalid payload) and failed processing
info (default) Also startup, and each event processed with its outcome and duration
debug Also webhooks that were ignored (unhandled event types and actions)

The value is case-insensitive; anything else stops Glint at startup. To read the logs by eye, pipe them through pino-pretty (docker logs glint | npx pino-pretty) or filter them with jq, for example docker logs glint | jq 'select(.level=="error")'.


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

# fatal, error, warn, info, debug, trace or silent
# LOG_LEVEL=info

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.
LOG_LEVEL must be one of fatal, error, warn, info, debug, trace, silent (got "verbose") LOG_LEVEL isn't a level pino knows.

Clone this wiki locally