diff --git a/.github/workflows/proxy-tests.yml b/.github/workflows/proxy-tests.yml index 7d896690786..69219981ad7 100644 --- a/.github/workflows/proxy-tests.yml +++ b/.github/workflows/proxy-tests.yml @@ -56,6 +56,7 @@ jobs: env: NODE_PATH: /home/runner/work/Blot/Blot/app NODE_SERVER_IP: 127.0.0.1 + LUA_PACKAGE_PATH: /home/runner/work/Blot/Blot/.luarocks/share/lua/5.1/?.lua REDIS_IP: 127.0.0.1 OPENRESTY_USER: runner DISABLE_HTTP2: true diff --git a/config/openresty/build-config.js b/config/openresty/build-config.js index c4ddf66975a..7a94f9d8092 100644 --- a/config/openresty/build-config.js +++ b/config/openresty/build-config.js @@ -17,6 +17,7 @@ const locals = { disable_http2: process.env.DISABLE_HTTP2, node_ip: NODE_SERVER_IP, node_port: config.port, + lua_package_path: process.env.LUA_PACKAGE_PATH, redis: { host: REDIS_IP }, reverse_proxy_ip: process.env.PUBLIC_IP, user: process.env.OPENRESTY_USER || "ec2-user", diff --git a/config/openresty/conf/http.conf b/config/openresty/conf/http.conf index 6f298adfda6..61acaaab3b4 100644 --- a/config/openresty/conf/http.conf +++ b/config/openresty/conf/http.conf @@ -12,7 +12,10 @@ charset utf-8; {{> static-file.conf}} -lua_package_path '/home/runner/work/Blot/Blot/.luarocks/share/lua/5.1/?.lua;;'; +{{#lua_package_path}} +lua_package_path '{{{lua_package_path}}};;'; +{{/lua_package_path}} + init_by_lua_file {{{config_directory}}}/init.lua; # Make sure this directory exists