Skip to content

[RFC]: Removal of Lua #107

@LaurenceJJones

Description

@LaurenceJJones

When I first started this project I wanted it to be completely independent of Lua based on our previous experience of cs-haproxy-bouncer. However, one glaring issue that arouse was "How do we render templates for ban and captcha?" well first thought was we could use the spoe protocol to pass back a full template string for haproxy to send back to clients, however, we hit a roadblock that the spoe protocol can only pass 4kb per key inside its value.

This is probably fine for our default template but if users wanted to get fancy with the templating engine then simply this would not scale. So to get a version out the door we fell back to our good ole pal Lua to render the template. At first this was okay, however, with more and more users using the spoa remediation its clear it wont scale to our minimum performance requirements as Lua is single threaded and rather an engine within haproxy.

We kind of mitigated the issue to only allow the Lua to run when needed within #62 but still any amount of Lua is too much in my opinion.

So what this RFC for?

Well we have an idea for an experimental feature which may in turn become the default to allow the spoa process to expose a http server that can render the templates. Then instead of haproxy offloading the rendering to Lua you instead direct the request to go to the http server instead of your traditional backend.

The pros:

  • No lua needed anymore
  • No mounting of files shared between containers
  • Deployments inside kubernetes become simpler because no shared files
  • Clear separation between what spoe should handle and the http server should handle (captcha validation)

The cons:

  • More configuration for http server, must allow (m)TLS in case requests means sending outside of the primary haproxy server
  • More code debt for experimental stages until RFC is accepted

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions