[MOD/WIP] Allow flat-file support, manpage updates

This commit is contained in:
LDA 2024-08-12 18:54:35 +02:00
commit 6c32868ca0
6 changed files with 30 additions and 9 deletions

View file

@ -88,11 +88,12 @@ Main(Array *args, HashMap *env)
char *data = NULL, *media = NULL, *listen = NULL;
int flag, code = EXIT_FAILURE;
int port = 5347;
size_t lmdb_size = 0;
listen = "localhost";
ArgParseStateInit(&state);
while ((flag = ArgParse(&state, args, "H:J:s:d:p:m:l:")) != -1)
while ((flag = ArgParse(&state, args, "H:J:s:d:p:m:l:S:")) != -1)
{
switch (flag)
{
@ -118,6 +119,9 @@ Main(Array *args, HashMap *env)
case 'p':
port = strtol(state.optArg, NULL, 10);
break;
case 'S':
lmdb_size = strtol(state.optArg, NULL, 10) * 1024 * 1024;
break;
}
}
@ -133,6 +137,7 @@ Main(Array *args, HashMap *env)
"-l [Host/IP to listen as] "
"-p [XMPP component port=5347] "
"-J [parsee.xmppserver.ex]",
"-S [LMDB size]",
ArrayGet(args, 0)
);
goto end;
@ -155,6 +160,7 @@ Main(Array *args, HashMap *env)
UtilMkdir(data, 0755);
JsonSet(json, JsonValueString(data), 1, "db");
JsonSet(json, JsonValueInteger(lmdb_size), 1, "db_size");
JsonSet(json, JsonValueString(homeserver), 1, "hs_base");
JsonSet(json, JsonValueString(api_base->host), 1, "hs_host");