v0.2.16 - fixed config bugs
This commit is contained in:
12
src/config.c
12
src/config.c
@@ -577,12 +577,20 @@ const char* get_config_value(const char* key) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Priority 1: Database configuration (updated from file)
|
||||
// Priority 1: Command line overrides via environment variables
|
||||
if (strcmp(key, "relay_port") == 0) {
|
||||
const char* port_override = getenv("C_RELAY_PORT_OVERRIDE");
|
||||
if (port_override) {
|
||||
return port_override;
|
||||
}
|
||||
}
|
||||
|
||||
// Priority 2: Database configuration (updated from file)
|
||||
if (get_database_config(key, buffer, sizeof(buffer)) == 0) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
// Priority 2: Environment variables (fallback)
|
||||
// Priority 3: Environment variables (fallback)
|
||||
const char* env_value = getenv(key);
|
||||
if (env_value) {
|
||||
return env_value;
|
||||
|
||||
Reference in New Issue
Block a user