Diff options
Diffstat (limited to 'custom/extensions/auth-file.lua')
| -rw-r--r-- | custom/extensions/auth-file.lua | 36 |
1 file changed, 17 insertions, 19 deletions
diff --git a/custom/extensions/auth-file.lua b/custom/extensions/auth-file.lua index 81c5710..fc6d2fc 100644 --- a/custom/extensions/auth-file.lua +++ b/custom/extensions/auth-file.lua @@ -14,7 +14,8 @@ -- The script runs on Lua 5.1 through 5.5 and LuaJIT, and the runtime has to be -- the same Lua that cgit was built against. On 5.5 it needs luaossl 20260910 --- or later, since earlier builds fail to load there. +-- or later, or a build patched for 5.5 such as Alpine's, since earlier +-- releases fail to load there. -- -- The session cookie is marked Secure by default, so a browser only sends -- it back over HTTPS. On an instance served over plain HTTP login loops @@ -22,27 +23,24 @@ -- the web server does not pass HTTPS=on, so one behind a proxy that ends TLS -- should set that by hand. -- --- Two libraries are needed. luaossl provides openssl.rand and openssl.hmac and --- lives at <https://github.com/wahern/luaossl>, and luaposix provides --- posix.sys.stat and posix.unistd and lives at --- <https://github.com/luaposix/luaposix>. The reliable cross-platform way to --- install them is LuaRocks matched to your Lua version, and luaossl also needs --- the OpenSSL development headers present. Each is loaded only once a request --- needs it, so a public repository is served without them while a protected --- one is refused. +-- Two libraries are needed, built for that same Lua. luaossl provides +-- openssl.rand and openssl.hmac and lives at +-- <https://github.com/wahern/luaossl>, and luaposix provides posix.sys.stat +-- and posix.unistd and lives at <https://github.com/luaposix/luaposix>. Each +-- is loaded only once a request needs it, so a public repository is served +-- without them while a protected one is refused. -- --- # Debian and Ubuntu --- sudo apt install luarocks libssl-dev --- sudo luarocks --lua-version 5.1 install luaossl --- sudo luarocks --lua-version 5.1 install luaposix +-- # Debian and Ubuntu, for Lua 5.1 to 5.4 and LuaJIT +-- sudo apt install lua-luaossl lua-posix -- --- # Fedora --- sudo dnf install luarocks openssl-devel --- sudo luarocks --lua-version 5.1 install luaossl luaposix +-- # Fedora, for Lua 5.4 +-- sudo dnf install lua-luaossl lua-posix +-- +-- # Alpine, named for the Lua version, 5.1 for LuaJIT +-- sudo apk add lua5.5-ossl lua5.5-posix -- --- # Alpine --- sudo apk add luarocks openssl-dev --- sudo luarocks-5.1 install luaossl luaposix +-- # elsewhere, LuaRocks matched to that Lua, with the OpenSSL headers +-- sudo luarocks --lua-version 5.1 install luaossl luaposix -- -- # macOS with Homebrew -- brew install luarocks openssl |
