diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-06-25 10:46:46 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-06-26 14:55:23 +0200 |
commit | 866b6c5e3766f65719f730ac4dac11b221a6692a (patch) | |
tree | 156e77509f6edaf2178e31e01987f367cc6d9c7f /sources/cfg.h | |
parent | c0f5d2c2068968822c2d1d397bf84447ae2e5642 (diff) |
#988 add json configuration file
New configuration file at /opt/opengnsys/cfg/ogserver.json
Diffstat (limited to 'sources/cfg.h')
-rw-r--r-- | sources/cfg.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sources/cfg.h b/sources/cfg.h new file mode 100644 index 0000000..cfb37bd --- /dev/null +++ b/sources/cfg.h @@ -0,0 +1,33 @@ +#ifndef _OG_SERVER_CFG_H +#define _OG_SERVER_CFG_H + +struct og_server_cfg { + struct { + const char *user; + const char *pass; + const char *ip; + const char *name; + } db; + struct { + const char *ip; + const char *port; + const char *api_token; + } rest; + struct { + const char *interface; + } wol; +}; + +int parse_json_config(const char *filename, struct og_server_cfg *cfg); + +extern char auth_token[4096]; +extern char usuario[4096]; +extern char pasguor[4096]; +extern char catalog[4096]; +extern char datasource[4096]; +extern char interface[4096]; +extern char api_token[4096]; + +void from_json_to_legacy(struct og_server_cfg *cfg); + +#endif |