Upload relayconf.h

This commit is contained in:
Zac Gaetano 2026-05-06 20:27:50 -04:00
parent ece712ec61
commit 50fa9854cd

26
src/wg/relayconf.h Normal file
View file

@ -0,0 +1,26 @@
#pragma once
#include <string>
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