mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-29 05:11:51 +02:00
chore: add ROOT_DIR environment variable, refactor
This commit is contained in:
31
internal/common/paths.go
Normal file
31
internal/common/paths.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// file, folder structure
|
||||
|
||||
var (
|
||||
ConfigDir = filepath.Join(RootDir, "config")
|
||||
ConfigFileName = "config.yml"
|
||||
ConfigExampleFileName = "config.example.yml"
|
||||
ConfigPath = filepath.Join(ConfigDir, ConfigFileName)
|
||||
|
||||
MiddlewareComposeDir = filepath.Join(ConfigDir, "middlewares")
|
||||
ErrorPagesDir = filepath.Join(RootDir, "error_pages")
|
||||
CertsDir = filepath.Join(RootDir, "certs")
|
||||
|
||||
DataDir = filepath.Join(RootDir, "data")
|
||||
MetricsDataDir = filepath.Join(DataDir, "metrics")
|
||||
|
||||
HomepageJSONConfigPath = filepath.Join(DataDir, "homepage.json")
|
||||
IconListCachePath = filepath.Join(DataDir, "icon_list_cache.json")
|
||||
IconCachePath = filepath.Join(DataDir, "icon_cache.json")
|
||||
)
|
||||
|
||||
var RequiredDirectories = []string{
|
||||
ConfigDir,
|
||||
ErrorPagesDir,
|
||||
MiddlewareComposeDir,
|
||||
}
|
||||
Reference in New Issue
Block a user