Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent/app/dto/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type RuleSearch struct {
}

type FirewallOperation struct {
Operation string `json:"operation" validate:"required,oneof=start stop restart disablePing enablePing"`
Operation string `json:"operation" validate:"required,oneof=start stop restart disableBanPing enableBanPing"`
WithDockerRestart bool `json:"withDockerRestart"`
}

Expand Down
5 changes: 0 additions & 5 deletions agent/app/service/device_clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,6 @@ func loadLogTree(fileOp fileUtils.FileOp) []dto.CleanTree {
size2, _ := fileOp.GetDirSize(path2)
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "task_log", Size: uint64(size2), Children: list2, Type: "task_log"})

path3 := path.Join(global.Dir.TmpDir, "script")
list3 := loadTreeWithAllFile(true, path3, "script", path3, fileOp)
size3, _ := fileOp.GetDirSize(path3)
treeData = append(treeData, dto.CleanTree{ID: uuid.NewString(), Label: "script", Size: uint64(size3), Children: list3, Type: "script", IsRecommend: true})

websiteLogList := loadWebsiteLogTree(fileOp)
logTotalSize := uint64(0)
for _, websiteLog := range websiteLogList {
Expand Down
4 changes: 2 additions & 2 deletions agent/app/service/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ func (u *FirewallService) OperateFirewall(req dto.FirewallOperation) error {
return err
}
needRestartDocker = true
case "disablePing":
case "disableBanPing":
if err := firewall.UpdatePingStatus("0"); err != nil {
_ = settingRepo.Update("BanPing", constant.StatusDisable)
return err
}
return nil
case "enablePing":
case "enableBanPing":
if err := firewall.UpdatePingStatus("1"); err != nil {
_ = settingRepo.Update("BanPing", constant.StatusEnable)
return err
Expand Down
49 changes: 37 additions & 12 deletions core/cmd/server/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22560,6 +22560,12 @@ const docTemplate = `{
},
"dto.CleanData": {
"properties": {
"backupClean": {
"items": {
"$ref": "#/definitions/dto.CleanTree"
},
"type": "array"
},
"containerClean": {
"items": {
"$ref": "#/definitions/dto.CleanTree"
Expand Down Expand Up @@ -22821,10 +22827,7 @@ const docTemplate = `{
"dto.ComposeCreate": {
"properties": {
"env": {
"items": {
"type": "string"
},
"type": "array"
"type": "string"
},
"file": {
"type": "string"
Expand Down Expand Up @@ -22857,6 +22860,9 @@ const docTemplate = `{
},
"dto.ComposeLogClean": {
"properties": {
"detailPath": {
"type": "string"
},
"name": {
"type": "string"
},
Expand Down Expand Up @@ -22972,11 +22978,11 @@ const docTemplate = `{
"content": {
"type": "string"
},
"detailPath": {
"type": "string"
},
"env": {
"items": {
"type": "string"
},
"type": "array"
"type": "string"
},
"name": {
"type": "string"
Expand Down Expand Up @@ -24591,8 +24597,8 @@ const docTemplate = `{
"start",
"stop",
"restart",
"disablePing",
"enablePing"
"disableBanPing",
"enableBanPing"
],
"type": "string"
},
Expand Down Expand Up @@ -25254,6 +25260,9 @@ const docTemplate = `{
},
"dto.InspectReq": {
"properties": {
"detail": {
"type": "string"
},
"id": {
"type": "string"
},
Expand Down Expand Up @@ -27541,7 +27550,8 @@ const docTemplate = `{
"ssl": {
"enum": [
"Enable",
"Disable"
"Disable",
"Mux"
],
"type": "string"
},
Expand Down Expand Up @@ -29048,6 +29058,9 @@ const docTemplate = `{
"id": {
"type": "integer"
},
"isIP": {
"type": "boolean"
},
"keyType": {
"type": "string"
},
Expand Down Expand Up @@ -29689,6 +29702,9 @@ const docTemplate = `{
},
"mountPoint": {
"type": "string"
},
"noFail": {
"type": "boolean"
}
},
"required": [
Expand Down Expand Up @@ -32179,6 +32195,9 @@ const docTemplate = `{
"content": {
"type": "string"
},
"sync": {
"type": "boolean"
},
"type": {
"type": "string"
}
Expand Down Expand Up @@ -32535,6 +32554,9 @@ const docTemplate = `{
"id": {
"type": "integer"
},
"isIp": {
"type": "boolean"
},
"keyType": {
"type": "string"
},
Expand Down Expand Up @@ -34692,6 +34714,9 @@ const docTemplate = `{
"id": {
"type": "integer"
},
"isIP": {
"type": "boolean"
},
"keyType": {
"type": "string"
},
Expand Down Expand Up @@ -34782,4 +34807,4 @@ var SwaggerInfo = &swag.Spec{

func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
}
47 changes: 36 additions & 11 deletions core/cmd/server/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -22556,6 +22556,12 @@
},
"dto.CleanData": {
"properties": {
"backupClean": {
"items": {
"$ref": "#/definitions/dto.CleanTree"
},
"type": "array"
},
"containerClean": {
"items": {
"$ref": "#/definitions/dto.CleanTree"
Expand Down Expand Up @@ -22817,10 +22823,7 @@
"dto.ComposeCreate": {
"properties": {
"env": {
"items": {
"type": "string"
},
"type": "array"
"type": "string"
},
"file": {
"type": "string"
Expand Down Expand Up @@ -22853,6 +22856,9 @@
},
"dto.ComposeLogClean": {
"properties": {
"detailPath": {
"type": "string"
},
"name": {
"type": "string"
},
Expand Down Expand Up @@ -22968,11 +22974,11 @@
"content": {
"type": "string"
},
"detailPath": {
"type": "string"
},
"env": {
"items": {
"type": "string"
},
"type": "array"
"type": "string"
},
"name": {
"type": "string"
Expand Down Expand Up @@ -24587,8 +24593,8 @@
"start",
"stop",
"restart",
"disablePing",
"enablePing"
"disableBanPing",
"enableBanPing"
],
"type": "string"
},
Expand Down Expand Up @@ -25250,6 +25256,9 @@
},
"dto.InspectReq": {
"properties": {
"detail": {
"type": "string"
},
"id": {
"type": "string"
},
Expand Down Expand Up @@ -27537,7 +27546,8 @@
"ssl": {
"enum": [
"Enable",
"Disable"
"Disable",
"Mux"
],
"type": "string"
},
Expand Down Expand Up @@ -29044,6 +29054,9 @@
"id": {
"type": "integer"
},
"isIP": {
"type": "boolean"
},
"keyType": {
"type": "string"
},
Expand Down Expand Up @@ -29685,6 +29698,9 @@
},
"mountPoint": {
"type": "string"
},
"noFail": {
"type": "boolean"
}
},
"required": [
Expand Down Expand Up @@ -32175,6 +32191,9 @@
"content": {
"type": "string"
},
"sync": {
"type": "boolean"
},
"type": {
"type": "string"
}
Expand Down Expand Up @@ -32531,6 +32550,9 @@
"id": {
"type": "integer"
},
"isIp": {
"type": "boolean"
},
"keyType": {
"type": "string"
},
Expand Down Expand Up @@ -34688,6 +34710,9 @@
"id": {
"type": "integer"
},
"isIP": {
"type": "boolean"
},
"keyType": {
"type": "string"
},
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ const message = {
interactive: 'Interactive script',
interactiveHelper: 'Requires user input during execution and cannot be used in scheduled tasks.',
library: 'Script Library',
remoteLibrary: 'Remote Script Library',
create: 'Add Script',
edit: 'Edit Script',
groupHelper:
Expand Down Expand Up @@ -2936,6 +2937,8 @@ const message = {
startFirewallHelper:
'After the firewall is enabled, the server security can be better protected. Do you want to continue?',
noPing: 'Disable ping',
enableBanPing: 'Block Ping',
disableBanPing: 'Unblock Ping',
noPingTitle: 'Disable ping',
noPingHelper: `This will disable ping, and the server won't echo ICMP response. Do you want to continue?`,
onPingHelper: 'This will enable ping, and hackers may discover your server. Do you want to continue?',
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ const message = {
interactive: 'Script interactivo',
interactiveHelper:
'Requiere introducir datos durante la ejecución y no puede ser usada en tareas programadas.',
remoteLibrary: 'Biblioteca de Scripts Remota',
library: 'Librería de scripts',
create: 'Agregar script',
edit: 'Editar script',
Expand Down Expand Up @@ -2919,6 +2920,8 @@ const message = {
startFirewallHelper:
'Tras habilitar el firewall, la seguridad del servidor podrá protegerse mejor. ¿Deseas continuar?',
noPing: 'Deshabilitar ping',
enableBanPing: 'Bloquear Ping',
disableBanPing: 'Desbloquear Ping',
noPingTitle: 'Deshabilitar ping',
noPingHelper: `Esto deshabilitará el ping, y el servidor no responderá con eco ICMP. ¿Deseas continuar?`,
onPingHelper: 'Esto habilitará el ping, y los atacantes podrían descubrir tu servidor. ¿Deseas continuar?',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,8 @@ const message = {
startFirewallHelper:
'ファイアウォールが有効になった後、サーバーのセキュリティをよりよく保護できます。続けたいですか?',
noPing: 'pingを無効にします',
enableBanPing: 'Ping禁止',
disableBanPing: 'Ping禁止解除',
noPingTitle: 'pingを無効にします',
noPingHelper: `これによりPingが無効になり、サーバーはICMP応答をエコーし​​ません。続けたいですか?`,
onPingHelper: 'これによりPingが可能になり、ハッカーはサーバーを発見する場合があります。続けたいですか?',
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,7 @@ const message = {
interactive: '대화형 스크립트',
interactiveHelper: '실행 중 사용자 입력이 필요하며 예약 작업에서는 사용할 수 없습니다.',
library: '스크립트 라이브러리',
remoteLibrary: 'リモートスクリプトライブラリ',
create: '스크립트 추가',
edit: '스크립트 수정',
groupHelper:
Expand Down Expand Up @@ -2803,6 +2804,8 @@ const message = {
stopFirewallHelper: '이 작업은 서버 보안을 잃게 만듭니다. 계속하시겠습니까?',
startFirewallHelper: '방화벽이 활성화되면 서버 보안이 강화됩니다. 계속하시겠습니까?',
noPing: 'Ping 비활성화',
enableBanPing: 'Ping 차단',
disableBanPing: 'Ping 차단 해제',
noPingTitle: 'Ping 비활성화',
noPingHelper: '이 작업은 Ping 을 비활성화하며 서버는 ICMP 응답을 보내지 않게 됩니다. 계속하시겠습니까?',
onPingHelper: '이 작업은 Ping 을 활성화하여 해커가 서버를 발견할 수 있습니다. 계속하시겠습니까?',
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,7 @@ const message = {
interactiveHelper:
'Memerlukan input pengguna semasa pelaksanaan dan tidak boleh digunakan dalam tugas terjadual.',
library: 'Perpustakaan Skrip',
remoteLibrary: 'Pustaka Skrip Jauh',
create: 'Tambah Skrip',
edit: 'Sunting Skrip',
groupHelper:
Expand Down Expand Up @@ -2917,6 +2918,8 @@ const message = {
startFirewallHelper:
'Selepas firewall diaktifkan, keselamatan pelayan boleh dilindungi dengan lebih baik. Adakah anda mahu meneruskan?',
noPing: 'Lumpuhkan ping',
enableBanPing: 'Sekat Ping',
disableBanPing: 'Nyahsekat Ping',
noPingTitle: 'Lumpuhkan ping',
noPingHelper: `Ini akan melumpuhkan ping, dan pelayan tidak akan memberikan tindak balas ICMP. Adakah anda mahu meneruskan?`,
onPingHelper:
Expand Down
Loading
Loading