summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2023-11-14 11:11:02 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2023-11-14 11:25:42 +0100
commit944fef7b04f67ef18c445d4c825a39952f7d8e73 (patch)
tree1da7d37025b0be7d98e39c31d6a3102bec9b8f48 /src/main.c
parent485bf92216b7f3235f4e57dee5ac586beb60a090 (diff)
core: restrict rest API to 127.0.0.1
Until there is TLS support for this, frontend and ogserver needs to be in the same box by now.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index d8453de..8b043f7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
if (parse_json_config(config_file, &ogconfig) < 0)
return EXIT_FAILURE;
- socket_rest = og_socket_server_init(ogconfig.rest.port);
+ socket_rest = og_socket_server_init("127.0.0.1", ogconfig.rest.port);
if (socket_rest < 0) {
syslog(LOG_ERR, "Cannot open REST API server socket\n");
exit(EXIT_FAILURE);
@@ -83,7 +83,7 @@ int main(int argc, char *argv[])
ev_io_init(&ev_io_server_rest, og_server_accept_cb, socket_rest, EV_READ);
ev_io_start(og_loop, &ev_io_server_rest);
- socket_agent_rest = og_socket_server_init("8889");
+ socket_agent_rest = og_socket_server_init("0.0.0.0", "8889");
if (socket_agent_rest < 0) {
syslog(LOG_ERR, "Cannot open ogClient server socket\n");
exit(EXIT_FAILURE);