2021-10-25 10:53:59 +00:00
|
|
|
package conf
|
|
|
|
|
2021-10-27 10:59:03 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"github.com/eko/gocache/v2/cache"
|
2021-10-27 14:45:36 +00:00
|
|
|
"github.com/robfig/cron/v3"
|
2021-10-27 10:59:03 +00:00
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
2021-10-25 10:53:59 +00:00
|
|
|
|
2021-11-04 05:23:17 +00:00
|
|
|
var (
|
|
|
|
BuiltAt string
|
|
|
|
GoVersion string
|
|
|
|
GitAuthor string
|
|
|
|
GitCommit string
|
2021-12-08 11:36:07 +00:00
|
|
|
GitTag string = "dev"
|
2021-11-04 05:23:17 +00:00
|
|
|
)
|
|
|
|
|
2021-10-25 10:53:59 +00:00
|
|
|
var (
|
|
|
|
ConfigFile string // config file
|
2021-10-26 14:28:37 +00:00
|
|
|
Conf *Config
|
|
|
|
Debug bool
|
2021-11-03 11:51:19 +00:00
|
|
|
Version bool
|
2021-11-16 07:00:56 +00:00
|
|
|
Password bool
|
2021-10-25 10:53:59 +00:00
|
|
|
|
2021-11-03 11:51:19 +00:00
|
|
|
DB *gorm.DB
|
2021-10-27 10:59:03 +00:00
|
|
|
Cache *cache.Cache
|
2021-11-03 11:51:19 +00:00
|
|
|
Ctx = context.TODO()
|
|
|
|
Cron *cron.Cron
|
2021-10-26 14:28:37 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2021-12-20 09:24:49 +00:00
|
|
|
TextTypes = []string{"txt", "htm", "html", "xml", "java", "properties", "sql",
|
|
|
|
"js", "md", "json", "conf", "ini", "vue", "php", "py", "bat", "gitignore", "yml",
|
|
|
|
"go", "sh", "c", "cpp", "h", "hpp", "tsx", "vtt", "srt", "ass"}
|
2021-10-26 14:28:37 +00:00
|
|
|
OfficeTypes = []string{"doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf"}
|
2021-12-08 06:43:38 +00:00
|
|
|
VideoTypes = []string{"mp4", "mkv", "avi", "mov", "rmvb", "webm"}
|
2021-11-11 11:51:25 +00:00
|
|
|
AudioTypes = []string{"mp3", "flac", "ogg", "m4a"}
|
2021-11-03 11:51:19 +00:00
|
|
|
ImageTypes = []string{"jpg", "tiff", "jpeg", "png", "gif", "bmp", "svg"}
|
2021-10-26 14:28:37 +00:00
|
|
|
)
|
2021-11-12 14:56:30 +00:00
|
|
|
|
|
|
|
// settings
|
|
|
|
var (
|
2021-11-16 07:00:56 +00:00
|
|
|
RawIndexHtml string
|
|
|
|
IndexHtml string
|
|
|
|
CheckParent bool
|
2021-12-07 12:16:34 +00:00
|
|
|
CheckDown bool
|
2021-11-28 08:18:09 +00:00
|
|
|
|
2021-12-07 12:16:34 +00:00
|
|
|
Token string
|
2021-11-28 08:18:09 +00:00
|
|
|
DavUsername string
|
|
|
|
DavPassword string
|
2021-11-14 06:37:26 +00:00
|
|
|
)
|