This commit is contained in:
2026-04-15 15:19:28 +08:00
commit 03229f23d4
159 changed files with 12538 additions and 0 deletions

62
include/dps/config.hpp Normal file
View File

@@ -0,0 +1,62 @@
#pragma once
#include <string>
namespace dps {
struct ServerConfig {
std::string host = "0.0.0.0";
int port = 8651;
bool trust_proxy = false;
std::string proxy_header = "x-forwarded-for";
};
struct JwtConfig {
std::string secret = "change-me";
long long expiration_seconds = 7200;
};
struct LoggingConfig {
std::string level = "info";
bool http_summary = true;
bool http_dump = false;
int http_max_body = 2048;
};
struct FeatureConfig {
bool video_enabled = false;
bool payment_enabled = false;
};
struct DatabaseConfig {
std::string host = "127.0.0.1";
int port = 3306;
std::string name = "rindro";
std::string user = "root";
std::string password;
std::string ssl_mode = "preferred";
std::string ssl_ca;
std::string plugin_dir;
};
struct PathConfig {
std::string configfile = "/root/rindro/Script/FileConfig.json";
std::string file_root = "/root/rindro/";
std::string file_map = "/root/rindro/file.json";
std::string script_root = "/root/rindro/ClentScript/";
std::string dps_root = "/home/DP_S/";
std::string client_user_script_root = "/root/rindro/ClentUserScript/";
};
struct AppConfig {
ServerConfig server;
JwtConfig jwt;
LoggingConfig logging;
FeatureConfig features;
DatabaseConfig database;
PathConfig paths;
};
AppConfig load_config(const std::string &path);
} // namespace dps