diff --git a/src/wg/relayconf.h b/src/wg/relayconf.h new file mode 100644 index 0000000..177832a --- /dev/null +++ b/src/wg/relayconf.h @@ -0,0 +1,26 @@ +#pragma once +#include + +namespace wg { + +/// Configuration loaded from relay.conf. +struct RelayConf { + std::string server_address; ///< WireGuard endpoint, e.g. "relay.wilddragon.net" + int server_port = 51820; ///< WireGuard UDP port + std::string private_key; ///< Base64 WireGuard private key for this host + std::string server_public_key; ///< Base64 WireGuard public key of the relay server + std::string relay_token; ///< Bearer token for DragonRelay HTTP API auth + std::string relay_host; ///< HTTP base URL, e.g. "https://relay.wilddragon.net" + int relay_port = 443; ///< DragonRelay HTTP API port +}; + +/// Parse relay.conf from the given file path. +/// Returns true on success; populates errOut on failure. +bool parseRelayConf(const std::string &path, RelayConf &conf, std::string &errOut); + +/// Returns the default relay.conf path: +/// Windows: %PROGRAMDATA%\Artemis\relay.conf +/// Linux/macOS: /etc/artemis/relay.conf +std::string defaultRelayConfPath(); + +} // namespace wg