diff --git a/TODO.txt b/TODO.txt index 238afd0..9e0e682 100644 --- a/TODO.txt +++ b/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 diff --git a/src/Main.c b/src/Main.c index b6379df..0d99e43 100644 --- a/src/Main.c +++ b/src/Main.c @@ -168,7 +168,7 @@ main(int argc, char **argv) goto finish; } - tConfig = TelodendriaConfigParse(config, LogConfigGlobal()); + tConfig = TelodendriaConfigParse(config); JsonFree(config); if (!tConfig) diff --git a/src/TelodendriaConfig.c b/src/TelodendriaConfig.c index 67996c7..4cef493 100644 --- a/src/TelodendriaConfig.c +++ b/src/TelodendriaConfig.c @@ -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; } diff --git a/src/include/TelodendriaConfig.h b/src/include/TelodendriaConfig.h index 9805b4b..4e5ce6e 100644 --- a/src/include/TelodendriaConfig.h +++ b/src/include/TelodendriaConfig.h @@ -60,7 +60,7 @@ typedef struct TelodendriaConfig } TelodendriaConfig; extern TelodendriaConfig * - TelodendriaConfigParse(HashMap *, LogConfig *); + TelodendriaConfigParse(HashMap *); extern void TelodendriaConfigFree(TelodendriaConfig *);