From 33db3154f0e4bab1fc3102693fb6350560497d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Oct 2022 02:50:32 +0200 Subject: Repair auth filter. --- hugo-authentication.lua | 11 ++++++++--- 1 file 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`. -- cgit v1.2.3