diff options
Diffstat (limited to 'custom/extensions')
| -rw-r--r-- | custom/extensions/email-gravatar.lua | 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | custom/extensions/email-libravatar.lua | 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 files changed, 8 insertions, 6 deletions
diff --git a/custom/extensions/email-gravatar.lua b/custom/extensions/email-gravatar.lua index 01db3f9..836841f 100644 --- a/custom/extensions/email-gravatar.lua +++ b/custom/extensions/email-gravatar.lua @@ -12,7 +12,8 @@ -- The one dependency is luaossl, the OpenSSL binding that provides -- openssl.digest, from <https://github.com/wahern/luaossl>. The reliable -- cross-platform install is LuaRocks, matched to the Lua version cgit is built --- against, and it needs the OpenSSL development headers present. +-- against, and it needs the OpenSSL development headers present. Without it +-- the filter draws no icons and leaves the names as they are. -- -- # Debian and Ubuntu -- sudo apt install luarocks libssl-dev @@ -31,7 +32,7 @@ -- that is not acceptable for your instance. Addresses are hashed with MD5, -- which Gravatar still accepts. -local digest = require("openssl.digest") +local has_digest, digest = pcall(require, "openssl.digest") -- The size is in pixels and serves both as the image asked of the service @@ -94,7 +95,7 @@ end function filter_open(email, page) buffer = "" local address = normalize_email(email) - if address == nil then + if address == nil or not has_digest then avatar_hash = nil else avatar_hash = hash_hex(address) diff --git a/custom/extensions/email-libravatar.lua b/custom/extensions/email-libravatar.lua index 1fb979d..2b1fecd 100644 --- a/custom/extensions/email-libravatar.lua +++ b/custom/extensions/email-libravatar.lua @@ -11,7 +11,8 @@ -- The one dependency is luaossl, the OpenSSL binding that provides -- openssl.digest, from <https://github.com/wahern/luaossl>. The reliable -- cross-platform install is LuaRocks, matched to the Lua version cgit is built --- against, and it needs the OpenSSL development headers present. +-- against, and it needs the OpenSSL development headers present. Without it +-- the filter draws no icons and leaves the names as they are. -- -- # Debian and Ubuntu -- sudo apt install luarocks libssl-dev @@ -29,7 +30,7 @@ -- committer's email to a third-party service, so leave this filter off if -- that is not acceptable for your instance. Addresses are hashed with MD5. -local digest = require("openssl.digest") +local has_digest, digest = pcall(require, "openssl.digest") -- The size is in pixels and serves both as the image asked of the service @@ -92,7 +93,7 @@ end function filter_open(email, page) buffer = "" local address = normalize_email(email) - if address == nil then + if address == nil or not has_digest then avatar_hash = nil else avatar_hash = hash_hex(address) |
