Release 3.9.0+1: Remnawave API configs, Remnawave-style UI with flags, Windows build.

EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Navis
2026-08-01 16:17:10 +03:00
co-authored by Cursor
parent 92cf707597
commit 015ded9bd5
24 changed files with 985 additions and 159 deletions
+6
View File
@@ -33,6 +33,12 @@ type Config struct {
// SubscriptionURL pulls share links (one per line or base64) and imports profiles.
SubscriptionURL string `json:"subscription_url,omitempty"`
// Remnawave panel integration (local only — do not commit tokens).
RemnawaveBaseURL string `json:"remnawave_base_url,omitempty"`
RemnawaveToken string `json:"remnawave_token,omitempty"`
RemnawaveShortUUID string `json:"remnawave_short_uuid,omitempty"`
RemnawaveCaddyToken string `json:"remnawave_caddy_token,omitempty"`
Profiles []Profile `json:"profiles"`
}
+10
View File
@@ -3,6 +3,8 @@ package config
import (
"fmt"
"strings"
"vpnclient/internal/geoflag"
)
// ProfileInfo is a safe summary for UI lists (no secrets beyond proxy URI the user already owns).
@@ -12,18 +14,26 @@ type ProfileInfo struct {
Proxy string `json:"proxy"`
Host string `json:"host"`
Active bool `json:"active"`
Country string `json:"country,omitempty"` // ISO 3166-1 alpha-2
Flag string `json:"flag,omitempty"` // emoji flag or empty
}
// ListProfiles returns UI-friendly profile summaries.
func (c *Config) ListProfiles() []ProfileInfo {
out := make([]ProfileInfo, 0, len(c.Profiles))
for _, p := range c.Profiles {
cc, flag := geoflag.FromText(p.Name)
if cc == "" {
cc, flag = geoflag.FromText(proxyHost(p.Proxy))
}
out = append(out, ProfileInfo{
Name: p.Name,
Protocol: string(p.Protocol),
Proxy: p.Proxy,
Host: proxyHost(p.Proxy),
Active: p.Name == c.Active,
Country: cc,
Flag: flag,
})
}
return out