src is includedir
This commit is contained in:
1 parent
1cc5d08887
commit
f7b1d75bab
24 files changed
+81
-81
No files matched your search
+1
-1
@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6)
|
|||||||
project(openrouter)
|
project(openrouter)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
|
||||||
include_directories(./src/libs/)
|
include_directories(./src/libs/ ./src)
|
||||||
|
|
||||||
add_executable(
|
add_executable(
|
||||||
openrouter
|
openrouter
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "OpenRouter.hpp"
|
#include <OpenRouter/OpenRouter.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include "../settings/settings.hpp"
|
#include <settings/settings.hpp>
|
||||||
#include "../system/system.hpp"
|
#include <system/system.hpp>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../security/cors.hpp"
|
#include <security/cors.hpp>
|
||||||
|
|
||||||
OpenRouter::OpenRouter()
|
OpenRouter::OpenRouter()
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
#include "auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <httplib.h>
|
#include <httplib.h>
|
||||||
#include "../routes.hpp"
|
#include <routes.hpp>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include "../types.hpp"
|
#include <types.hpp>
|
||||||
|
|
||||||
bool authenticate(const std::string &token)
|
bool authenticate(const std::string &token)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "OpenRouter/OpenRouter.hpp"
|
#include <OpenRouter/OpenRouter.hpp>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "cors.hpp"
|
#include <security/cors.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
|
|
||||||
namespace api
|
namespace api
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "dns.hpp"
|
#include <settings/dns/dns.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define DNS_REQUIRED_STRING R"({"required":"[token,enabled]"})"
|
#define DNS_REQUIRED_STRING R"({"required":"[token,enabled]"})"
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "dns.hpp"
|
#include <settings/dns/dns.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
namespace api
|
namespace api
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "dns.hpp"
|
#include <settings/dns/dns.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
namespace api
|
namespace api
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "ftp.hpp"
|
#include <settings/ftp/ftp.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define FTP_REQUIRED_STRING R"({"required":"[token,enabled]"})"
|
#define FTP_REQUIRED_STRING R"({"required":"[token,enabled]"})"
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#ifndef SETTINGS_HPP
|
#ifndef SETTINGS_HPP
|
||||||
#define SETTINGS_HPP
|
#define SETTINGS_HPP
|
||||||
|
|
||||||
#include "wifi/wifi.hpp"
|
#include <settings/wifi/wifi.hpp>
|
||||||
#include "telnet/telnet.hpp"
|
#include <settings/telnet/telnet.hpp>
|
||||||
#include "ssh/ssh.hpp"
|
#include <settings/ssh/ssh.hpp>
|
||||||
#include "ftp/ftp.hpp"
|
#include <settings/ftp/ftp.hpp>
|
||||||
#include "dns/dns.hpp"
|
#include <settings/dns/dns.hpp>
|
||||||
|
|
||||||
#endif // SETTINGS_HPP
|
#endif // SETTINGS_HPP
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "ssh.hpp"
|
#include <settings/ssh/ssh.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define KEYS_PATH "/root/.ssh/authorized_keys"
|
#define KEYS_PATH "/root/.ssh/authorized_keys"
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#include "ssh.hpp"
|
#include <settings/ssh/ssh.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define SSH_PORT_REQUIRED_STRING R"({"required":"[token,port]"})"
|
#define SSH_PORT_REQUIRED_STRING R"({"required":"[token,port]"})"
|
||||||
#define SSH_PORT_PATH "/etc/openrouter/ssh/port"
|
#define SSH_PORT_PATH "/etc/openrouter/ssh/port"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "ssh.hpp"
|
#include <settings/ssh/ssh.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define SSH_REQUIRED_STRING R"({"required":"[token,status]"})"
|
#define SSH_REQUIRED_STRING R"({"required":"[token,status]"})"
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#include "telnet.hpp"
|
#include <settings/telnet/telnet.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define TELNET_REQUIRED_STRING R"({"required":"[token,enabled]"})"
|
#define TELNET_REQUIRED_STRING R"({"required":"[token,enabled]"})"
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#include "telnet.hpp"
|
#include <settings/telnet/telnet.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define TELNET_PORT_REQUIRED_STRING R"({"required":"[token,port]"})"
|
#define TELNET_PORT_REQUIRED_STRING R"({"required":"[token,port]"})"
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#include "wifi.hpp"
|
#include <settings/wifi/wifi.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define WIFI_CHANNEL_REQUIRED_STRING R"({"required":"[token,channel]"})"
|
#define WIFI_CHANNEL_REQUIRED_STRING R"({"required":"[token,channel]"})"
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#include "wifi.hpp"
|
#include <settings/wifi/wifi.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define WIFI_NAME_REQUIRED_STRING R"({"required":"[token,name]"})"
|
#define WIFI_NAME_REQUIRED_STRING R"({"required":"[token,name]"})"
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#include "wifi.hpp"
|
#include <settings/wifi/wifi.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define WIFI_PASSWORD_REQUIRED_STRING R"({"required":"[token,password,newpassword]"})"
|
#define WIFI_PASSWORD_REQUIRED_STRING R"({"required":"[token,password,newpassword]"})"
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
#include "wifi.hpp"
|
#include <settings/wifi/wifi.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <QR-Code-generator/qrcodegen.hpp>
|
#include <QR-Code-generator/qrcodegen.hpp>
|
||||||
#include <QR-Code-generator/qrtosvg.hpp>
|
#include <QR-Code-generator/qrtosvg.hpp>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
namespace api
|
namespace api
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "wifi.hpp"
|
#include <settings/wifi/wifi.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include "../../types.hpp"
|
#include <types.hpp>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
#include "../../helpers.hpp"
|
#include <helpers.hpp>
|
||||||
|
|
||||||
#define WIFI_REQUIRED_STRING R"({"required":"[token,status]"})"
|
#define WIFI_REQUIRED_STRING R"({"required":"[token,status]"})"
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include "reboot.hpp"
|
#include <system/reboot/reboot.hpp>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include "../types.hpp"
|
#include <types.hpp>
|
||||||
#include "../../auth/auth.hpp"
|
#include <auth/auth.hpp>
|
||||||
|
|
||||||
namespace api
|
namespace api
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "syslog.hpp"
|
#include <system/syslog/syslog.hpp>
|
||||||
#include "../types.hpp"
|
#include <types.hpp>
|
||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
#define SYSTEM_HPP
|
#define SYSTEM_HPP
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include "uptime/uptime.hpp"
|
#include <system/uptime/uptime.hpp>
|
||||||
#endif // __linux__
|
#endif // __linux__
|
||||||
#include "syslog/syslog.hpp"
|
#include <system/syslog/syslog.hpp>
|
||||||
#include "reboot/reboot.hpp"
|
#include <system/reboot/reboot.hpp>
|
||||||
|
|
||||||
#endif // SYSTEM_HPP
|
#endif // SYSTEM_HPP
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "uptime.hpp"
|
#include <system/uptime/uptime.hpp>
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
#endif // __linux__
|
#endif // __linux__
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include "../types.hpp"
|
#include <types.hpp>
|
||||||
|
|
||||||
namespace api
|
namespace api
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user