2022-11-02 15:19:14 +08:00
|
|
|
package constant
|
|
|
|
|
|
|
|
type DBContext string
|
|
|
|
|
|
|
|
const (
|
|
|
|
DB DBContext = "db"
|
2023-11-02 14:35:58 +08:00
|
|
|
|
|
|
|
SystemRestart = "systemRestart"
|
2023-11-23 11:00:08 +08:00
|
|
|
|
|
|
|
TypeWebsite = "website"
|
|
|
|
TypePhp = "php"
|
|
|
|
TypeSSL = "ssl"
|
|
|
|
TypeSystem = "system"
|
2022-11-02 15:19:14 +08:00
|
|
|
)
|
2024-06-06 17:37:38 +08:00
|
|
|
|
|
|
|
const (
|
|
|
|
TimeOut5s = 5
|
|
|
|
TimeOut20s = 20
|
|
|
|
TimeOut5m = 300
|
2024-06-28 14:04:08 +08:00
|
|
|
|
|
|
|
DateLayout = "2006-01-02" // or use time.DateOnly while go version >= 1.20
|
|
|
|
DefaultDate = "1970-01-01"
|
|
|
|
DateTimeLayout = "2006-01-02 15:04:05" // or use time.DateTime while go version >= 1.20
|
|
|
|
DateTimeSlimLayout = "20060102150405"
|
2024-06-06 17:37:38 +08:00
|
|
|
)
|
2024-11-21 16:31:07 +08:00
|
|
|
|
|
|
|
var WebUrlMap = map[string]struct{}{
|
|
|
|
"/apps": {},
|
|
|
|
"/apps/all": {},
|
|
|
|
"/apps/installed": {},
|
|
|
|
"/apps/upgrade": {},
|
|
|
|
|
|
|
|
"/containers": {},
|
|
|
|
"/containers/container": {},
|
|
|
|
"/containers/image": {},
|
|
|
|
"/containers/network": {},
|
|
|
|
"/containers/volume": {},
|
|
|
|
"/containers/repo": {},
|
|
|
|
"/containers/compose": {},
|
|
|
|
"/containers/template": {},
|
|
|
|
"/containers/setting": {},
|
|
|
|
|
|
|
|
"/cronjobs": {},
|
|
|
|
|
|
|
|
"/databases": {},
|
|
|
|
"/databases/mysql": {},
|
|
|
|
"/databases/mysql/remote": {},
|
|
|
|
"/databases/postgresql": {},
|
|
|
|
"/databases/postgresql/remote": {},
|
|
|
|
"/databases/redis": {},
|
|
|
|
"/databases/redis/remote": {},
|
|
|
|
|
|
|
|
"/hosts": {},
|
|
|
|
"/hosts/files": {},
|
|
|
|
"/hosts/monitor/monitor": {},
|
|
|
|
"/hosts/monitor/setting": {},
|
|
|
|
"/hosts/terminal": {},
|
|
|
|
"/hosts/firewall/port": {},
|
|
|
|
"/hosts/firewall/forward": {},
|
|
|
|
"/hosts/firewall/ip": {},
|
|
|
|
"/hosts/process/process": {},
|
|
|
|
"/hosts/process/network": {},
|
|
|
|
"/hosts/ssh/ssh": {},
|
|
|
|
"/hosts/ssh/log": {},
|
|
|
|
"/hosts/ssh/session": {},
|
|
|
|
|
|
|
|
"/logs": {},
|
|
|
|
"/logs/operation": {},
|
|
|
|
"/logs/login": {},
|
|
|
|
"/logs/website": {},
|
|
|
|
"/logs/system": {},
|
|
|
|
"/logs/ssh": {},
|
|
|
|
|
|
|
|
"/settings": {},
|
|
|
|
"/settings/panel": {},
|
|
|
|
"/settings/backupaccount": {},
|
|
|
|
"/settings/license": {},
|
|
|
|
"/settings/about": {},
|
|
|
|
"/settings/safe": {},
|
|
|
|
"/settings/snapshot": {},
|
|
|
|
"/settings/expired": {},
|
|
|
|
|
|
|
|
"/toolbox": {},
|
|
|
|
"/toolbox/device": {},
|
|
|
|
"/toolbox/supervisor": {},
|
|
|
|
"/toolbox/clam": {},
|
|
|
|
"/toolbox/clam/setting": {},
|
|
|
|
"/toolbox/ftp": {},
|
|
|
|
"/toolbox/fail2ban": {},
|
|
|
|
"/toolbox/clean": {},
|
|
|
|
|
|
|
|
"/websites": {},
|
|
|
|
"/websites/ssl": {},
|
|
|
|
"/websites/runtimes/php": {},
|
|
|
|
"/websites/runtimes/node": {},
|
|
|
|
"/websites/runtimes/java": {},
|
|
|
|
"/websites/runtimes/net": {},
|
|
|
|
"/websites/runtimes/go": {},
|
|
|
|
"/websites/runtimes/python": {},
|
|
|
|
|
|
|
|
"/login": {},
|
|
|
|
}
|
|
|
|
|
|
|
|
var DynamicRoutes = []string{
|
|
|
|
`^/containers/composeDetail/[^/]+$`,
|
|
|
|
`^/databases/mysql/setting/[^/]+/[^/]+$`,
|
|
|
|
`^/databases/postgresql/setting/[^/]+/[^/]+$`,
|
|
|
|
`^/websites/[^/]+/config/[^/]+$`,
|
|
|
|
}
|