Skip to content

Commit d1b3d1c

Browse files
committed
fix comment
1 parent fda7e51 commit d1b3d1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/setting/setting.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,13 +688,13 @@ func NewContext() {
688688
StaticCacheTime = sec.Key("STATIC_CACHE_TIME").MustDuration(6 * time.Hour)
689689
AppDataPath = sec.Key("APP_DATA_PATH").MustString(path.Join(AppWorkPath, "data"))
690690
if _, err = os.Stat(AppDataPath); err != nil {
691-
// FIXME: Many calls to MkdirAll are using 0644 (not executable) or `os.ModePerm`(0o777, world-wide writable), which are incorrect.
692691
// FIXME: There are too many calls to MkdirAll in old code. It is incorrect.
693692
// For example, if someDir=/mnt/vol1/gitea-home/data, if the mount point /mnt/vol1 is not mounted when Gitea runs,
694693
// then gitea will make new empty directories in /mnt/vol1, all are stored in the root filesystem.
695694
// The correct behavior should be: creating parent directories is end users' duty. We only create sub-directories in existing parent directories.
696-
// Now we can take the first step to do correctly (Mkdir) in other packages, and prepare the AppDataPath here, then make a refactor in future.
697-
err = os.MkdirAll(AppDataPath, os.FileMode(0755))
695+
// For quickstart, the parent directories should be created automatically for first startup (eg: a flag or a check of INSTALL_LOCK).
696+
// Now we can take the first step to do correctly (using Mkdir) in other packages, and prepare the AppDataPath here, then make a refactor in future.
697+
err = os.MkdirAll(AppDataPath, os.ModePerm)
698698
if err != nil {
699699
log.Fatal("Failed to create the directory for app data path '%s'", AppDataPath)
700700
}

0 commit comments

Comments
 (0)