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
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:
1 parent
ee517632e4
commit
0c4183843f
21 files changed
+282
-203
No files matched your search
@@ -5,6 +5,7 @@
|
||||
#include <syslog.h>
|
||||
#include <auth/auth.hpp>
|
||||
#include <helpers.hpp>
|
||||
#include <config/config.hpp>
|
||||
|
||||
#define SSH_REQUIRED_STRING R"({"required":"[token,status]"})"
|
||||
|
||||
@@ -30,10 +31,11 @@ namespace api
|
||||
response.set_content(R"({"access":"reject"})", JSON_TYPE);
|
||||
return;
|
||||
}
|
||||
std::ifstream sshstatusfile("/etc/openrouter/ssh/status");
|
||||
int ssh_status;
|
||||
sshstatusfile >> ssh_status;
|
||||
sshstatusfile.close();
|
||||
// std::ifstream sshstatusfile("/etc/openrouter/ssh/status");
|
||||
// int ssh_status;
|
||||
// sshstatusfile >> ssh_status;
|
||||
// sshstatusfile.close();
|
||||
int ssh_status = config::config.getConfig()["settings"]["ssh"]["enabled"];
|
||||
std::stringstream responsedata;
|
||||
responsedata << R"({"status":")" << ssh_status << R"("})";
|
||||
response.set_content(responsedata.str(), JSON_TYPE);
|
||||
|
||||
Reference in new issue
Block a user