11import Config
22
3+ # Default config for dev/test
4+ config :ambrosia ,
5+ port: String . to_integer ( System . get_env ( "GEMINI_PORT" , "1965" ) ) ,
6+ root_dir: System . get_env ( "ROOT_DIR" , "/tmp/gemini" ) ,
7+ cert_file: System . get_env ( "CERT_FILE" , "priv/cert.pem" ) ,
8+ key_file: System . get_env ( "KEY_FILE" , "priv/key.pem" ) ,
9+ max_connections: String . to_integer ( System . get_env ( "MAX_CONNECTIONS" , "1000" ) ) ,
10+ request_timeout:
11+ String . to_integer ( System . get_env ( "REQUEST_TIMEOUT" , "10000" ) ) ,
12+ hostname: System . get_env ( "HOSTNAME" , "localhost" ) ,
13+ rate_limit_requests:
14+ String . to_integer ( System . get_env ( "RATE_LIMIT_REQUESTS" , "10" ) ) ,
15+ rate_limit_window_ms:
16+ String . to_integer ( System . get_env ( "RATE_LIMIT_WINDOW_MS" , "1000" ) ) ,
17+ max_per_ip: String . to_integer ( System . get_env ( "MAX_PER_IP" , "10" ) ) ,
18+ stats_interval: String . to_integer ( System . get_env ( "STATS_INTERVAL" , "30000" ) )
19+
320if config_env ( ) == :prod do
421 hostname = System . get_env ( "HOSTNAME" )
522
@@ -8,17 +25,6 @@ if config_env() == :prod do
825 end
926
1027 config :ambrosia ,
11- port: String . to_integer ( System . get_env ( "GEMINI_PORT" , "1965" ) ) ,
12- root_dir: System . get_env ( "ROOT_DIR" , "/app/gemini" ) ,
13- cert_file: System . get_env ( "CERT_FILE" , "/certs/cert.pem" ) ,
14- key_file: System . get_env ( "KEY_FILE" , "/certs/key.pem" ) ,
15- max_connections:
16- String . to_integer ( System . get_env ( "MAX_CONNECTIONS" , "1000" ) ) ,
17- request_timeout:
18- String . to_integer ( System . get_env ( "REQUEST_TIMEOUT" , "10000" ) ) ,
1928 hostname: hostname ,
20- rate_limit_requests:
21- String . to_integer ( System . get_env ( "RATE_LIMIT_REQUESTS" , "10" ) ) ,
22- rate_limit_window_ms:
23- String . to_integer ( System . get_env ( "RATE_LIMIT_WINDOW_MS" , "1000" ) )
29+ root_dir: System . get_env ( "ROOT_DIR" , "/app/gemini" )
2430end
0 commit comments