-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv.ts
45 lines (38 loc) · 1.7 KB
/
env.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
|--------------------------------------------------------------------------
| Validating Environment Variables
|--------------------------------------------------------------------------
|
| In this file we define the rules for validating environment variables.
| By performing validation we ensure that your application is running in
| a stable environment with correct configuration values.
|
| This file is read automatically by the framework during the boot lifecycle
| and hence do not rename or move this file to a different location.
|
*/
import Env from '@ioc:Adonis/Core/Env'
export default Env.rules({
HOST: Env.schema.string({ format: 'host' }),
PORT: Env.schema.number(),
APP_KEY: Env.schema.string(),
NODE_ENV: Env.schema.enum(['production', 'development', 'test'] as const),
LOG_LEVEL: Env.schema.enum(['info', 'debug', 'warning', 'error'] as const),
SESSION_DRIVER: Env.schema.enum(['cookie', 'file', 'redis'] as const),
DB_CONNECTION: Env.schema.enum(['sqlite', 'pg', 'mysql', 'mssql', 'oracle'] as const),
DB_HOST: Env.schema.string({ format: 'host' }),
DB_USER: Env.schema.string(),
DB_PASSWORD: Env.schema.string.optional(),
DB_NAME: Env.schema.string(),
DB_HEALTHCHECK: Env.schema.boolean.optional(),
HASH_DRIVER: Env.schema.enum(['argon', 'bcrypt'] as const),
TWITCH_CLIENT_TOKEN: Env.schema.string(),
TWITCH_CLIENT_SECRET: Env.schema.string(),
TWITCH_REDIRECT_URI: Env.schema.string(),
TWITCH_BOT_REDIRECT_URI: Env.schema.string(),
TWITCH_BOT_NAME: Env.schema.string(),
TWITCH_BOT_ID: Env.schema.string(),
PERSPECTIVE_API_TOKEN: Env.schema.string.optional(),
PERSPECTIVE_API_THROTTLE: Env.schema.number(),
PERSPECTIVE_API_THRESHOLD_TOXICITY: Env.schema.number()
})