Format code, remove dataDir from sample production.conf

This commit is contained in:
Jordan Bancino 2023-04-19 02:07:38 +00:00
parent 0cca38115a
commit ae38791df2
14 changed files with 53 additions and 25 deletions

View file

@ -2,7 +2,6 @@
"log": { "log": {
"output": "file" "output": "file"
}, },
"dataDir": "/var/telodendria",
"listen": [ "listen": [
{ {
"port": 8008, "port": 8008,

View file

@ -292,7 +292,8 @@ start:
Log(LOG_ERR, "Please restore from a backup."); Log(LOG_ERR, "Please restore from a backup.");
exit = EXIT_FAILURE; exit = EXIT_FAILURE;
goto finish; goto finish;
} else if (!tConfig->ok) }
else if (!tConfig->ok)
{ {
Log(LOG_ERR, tConfig->err); Log(LOG_ERR, tConfig->err);
exit = EXIT_FAILURE; exit = EXIT_FAILURE;

View file

@ -66,6 +66,7 @@ ROUTE_IMPL(RouteChangePwd, path, argp)
char *newPassword; char *newPassword;
Config *config = ConfigLock(db); Config *config = ConfigLock(db);
if (!config) if (!config)
{ {
Log(LOG_ERR, "Password endpoint failed to lock configuration."); Log(LOG_ERR, "Password endpoint failed to lock configuration.");

View file

@ -58,6 +58,7 @@ ROUTE_IMPL(RouteLogin, path, argp)
char *fullUsername; char *fullUsername;
Config *config = ConfigLock(db); Config *config = ConfigLock(db);
if (!config) if (!config)
{ {
Log(LOG_ERR, "Login endpoint failed to lock configuration."); Log(LOG_ERR, "Login endpoint failed to lock configuration.");

View file

@ -78,6 +78,7 @@ ROUTE_IMPL(RouteRegister, path, argp)
DbRef *sessionRef; DbRef *sessionRef;
Config *config = ConfigLock(db); Config *config = ConfigLock(db);
if (!config) if (!config)
{ {
Log(LOG_ERR, "Registration endpoint failed to lock configuration."); Log(LOG_ERR, "Registration endpoint failed to lock configuration.");

View file

@ -49,6 +49,7 @@ ROUTE_IMPL(RouteUserProfile, path, argp)
char *value = NULL; char *value = NULL;
Config *config = ConfigLock(db); Config *config = ConfigLock(db);
if (!config) if (!config)
{ {
Log(LOG_ERR, "User profile endpoint failed to lock configuration."); Log(LOG_ERR, "User profile endpoint failed to lock configuration.");

View file

@ -36,6 +36,7 @@ ROUTE_IMPL(RouteWellKnown, path, argp)
HashMap *response; HashMap *response;
Config *config = ConfigLock(args->matrixArgs->db); Config *config = ConfigLock(args->matrixArgs->db);
if (!config) if (!config)
{ {
Log(LOG_ERR, "Well-known endpoint failed to lock configuration."); Log(LOG_ERR, "Well-known endpoint failed to lock configuration.");

View file

@ -46,6 +46,7 @@ ROUTE_IMPL(RouteWhoami, path, argp)
char *deviceID; char *deviceID;
Config *config = ConfigLock(db); Config *config = ConfigLock(db);
if (!config) if (!config)
{ {
Log(LOG_ERR, "Who am I endpoint failed to lock configuration."); Log(LOG_ERR, "Who am I endpoint failed to lock configuration.");

View file

@ -197,4 +197,3 @@ TelodendriaPrintHeader(void)
"Documentation/Support: https://telodendria.io"); "Documentation/Support: https://telodendria.io");
Log(LOG_INFO, ""); Log(LOG_INFO, "");
} }

View file

@ -1,3 +1,26 @@
/*
* Copyright (C) 2022-2023 Jordan Bancino <@jordan:bancino.net>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef TELODENDRIA_MAIN_H #ifndef TELODENDRIA_MAIN_H
#define TELODENDRIA_MAIN_H #define TELODENDRIA_MAIN_H