// Prestium initial config
if (config()->get(Config::firstRun).toBool() && Prestium::detect()) {
config()->set(Config::proxy, Config::Proxy::i2p);
- config()->set(Config::socks5Port, 4448);
+ config()->set(Config::socks5Port, Prestium::i2pPort());
}
if (parser.isSet("use-local-tor"))
#include "utils/Utils.h"
+#define PRESTIUM_DEFAULT_PORT 4448
+
bool Prestium::detect()
{
return QSysInfo::prettyProductName().contains("Prestium");
+}
+
+int Prestium::i2pPort()
+{
+ QString portStr = qgetenv("PRESTIUM_FEATHER_I2P_PORT");
+ if (portStr.isEmpty()) {
+ return PRESTIUM_DEFAULT_PORT;
+ }
+
+ int port = portStr.toInt();
+ if (port < 1 || port > 65535) {
+ return PRESTIUM_DEFAULT_PORT;
+ }
+
+ return port;
}
\ No newline at end of file