Added most basic auth

This commit is contained in:
Pablu23
2024-05-21 16:36:40 +02:00
parent 0904a1214e
commit 63ffb8df6e
10 changed files with 133 additions and 31 deletions

View File

@@ -9,6 +9,21 @@ import (
const port = 8000
func getSecret() string {
dir, err := os.UserCacheDir()
if err != nil {
panic(err)
}
dirPath := filepath.Join(dir, "MangaGetter")
filePath := filepath.Join(dirPath, "secret.secret")
buf, err := os.ReadFile(filePath)
if err != nil {
panic(err)
}
return string(buf)
}
func getDbPath() string {
dir, err := os.UserCacheDir()
if err != nil {