feat(relay): support configurable frps webui port and fix node detail integration

- Implement configurable FRPS WebUI switch and custom port setting (relay_frps_web_ui_port) in system configs.
- Integrate settings into Relay Node detail manage page instead of global settings.
- Dynamically query server version to select matching Docker image tag for Relay installation.
- Clean up legacy code and fix backend linter/test warnings.
This commit is contained in:
ryan
2026-06-22 12:48:54 +08:00
parent ffe98f6307
commit 346024f346
24 changed files with 204 additions and 69 deletions
+2
View File
@@ -180,6 +180,7 @@ var countryCentroidsByName = map[string]countryCentroid{
"Zimbabwe": {lat: -19.006775, lon: 29.850564},
}
// CountryCentroidByName returns latitude and longitude for a country name, if found.
func CountryCentroidByName(name string) (lat float64, lon float64, ok bool) {
name = strings.TrimSpace(name)
if name == "" {
@@ -191,6 +192,7 @@ func CountryCentroidByName(name string) (lat float64, lon float64, ok bool) {
return 0, 0, false
}
// CountryCentroidByISO returns latitude and longitude for an ISO country code, if found.
func CountryCentroidByISO(iso string) (lat float64, lon float64, ok bool) {
name, ok := isoToCountryName[strings.ToUpper(strings.TrimSpace(iso))]
if !ok {
+1 -1
View File
@@ -118,7 +118,7 @@ func parseIPInfoCoordinates(value string) (*float64, *float64) {
}
func formatIPInfoLocation(resp ipInfoResponse) string {
parts := make([]string, 0, 3)
parts := make([]string, 0, 3) //nolint:mnd // 3 parts: city, region, country
if city := strings.TrimSpace(resp.City); city != "" {
parts = append(parts, city)
}
+1
View File
@@ -43,6 +43,7 @@ type RelayConfig struct {
AuthToken string `json:"auth_token"`
LogLevel string `json:"log_level"`
WebServerEnabled bool `json:"web_server_enabled"`
WebServerPort int `json:"web_server_port"`
}
// RelaySettings holds relay runtime settings.