feat: 任务周期备份配置文件发送ftp备份

This commit is contained in:
TsMask
2025-06-19 20:53:47 +08:00
parent 94c64820f2
commit ea21f73abd
2 changed files with 18 additions and 4 deletions

View File

@@ -331,7 +331,7 @@ func (s *FileController) File(c *gin.Context) {
}
// 检查路径是否在允许的目录范围内
allowedPaths := []string{"/var/log", "/tmp", "/usr/local/omc/backup"}
allowedPaths := []string{"/var/log", "/tmp", "/usr/local/omc/backup", "/usr/local/etc/omc"}
allowed := false
for _, p := range allowedPaths {
if strings.HasPrefix(querys.Path, p) {
@@ -382,7 +382,7 @@ func (s *FileController) Remove(c *gin.Context) {
}
// 检查路径是否在允许的目录范围内
allowedPaths := []string{"/tmp", "/usr/local/omc/backup"}
allowedPaths := []string{"/tmp", "/usr/local/omc/backup", "/usr/local/etc/omc"}
allowed := false
for _, p := range allowedPaths {
if strings.HasPrefix(querys.Path, p) {