51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
/*
|
|
|--------------------------------------------------------------------------
|
|
| Environment variables service
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| The `Env.create` method creates an instance of the Env service. The
|
|
| service validates the environment variables and also cast values
|
|
| to JavaScript data types.
|
|
|
|
|
*/
|
|
|
|
import { Env } from '@adonisjs/core/env'
|
|
|
|
export default await Env.create(new URL('../', import.meta.url), {
|
|
// Node
|
|
NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const),
|
|
PORT: Env.schema.number(),
|
|
HOST: Env.schema.string({ format: 'host' }),
|
|
LOG_LEVEL: Env.schema.string(),
|
|
|
|
// App
|
|
APP_KEY: Env.schema.secret(),
|
|
APP_URL: Env.schema.string({ format: 'url', tld: false }),
|
|
|
|
// Session
|
|
SESSION_DRIVER: Env.schema.enum(['cookie', 'memory', 'database'] as const),
|
|
|
|
// Database (SQLite file holding users, history and the action log)
|
|
DB_PATH: Env.schema.string.optional(),
|
|
|
|
// VPS paths, as seen from inside the container
|
|
SRV_ROOT: Env.schema.string(),
|
|
HOST_PROC: Env.schema.string.optional(),
|
|
DISK_PATH: Env.schema.string.optional(),
|
|
BACKUP_DIR: Env.schema.string(),
|
|
|
|
// Docker
|
|
DOCKER_SOCKET: Env.schema.string.optional(),
|
|
CADDY_CONTAINER: Env.schema.string(),
|
|
CADDYFILE_PATH: Env.schema.string(),
|
|
CADDY_CONFIG_PATH: Env.schema.string(),
|
|
MARIADB_CONTAINER: Env.schema.string(),
|
|
|
|
// Projects
|
|
BASE_DOMAIN: Env.schema.string(),
|
|
|
|
// Backups ("HH:MM" in the server timezone, empty = no automatic backup)
|
|
BACKUP_DAILY_AT: Env.schema.string.optional(),
|
|
BACKUP_KEEP: Env.schema.number.optional(),
|
|
})
|