| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| Env | string | ENV | prod, dev, test | prod | Server mode |
| RootDir | string | ROOT_DIR | Root dir | ||
| DocDir | string | DOC_DIR | web | Server templates dir | |
| TmpDir | string | TMP_DIR | tmp | Temporary files dir | |
| SecretKey | string | SECRET_KEY | Envelope encryption key |
The
SECRET_KEYis used for encryptingplaintextsecrets such as email server password. When you change this key you must reset the secrets.
Example
[admin]
RootDir="/app"
TmpDir="/tmp"
SecretKey="!oeij9iUr.toAweija/oWeiJfh0a-wng1anglag/!sF5dSh#Gd"
Setup
These settings are used for the initial setup of the system.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| SiteName | string | SITE_NAME | “Cradle CMS” | Name of the site | |
| DomainName | string | DOMAIN_NAME | ”*” | Domain name | |
| AccountName | string | ACCOUNT_NAME | “Master Account” | Account name | |
| LanguageCode | string | LANGUAGE_CODE | “en” | Primary language | |
| CurrencyCode | string | CURRENCY_CODE | “EUR” | Base currency |
The catch all
*domain is used when no domain[host] matches any configured domain.
Example
[admin.Setup]
SiteName="My Site"
DomainName="my.cradle.site"
AccountName="Cradle Company"
LanguageCode="es"
CurrencyCode="USD"
Server
Server configuration options.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| Host | string | ADMIN_HOST | hostname or IP | Server listener host | |
| Port | uint | ADMIN_PORT | 1-65535 | 80 | Server listener port |
| TLS | bool | ADMIN_TLS | true=on, false=off | false | Enable TLS |
| Mount | string | ADMIN_MOUNT | admin | Admin mount path | |
| CertDir | string | ADMIN_CERT_DIR | /storage/certs | Certificate directory | |
| Cert | string | ADMIN_CERT_FILE | cert.pem | Pem encoded certificate | |
| Pass | string | ADMIN_CERT_PASS | Certificate password | ||
| Acme | bool | ADMIN_ACME | true=on, false=off | false | ACME certificates |
| Contact | string | ADMIN_CONTACT | Server contact name | ||
| TrustProxy | string | ADMIN_TRUST_PROXY | Trust proxy headers | ||
| Api | string | ADMIN_API | hostname or IP | “frontend” | Admin REST API service |
Example
[admin.Server]
Host="admin.server.int"
Port=8080
Mount="administrator"
TrustProxy="X-Forwarded-For"
Backend
Backend service url.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| URL | string | BACKEND_URL | hostname or IP | nats://127.0.0.1:4222 | Backend message bus host |
Example
[admin.Backend]
Url="nats://backend.server.int"
Session
Admin session cookie configuration.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| Key | string | ADMIN_SESSION_KEY | base64 RAW | Session cookie hmac key | |
| Secret | string | ADMIN_SESSION_SECRET | base64 RAW | Cookie encryption secret | |
| IdleTime | uint | ADMIN_SESSION_IDLETIME | seconds | 300 | Session idle timeout |
| LifeTime | uint | ADMIN_SESSION_LIFETIME | seconds | 600 | Session lifetime |
| Secure | bool | ADMIN_SESSION_SECURE | true | Secure session only (tls) | |
| HttpOnly | bool | ADMIN_SESSION_HTTP_ONLY | true | Http only |
If you allow
httpaccess to yoursite/adminyou must setSecuretofalseor the cookie won’t be sent by the browser.
Example
[admin.Session]
Key="YSBsb25nIHJhbmRvbSBzdHJpbmcgb2YgY2hhcmFjdGVycwo"
Secret="c29tZXRoaW5nIHJhbmRvbSB1c2VkIGZvciBjb29raWUgZW5jcnlwdGlvbgo"
Idletime=300
Lifetime=86400
Httponly=true
Secure=true
User
Admin user configuration. When logged in you can reconfigure these settings for the admin user.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| Name | string | ADMIN_NAME | “admin user” | Admin name | |
| Username | string | ADMIN_USER | admin | Admin username | |
| Password | string | ADMIN_PASS | “admin password” | Admin password | |
| string | ADMIN_EMAIL | admin@invalid | Admin email |
Example
[admin.User]
Name="Administrator"
Username="bofh"
Password="p4ssw0rd:P"
Email="admin@mycompany.email"
Storage
Cradle currently supports FileSystem, S3 and NATS Object storage for files.
Storage configuration.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| ReadOnly | bool | READ_ONLY | false | Read only storage mode |
Normally you have the same storage configuration for
adminandfrontend. However it can be set differently if you want separate access credentials for yourS3buckets to controlreadandwritepermissions.
S3
S3 based storage configuration.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| Endpoint | string | S3_ENDPPOINT | S3 server endpoint url | ||
| Region | string | S3_REGION | “us-east-1” | S3 region | |
| AccessKey | string | S3_ACCESS_KEY | S3 server access key | ||
| SecretKey | string | S3_SECRET_KEY | S3 server secret key |
Example
[frontend.Storage.S3]
Endpoint="https://s3.amazonaws.com"
Region="us-east-2"
AccessKey="AKIAIOSFODNN7EXAMPLE"
SecretKey="wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY"
Object
NATS Object storage configuration.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| Endpoint | string | OBJECT_STORAGE | Nats server endpoint |
Example
[frontend.Storage.Object]
Endpoint="nats://127.0.0.1:4222"
Buckets
Bucket configuration for storage.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| ThemeFiles | string | BUCKET_THEME_FILES | “theme” | Theme files | |
| MediaFiles | string | BUCKET_MEDIA_FILES | “media” | Media files | |
| CacheFiles | string | BUCKET_CACHE_FILES | “cache” | Cache files | |
| CertFiles | string | BUCKET_CERTIFICATE_FILES | “certs” | Certificates |
When using
FileSystemthe buckets are mapped todirectories.
Example
[frontend.Storage.Buckets]
ThemeFiles="theme"
MediaFiles="media"
CacheFiles="cache"
CertFiles="certs"
FileSystem
Filesystem storage configuration.
| Name | Type | Env | Values | Default | Description |
|---|---|---|---|---|---|
| Base | string | FILESYSTEM_BASE | ”/storage” | Filesystem base path |
Example
[frontend.Storage.FileSystem]
Base="/storage"