feat: added captcha serving service to haproxy

This commit is contained in:
Eugene Prodan
2021-06-07 23:44:39 +03:00
parent 1dff57f048
commit 0fde9b873b
7 changed files with 1656 additions and 3 deletions

View File

@@ -95,8 +95,26 @@ STOPSIGNAL SIGUSR1
ADD haproxy/docker-entrypoint.sh /usr/local/bin/
RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
RUN apt-get update && apt-get install luarocks -y
RUN luarocks install luasocket
# This is terrible mess but we need it for simple testing purposes of our POC
RUN apt-get update && apt-get install libssl-dev make nano wget gcc libreadline-dev unzip git -y
RUN wget http://www.lua.org/ftp/lua-5.3.5.tar.gz &&\
tar -zxf lua-5.3.5.tar.gz &&\
cd lua-5.3.5 &&\
make linux test &&\
make install
RUN wget "https://luarocks.org/releases/luarocks-3.3.1.tar.gz" &&\
tar zxpf luarocks-3.3.1.tar.gz &&\
cd luarocks-3.3.1 &&\
./configure --with-lua-include=/usr/local/include --lua-version=5.3 --lua-suffix=5.3 &&\
make &&\
make install
RUN /usr/local/bin/luarocks install luasocket &&\
/usr/local/bin/luarocks install luasec &&\
/usr/local/bin/luarocks install net-url
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# no USER for backwards compatibility (to try to avoid breaking existing users)

View File

@@ -15,6 +15,7 @@ frontend http-in
default_backend servers
# http-request lua.test-payload
http-request use-service lua.hello-world if { path /hello_world }
http-request use-service lua.hcaptcha-view if { path /captcha }
backend servers
server server1 nginx:80 maxconn 32