forked from Telodendria/Telodendria
Remove remnants of non-global LogConfig from TelodendriaConfig
This commit is contained in:
parent
e6f3dfad18
commit
e30fa3ee33
4 changed files with 15 additions and 14 deletions
13
TODO.txt
13
TODO.txt
|
@ -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
|
||||
|
|
|
@ -168,7 +168,7 @@ main(int argc, char **argv)
|
|||
goto finish;
|
||||
}
|
||||
|
||||
tConfig = TelodendriaConfigParse(config, LogConfigGlobal());
|
||||
tConfig = TelodendriaConfigParse(config);
|
||||
JsonFree(config);
|
||||
|
||||
if (!tConfig)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ typedef struct TelodendriaConfig
|
|||
} TelodendriaConfig;
|
||||
|
||||
extern TelodendriaConfig *
|
||||
TelodendriaConfigParse(HashMap *, LogConfig *);
|
||||
TelodendriaConfigParse(HashMap *);
|
||||
|
||||
extern void
|
||||
TelodendriaConfigFree(TelodendriaConfig *);
|
||||
|
|
Loading…
Reference in a new issue