1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-02-07 17:10:07 +08:00

fix: Fail2ban 配置修改后重启服务 (#3261)

This commit is contained in:
ssongliu 2023-12-11 13:50:07 +08:00 committed by GitHub
parent 73d41675a0
commit 3a6e526033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 60 additions and 14 deletions

View File

@ -19,7 +19,7 @@ type Fail2BanSearch struct {
} }
type Fail2BanUpdate struct { type Fail2BanUpdate struct {
Key string `json:"key" validate:"required,oneof=port bantime findtime maxretry banaction logpath"` Key string `json:"key" validate:"required,oneof=port bantime findtime maxretry banaction logpath port"`
Value string `json:"value"` Value string `json:"value"`
} }

View File

@ -167,7 +167,7 @@ func (u *Fail2BanService) UpdateConf(req dto.Fail2BanUpdate) error {
if err != nil { if err != nil {
return err return err
} }
if err := client.Operate("reload"); err != nil { if err := client.Operate("restart"); err != nil {
return err return err
} }
return nil return nil
@ -187,7 +187,7 @@ func (u *Fail2BanService) UpdateConfByFile(req dto.UpdateByFile) error {
if err != nil { if err != nil {
return err return err
} }
if err := client.Operate("reload"); err != nil { if err := client.Operate("restart"); err != nil {
return err return err
} }
return nil return nil

View File

@ -14984,9 +14984,15 @@ const docTemplate = `{
"isExist": { "isExist": {
"type": "boolean" "type": "boolean"
}, },
"logPath": {
"type": "string"
},
"maxRetry": { "maxRetry": {
"type": "integer" "type": "integer"
}, },
"port": {
"type": "integer"
},
"version": { "version": {
"type": "string" "type": "string"
} }
@ -15020,7 +15026,9 @@ const docTemplate = `{
"bantime", "bantime",
"findtime", "findtime",
"maxretry", "maxretry",
"banaction" "banaction",
"logpath",
"port"
] ]
}, },
"value": { "value": {
@ -16603,7 +16611,8 @@ const docTemplate = `{
"dto.SSLUpdate": { "dto.SSLUpdate": {
"type": "object", "type": "object",
"required": [ "required": [
"ssl" "ssl",
"sslType"
], ],
"properties": { "properties": {
"cert": { "cert": {
@ -16626,7 +16635,13 @@ const docTemplate = `{
"type": "integer" "type": "integer"
}, },
"sslType": { "sslType": {
"type": "string" "type": "string",
"enum": [
"self",
"select",
"import-paste",
"import-local"
]
} }
} }
}, },

View File

