fix tpl path

pull/1/head
vasyahacker 2023-03-28 17:27:27 +04:00
parent 3771b9f7f6
commit 5c9b00bd73
2 changed files with 4 additions and 4 deletions

View File

@ -101,7 +101,7 @@ func main() {
flag.Parse()
unix.Unveil("./tpl", "r")
unix.Unveil("/usr/local/share/openidec/tpl", "r")
unix.Unveil("/var/openidec/tpl", "r")
unix.Unveil(*echo_opt, "r")
unix.Unveil(*users_opt, "rwc")
unix.Unveil(filepath.Dir(*db_opt), "rwc")

View File

@ -915,10 +915,10 @@ func WebInit(www *WWW) {
tpl_path := "tpl"
if _, err := os.Stat(tpl_path); errors.Is(err, os.ErrNotExist) {
fmt.Println("./tpl not found, trying /usr/local/share/openidec/tpl..")
tpl_path = "/usr/local/share/openidec/tpl"
ii.Info.Printf("./tpl not found, trying /var/openidec/tpl..")
tpl_path = "/var/openidec/tpl"
if _, err := os.Stat(tpl_path); errors.Is(err, os.ErrNotExist) {
fmt.Println(tpl_path, "not found")
ii.Error.Printf(" %s not found", tpl_path)
os.Exit(1)
}
}