keelconfig.yaml
The keelconfig.yaml
file is expected at the root of your project and is used to configure your Keel backend. It enables configuring the following options:
- Environment variables
- Secrets
- Authentication
Let's walk through how you can configure each of these options.
Configuring staging and production
The configuration in your keelconfig.yaml
is used locally (when running your application with keel run
) but will also be applied to your staging and production environments.
However, you may want to provide a different configuration on your staging and productions environments to what you use locally. This is achieved using a
keelconfig.staging.yaml
for staging environments, and akeelconfig.production.yaml
for production environments.
If these are provided, the subsequent environment will take on those settings and will ignore the default keelconfig.yaml
entirely.
Environment variables
Environment variables are values that are passed to your application at runtime.
This can be configured like so in your keelconfig.yaml
file:
environment:
- name: EXTERNAL_API_URL
value: "https://staging.some-api.com"
- name: DB_URL
value: "https://some-api.com"
We cover this in more detail under the Environment Variables section of the docs.
Secrets
Secrets are similar to environment variables, but are used to store sensitive information such as API keys, passwords, etc. In your keelconfig.yaml
, you can store names of secrets that your application will depend on, while their values are stored in your Keel backend.
Secrets can be configured like so in your keelconfig.yaml
file:
secrets:
- name: MY_SECRET
- name: MY_OTHER_SECRET
To set a secret locally, you can use the keel secret set
command from the Keel CLI, and to set a secret in your deployed backend on Keel, you can use the Secrets page in the console.
We cover secrets in more detail in its dedicated page.
Authentication
Authentication enables users to sign up and log in to your application using a number of open paradigms, such as SSO (Single Sign-On), OpenID Connect, and more. Keel supports a number of authentication providers out of the box, and you can configure them in your keelconfig.yaml
file like so:
auth:
redirectUrl: http://localhost:8000/callback
providers:
- type: google
name: google_client
clientId: 1234
hooks: [afterIdentityCreated]
We cover authentication in more detail in its dedicated page.