Configuration reference
The server's own settings come from command-line flags, environment variables or the configuration file config.yaml, in increasing order of precedence: default, configuration file, environment variable, command-line flag. Certificates, providers and other settings of the panel are managed in the interface and are not covered here.
Settings
| Flag | Environment | config.yaml | Default |
|---|---|---|---|
-data-dir | JEC_DATA_DIR | data (/data in the image) | |
-listen | JEC_LISTEN | listen | :8080 |
-base-url | JEC_BASE_URL | base_url | the address the server sees |
-hsts | JEC_HSTS | hsts | false |
-trusted-proxies | JEC_TRUSTED_PROXIES | trusted_proxies | none |
-allowed-clients | JEC_ALLOWED_CLIENTS | allowed_clients | any |
-tls-cert | JEC_TLS_CERT | tls_cert | none (serves HTTP) |
-tls-key | JEC_TLS_KEY | tls_key | none |
-http-listen | JEC_HTTP_LISTEN | http_listen | none |
-dns-resolvers | JEC_DNS_RESOLVERS | dns_resolvers | the system's |
-log-level | JEC_LOG_LEVEL | log.level | info |
-log-format | JEC_LOG_FORMAT | log.format | text (or json) |
-config | JEC_CONFIG | <data-dir>/config.yaml, if it exists | |
JEC_SECRET_KEY | <data-dir>/secret.key | ||
JEC_DATABASE_URL | database_url | SQLite in the data directory; see PostgreSQL |
jec <command> -h lists the flags of a command. An example configuration file:
listen: ":8080"
base_url: https://certs.example.com
trusted_proxies: 172.16.0.0/12
dns_resolvers: 223.5.5.5,119.29.29.29
log:
level: info
format: jsonBehind a reverse proxy
Reverse proxy and CDN has complete configurations for Caddy and nginx, also behind a CDN.
JEC_BASE_URL: the URL users open, such ashttps://certs.example.com, orhttps://example.com/certs/for a sub-path. With anhttpsURL, the session cookie is sent over HTTPS only. Notifications link to the pages they concern only when this is set.JEC_TRUSTED_PROXIES: the addresses or CIDR ranges of the reverse proxies, separated by commas, such as127.0.0.1, or172.16.0.0/12for the networks of containers, asdocker-compose.ymlsets by default. For requests from them, JEC reads the client address fromX-Forwarded-For; without it, everyone behind the proxy shares the proxy's address, and one person's failed sign-ins lock out everyone.JEC_ALLOWED_CLIENTS: only these addresses or CIDR ranges, separated by commas, reach the panel and its API, such as192.168.0.0/16,10.0.0.0/8; the client is found asJEC_TRUSTED_PROXIESsays. Others get 403. Requests under/.well-known/, as a CA's file validation makes, the health check, and the operations machines use with a key of their own (pull addresses, the calendar feed, Prometheus metrics) are answered to anyone.JEC_HSTS: set it totrueonly when the panel is always reached over HTTPS; browsers then refuse plain HTTP to it for a year.JEC_TLS_CERT,JEC_TLS_KEY: PEM files of a certificate (with its chain) and of its private key, set together. JEC then serves HTTPS itself onJEC_LISTEN, with no reverse proxy, and sends the session cookie over HTTPS only. It takes a new certificate within about 10 seconds of the files changing, without a restart. While the files are not there yet, a self-signed certificate stands in; files that are there but do not load stop JEC from starting.JEC_HTTP_LISTEN, such as:80, then answers plain HTTP as well: requests under/.well-known/, as a CA's file validation makes, are answered, and the rest sent to HTTPS. See Without a reverse proxy.
DNS resolvers
JEC_DNS_RESOLVERS sets recursive DNS resolvers, such as 223.5.5.5,119.29.29.29, with or without a port. To check a validation record, JEC first finds its zone through them, then queries the zone's authoritative servers directly. It is needed only when the machine's own resolver answers incorrectly, as with split-horizon DNS; JEC refuses to start with an address that is not valid.
Master key
Private keys and credentials are encrypted in the database with AES-256-GCM. The master key is secret.key in the data directory by default, created on first start. It can also be passed in JEC_SECRET_KEY: 32 random bytes in base64, as generated by openssl rand -base64 32, through the environment only. JEC refuses to start when the master key does not match the key the database was encrypted with. See Data and backups for backing it up.
Time zone
The daily check time of renewals, the times in notifications and the times in the interface all use the panel's time zone. It is chosen under Appearance on the Settings page, and follows the server's by default (the TZ environment variable; docker-compose.yml sets Asia/Shanghai).
Proxies
JEC's common HTTP client, used by most notification channels and deploy targets, does not read the proxies of the environment (HTTP_PROXY, HTTPS_PROXY), so that services within the same country are not reached through a proxy. Provider types that reach services abroad accept a proxy of their own in their advanced settings, http://, https:// or socks5://. ACME accounts without a proxy of their own, lego's DNS providers and the check for updates use the proxies of the environment.