Merge dev: lite6 + lite7 default servers

This commit is contained in:
2026-09-02 04:20:45 -05:00
3 changed files with 31 additions and 9 deletions

View File

@@ -108,6 +108,20 @@ void loadClamped(const json& j, const char* key, T& field, T lo, T hi)
} // namespace } // namespace
std::vector<Settings::LiteServerPreference> Settings::defaultLiteServers()
{
return {
{"https://lite.dragonx.is", "DragonX Lite", true},
{"https://lite1.dragonx.is", "DragonX Lite 1", true},
{"https://lite2.dragonx.is", "DragonX Lite 2", true},
{"https://lite3.dragonx.is", "DragonX Lite 3", true},
{"https://lite4.dragonx.is", "DragonX Lite 4", true},
{"https://lite5.dragonx.is", "DragonX Lite 5", true},
{"https://lite6.dragonx.is", "DragonX Lite 6", true},
{"https://lite7.dragonx.is", "DragonX Lite 7", true}
};
}
std::string Settings::getDefaultPath() std::string Settings::getDefaultPath()
{ {
// Single per-platform, per-variant config dir (util::Platform::getConfigDir handles the // Single per-platform, per-variant config dir (util::Platform::getConfigDir handles the
@@ -307,6 +321,16 @@ bool Settings::load(const std::string& path)
} }
lite_servers_.push_back(preference); lite_servers_.push_back(preference);
} }
// Surface newly-shipped default servers (e.g. lite6/lite7) on an existing
// install whose saved list predates them. Servers are hidden (see
// lite_hidden_servers_), never deleted, so appending a missing default won't
// resurrect one the user intentionally removed.
for (const auto& def : defaultLiteServers()) {
bool present = false;
for (const auto& s : lite_servers_)
if (s.url == def.url) { present = true; break; }
if (!present) lite_servers_.push_back(def);
}
} }
if (lite.contains("rollout_override") && lite["rollout_override"].is_string()) { if (lite.contains("rollout_override") && lite["rollout_override"].is_string()) {
const auto v = lite["rollout_override"].get<std::string>(); const auto v = lite["rollout_override"].get<std::string>();

View File

@@ -439,6 +439,9 @@ public:
void setLitePersistSelectedServer(bool persist) { lite_persist_selected_server_ = persist; } void setLitePersistSelectedServer(bool persist) { lite_persist_selected_server_ = persist; }
const std::vector<LiteServerPreference>& getLiteServers() const { return lite_servers_; } const std::vector<LiteServerPreference>& getLiteServers() const { return lite_servers_; }
void setLiteServers(const std::vector<LiteServerPreference>& servers) { lite_servers_ = servers; } void setLiteServers(const std::vector<LiteServerPreference>& servers) { lite_servers_ = servers; }
// Servers shipped as defaults. Also merged into an existing install's saved list on load
// (see Settings::load), so upgrades surface newly-added servers (e.g. lite6/lite7).
static std::vector<LiteServerPreference> defaultLiteServers();
// User-defined portfolio entries (Market tab). "All funds" is implicit, not stored here. // User-defined portfolio entries (Market tab). "All funds" is implicit, not stored here.
const std::vector<PortfolioEntry>& getPortfolioEntries() const { return portfolio_entries_; } const std::vector<PortfolioEntry>& getPortfolioEntries() const { return portfolio_entries_; }
@@ -655,14 +658,7 @@ private:
bool lite_persist_selected_server_ = true; bool lite_persist_selected_server_ = true;
std::string lite_rollout_override_ = "auto"; // auto|force_on|force_off std::string lite_rollout_override_ = "auto"; // auto|force_on|force_off
std::string lite_install_id_; // random local-only id; rollout-bucket source std::string lite_install_id_; // random local-only id; rollout-bucket source
std::vector<LiteServerPreference> lite_servers_ = { std::vector<LiteServerPreference> lite_servers_ = defaultLiteServers();
{"https://lite.dragonx.is", "DragonX Lite", true},
{"https://lite1.dragonx.is", "DragonX Lite 1", true},
{"https://lite2.dragonx.is", "DragonX Lite 2", true},
{"https://lite3.dragonx.is", "DragonX Lite 3", true},
{"https://lite4.dragonx.is", "DragonX Lite 4", true},
{"https://lite5.dragonx.is", "DragonX Lite 5", true}
};
std::set<std::string> lite_hidden_servers_; // server URLs hidden from the Network tab std::set<std::string> lite_hidden_servers_; // server URLs hidden from the Network tab
std::vector<PortfolioEntry> portfolio_entries_; // Market tab custom portfolio groups std::vector<PortfolioEntry> portfolio_entries_; // Market tab custom portfolio groups

View File

@@ -66,7 +66,9 @@ std::vector<LiteServerEndpoint> defaultDragonXLiteServers()
{"https://lite2.dragonx.is", "DragonX Lite 2", true}, {"https://lite2.dragonx.is", "DragonX Lite 2", true},
{"https://lite3.dragonx.is", "DragonX Lite 3", true}, {"https://lite3.dragonx.is", "DragonX Lite 3", true},
{"https://lite4.dragonx.is", "DragonX Lite 4", true}, {"https://lite4.dragonx.is", "DragonX Lite 4", true},
{"https://lite5.dragonx.is", "DragonX Lite 5", true} {"https://lite5.dragonx.is", "DragonX Lite 5", true},
{"https://lite6.dragonx.is", "DragonX Lite 6", true},
{"https://lite7.dragonx.is", "DragonX Lite 7", true}
}; };
} }