read config from file

This commit is contained in:
2026-04-15 14:22:05 -06:00
parent 58f9093406
commit 87d52aae58
3 changed files with 17 additions and 14 deletions
+2 -2
View File
@@ -15,8 +15,8 @@ func (s *Server) handlePackage(w http.ResponseWriter, req *http.Request) {
repo := req.PathValue("repo")
arch := req.PathValue("arch")
file := req.PathValue("file")
repoPath := filepath.Join(repo, "os", arch, file) //path from mirror root to pkg or db file
pkgPath := filepath.Join(s.cfg.MirrorRoot, repoPath) //absolute path for local read of the file
repoPath := filepath.Join(repo, "os", arch, file) //path from mirror root to pkg or db file
pkgPath := filepath.Join(s.cfg.CacheRoot, repoPath) //absolute path for local read of the file
if _, err := os.Stat(pkgPath); err != nil {
err = s.c.Fetch(repoPath)