Environment
Env Vars
Environment variables are evaluated in the following order to allow flexibility when running in production:
.env
file- environment variables
- cmd flags (if available)
During development, it is recommended to use a .env
file. You can find a reference under /.env.sample` to get started.
To ease your development process, we've included a command to print the environment to better understand your app behaviour. Simply run go run . info env
. Together with go run . info features
, you should be able to get to the bottom of an issue.
List of all available env vars
Var Name | Required | Description |
---|---|---|
HOST | optional | service host address. default: 0.0.0.0 |
PROTECTED_API_PORT | optional | Service port. Default: 8080 |
PUBLIC_API_PORT | optional | Service port. Default: 8081 |
HIDDEN_API_PORT | optional | Service port. Default: 8079 |
DB_HOST | optional | Database host |
DB_PORT | optional | Database port |
DB_USER | optional | Database username |
DB_PASSWORD | optional | Database password |
DB_NAME | optional | Database name |
DB_TIMEZONE | optional | Database timezone. Required with Postgres platform |
DB_PLATFORM | optional | Enum: ["postgres", "mysql", "sqlite"]. default: "sqlite" |
KRATOS_PUBLIC_SERVICE | optional | Ory Kratos public API URL |
KRATOS_ADMIN_SERVICE | optional | Ory Kratos admin API URL |
KETO_READ_SERVICE | optional | Ory Keto read API URL |
KETO_WRITE_SERVICE | optional | Ory Keto write API URL |
REDIS_HOST | optional | Redis host URL. Required if Redis is enabled |
REDIS_PORT | optional | Redis port. Required if Redis is enabled |
REDIS_PASSWORD | optional | Redis password. Required if Redis is enabled |
LOG_LEVEL | optional | Enum: ["info", "warn", "debug", "error"]. default: "info" |
CORS_ALLOW_ORIGINS | optional | Allowed origins. Default: "*" |
REQUEST_TIMEOUT_DURATION | optional | Number in seconds. Default: "60" |
DISABLE_FEATURES | optional | List of features to disable in runtime, make sure its comma separated without spaces |