added config mangager
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Waiting to run
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Waiting to run

This commit is contained in:
wt committed 2025-02-10 18:13:51 +07:00
1 parent ee517632e4
commit 0c4183843f
21 files changed
+282 -203

No files matched your search

+6 -4
View File
@@ -9,6 +9,7 @@
#include <syslog.h>
#include <auth/auth.hpp>
#include <helpers.hpp>
#include <config/config.hpp>
#define SSH_PORT_REQUIRED_STRING R"({"required":"[token,port]"})"
#define SSH_PORT_PATH "/etc/openrouter/ssh/port"
@@ -35,10 +36,11 @@ namespace api
response.set_content(R"({"access":"reject"})", JSON_TYPE);
return;
}
std::ifstream sshportfile(SSH_PORT_PATH);
int ssh_port;
sshportfile >> ssh_port;
sshportfile.close();
// std::ifstream sshportfile(SSH_PORT_PATH);
// int ssh_port;
// sshportfile >> ssh_port;
// sshportfile.close();
int ssh_port = config::config.getConfig()["settings"]["ssh"]["port"];
std::stringstream responsedata;
responsedata << R"({"port":")" << ssh_port << R"("})";
response.set_content(responsedata.str(), JSON_TYPE);