Signed-off-by: faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2026-07-25 23:44:29 +03:00
1 parent 24075fbd52
commit caac928923
5 files changed
+131 -9

No files matched your search

+86 -2
View File
@@ -72,8 +72,8 @@ namespace Echoion::Api
// UI derives ws://<page-host>:<rpcPort> from the served config.
std::string rpcUrl;
// Public address users reach the web interface at (e.g.
// "https://bot.example.com"). Presentation only — !help links to
// it when set; serving is unaffected.
// "https://bot.example.com"). Required by the internal URL
// shortener and also used by !help when set; serving is unaffected.
std::string publicUrl;
// External VoidWatch deployment. Echoion only presents this link
// and redirects the retired local /watch entrypoint to it.
@@ -82,6 +82,22 @@ namespace Echoion::Api
// (muted, synced). Users can still disable it locally; this is
// the server-wide off switch, surfaced through /config.json.
bool nowPlayingVideo = true;
// Forwarded client addresses are trusted only when the immediate
// peer belongs to one of these IPv4/IPv6 CIDRs. Empty is safest and
// ignores X-Forwarded-For entirely.
std::vector<std::string> trustedProxyCidrs;
};
struct UrlShorteningConfig {
bool enabled = false;
std::string provider = "url-shortener-internal";
std::vector<std::string> sources = {"youtube"};
std::chrono::milliseconds timeout = std::chrono::milliseconds(3000);
};
struct PluginsConfig {
// Empty resolves to a plugins.d directory beside the main config.
std::string configDirectory;
};
// Music source resolution chain. Default order tries the native
@@ -181,6 +197,71 @@ namespace Echoion::Api
uint32_t tempCleanupInterval = 3600; // seconds
};
// Component updater. Runtime means the complete relocatable daemon bundle,
// not only the echoiond ELF. Core and managed extension plugins may use
// independent channels, but the updater still enforces the compatibility
// metadata carried by the selected feed releases.
struct UpdatePublicKey {
std::string id;
std::string ed25519;
};
struct UpdateSourceConfig {
// Empty is only meaningful for the built-in "official" source and
// resolves to the URL injected by the release build.
std::string url;
std::vector<UpdatePublicKey> publicKeys;
bool allowUnsigned = false;
// Environment variable name only. Secret values are never
// persisted.
std::string bearerTokenEnv;
};
struct UpdateComponentConfig {
bool enabled = true;
std::string source = "official";
std::string channel = "stable";
bool autoApply = true;
};
struct PluginUpdateOverride {
std::string source = "official";
std::string channel = "stable";
bool autoApply = true;
};
struct PluginUpdatesConfig {
bool enabled = true;
std::string source = "official";
std::string channel = "stable";
bool autoApply = true;
bool managedOnly = true;
std::map<std::string, PluginUpdateOverride> overrides;
};
struct UpdateMaintenanceWindow {
// HH:MM in UTC. The updater validates the value before saving it.
std::string start = "03:00";
std::chrono::milliseconds duration = std::chrono::hours(2);
};
struct UpdatesConfig {
bool enabled = true;
std::chrono::milliseconds checkInterval = std::chrono::hours(6);
std::chrono::milliseconds jitter = std::chrono::minutes(30);
UpdateMaintenanceWindow maintenanceWindowUtc;
std::chrono::milliseconds maxRuntimeDeferral =
std::chrono::hours(24);
// Number of previous healthy versions retained in addition to
// active.
uint32_t retainHealthyVersions = 2;
std::map<std::string, UpdateSourceConfig> sources = {
{"official", UpdateSourceConfig{}}};
UpdateComponentConfig runtime;
UpdateComponentConfig core;
PluginUpdatesConfig plugins;
};
// Connection settings passed across the Echoion host interface.
struct ServerConfig {
std::string address;
@@ -213,6 +294,9 @@ namespace Echoion::Api
SecurityConfig security;
FeaturesConfig features;
AdvancedConfig advanced;
UpdatesConfig updates;
UrlShorteningConfig urlShortening;
PluginsConfig plugins;
AdminCredentials admin;
WebConfig web;
std::map<std::string, ConfigEntry> custom;