mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 02:06:37 +08:00
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:
@@ -37,7 +37,7 @@ func EnsureRuntimeProvider(ctx context.Context) error {
|
||||
runtimeInitErr = err
|
||||
return
|
||||
}
|
||||
runtimeInitErr = applyProviderFromModel()
|
||||
runtimeInitErr = applyProviderFromModel(ctx)
|
||||
})
|
||||
return runtimeInitErr
|
||||
}
|
||||
@@ -47,18 +47,18 @@ func RefreshRuntimeProvider(ctx context.Context) error {
|
||||
if err := model.InitOptionMap(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
return applyProviderFromModel()
|
||||
return applyProviderFromModel(ctx)
|
||||
}
|
||||
|
||||
func applyProviderFromModel() error {
|
||||
func applyProviderFromModel(ctx context.Context) error {
|
||||
model.OptionMapRWMutex.RLock()
|
||||
provider := strings.TrimSpace(model.GeoIPProvider)
|
||||
model.OptionMapRWMutex.RUnlock()
|
||||
return ApplyProvider(provider)
|
||||
return ApplyProvider(ctx, provider)
|
||||
}
|
||||
|
||||
// ApplyProvider switches the process-wide GeoIP backend.
|
||||
func ApplyProvider(provider string) error {
|
||||
func ApplyProvider(ctx context.Context, provider string) error {
|
||||
normalized := strings.TrimSpace(strings.ToLower(provider))
|
||||
if normalized == "" {
|
||||
normalized = pkggeoip.ProviderDisabled
|
||||
@@ -75,7 +75,7 @@ func ApplyProvider(provider string) error {
|
||||
if normalized == pkggeoip.ProviderMaxMind {
|
||||
path, err := ensureServerMMDB()
|
||||
if err != nil {
|
||||
logger.WarnF(context.Background(), "[GeoIP] seed MaxMind database failed: %v", err)
|
||||
logger.WarnF(ctx, "[GeoIP] seed MaxMind database failed: %v", err)
|
||||
}
|
||||
if path != "" {
|
||||
pkggeoip.GeoIPFilePath = path
|
||||
|
||||
Reference in New Issue
Block a user