From 6dc5deb6d3d7aec94cd57c3791d82393b23dfe78 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Thu, 7 May 2026 09:53:28 +0800 Subject: [PATCH] feat: support enterprise resource urls (#12669) --- agent/cmd/server/conf/app.yaml | 1 + agent/global/config.go | 19 ++++++++++--------- agent/global/global.go | 9 +++++++++ core/global/global.go | 9 +++++++++ 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/agent/cmd/server/conf/app.yaml b/agent/cmd/server/conf/app.yaml index 5909c8148..a4f52b67b 100644 --- a/agent/cmd/server/conf/app.yaml +++ b/agent/cmd/server/conf/app.yaml @@ -4,6 +4,7 @@ base: is_demo: false is_offline: false is_fxplay: false + is_enterprise: true log: level: debug diff --git a/agent/global/config.go b/agent/global/config.go index 9f877fe1f..1424b1ed5 100644 --- a/agent/global/config.go +++ b/agent/global/config.go @@ -7,15 +7,16 @@ type ServerConfig struct { } type Base struct { - Port string `mapstructure:"port"` - IsFxplay bool `mapstructure:"is_fxplay"` - Edition string `mapstructure:"edition"` // [ cn / intl] - Version string `mapstructure:"version"` - EncryptKey string `mapstructure:"encrypt_key"` - Mode string `mapstructure:"mode"` // xpack [ Enable / Disable ] - IsDemo bool `mapstructure:"is_demo"` - InstallDir string `mapstructure:"install_dir"` - IsOffline bool `mapstructure:"is_offline"` + Port string `mapstructure:"port"` + IsFxplay bool `mapstructure:"is_fxplay"` + IsEnterprise bool `mapstructure:"is_enterprise"` + Edition string `mapstructure:"edition"` // [ cn / intl] + Version string `mapstructure:"version"` + EncryptKey string `mapstructure:"encrypt_key"` + Mode string `mapstructure:"mode"` // xpack [ Enable / Disable ] + IsDemo bool `mapstructure:"is_demo"` + InstallDir string `mapstructure:"install_dir"` + IsOffline bool `mapstructure:"is_offline"` } type SystemDir struct { diff --git a/agent/global/global.go b/agent/global/global.go index 34d273e1e..3782179a3 100644 --- a/agent/global/global.go +++ b/agent/global/global.go @@ -42,6 +42,9 @@ var ( ) func RepoURL() string { + if CONF.Base.IsEnterprise { + return "https://resource.fit2cloud.com/1panel/package/enterprise" + } if CONF.Base.IsFxplay { return "https://resource.fit2cloud.com/1panel/package/fusionxplay" } @@ -51,6 +54,9 @@ func RepoURL() string { return "https://resource.1panel.pro/v2" } func ResourceURL() string { + if CONF.Base.IsEnterprise { + return "https://resource.fit2cloud.com/1panel/resource/enterprise" + } if CONF.Base.IsFxplay { return "https://resource.fit2cloud.com/1panel/resource/fusionxplay" } @@ -60,6 +66,9 @@ func ResourceURL() string { return "https://resource.1panel.pro/v2/resource" } func AppRepoURL() string { + if CONF.Base.IsEnterprise { + return "https://apps-assets.fit2cloud.com" + } if CONF.Base.IsFxplay { return "https://apps-assets.fit2cloud.com" } diff --git a/core/global/global.go b/core/global/global.go index d4ec6a52f..94331c5a1 100644 --- a/core/global/global.go +++ b/core/global/global.go @@ -35,6 +35,9 @@ var ( type DBOption func(*gorm.DB) *gorm.DB func RepoURL() string { + if CONF.Base.IsEnterprise { + return "https://resource.fit2cloud.com/1panel/package/enterprise" + } if CONF.Base.IsFxplay { return "https://resource.fit2cloud.com/1panel/package/fusionxplay" } @@ -44,6 +47,9 @@ func RepoURL() string { return "https://resource.1panel.pro/v2" } func ResourceURL() string { + if CONF.Base.IsEnterprise { + return "https://resource.fit2cloud.com/1panel/resource/enterprise" + } if CONF.Base.IsFxplay { return "https://resource.fit2cloud.com/1panel/resource/fusionxplay" } @@ -53,6 +59,9 @@ func ResourceURL() string { return "https://resource.1panel.pro/v2/resource" } func AppRepoURL() string { + if CONF.Base.IsEnterprise { + return "https://apps-assets.fit2cloud.com" + } if CONF.Base.IsFxplay { return "https://apps-assets.fit2cloud.com" }