Our great sponsors
-
haproxy-auth-request
auth-request allows you to add access control to your HTTP services based on a subrequest to a configured HAProxy backend.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
A lot of the more advanced HAproxy configs for SSO (think Authelia for example) require the use of Lua scripts which would be fine, but the scripts themselves need to reference OTHER scripts. For example haproxy-auth-request requires the use of haproxy-lua-http which needs to reference a JSON library such as json.lua. You usually will see statement such as local http = require("haproxy-lua-http") which indicates our script very explicitly is looking for that other script.
A lot of the more advanced HAproxy configs for SSO (think Authelia for example) require the use of Lua scripts which would be fine, but the scripts themselves need to reference OTHER scripts. For example haproxy-auth-request requires the use of haproxy-lua-http which needs to reference a JSON library such as json.lua. You usually will see statement such as local http = require("haproxy-lua-http") which indicates our script very explicitly is looking for that other script.
A lot of the more advanced HAproxy configs for SSO (think Authelia for example) require the use of Lua scripts which would be fine, but the scripts themselves need to reference OTHER scripts. For example haproxy-auth-request requires the use of haproxy-lua-http which needs to reference a JSON library such as json.lua. You usually will see statement such as local http = require("haproxy-lua-http") which indicates our script very explicitly is looking for that other script.
This would all be well and good IF AND ONLY IF THE FREAKING HAPROXY PLUGIN DIDN'T RENAME THE SCRIPTS WHEN YOU UPLOAD THEM. When you name the script in the plugin, it is only for sorting purposes. The actual config will contain something like lua-load /tmp/haproxy/lua/6106c1930d3869.70081312.lua , while the other script is still looking haproxy-lua-http. Furthermore, that dot in the middle of the randomly generated file name throws off the require statements! There is an open issue about this on Github and a forum post here as well.
So short of trying to fix the code, of which most of us are not equipped to do, what can we do? Well, there is a really fun little tool called luabundler. This tool will analyze the Lua file you feed it, figure out all the dependency Lua scripts based on the require statements, and then wrap them all up in one self-contained Lua script! All we need is Node, the bundler, and the individual scripts.