diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-10-11 02:50:32 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-10-11 02:50:32 +0200 |
commit | 33db3154f0e4bab1fc3102693fb6350560497d3b (patch) | |
tree | 9c05c18b6b7ad487b46ffbe990c7834778827027 | |
parent | Fix silly mistakes. (diff) | |
download | cgit-filters-33db3154f0e4bab1fc3102693fb6350560497d3b.tar.gz cgit-filters-33db3154f0e4bab1fc3102693fb6350560497d3b.tar.xz |
Repair auth filter.
-rw-r--r-- | hugo-authentication.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/hugo-authentication.lua b/hugo-authentication.lua index 28343ef..fe76019 100644 --- a/hugo-authentication.lua +++ b/hugo-authentication.lua @@ -24,10 +24,15 @@ local protected_repos = { } local public_repos = {} -public_repo_file = io.open('/usr/local/var/public-repos') -while data ~= nil do - public_repos[data] = true +public_repo_file, err = io.open('/usr/local/var/public-repos') +if public_repo_file == nil then + print(err) +else data = public_repo_file:read() + while data ~= nil do + public_repos[data] = true + data = public_repo_file:read() + end end -- A list of users and hashes, generated with `mkpasswd -m sha-512 -R 300000`. |