diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 2bec24b9..1e9fad5d 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -29,6 +29,7 @@ archives: - public/* - storage/* - database/* + - lang/* - scripts/* - panel-example.conf diff --git a/app/http/controllers/file_controller.go b/app/http/controllers/file_controller.go index 2b2c6d88..e7d82f42 100644 --- a/app/http/controllers/file_controller.go +++ b/app/http/controllers/file_controller.go @@ -82,7 +82,7 @@ func (r *FileController) Content(ctx http.Context) http.Response { return Error(ctx, http.StatusInternalServerError, "目标路径不是文件") } if fileInfo.Size() > 10*1024*1024 { - return Error(ctx, http.StatusInternalServerError, "文件大小超过 10M") + return Error(ctx, http.StatusInternalServerError, "文件大小超过 10 M,不支持在线编辑") } content, err := tools.Read(request.Path) @@ -209,15 +209,15 @@ func (r *FileController) Move(ctx http.Context) http.Response { return sanitize } - if tools.Exists(request.New) && !ctx.Request().InputBool("force") { + if tools.Exists(request.Target) && !ctx.Request().InputBool("force") { return Error(ctx, http.StatusForbidden, "目标路径已存在,是否覆盖?") } - if err := tools.Mv(request.Old, request.New); err != nil { + if err := tools.Mv(request.Source, request.Target); err != nil { return Error(ctx, http.StatusInternalServerError, err.Error()) } - r.setPermission(request.New, 0755, "www", "www") + r.setPermission(request.Target, 0755, "www", "www") return Success(ctx, nil) } diff --git a/app/http/requests/file/move.go b/app/http/requests/file/move.go index ca7862c7..8946d8cc 100644 --- a/app/http/requests/file/move.go +++ b/app/http/requests/file/move.go @@ -6,8 +6,8 @@ import ( ) type Move struct { - Old string `form:"old" json:"old"` - New string `form:"new" json:"new"` + Source string `form:"source" json:"source"` + Target string `form:"target" json:"target"` } func (r *Move) Authorize(ctx http.Context) error { @@ -16,8 +16,8 @@ func (r *Move) Authorize(ctx http.Context) error { func (r *Move) Rules(ctx http.Context) map[string]string { return map[string]string{ - "old": "regex:^/[a-zA-Z0-9_.@#$%-]+(\\/[a-zA-Z0-9_.@#$%-]+)*$|path_exists", - "new": "regex:^/[a-zA-Z0-9_.@#$%-]+(\\/[a-zA-Z0-9_.@#$%-]+)*$", + "source": "regex:^/[a-zA-Z0-9_.@#$%-]+(\\/[a-zA-Z0-9_.@#$%-]+)*$|path_exists", + "target": "regex:^/[a-zA-Z0-9_.@#$%-]+(\\/[a-zA-Z0-9_.@#$%-]+)*$", } } diff --git a/docs/docs.go b/docs/docs.go index 72e33f83..cb0b6fec 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -4383,10 +4383,10 @@ const docTemplate = `{ "requests.Move": { "type": "object", "properties": { - "new": { + "source": { "type": "string" }, - "old": { + "target": { "type": "string" } } diff --git a/docs/swagger.json b/docs/swagger.json index b178ab0a..98e48ac0 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -4376,10 +4376,10 @@ "requests.Move": { "type": "object", "properties": { - "new": { + "source": { "type": "string" }, - "old": { + "target": { "type": "string" } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 234f0d85..79a8319f 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -426,9 +426,9 @@ definitions: type: object requests.Move: properties: - new: + source: type: string - old: + target: type: string type: object requests.NetworkConnectDisConnect: diff --git a/scripts/mysql/install.sh b/scripts/mysql/install.sh index 0c857a8d..0456b6bb 100644 --- a/scripts/mysql/install.sh +++ b/scripts/mysql/install.sh @@ -87,6 +87,7 @@ rm -f mysql-${mysqlVersion}.7z.checksum.txt # 编译 mv mysql-${mysqlVersion} src +chmod -R 755 src cd src rm mysql-test/CMakeLists.txt sed -i 's/ADD_SUBDIRECTORY(mysql-test)//g' CMakeLists.txt diff --git a/scripts/mysql/update.sh b/scripts/mysql/update.sh index d9131152..12a3d844 100644 --- a/scripts/mysql/update.sh +++ b/scripts/mysql/update.sh @@ -83,6 +83,7 @@ rm -f mysql-${mysqlVersion}.7z.checksum.txt # 编译 mv mysql-${mysqlVersion} src +chmod -R 755 src cd src mkdir build cd build diff --git a/scripts/openresty/install.sh b/scripts/openresty/install.sh index db212213..799913aa 100644 --- a/scripts/openresty/install.sh +++ b/scripts/openresty/install.sh @@ -80,6 +80,7 @@ fi rm -f openssl-3.0.12.7z rm -f openssl-3.0.12.7z.checksum.txt mv openssl-3.0.12 openssl +chmod -R 755 openssl # patch openssl cd openssl @@ -113,6 +114,7 @@ fi rm -f pcre2-10.43.7z rm -f pcre2-10.43.7z.checksum.txt mv pcre2-10.43 pcre2 +chmod -R 755 pcre2 # ngx_cache_purge wget -T 20 -t 3 -O ngx_cache_purge-2.3.tar.gz ${downloadUrl}/modules/ngx_cache_purge-2.3.tar.gz diff --git a/scripts/php/install.sh b/scripts/php/install.sh index f98d9662..44cb3d36 100644 --- a/scripts/php/install.sh +++ b/scripts/php/install.sh @@ -90,6 +90,7 @@ fi rm -f php-${phpVersionCode}.7z rm -f php-${phpVersionCode}.7z.checksum.txt mv php-* src +chmod -R 755 src if [ "${phpVersion}" -le "80" ]; then wget -T 120 -t 3 -O ${phpPath}/openssl-1.1.1w.tar.gz ${downloadUrl}/openssl/openssl-1.1.1w.tar.gz diff --git a/scripts/postgresql/install.sh b/scripts/postgresql/install.sh index d305e1b8..86351f9e 100644 --- a/scripts/postgresql/install.sh +++ b/scripts/postgresql/install.sh @@ -80,6 +80,7 @@ fi rm -f postgresql-${postgresqlVersion}.7z rm -f postgresql-${postgresqlVersion}.7z.checksum.txt mv postgresql-${postgresqlVersion} src +chmod -R 755 src # 编译 cd src diff --git a/scripts/postgresql/update.sh b/scripts/postgresql/update.sh index a01414ee..f0c17ab8 100644 --- a/scripts/postgresql/update.sh +++ b/scripts/postgresql/update.sh @@ -75,6 +75,7 @@ fi rm -f postgresql-${postgresqlVersion}.7z rm -f postgresql-${postgresqlVersion}.7z.checksum.txt mv postgresql-${postgresqlVersion} src +chmod -R 755 src # 编译 cd src