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.
AI_PROVIDER No anthropic anthropic or openai-compatible. Since v0.1.20; see AI providers.
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.
OPENAI_BASE_URL No https://api.openai.com/v1 Base URL of the OpenAI-compatible API, including its /v1 path.
OPENAI_MODEL Yes³ — Model name to request, e.g. gpt-4o-mini or llama3.2.
OPENAI_API_KEY No — API key for the OpenAI-compatible API. Leave unset for servers that need none, such as Ollama.
MAX_DIFF_CHARS No 20000 Most characters of diff sent to the model (minimum 1000). Since v0.1.20; see Diff size.
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. ² Required when AI_PROVIDER is anthropic (the default). ³ Required when AI_PROVIDER is openai-compatible.


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.

AI providers

Since v0.1.20 Glint can use either of two providers, chosen with AI_PROVIDER. Both get the same prompts.

AI_PROVIDER Talks to Required settings
anthropic (default) The Anthropic API ANTHROPIC_API_KEY
openai-compatible Any server that implements the OpenAI Chat Completions API OPENAI_MODEL; usually OPENAI_BASE_URL; OPENAI_API_KEY if the server needs one

Ollama (local, nothing leaves your network)

AI_PROVIDER=openai-compatible
OPENAI_BASE_URL=http://localhost:11434/v1
OPENAI_MODEL=llama3.2
MAX_DIFF_CHARS=8000

Pull the model first (ollama pull llama3.2). If Glint runs in Docker and Ollama on the host, use http://host.docker.internal:11434/v1; on Linux also add extra_hosts: ["host.docker.internal:host-gateway"] to the Compose service.

OpenAI

AI_PROVIDER=openai-compatible
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxx
OPENAI_MODEL=gpt-4o-mini

Other compatible services use the same settings with their own base URL: Google Gemini (https://generativelanguage.googleapis.com/v1beta/openai), OpenRouter (https://openrouter.ai/api/v1), LM Studio, vLLM. Only Anthropic and Ollama are tested by the maintainers. The others should work if they accept a bearer API key and a standard POST /chat/completions request. Azure OpenAI authenticates differently and isn't supported yet.

How the OpenAI-compatible provider behaves:

  • OPENAI_BASE_URL includes the /v1 path; Glint appends /chat/completions. Trailing slashes are removed.
  • OPENAI_API_KEY is sent as Authorization: Bearer … only when set.
  • No output-token limit is sent, because the parameter's name differs between servers. The prompts ask for concise output.
  • Requests time out after five minutes, to allow for slow local models.
  • Small local models write weaker summaries than Claude or other large hosted models.

Diff size

MAX_DIFF_CHARS (default 20000, minimum 1000) caps how much diff text is sent to the model, for either provider. Anything beyond it is cut and the model is told so. Lower it for local models with a small context window: if summaries ignore later files or come back empty, the diff is probably overflowing the model's context.

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.

With the OpenAI-compatible provider the model comes from OPENAI_MODEL instead, and ANTHROPIC_MODEL is ignored. The startup log line shows the provider and model in use.

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

# Or an OpenAI-compatible provider instead of Anthropic
# AI_PROVIDER=openai-compatible
# OPENAI_BASE_URL=http://localhost:11434/v1
# OPENAI_MODEL=llama3.2
# OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxx
# MAX_DIFF_CHARS=20000

# 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.
AI_PROVIDER must be one of anthropic, openai-compatible (got "ollama") Use openai-compatible for Ollama, OpenAI and similar servers.
Missing required environment variable: OPENAI_MODEL AI_PROVIDER is openai-compatible but no model is set.
OPENAI_BASE_URL is not a valid URL / must start with http:// or https:// Include the scheme and the /v1 path, e.g. http://localhost:11434/v1.
MAX_DIFF_CHARS must be a whole number of at least 1000 Not a number, or too small to be useful.
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