All environment variables: address, SSH, encryption, email, single sign-on, LDAP and footer.

Codeny is configured with environment variables. With Docker Compose they live in deploy/.env. Restart the container after a change: docker compose --env-file .env up -d codeny.

VariableDefaultMeaning
CODENY_BASE_URL–public address, e.g. https://git.example.com
CODENY_DATABASE_URL–PostgreSQL connection (set by Compose)
CODENY_ADDR:8080HTTP listen address
CODENY_COOKIE_SECUREtruecookies over HTTPS only; false locally without TLS
CODENY_REGISTRATION_OPENtruedefault for self-registration (can be overridden in the admin area)
CODENY_REPO_ROOT/data/reposstorage for repositories and files
CODENY_SSH_ADDR:2222SSH listen address, disabled turns it off
CODENY_SSH_PUBLIC_PORT–port shown in SSH clone URLs
CODENY_SECRET_KEY–64 hex characters (openssl rand -hex 32) for encryption; empty = key file in the repo volume
CODENY_WEBHOOK_ALLOW_PRIVATEfalsedevelopment only: allow webhooks/mirrors into private networks
CODENY_SMTP_HOST, _PORT, _USER, _PASSWORD, _FROMPort 587sending email (password reset, test mail)
CODENY_SMTP_TLSstarttlsstarttls, tls or none
CODENY_OIDC_ISSUER, _CLIENT_ID, _CLIENT_SECRET, _LABEL–single sign-on; callback URL at the provider: <BASE_URL>/api/v1/auth/oidc/callback
CODENY_LDAP_URL, _TLS, _BIND_DN, _BIND_PASSWORD, _BASE_DN–LDAP/Active Directory; ldaps:// or STARTTLS, plain text only with _TLS=none
CODENY_LDAP_USER_FILTER, _UID_ATTR, _MAIL_ATTR, _NAME_ATTR–search filter and attributes for LDAP
CODENY_THEIA_URL–URL template for “Open in Theia” with {clone_url}, {ssh_url}, {owner}, {repo}, {branch}
CODENY_FOOTER_LEGAL–default footer links: `Imprinthttps://…;Privacyhttps://…`
CODENY_FOOTER_SOCIAL–default social links: `githubhttps://…;mastodonhttps://…`

Never change CODENY_SECRET_KEY (or the key file) after the first start. Otherwise stored secrets can no longer be decrypted.

Single sign-on (OIDC)#

Codeny uses the authorization code flow with PKCE. At the provider (Keycloak, Authentik, Entra ID, Google …) enter <CODENY_BASE_URL>/api/v1/auth/oidc/callback as callback URL. The first sign-in creates an account if the email address is verified and registration is open. An existing local account is not linked automatically by email address.

LDAP / Active Directory#

A service account (_BIND_DN, _BIND_PASSWORD) searches the entry under _BASE_DN with _USER_FILTER; then Codeny binds as that user. The first sign-in creates the account (email attribute required). LDAP credentials also work for Git over HTTPS; local two-factor authentication stays in effect.

Settings in the admin area#

Registration, instance name, banner, maintenance mode and footer and social links are set under Administration → Settings. These values take precedence over the defaults from .env. See administration.

Last updated