-
Notifications
You must be signed in to change notification settings - Fork 0
Templates
When you run keyseal add, you can pass --template <name> to seed the new encrypted file with a set of starter keys. All templates produce a kind: env document with placeholder values - they are starting points, not complete configurations.
13 keys covering the most common Laravel application environment variables.
values:
APP_NAME: ExampleApp
APP_ENV: production
APP_KEY: base64:REPLACE_ME
APP_DEBUG: "false"
APP_URL: https://example.com
DB_HOST: 127.0.0.1
DB_PORT: "3306"
DB_DATABASE: app
DB_USERNAME: app
DB_PASSWORD: REPLACE_ME
CACHE_STORE: redis
QUEUE_CONNECTION: redis
SESSION_DRIVER: redisUse with:
keyseal add production/platform/app --template laravelThe placeholders (base64:REPLACE_ME, REPLACE_ME) are recognizable to doctor's placeholder check when .sops.yaml is being checked, but not when scanning secret values - doctor only checks .sops.yaml recipients for the REPLACE_ME pattern. You will need to edit these values manually with keyseal edit.
3 keys for Stripe API credentials.
values:
STRIPE_SECRET_KEY: sk_live_REPLACE_ME
STRIPE_WEBHOOK_SECRET: whsec_REPLACE_ME
STRIPE_CONNECT_CLIENT_ID: ca_REPLACE_MEUse with:
keyseal add production/platform/stripe --template stripe6 keys for SMTP mail configuration.
values:
MAIL_MAILER: smtp
MAIL_HOST: smtp.example.com
MAIL_PORT: "587"
MAIL_USERNAME: mailer
MAIL_PASSWORD: REPLACE_ME
MAIL_FROM_ADDRESS: noreply@example.comUse with:
keyseal add production/platform/mail --template mail5 keys for a MySQL application user connection.
values:
DB_HOST: 127.0.0.1
DB_PORT: "3306"
DB_DATABASE: app
DB_USERNAME: app
DB_PASSWORD: REPLACE_MEUse with:
keyseal add production/infra/mysql --template mysql-appIf --template is not specified, the starter document contains a single placeholder key:
values:
EXAMPLE_KEY: REPLACE_METhis is the minimal starting point. It satisfies validation.require_values (the map is non-empty) and passes key pattern validation. Edit it immediately with keyseal edit to replace the example key with real content.
templates.Build(logicalName, templateName) constructs an EnvSecretDocument with:
Version: 1Kind: "env"Name: <logicalName>Description: "Secrets for <logicalName>"Values: <template map>
The document is validated before encryption, so if the template's default values fail validation for some reason (e.g. you've changed key_pattern to disallow uppercase), add will fail before touching SOPS.
An unknown template name returns an error immediately:
keyseal add production/platform/app --template doesnotexist
# Error: unknown template "doesnotexist"Templates are starter scaffolding, not finished secrets. The laravel template uses 127.0.0.1 for DB_HOST, which is unlikely to be correct for every deployment. The mail template uses smtp.example.com. The stripe template uses sk_live_REPLACE_ME.
After running keyseal add --template <name>, always run keyseal edit <logical> to replace placeholder values with real credentials before the file is deployed or used.
Getting Started
Reference
Operations
Development