Skip to content

Commit 2ae966b

Browse files
committed
Merge remote-tracking branch 'origin/db-ssl'
2 parents a666501 + b873d40 commit 2ae966b

File tree

6 files changed

+24
-2
lines changed

6 files changed

+24
-2
lines changed

Dockerfile-postgres

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM public.ecr.aws/docker/library/postgres:15.10-bookworm
2+
COPY ./test/config/ssl_test.crt /var/lib/postgresql/server.crt
3+
COPY ./test/config/ssl_test.key /var/lib/postgresql/server.key
4+
RUN chown postgres /var/lib/postgresql/server.key /var/lib/postgresql/server.key && chmod 600 /var/lib/postgresql/server.key
5+
6+
CMD ["postgres", "-c", "ssl=on", "-c", "ssl_cert_file=/var/lib/postgresql/server.crt", "-c", "ssl_key_file=/var/lib/postgresql/server.key"]

config/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ fluent_bit:
9898
geoip:
9999
db_update_frequency: false
100100
postgresql:
101+
ssl: true
102+
ssl_required: true
101103
database: api_umbrella_test
102104
password: dev_password
103105
migrations:

docker-compose.ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ services:
99
- postgres
1010
- opensearch
1111
postgres:
12-
image: postgres:15.10-bookworm
12+
build:
13+
context: .
14+
dockerfile: Dockerfile-postgres
1315
environment:
1416
POSTGRES_PASSWORD: dev_password
1517
healthcheck:

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ services:
2424
- postgres
2525
- opensearch
2626
postgres:
27-
image: postgres:15.10-bookworm
27+
build:
28+
context: .
29+
dockerfile: Dockerfile-postgres
2830
environment:
2931
POSTGRES_PASSWORD: dev_password
3032
volumes:

src/api-umbrella/utils/pg_utils.lua

Lines changed: 3 additions & 0 deletions
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/deps/openresty

Lines changed: 7 additions & 0 deletions
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)