Skip to content

Commit

Permalink
Change response of /api/v1/config/active from raw xray config to seri…
Browse files Browse the repository at this point in the history
…alized config with meta-info
  • Loading branch information
aiamnezia committed Feb 14, 2025
1 parent 74a79d8 commit a400055
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.25)

project(desktopproxy VERSION 0.1.0.0 LANGUAGES CXX)
project(desktopproxy VERSION 0.1.0.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
2 changes: 1 addition & 1 deletion deploy/installer/config/windows.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Censortracker Proxy Server</Name>
<Version>0.1.0.0</Version>
<Version>0.1.0.1</Version>
<Title>Censortracker Proxy Server</Title>
<Publisher>Censortracker</Publisher>
<StartMenuDir>Censortracker</StartMenuDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Package>
<DisplayName>Censortracker Proxy Server</DisplayName>
<Description>Installation package for Censortracker Proxy Server</Description>
<Version>0.1.0.0</Version>
<Version>0.1.0.1</Version>
<ReleaseDate>2025-02-11</ReleaseDate>
<Default>true</Default>
<Script>installscript.qs</Script>
Expand Down
15 changes: 14 additions & 1 deletion proxyserver/src/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,20 @@ bool ConfigManager::activateConfig(const QString &uuid)

QJsonObject ConfigManager::getActiveConfig() const
{
return readActiveConfig();
Logger::getInstance().debug("Getting active config info");
QJsonObject configsInfo = readConfigsInfo();
QJsonObject configs = configsInfo["configs"].toObject();
QString activeUuid = getActiveConfigUuid();

if (activeUuid.isEmpty() || !configs.contains(activeUuid)) {
Logger::getInstance().debug("No active config found");
return QJsonObject();
}

Logger::getInstance().debug(QString("Retrieved active config info for UUID: %1").arg(activeUuid));
QJsonObject result = configs[activeUuid].toObject();
result["id"] = activeUuid;
return result;
}

QMap<QString, QJsonObject> ConfigManager::getAllConfigs() const
Expand Down

0 comments on commit a400055

Please sign in to comment.