76 lines
		
	
	
	
		
			2.5 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			76 lines
		
	
	
	
		
			2.5 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_ENV: Env.schema.enum(['development', 'production', 'test'] as const),
 | |
|   PORT: Env.schema.number(),
 | |
|   APP_KEY: Env.schema.string(),
 | |
|   HOST: Env.schema.string({ format: 'host' }),
 | |
|   LOG_LEVEL: Env.schema.string(),
 | |
| 
 | |
|   /*
 | |
|   |----------------------------------------------------------
 | |
|   | Variables for configuring database connection
 | |
|   |----------------------------------------------------------
 | |
|   */
 | |
|   DB_HOST: Env.schema.string({ format: 'host' }),
 | |
|   DB_PORT: Env.schema.number(),
 | |
|   DB_USER: Env.schema.string(),
 | |
|   DB_PASSWORD: Env.schema.string.optional(),
 | |
|   DB_DATABASE: Env.schema.string(),
 | |
| 
 | |
|   /*
 | |
|   |----------------------------------------------------------
 | |
|   | Variables for configuring the limiter package
 | |
|   |----------------------------------------------------------
 | |
|   */
 | |
|   LIMITER_STORE: Env.schema.enum(['redis', 'memory'] as const),
 | |
| 
 | |
|   /*
 | |
|   |----------------------------------------------------------
 | |
|   | Variables for configuring the drive package
 | |
|   |----------------------------------------------------------
 | |
|   */
 | |
|   DRIVE_DISK: Env.schema.enum(['fs'] as const),
 | |
| 
 | |
|   /*
 | |
|   |----------------------------------------------------------
 | |
|   | Variables for configuring the mail package
 | |
|   |----------------------------------------------------------
 | |
|   */
 | |
|   MAILGUN_API_KEY: Env.schema.string(),
 | |
|   MAILGUN_DOMAIN: Env.schema.string(),
 | |
|   MAIL_FROM: Env.schema.string(),
 | |
| 
 | |
|   /*
 | |
|   |----------------------------------------------------------
 | |
|   | Variables for configuring the redis package
 | |
|   |----------------------------------------------------------
 | |
|   */
 | |
|   REDIS_HOST: Env.schema.string({ format: 'host' }),
 | |
|   REDIS_PORT: Env.schema.number(),
 | |
|   REDIS_PASSWORD: Env.schema.string.optional(),
 | |
| 
 | |
|   TURNSTILE_SITE_KEY: Env.schema.string.optional(),
 | |
|   TURNSTILE_SECRET: Env.schema.string.optional(),
 | |
| 
 | |
|   SESSION_DRIVER: Env.schema.enum(['cookie', 'memory'] as const),
 | |
| 
 | |
|   PUBLIC_URL: Env.schema.string({ format: 'url' }),
 | |
| 
 | |
|   VAPID_DETAILS: Env.schema.string(),
 | |
|   VAPID_PUBLIC_KEY: Env.schema.string(),
 | |
|   VAPID_PRIVATE_KEY: Env.schema.string(),
 | |
| 
 | |
|   API_BEARER_TOKEN: Env.schema.string(),
 | |
| })
 | 
