Skip to content

Commit b873d40

Browse files
committed
More proper fix for lua-resty-openssl to install production module.
1 parent 9f4a69f commit b873d40

File tree

5 files changed

+11
-42
lines changed

5 files changed

+11
-42
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ COPY src/api-umbrella/web-app/package.json src/api-umbrella/web-app/pnpm-lock.ya
6262
COPY tasks/app-deps/web-app/pnpm /app/tasks/app-deps/web-app/
6363
RUN make app-deps:web-app:pnpm && make clean:dev
6464

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

build/patches/lua-resty-openssl.patch

-34
This file was deleted.

src/api-umbrella/utils/pg_utils.lua

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ local xpcall_error_handler = require "api-umbrella.utils.xpcall_error_handler"
77
-- Preload modules that pgmoon may require at query() time.
88
require "pgmoon.arrays"
99
require "pgmoon.json"
10+
require "resty.openssl"
11+
require "resty.openssl.auxiliary.nginx"
12+
require "resty.openssl.auxiliary.nginx_c"
1013

1114
local _encode_bytea = pgmoon.Postgres.encode_bytea
1215
local _escape_identifier = pgmoon.Postgres.escape_identifier

tasks/app-deps/luarocks

-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ extra_args=(
1717

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

20-
# Temporary workaround for lua-resty-openssl and OpenResty 1.27:
21-
# https://github.com/fffonion/lua-resty-openssl/pull/200
22-
(
23-
cd "${APP_VENDOR_LUA_SHARE_DIR}/resty/openssl"
24-
patch -p4 < "$SOURCE_DIR/build/patches/lua-resty-openssl.patch"
25-
)
26-
2720
# lrexlib-pcre2
2821
(
2922
lrexlib_pcre2_version="2.9.2-1"

tasks/deps/openresty

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
lua_resty_openssl_aux_module_version="0.3.0"
4+
lua_resty_openssl_aux_module_hash="535cda86ca5f326479fb9870288ca8f6ecd94e579374e6686d8fe508872dd4ce"
35
ngx_http_geoip2_module_version="3.4"
46
ngx_http_geoip2_module_hash="82d4beef48c260c3568eb0ae56451c95"
57
openresty_version="1.27.1.1"
@@ -16,6 +18,9 @@ extract_download "openresty-$openresty_version.tar.gz"
1618
download "https://github.com/leev/ngx_http_geoip2_module/archive/$ngx_http_geoip2_module_version.tar.gz" "md5" "$ngx_http_geoip2_module_hash"
1719
extract_download "$ngx_http_geoip2_module_version.tar.gz"
1820

21+
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"
22+
extract_download "$lua_resty_openssl_aux_module_version.tar.gz"
23+
1924
cd "openresty-$openresty_version"
2025
patch -p1 < "$SOURCE_DIR/build/patches/openresty-cli.patch"
2126

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

0 commit comments

Comments
 (0)