Signed-off-by: faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2026-07-15 19:50:07 +03:00
1 parent 295542ab9e
commit 24075fbd52
11 files changed
+305 -133

No files matched your search

@@ -1,5 +1,4 @@
#pragma once
#ifndef PLUGIN
#include "ConfigTypes.hpp"
#include <atomic>
#include <filesystem>
@@ -93,5 +92,3 @@ namespace Echoion::Api
};
} // namespace Echoion::Api
#endif
+16 -15
View File
@@ -1,5 +1,4 @@
#pragma once
#ifndef PLUGIN
#include "AudioTypes.hpp"
#include "NetworkTypes.hpp"
#include "Types.hpp"
@@ -29,8 +28,8 @@ namespace Echoion::Api
struct BotConfig {
std::string botName = "Echoion";
std::string commandPrefix = "!";
// Default bot language ("en" or "ru"). Applies to users who have not
// picked a per-user language. Anything else normalises to "en".
// Default bot language ("en" or "ru"). Applies to users who have
// not picked a per-user language. Anything else normalises to "en".
std::string language = "en";
float defaultVolume = 0.5f;
uint32_t maxQueueSize = 100;
@@ -61,9 +60,9 @@ namespace Echoion::Api
std::string rpcBindAddress = "127.0.0.1";
};
// Browser web interface (EchoionWeb). Serves the static UI and hosts the
// independent sync-watch WebSocket. Bot control from the browser goes
// directly to the RPC server (network.rpcPort), not through this server.
// Browser web interface (EchoionWeb). Serves the public dashboard and
// same-origin RPC bridge. Watch Together is deployed independently and
// linked through watchUrl.
struct WebConfig {
bool enabled = false;
uint16_t port = 8080;
@@ -76,6 +75,9 @@ namespace Echoion::Api
// "https://bot.example.com"). Presentation only — !help links to
// it 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.
std::string watchUrl;
// Allow the Now Playing view to show the current song's video
// (muted, synced). Users can still disable it locally; this is
// the server-wide off switch, surfaced through /config.json.
@@ -86,9 +88,9 @@ namespace Echoion::Api
// innertube YouTube path and Yandex Music first, then falls back to
// (optionally proxied) yt-dlp last.
struct SourcesConfig {
std::vector<std::string> order = {
"innertube", "yandex", "direct-url",
"ytdlp-direct", "ytdlp-proxied"};
std::vector<std::string> order = {"innertube", "yandex",
"direct-url", "ytdlp-direct",
"ytdlp-proxied"};
// How long a failing source is skipped before being retried.
std::chrono::milliseconds failureCooldown =
std::chrono::milliseconds(300000); // 5m
@@ -132,9 +134,9 @@ namespace Echoion::Api
std::chrono::milliseconds(3600000);
bool enableAuditLog = true;
std::optional<std::string> apiKey;
// Reserved, not currently honored: the web UI, /rpc bridge and /ws
// are all same-origin behind the web server, so no CORS headers are
// emitted anywhere.
// Reserved, not currently honored: the web UI and /rpc bridge are
// same-origin behind the web server, so no CORS headers are
// emitted.
bool allowCors = false;
std::vector<std::string> corsOrigins;
};
@@ -175,11 +177,11 @@ namespace Echoion::Api
// across plays and restarts).
bool cacheEnabled = true;
std::string cacheMaxSize = "1GB";
uint32_t cacheTTL = 86400; // seconds
uint32_t cacheTTL = 86400; // seconds
uint32_t tempCleanupInterval = 3600; // seconds
};
// ServerConfig for Plugin interface (mirrors PluginTypes.hpp version)
// Connection settings passed across the Echoion host interface.
struct ServerConfig {
std::string address;
uint16_t port = 0;
@@ -217,4 +219,3 @@ namespace Echoion::Api
};
} // namespace Echoion::Api
#endif