Compare commits

...
Author SHA1 Message Date
ssongliu 884a169a6f fix: 增加特殊字符命令过滤 (#4599) 2024-04-19 08:58:08 +00:00
ssongliu e79a5f9ae2 fix: 修改安全入口长度校验 (#4594) 2024-04-19 07:24:08 +00:00
ssongliu 25608e7378 fix: 修改许可证状态获取接口 (#4593)
Refs #4589
2024-04-19 07:22:08 +00:00
zhengkunwang dad8bac715 fix: 解决伪静态开启报错的问题 (#4591) 2024-04-19 07:20:08 +00:00
ssongliu a4ee16cf1f fix: 解决容器日志文件被删除但是进程未结束的问题 (#4588)
Refs #4582
2024-04-19 07:18:10 +00:00
dependabot[bot] 7f7465b383 chore(deps): bump github.com/docker/docker (#4586)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 26.0.0+incompatible to 26.0.2+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v26.0.0...v26.0.2)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 15:17:29 +08:00
zhengkunwang b7c3dc0d2a fix: 解决创建 PHP 网站首页无法访问的 BUG (#4577) 2024-04-18 14:40:07 +00:00
ssongliu bb02991b05 fix: 解决监控数据迁移失败的问题 (#4569)
Refs #4568
2024-04-18 14:38:06 +00:00
18 changed files with 64 additions and 31 deletions
+1 -1
View File
@@ -701,7 +701,7 @@ func (u *ContainerService) ContainerLogs(wsConn *websocket.Conn, containerType,
return
}
global.LOG.Errorf("read bytes from log failed, err: %v", err)
continue
return
}
if !utf8.Valid(buffer[:n]) {
continue
+1 -1
View File
@@ -133,7 +133,7 @@ func (f *FileService) Create(op request.FileCreate) error {
}
}
if op.IsDir {
return fo.CreateDir(op.Path, fs.FileMode(mode))
return fo.CreateDirWithMode(op.Path, fs.FileMode(mode))
}
if op.IsLink {
if !fo.Stat(op.LinkPath) {
+2 -2
View File
@@ -1954,7 +1954,7 @@ func (w WebsiteService) UpdateAntiLeech(req request.NginxAntiLeechUpdate) (err e
Parameters: []string{"off"},
})
validDir := &components.Directive{
Name: "valid_referrers",
Name: "valid_referers",
Parameters: []string{},
}
if req.NoneRef {
@@ -2023,7 +2023,7 @@ func (w WebsiteService) GetAntiLeech(id uint) (*response.NginxAntiLeechRes, erro
}
lDirectives := location.GetBlock().GetDirectives()
for _, lDir := range lDirectives {
if lDir.GetName() == "valid_referrers" {
if lDir.GetName() == "valid_referers" {
res.Enable = true
params := lDir.GetParameters()
for _, param := range params {
+12 -6
View File
@@ -74,8 +74,10 @@ var NewMonitorDB = &gormigrate.Migration{
} else {
itemData = bases[200*i:]
}
if err := global.MonitorDB.Create(&itemData).Error; err != nil {
return err
if len(itemData) != 0 {
if err := global.MonitorDB.Create(&itemData).Error; err != nil {
return err
}
}
}
}
@@ -87,8 +89,10 @@ var NewMonitorDB = &gormigrate.Migration{
} else {
itemData = ios[200*i:]
}
if err := global.MonitorDB.Create(&itemData).Error; err != nil {
return err
if len(itemData) != 0 {
if err := global.MonitorDB.Create(&itemData).Error; err != nil {
return err
}
}
}
}
@@ -100,8 +104,10 @@ var NewMonitorDB = &gormigrate.Migration{
} else {
itemData = networks[200*i:]
}
if err := global.MonitorDB.Create(&itemData).Error; err != nil {
return err
if len(itemData) != 0 {
if err := global.MonitorDB.Create(&itemData).Error; err != nil {
return err
}
}
}
}
+1 -1
View File
@@ -178,7 +178,7 @@ func CheckIllegal(args ...string) bool {
if strings.Contains(arg, "&") || strings.Contains(arg, "|") || strings.Contains(arg, ";") ||
strings.Contains(arg, "$") || strings.Contains(arg, "'") || strings.Contains(arg, "`") ||
strings.Contains(arg, "(") || strings.Contains(arg, ")") || strings.Contains(arg, "\"") ||
strings.Contains(arg, "\n") || strings.Contains(arg, "\r") || strings.Contains(arg, ">") {
strings.Contains(arg, "\n") || strings.Contains(arg, "\r") || strings.Contains(arg, ">") || strings.Contains(arg, "<") {
return true
}
}
+22 -8
View File
@@ -54,17 +54,14 @@ func (f FileOp) GetContent(dst string) ([]byte, error) {
}
func (f FileOp) CreateDir(dst string, mode fs.FileMode) error {
return f.Fs.MkdirAll(dst, mode)
}
func (f FileOp) CreateDirWithMode(dst string, mode fs.FileMode) error {
if err := f.Fs.MkdirAll(dst, mode); err != nil {
return err
}
modStr := fmt.Sprintf("%o", mode)
modeInt, err := strconv.ParseInt(modStr, 10, 64)
if err != nil {
modeInt = 0755
}
return f.ChmodR(dst, modeInt, true)
return f.ChmodRWithMode(dst, mode, true)
}
func (f FileOp) CreateFile(dst string) error {
@@ -193,6 +190,23 @@ func (f FileOp) ChmodR(dst string, mode int64, sub bool) error {
return nil
}
func (f FileOp) ChmodRWithMode(dst string, mode fs.FileMode, sub bool) error {
cmdStr := fmt.Sprintf(`chmod %v "%s"`, fmt.Sprintf("%o", mode.Perm()), dst)
if sub {
cmdStr = fmt.Sprintf(`chmod -R %v "%s"`, fmt.Sprintf("%o", mode.Perm()), dst)
}
if cmd.HasNoPasswordSudo() {
cmdStr = fmt.Sprintf("sudo %s", cmdStr)
}
if msg, err := cmd.ExecWithTimeOut(cmdStr, 10*time.Second); err != nil {
if msg != "" {
return errors.New(msg)
}
return err
}
return nil
}
func (f FileOp) Rename(oldName string, newName string) error {
return f.Fs.Rename(oldName, newName)
}
+4
View File
@@ -151,4 +151,8 @@ export namespace Setting {
trial: boolean;
status: string;
}
export interface LicenseStatus {
productPro: string;
status: string;
}
}
+3
View File
@@ -13,6 +13,9 @@ export const UploadFileData = (params: FormData) => {
export const getLicense = () => {
return http.get<Setting.License>(`/licenses/get`);
};
export const getLicenseStatus = () => {
return http.get<Setting.LicenseStatus>(`/licenses/get/status`);
};
export const syncLicense = () => {
return http.post(`/licenses/sync`);
@@ -53,7 +53,7 @@
<script lang="ts" setup>
import i18n from '@/lang';
import { dateFormatForName, downloadWithContent } from '@/utils/util';
import { computed, reactive, ref, shallowRef, watch } from 'vue';
import { computed, onBeforeUnmount, reactive, ref, shallowRef, watch } from 'vue';
import { Codemirror } from 'vue-codemirror';
import { javascript } from '@codemirror/lang-javascript';
import { oneDark } from '@codemirror/theme-one-dark';
@@ -128,6 +128,7 @@ const searchLogs = async () => {
MsgError(i18n.global.t('container.linesHelper'));
return;
}
terminalSocket.value?.send('close conn');
terminalSocket.value?.close();
logInfo.value = '';
const href = window.location.href;
@@ -180,6 +181,10 @@ const acceptParams = (props: DialogProps): void => {
}
};
onBeforeUnmount(() => {
handleClose();
});
defineExpose({
acceptParams,
});
@@ -102,6 +102,7 @@ const searchLogs = async () => {
MsgError(i18n.global.t('container.linesHelper'));
return;
}
terminalSocket.value?.send('close conn');
terminalSocket.value?.close();
logInfo.value = '';
const href = window.location.href;
+1 -1
View File
@@ -1350,7 +1350,7 @@ const message = {
showEntrance: 'Enable Home Page Notification Not Enabled',
entranceHelper: 'Enabling secure entry will only allow logging in to the panel through specified secure entry.',
entranceError:
'Please enter a secure login entry point of 6-10 characters, only numbers or letters are supported.',
'Please enter a secure login entry point of 5-116 characters, only numbers or letters are supported.',
entranceInputHelper: 'When the security entry is set to blank, the security entry is cancelled.',
randomGenerate: 'Random',
expirationTime: 'Expiration Time',
+1 -1
View File
@@ -1311,7 +1311,7 @@ const message = {
entrance: '安全入口',
showEntrance: '啟用概覽頁未開啟提醒',
entranceHelper: '開啟安全入口後只能通過指定安全入口登錄面板',
entranceError: '請輸入 6-10 位安全登錄入口,僅支持輸入數字或字母',
entranceError: '請輸入 5-116 位安全登錄入口,僅支持輸入數字或字母',
entranceInputHelper: '安全入口設置為空時,則取消安全入口',
randomGenerate: '隨機生成',
expirationTime: '密碼過期時間',
+1 -1
View File
@@ -1312,7 +1312,7 @@ const message = {
entrance: '安全入口',
showEntrance: '启用概览页未开启提醒',
entranceHelper: '开启安全入口后只能通过指定安全入口登录面板',
entranceError: '请输入 6-10 位安全登录入口,仅支持输入数字或字母',
entranceError: '请输入 5-116 位安全登录入口,仅支持输入数字或字母',
entranceInputHelper: '安全入口设置为空时,则取消安全入口',
randomGenerate: '随机生成',
expirationTime: '密码过期时间',
+2 -2
View File
@@ -22,7 +22,7 @@ import { GlobalStore, MenuStore, TabsStore } from '@/store';
import { DeviceType } from '@/enums/app';
import { useI18n } from 'vue-i18n';
import { useTheme } from '@/hooks/use-theme';
import { getLicense, getSettingInfo, getSystemAvailable } from '@/api/modules/setting';
import { getLicenseStatus, getSettingInfo, getSystemAvailable } from '@/api/modules/setting';
import { useRoute, useRouter } from 'vue-router';
import { initFavicon, resetXSetting } from '@/utils/xpack';
useResize();
@@ -109,7 +109,7 @@ const loadDataFromXDB = async () => {
};
const loadProductProFromDB = async () => {
const res = await getLicense();
const res = await getLicenseStatus();
if (!res.data) {
globalStore.isProductPro = false;
return;
@@ -157,7 +157,7 @@ import { GlobalStore, MenuStore, TabsStore } from '@/store';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
import { useI18n } from 'vue-i18n';
import { getLicense } from '@/api/modules/setting';
import { getLicenseStatus } from '@/api/modules/setting';
import { initFavicon } from '@/utils/xpack';
const globalStore = GlobalStore();
@@ -327,7 +327,7 @@ const loadLanguage = async () => {
};
const loadProductProFromDB = async () => {
const res = await getLicense();
const res = await getLicenseStatus();
if (!res.data) {
globalStore.isProductPro = false;
return;
@@ -72,7 +72,7 @@ const rules = reactive({
function checkSecurityEntrance(rule: any, value: any, callback: any) {
if (form.securityEntrance !== '') {
const reg = /^[A-Za-z0-9]{6,10}$/;
const reg = /^[A-Za-z0-9]{5,116}$/;
if (!reg.test(form.securityEntrance)) {
return callback(new Error(i18n.global.t('setting.entranceError')));
}
+1 -1
View File
@@ -10,7 +10,7 @@ require (
github.com/dgraph-io/badger/v4 v4.2.0
github.com/docker/cli v26.0.0+incompatible
github.com/docker/compose/v2 v2.26.1
github.com/docker/docker v26.0.0+incompatible
github.com/docker/docker v26.0.2+incompatible
github.com/docker/go-connections v0.5.0
github.com/fsnotify/fsnotify v1.7.0
github.com/gin-contrib/gzip v0.0.6
+2 -2
View File
@@ -219,8 +219,8 @@ github.com/docker/compose/v2 v2.26.1/go.mod h1:5iVCMlr18ab0NlMxIPdtTgThTkzb34Z/z
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU=
github.com/docker/docker v26.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v26.0.2+incompatible h1:yGVmKUFGgcxA6PXWAokO0sQL22BrQ67cgVjko8tGdXE=
github.com/docker/docker v26.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=