@ -14977,9 +14977,15 @@
"isExist": { "isExist": {
"type": "boolean" "type": "boolean"
}, },
"logPath": {
"type": "string"
},
"maxRetry": { "maxRetry": {
"type": "integer" "type": "integer"
}, },
"port": {
"type": "integer"
},
"version": { "version": {
"type": "string" "type": "string"
} }
@ -15013,7 +15019,9 @@
"bantime", "bantime",
"findtime", "findtime",
"maxretry", "maxretry",
"banaction" "banaction",
"logpath",
"port"
] ]
}, },
"value": { "value": {
@ -16596,7 +16604,8 @@
"dto.SSLUpdate": { "dto.SSLUpdate": {
"type": "object", "type": "object",
"required": [ "required": [
"ssl" "ssl",
"sslType"
], ],
"properties": { "properties": {
"cert": { "cert": {
@ -16619,7 +16628,13 @@
"type": "integer" "type": "integer"
}, },
"sslType": { "sslType": {
"type": "string" "type": "string",
"enum": [
"self",
"select",
"import-paste",
"import-local"
]
} }
} }
}, },

View File

@ -1079,8 +1079,12 @@ definitions:
type: boolean type: boolean
isExist: isExist:
type: boolean type: boolean
logPath:
type: string
maxRetry: maxRetry:
type: integer type: integer
port:
type: integer
version: version:
type: string type: string
type: object type: object
@ -1103,6 +1107,8 @@ definitions:
- findtime - findtime
- maxretry - maxretry
- banaction - banaction
- logpath
- port
type: string type: string
value: value:
type: string type: string
@ -2186,9 +2192,15 @@ definitions:
sslID: sslID:
type: integer type: integer
sslType: sslType:
enum:
- self
- select
- import-paste
- import-local
type: string type: string
required: required:
- ssl - ssl
- sslType
type: object type: object
dto.SearchForAnalysis: dto.SearchForAnalysis:
properties: properties:

View File

@ -1226,7 +1226,7 @@ const message = {
OneDrive: 'Microsoft OneDrive', OneDrive: 'Microsoft OneDrive',
backupDir: 'Backup dir', backupDir: 'Backup dir',
codeWarning: 'The current authorization code format is incorrect, please confirm again!', codeWarning: 'The current authorization code format is incorrect, please confirm again!',
isCN: 'Domestic version', isCN: 'Domestic version (not supported at the moment)',
code: 'Auth code', code: 'Auth code',
codeHelper: codeHelper:
'Please click on the "Acquire" button, then login to OneDrive and copy the content after "code" in the redirected link. Paste it into this input box. For specific instructions, please refer to the official documentation.', 'Please click on the "Acquire" button, then login to OneDrive and copy the content after "code" in the redirected link. Paste it into this input box. For specific instructions, please refer to the official documentation.',

View File

@ -1153,7 +1153,7 @@ const message = {
OneDrive: '微軟 OneDrive', OneDrive: '微軟 OneDrive',
codeWarning: '當前授權碼格式錯誤請重新確認', codeWarning: '當前授權碼格式錯誤請重新確認',
backupDir: '備份路徑', backupDir: '備份路徑',
isCN: '國內版', isCN: '國內版 (暫不支持)',
code: '授權碼', code: '授權碼',
codeHelper: codeHelper:
'請點擊獲取按鈕然後登錄 OneDrive 復製跳轉鏈接中 code 後面的內容粘貼到該輸入框中具體操作可參考官方文檔', '請點擊獲取按鈕然後登錄 OneDrive 復製跳轉鏈接中 code 後面的內容粘貼到該輸入框中具體操作可參考官方文檔',

View File

@ -1154,7 +1154,7 @@ const message = {
OneDrive: '微软 OneDrive', OneDrive: '微软 OneDrive',
codeWarning: '当前授权码格式错误请重新确认', codeWarning: '当前授权码格式错误请重新确认',
backupDir: '备份路径', backupDir: '备份路径',
isCN: '国内版', isCN: '国内版 (暂不支持)',
code: '授权码', code: '授权码',
codeHelper: codeHelper:
'请点击获取按钮然后登录 OneDrive 复制跳转链接中 code 后面的内容粘贴到该输入框中具体操作可参考官方文档', '请点击获取按钮然后登录 OneDrive 复制跳转链接中 code 后面的内容粘贴到该输入框中具体操作可参考官方文档',

View File

@ -195,7 +195,7 @@ const loadRepos = async () => {
}; };
const onDelete = (row: Container.ImageInfo) => { const onDelete = (row: Container.ImageInfo) => {
let names = row.tags || [row.id.replaceAll('sha256:', '').substring(0, 12)]; let names = [row.id.replaceAll('sha256:', '').substring(0, 12)];
opRef.value.acceptParams({ opRef.value.acceptParams({
title: i18n.global.t('commons.button.delete'), title: i18n.global.t('commons.button.delete'),
names: names, names: names,

View File

@ -46,7 +46,11 @@
<el-input show-password clearable v-model.trim="dialogData.rowData!.credential" /> <el-input show-password clearable v-model.trim="dialogData.rowData!.credential" />
</el-form-item> </el-form-item>
<el-form-item v-if="dialogData.rowData!.type === 'OneDrive'"> <el-form-item v-if="dialogData.rowData!.type === 'OneDrive'">
<el-checkbox v-model="dialogData.rowData!.varsJson['isCN']" :label="$t('setting.isCN')" /> <el-checkbox
disabled
v-model="dialogData.rowData!.varsJson['isCN']"
:label="$t('setting.isCN')"
/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="dialogData.rowData!.type === 'OneDrive'" v-if="dialogData.rowData!.type === 'OneDrive'"