Remove remnants of non-global LogConfig from TelodendriaConfig

This commit is contained in:
Jordan Bancino 2023-03-22 16:31:24 +00:00
parent e6f3dfad18
commit e30fa3ee33
4 changed files with 15 additions and 14 deletions

View file

@ -38,20 +38,21 @@ Milestone: v0.3.0
[x] Global log object
- So we don't have to pass LogConfig around everywhere
- Also allows debug and error logging in other APIs
[ ] Proper HTTP request router
- Support regex matching
[ ] Make 'listen' directive in config an array of objects
- Each object has port, threads, maxConnections
- If tls is given, it can be null, false, or an object with cert and key
[ ] Pass TLS certs and keys into HttpServer
[ ] Move configuration to database
[ ] Initial configuration
[ ] If no config, create one-time use registration token that
grants user admin privileges.
[ ] /_telodendria/admin/config endpoint
[ ] Refactor TelodendriaConfig to just Config (ConfigLock() and ConfigUnlock())
[ ] Make 'listen' directive in config an array of objects
- Each object has port, threads, maxConnections
- If tls is given, it can be null, false, or an object with cert and key
[ ] Pass TLS certs and keys into HttpServer
[ ] Proper HTTP request router
- Support regex matching
[ ] Documentation
[ ] Array
[ ] Io
[ ] Stream
[ ] Tls

View file

@ -168,7 +168,7 @@ main(int argc, char **argv)
goto finish;
}
tConfig = TelodendriaConfigParse(config, LogConfigGlobal());
tConfig = TelodendriaConfigParse(config);
JsonFree(config);
if (!tConfig)

View file

@ -90,7 +90,7 @@
}
int
ConfigParseRunAs(LogConfig * lc, TelodendriaConfig * tConfig, HashMap * config)
ConfigParseRunAs(TelodendriaConfig * tConfig, HashMap * config)
{
JsonValue *value;
@ -106,7 +106,7 @@ error:
}
int
ConfigParseLog(LogConfig * lc, TelodendriaConfig * tConfig, HashMap * config)
ConfigParseLog(TelodendriaConfig * tConfig, HashMap * config)
{
JsonValue *value;
char *str;
@ -192,12 +192,12 @@ error:
}
TelodendriaConfig *
TelodendriaConfigParse(HashMap * config, LogConfig * lc)
TelodendriaConfigParse(HashMap * config)
{
TelodendriaConfig *tConfig;
JsonValue *value;
if (!config || !lc)
if (!config)
{
return NULL;
}
@ -240,7 +240,7 @@ TelodendriaConfigParse(HashMap * config, LogConfig * lc)
{
if (JsonValueType(value) == JSON_OBJECT)
{
if (!ConfigParseRunAs(lc, tConfig, JsonValueAsObject(value)))
if (!ConfigParseRunAs(tConfig, JsonValueAsObject(value)))
{
goto error;
}
@ -273,7 +273,7 @@ TelodendriaConfigParse(HashMap * config, LogConfig * lc)
}
CONFIG_REQUIRE("log", JSON_OBJECT);
if (!ConfigParseLog(lc, tConfig, JsonValueAsObject(value)))
if (!ConfigParseLog(tConfig, JsonValueAsObject(value)))
{
goto error;
}

View file

@ -60,7 +60,7 @@ typedef struct TelodendriaConfig
} TelodendriaConfig;
extern TelodendriaConfig *
TelodendriaConfigParse(HashMap *, LogConfig *);
TelodendriaConfigParse(HashMap *);
extern void
TelodendriaConfigFree(TelodendriaConfig *);