Skip to content

Commit

Permalink
More proper fix for lua-resty-openssl to install production module.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Feb 4, 2025
1 parent 9f4a69f commit b873d40
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ COPY src/api-umbrella/web-app/package.json src/api-umbrella/web-app/pnpm-lock.ya
COPY tasks/app-deps/web-app/pnpm /app/tasks/app-deps/web-app/
RUN make app-deps:web-app:pnpm && make clean:dev

COPY build/patches/lrexlib-pcre2.patch build/patches/lua-resty-openssl.patch /app/build/patches/
COPY build/patches/lrexlib-pcre2.patch /app/build/patches/
COPY tasks/app-deps/luarocks /app/tasks/app-deps/
RUN make app-deps:luarocks && make clean:dev

Expand Down
34 changes: 0 additions & 34 deletions build/patches/lua-resty-openssl.patch

This file was deleted.

3 changes: 3 additions & 0 deletions src/api-umbrella/utils/pg_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ local xpcall_error_handler = require "api-umbrella.utils.xpcall_error_handler"
-- Preload modules that pgmoon may require at query() time.
require "pgmoon.arrays"
require "pgmoon.json"
require "resty.openssl"
require "resty.openssl.auxiliary.nginx"
require "resty.openssl.auxiliary.nginx_c"

local _encode_bytea = pgmoon.Postgres.encode_bytea
local _escape_identifier = pgmoon.Postgres.escape_identifier
Expand Down
7 changes: 0 additions & 7 deletions tasks/app-deps/luarocks
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ extra_args=(

luarocks_install "./api-umbrella-git-1.rockspec" "git-1" "${extra_args[@]}"

# Temporary workaround for lua-resty-openssl and OpenResty 1.27:
# https://github.com/fffonion/lua-resty-openssl/pull/200
(
cd "${APP_VENDOR_LUA_SHARE_DIR}/resty/openssl"
patch -p4 < "$SOURCE_DIR/build/patches/lua-resty-openssl.patch"
)

# lrexlib-pcre2
(
lrexlib_pcre2_version="2.9.2-1"
Expand Down
7 changes: 7 additions & 0 deletions tasks/deps/openresty
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

lua_resty_openssl_aux_module_version="0.3.0"
lua_resty_openssl_aux_module_hash="535cda86ca5f326479fb9870288ca8f6ecd94e579374e6686d8fe508872dd4ce"
ngx_http_geoip2_module_version="3.4"
ngx_http_geoip2_module_hash="82d4beef48c260c3568eb0ae56451c95"
openresty_version="1.27.1.1"
Expand All @@ -16,6 +18,9 @@ extract_download "openresty-$openresty_version.tar.gz"
download "https://github.com/leev/ngx_http_geoip2_module/archive/$ngx_http_geoip2_module_version.tar.gz" "md5" "$ngx_http_geoip2_module_hash"
extract_download "$ngx_http_geoip2_module_version.tar.gz"

download "https://github.com/fffonion/lua-resty-openssl-aux-module/archive/refs/tags/$lua_resty_openssl_aux_module_version.tar.gz" "sha256" "$lua_resty_openssl_aux_module_hash"
extract_download "$lua_resty_openssl_aux_module_version.tar.gz"

cd "openresty-$openresty_version"
patch -p1 < "$SOURCE_DIR/build/patches/openresty-cli.patch"

Expand Down Expand Up @@ -51,6 +56,8 @@ patch -p1 < "$SOURCE_DIR/build/patches/openresty-cli.patch"
--with-threads \
--with-luajit-xcflags="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT" \
--add-module="../ngx_http_geoip2_module-$ngx_http_geoip2_module_version" \
--add-module="../lua-resty-openssl-aux-module-$lua_resty_openssl_aux_module_version" \
--add-module="../lua-resty-openssl-aux-module-$lua_resty_openssl_aux_module_version/stream" \
-j"$NPROC"
make -j"$NPROC"
make install DESTDIR="$STAGE_DIR"
Expand Down

0 comments on commit b873d40

Please sign in to comment.