Make LocalCopyPath a setting instead of a hard-coded path (#1881)

This commit is contained in:
Phil Hopper 2017-06-06 05:09:54 -04:00 committed by Bo-Yi Wu
parent cbdd5f787c
commit 6ec07a6bd7
4 changed files with 44 additions and 1 deletions

View file

@ -174,6 +174,11 @@ var (
FileMaxSize int64
MaxFiles int
} `ini:"-"`
// Repository local settings
Local struct {
LocalCopyPath string
} `ini:"-"`
}{
AnsiCharset: "",
ForcePrivate: false,
@ -206,6 +211,13 @@ var (
FileMaxSize: 3,
MaxFiles: 5,
},
// Repository local settings
Local: struct {
LocalCopyPath string
}{
LocalCopyPath: "tmp/local-repo",
},
}
RepoRootPath string
ScriptType = "bash"
@ -887,6 +899,8 @@ please consider changing to GITEA_CUSTOM`)
log.Fatal(4, "Failed to map Repository.Editor settings: %v", err)
} else if err = Cfg.Section("repository.upload").MapTo(&Repository.Upload); err != nil {
log.Fatal(4, "Failed to map Repository.Upload settings: %v", err)
} else if err = Cfg.Section("repository.local").MapTo(&Repository.Local); err != nil {
log.Fatal(4, "Failed to map Repository.Local settings: %v", err)
}
if !filepath.IsAbs(Repository.Upload.TempPath) {