summaryrefslogtreecommitdiffstats
path: root/src/cfg.c
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2020-10-07 11:10:36 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-10-07 11:17:00 +0200
commitfe1ce97c50e575201fe47d7587251e228edf8fdf (patch)
tree4656eeb2fe23e2ef1a148af1303cae329c449078 /src/cfg.c
parent3cea4bb763165d119a329a1c7f2c767857cdb384 (diff)
#988 remove legacy configuration
Use og_server_cfg everywhere. Convert port to string to make it easy for the dbi API since it expects a string. Remove legacy example configuration file.
Diffstat (limited to 'src/cfg.c')
-rw-r--r--src/cfg.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/cfg.c b/src/cfg.c
index 42da3a5..6ac2f2d 100644
--- a/src/cfg.c
+++ b/src/cfg.c
@@ -58,8 +58,7 @@ static int parse_json_db(struct og_server_cfg *cfg, json_t *element)
if (og_json_parse_string(value, &cfg->db.name) < 0)
return -1;
} else if (!strcmp(key, "port")) {
- if (og_json_parse_uint(value, &cfg->db.port) < 0 ||
- cfg->db.port > UINT16_MAX)
+ if (og_json_parse_string(value, &cfg->db.port) < 0)
return -1;
} else {
syslog(LOG_ERR, "unknown key `%s' in db\n", key);
@@ -188,16 +187,3 @@ int parse_json_config(const char *filename, struct og_server_cfg *cfg)
return ret;
}
-
-void from_json_to_legacy(struct og_server_cfg *cfg)
-{
- snprintf(servidoradm, sizeof(servidoradm), "%s", cfg->rest.ip);
- snprintf(puerto, sizeof(puerto), "%s", cfg->rest.port);
- snprintf(usuario, sizeof(usuario), "%s", cfg->db.user);
- snprintf(pasguor, sizeof(pasguor), "%s", cfg->db.pass);
- snprintf(datasource, sizeof(datasource), "%s", cfg->db.ip);
- snprintf(catalog, sizeof(catalog), "%s", cfg->db.name);
- snprintf(interface, sizeof(interface), "%s", cfg->wol.interface);
- snprintf(auth_token, sizeof(auth_token), "%s", cfg->rest.api_token);
- snprintf(db_port, sizeof(db_port), "%u", cfg->db.port);
-}