From 2bde755fc4f37147fde8e3beda14f0f693cb4842 Mon Sep 17 00:00:00 2001
From: ChengPlay <31820853+zhengkunwang223@users.noreply.github.com>
Date: Mon, 28 Apr 2025 22:43:48 +0800
Subject: [PATCH] feat: merge code from dev (#8504)
---
agent/go.mod | 1 +
agent/go.sum | 2 +
agent/init/migration/migrations/init.go | 3 --
agent/utils/ssl/client.go | 50 ++++++++++++++-----
core/app/api/v2/auth.go | 6 +++
frontend/src/global/mimetype.ts | 8 +++
frontend/src/lang/modules/en.ts | 1 +
frontend/src/lang/modules/ja.ts | 1 +
frontend/src/lang/modules/ko.ts | 1 +
frontend/src/lang/modules/ms.ts | 1 +
frontend/src/lang/modules/pt-br.ts | 1 +
frontend/src/lang/modules/ru.ts | 1 +
frontend/src/lang/modules/zh-Hant.ts | 1 +
frontend/src/lang/modules/zh.ts | 1 +
frontend/src/views/app-store/index.vue | 11 +++-
.../website/ssl/dns-account/create/index.vue | 19 +++++++
16 files changed, 92 insertions(+), 16 deletions(-)
diff --git a/agent/go.mod b/agent/go.mod
index b06dd71d5..43240c090 100644
--- a/agent/go.mod
+++ b/agent/go.mod
@@ -171,6 +171,7 @@ require (
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 // indirect
github.com/nrdcg/dnspod-go v0.4.0 // indirect
github.com/nrdcg/freemyip v0.3.0 // indirect
+ github.com/nrdcg/mailinabox v0.2.0 // indirect
github.com/nrdcg/namesilo v0.2.1 // indirect
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
diff --git a/agent/go.sum b/agent/go.sum
index 1b47d1775..fe27f45ff 100644
--- a/agent/go.sum
+++ b/agent/go.sum
@@ -712,6 +712,8 @@ github.com/nrdcg/dnspod-go v0.4.0 h1:c/jn1mLZNKF3/osJ6mz3QPxTudvPArXTjpkmYj0uK6U
github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ=
github.com/nrdcg/freemyip v0.3.0 h1:0D2rXgvLwe2RRaVIjyUcQ4S26+cIS2iFwnhzDsEuuwc=
github.com/nrdcg/freemyip v0.3.0/go.mod h1:c1PscDvA0ukBF0dwelU/IwOakNKnVxetpAQ863RMJoM=
+github.com/nrdcg/mailinabox v0.2.0 h1:IKq8mfKiVwNW2hQii/ng1dJ4yYMMv3HAP3fMFIq2CFk=
+github.com/nrdcg/mailinabox v0.2.0/go.mod h1:0yxqeYOiGyxAu7Sb94eMxHPIOsPYXAjTeA9ZhePhGnc=
github.com/nrdcg/namesilo v0.2.1 h1:kLjCjsufdW/IlC+iSfAqj0iQGgKjlbUUeDJio5Y6eMg=
github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw=
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk=
diff --git a/agent/init/migration/migrations/init.go b/agent/init/migration/migrations/init.go
index 937ff6724..3bca77e47 100644
--- a/agent/init/migration/migrations/init.go
+++ b/agent/init/migration/migrations/init.go
@@ -61,9 +61,6 @@ var AddTable = &gormigrate.Migration{
&model.Group{},
&model.AppIgnoreUpgrade{},
&model.McpServer{},
- &model.MonitorBase{},
- &model.MonitorIO{},
- &model.MonitorNetwork{},
)
},
}
diff --git a/agent/utils/ssl/client.go b/agent/utils/ssl/client.go
index 760755554..b4b51647c 100644
--- a/agent/utils/ssl/client.go
+++ b/agent/utils/ssl/client.go
@@ -7,6 +7,7 @@ import (
"github.com/go-acme/lego/v4/providers/dns/alidns"
"github.com/go-acme/lego/v4/providers/dns/clouddns"
"github.com/go-acme/lego/v4/providers/dns/cloudflare"
+ "github.com/go-acme/lego/v4/providers/dns/cloudns"
"github.com/go-acme/lego/v4/providers/dns/dnspod"
"github.com/go-acme/lego/v4/providers/dns/freemyip"
"github.com/go-acme/lego/v4/providers/dns/godaddy"
@@ -19,6 +20,7 @@ import (
"github.com/go-acme/lego/v4/providers/dns/tencentcloud"
"github.com/go-acme/lego/v4/providers/dns/vercel"
"github.com/go-acme/lego/v4/providers/dns/volcengine"
+ "github.com/go-acme/lego/v4/providers/dns/westcn"
"os"
"strings"
"time"
@@ -101,21 +103,27 @@ const (
FreeMyIP DnsType = "FreeMyIP"
Vercel DnsType = "Vercel"
Spaceship DnsType = "Spaceship"
+ WestCN DnsType = "WestCN"
+ ClouDNS DnsType = "ClouDNS"
)
type DNSParam struct {
- ID string `json:"id"`
- Token string `json:"token"`
- AccessKey string `json:"accessKey"`
- SecretKey string `json:"secretKey"`
- Email string `json:"email"`
- APIkey string `json:"apiKey"`
- APIUser string `json:"apiUser"`
- APISecret string `json:"apiSecret"`
- SecretID string `json:"secretID"`
- ClientID string `json:"clientID"`
- Password string `json:"password"`
- Region string `json:"region"`
+ ID string `json:"id"`
+ Token string `json:"token"`
+ AccessKey string `json:"accessKey"`
+ SecretKey string `json:"secretKey"`
+ Email string `json:"email"`
+ APIkey string `json:"apiKey"`
+ APIUser string `json:"apiUser"`
+ APISecret string `json:"apiSecret"`
+ SecretID string `json:"secretID"`
+ ClientID string `json:"clientID"`
+ Password string `json:"password"`
+ Region string `json:"region"`
+ Username string `json:"username"`
+ AuthID string `json:"authID"`
+ SubAuthID string `json:"subAuthID"`
+ AuthPassword string `json:"authPassword"`
}
var (
@@ -250,6 +258,24 @@ func getDNSProviderConfig(dnsType DnsType, params string) (challenge.Provider, e
spaceshipConfig.PollingInterval = pollingInterval
spaceshipConfig.TTL = ttl
p, err = spaceship.NewDNSProviderConfig(spaceshipConfig)
+ case WestCN:
+ westcnConfig := westcn.NewDefaultConfig()
+ westcnConfig.Username = param.Username
+ westcnConfig.Password = param.Password
+ westcnConfig.PropagationTimeout = propagationTimeout
+ westcnConfig.PollingInterval = pollingInterval
+ westcnConfig.TTL = ttl
+ p, err = westcn.NewDNSProviderConfig(westcnConfig)
+
+ case ClouDNS:
+ cloudnsConfig := cloudns.NewDefaultConfig()
+ cloudnsConfig.AuthID = param.AuthID
+ cloudnsConfig.SubAuthID = param.SubAuthID
+ cloudnsConfig.AuthPassword = param.AuthPassword
+ cloudnsConfig.PropagationTimeout = propagationTimeout
+ cloudnsConfig.PollingInterval = pollingInterval
+ cloudnsConfig.TTL = ttl
+ p, err = cloudns.NewDNSProviderConfig(cloudnsConfig)
}
if err != nil {
return nil, err
diff --git a/core/app/api/v2/auth.go b/core/app/api/v2/auth.go
index 67995cf66..d13c1528c 100644
--- a/core/app/api/v2/auth.go
+++ b/core/app/api/v2/auth.go
@@ -36,6 +36,12 @@ func (b *BaseApi) Login(c *gin.Context) {
if len(entranceItem) != 0 {
entrance, _ = base64.StdEncoding.DecodeString(entranceItem)
}
+ if len(entrance) == 0 {
+ cookieValue, err := c.Cookie("SecurityEntrance")
+ if err == nil {
+ entrance, _ = base64.StdEncoding.DecodeString(cookieValue)
+ }
+ }
user, msgKey, err := authService.Login(c, req, string(entrance))
go saveLoginLogs(c, err)
diff --git a/frontend/src/global/mimetype.ts b/frontend/src/global/mimetype.ts
index 3627fc318..baf76e839 100644
--- a/frontend/src/global/mimetype.ts
+++ b/frontend/src/global/mimetype.ts
@@ -220,6 +220,14 @@ export const DNSTypes = [
label: i18n.global.t('website.rainyun'),
value: 'RainYun',
},
+ {
+ label: i18n.global.t('website.westCN'),
+ value: 'WestCN',
+ },
+ {
+ label: 'ClouDNS',
+ value: 'ClouDNS',
+ },
{
label: 'Spaceship',
value: 'Spaceship',
diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index a2468bc5b..eb7b16cc5 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -2449,6 +2449,7 @@ const message = {
cancelFavorite: 'Cancel Favorite',
useProxy: 'Use Proxy',
useProxyHelper: 'Use the proxy server address in the panel settings',
+ westCN: 'West Digital',
},
php: {
short_open_tag: 'Short tag support',
diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts
index 281e0b5fa..1a5ca536c 100644
--- a/frontend/src/lang/modules/ja.ts
+++ b/frontend/src/lang/modules/ja.ts
@@ -2356,6 +2356,7 @@ const message = {
cancelFavorite: 'お気に入りを解除',
useProxy: 'プロキシを使用',
useProxyHelper: 'パネル設定のプロキシサーバーアドレスを使用',
+ westCN: '西部デジタル',
},
php: {
short_open_tag: '短いタグサポート',
diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts
index 5989efc58..ae7649ded 100644
--- a/frontend/src/lang/modules/ko.ts
+++ b/frontend/src/lang/modules/ko.ts
@@ -2317,6 +2317,7 @@ const message = {
cancelFavorite: '즐겨찾기 취소',
useProxy: '프록시 사용',
useProxyHelper: '패널 설정의 프록시 서버 주소 사용',
+ westCN: '서부 디지털',
},
php: {
short_open_tag: '짧은 태그 지원',
diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts
index 528861fc6..301115068 100644
--- a/frontend/src/lang/modules/ms.ts
+++ b/frontend/src/lang/modules/ms.ts
@@ -2410,6 +2410,7 @@ const message = {
cancelFavorite: 'Batalkan Kegemaran',
useProxy: 'Gunakan Proksi',
useProxyHelper: 'Gunakan alamat pelayan proksi dalam tetapan panel',
+ westCN: 'West Digital',
},
php: {
short_open_tag: 'Sokongan tag pendek',
diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts
index 6c0892901..ccd0bf70c 100644
--- a/frontend/src/lang/modules/pt-br.ts
+++ b/frontend/src/lang/modules/pt-br.ts
@@ -2406,6 +2406,7 @@ const message = {
cancelFavorite: 'Cancelar Favorito',
useProxy: 'Usar Proxy',
useProxyHelper: 'Usar o endereço do servidor proxy nas configurações do painel',
+ westCN: 'West Digital',
},
php: {
short_open_tag: 'Suporte para short tags',
diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts
index adf520beb..66428e8f2 100644
--- a/frontend/src/lang/modules/ru.ts
+++ b/frontend/src/lang/modules/ru.ts
@@ -2407,6 +2407,7 @@ const message = {
cancelFavorite: 'Отменить избранное',
useProxy: 'Использовать прокси',
useProxyHelper: 'Использовать адрес прокси-сервера в настройках панели',
+ westCN: 'Западный цифровой',
},
php: {
short_open_tag: 'Поддержка коротких тегов',
diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts
index fa62ef721..de89c87a9 100644
--- a/frontend/src/lang/modules/zh-Hant.ts
+++ b/frontend/src/lang/modules/zh-Hant.ts
@@ -2273,6 +2273,7 @@ const message = {
cancelFavorite: '取消收藏',
useProxy: '使用代理',
useProxyHelper: '使用面板設置中的代理服務器地址',
+ westCN: '西部數碼',
},
php: {
short_open_tag: '短標簽支持',
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index 2593f23cf..a5df567da 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -2263,6 +2263,7 @@ const message = {
cancelFavorite: '取消收藏',
useProxy: '使用代理',
useProxyHelper: '使用面板设置中的代理服务器地址',
+ westCN: '西部数码',
},
php: {
short_open_tag: '短标签支持',
diff --git a/frontend/src/views/app-store/index.vue b/frontend/src/views/app-store/index.vue
index 2a82372f7..8a6345ad8 100644
--- a/frontend/src/views/app-store/index.vue
+++ b/frontend/src/views/app-store/index.vue
@@ -14,9 +14,11 @@ import i18n from '@/lang';
import { onMounted, ref } from 'vue';
import { searchAppInstalled } from '@/api/modules/app';
import bus from '@/global/bus';
+import { GlobalStore } from '@/store';
+const globalStore = GlobalStore();
let showButton = ref(false);
-const buttons = [
+let buttons = [
{
label: i18n.global.t('app.all'),
path: '/apps/all',
@@ -30,6 +32,9 @@ const buttons = [
path: '/apps/upgrade',
count: 0,
},
+];
+
+const settingButtons = [
{
label: i18n.global.t('commons.button.set'),
path: '/apps/setting',
@@ -51,6 +56,10 @@ const search = () => {
};
onMounted(() => {
+ if (globalStore.isProductPro) {
+ buttons = buttons.concat(settingButtons);
+ }
+
search();
bus.on('upgrade', () => {
showButton.value = false;
diff --git a/frontend/src/views/website/ssl/dns-account/create/index.vue b/frontend/src/views/website/ssl/dns-account/create/index.vue
index 5af15d1c3..1bc90952d 100644
--- a/frontend/src/views/website/ssl/dns-account/create/index.vue
+++ b/frontend/src/views/website/ssl/dns-account/create/index.vue
@@ -112,6 +112,25 @@