Skip to content

Commit 2441263

Browse files
authored
chore: update adminmgr, fix gotrue, fix config perms (#847)
1 parent 1d78e9e commit 2441263

File tree

9 files changed

+28
-9
lines changed

9 files changed

+28
-9
lines changed

ansible/vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ postgres_exporter_release_checksum:
4747
amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84
4848

4949
adminapi_release: 0.58.1
50-
adminmgr_release: 0.14.0
50+
adminmgr_release: 0.14.2
5151

5252
# Postgres Extensions
5353
postgis_release: "3.3.2"

docker/all-in-one/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ ARG postgres_version=15.1.0.148
22

33
ARG pgbouncer_release=1.18.0
44
ARG postgrest_release=10.1.2
5-
ARG gotrue_release=2.47.0
5+
ARG gotrue_release=2.130.0
66
ARG adminapi_release=0.58.1
7-
ARG adminmgr_release=0.14.0
7+
ARG adminmgr_release=0.14.2
88
ARG vector_release=0.22.3
99
ARG postgres_exporter_release=0.9.0
1010
ARG envoy_release=1.28.0
@@ -154,8 +154,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
154154

155155
# Copy single binary dependencies
156156
COPY --from=pgrst /bin/postgrest /dist/
157-
COPY --from=gotrue /usr/local/bin/gotrue /dist/
158-
COPY --from=gotrue /usr/local/etc/gotrue /opt/gotrue/
157+
COPY --from=gotrue /usr/local/bin/auth /dist/gotrue
158+
COPY --from=gotrue /usr/local/etc/auth /opt/gotrue/
159159
COPY --from=envoy /usr/local/bin/envoy /dist/
160160
COPY --from=adminapi /tmp/supabase-admin-api /dist/
161161
COPY --chown=root:root --from=adminmgr /tmp/admin-mgr /dist/

docker/all-in-one/init/configure-adminapi.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then
5151
chown -R adminapi:adminapi "/etc/adminapi"
5252

5353
chown -R adminapi:adminapi "${ADMINAPI_CUSTOM_DIR}"
54-
chmod g+rx "${ADMINAPI_CUSTOM_DIR}"
54+
chmod g+wrx "${ADMINAPI_CUSTOM_DIR}"
5555
fi

docker/all-in-one/init/configure-autoshutdown.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then
1515

1616
rm -f "/etc/supa-shutdown/shutdown.conf"
1717
ln -s "${AUTOSHUTDOWN_CUSTOM_CONFIG_FILE_PATH}" "/etc/supa-shutdown/shutdown.conf"
18+
chmod g+wrx "${AUTOSHUTDOWN_CUSTOM_DIR}"
1819
chown -R adminapi:adminapi "/etc/supa-shutdown/shutdown.conf"
1920
chown -R adminapi:adminapi "${AUTOSHUTDOWN_CUSTOM_CONFIG_FILE_PATH}"
2021
fi

docker/all-in-one/init/configure-gotrue.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ GOTRUE_CUSTOM_CONFIG_FILE_PATH="${DATA_VOLUME_MOUNTPOINT}/etc/gotrue/gotrue.env"
1010

1111
if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then
1212
mkdir -p "${GOTRUE_CUSTOM_DIR}"
13+
chmod g+wrx "${GOTRUE_CUSTOM_DIR}"
1314
chown adminapi:adminapi "${GOTRUE_CUSTOM_DIR}"
1415

1516
if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then

docker/all-in-one/init/configure-kong.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
set -eou pipefail
33

44
KONG_CONF=/etc/kong/kong.yml
5+
KONG_CUSTOM_DIR="${DATA_VOLUME_MOUNTPOINT}/etc/kong"
6+
57
touch /var/log/services/kong.log
68

79
if [ -f "${INIT_PAYLOAD_PATH:-}" ]; then
@@ -29,3 +31,18 @@ sed -i -e "s|anon_key|$ANON_KEY|g" \
2931
# Update kong ports
3032
sed -i "s|:80 |:$KONG_HTTP_PORT |g" /etc/kong/kong.conf
3133
sed -i "s|:443 |:$KONG_HTTPS_PORT |g" /etc/kong/kong.conf
34+
35+
if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then
36+
mkdir -p "${KONG_CUSTOM_DIR}"
37+
if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then
38+
echo "Copying existing custom kong config from /etc/kong/kong.yml to ${KONG_CUSTOM_DIR}"
39+
cp /etc/kong/kong.yml "${KONG_CUSTOM_DIR}/kong.yml"
40+
fi
41+
42+
rm -rf "/etc/kong/kong.yml"
43+
ln -s "${KONG_CUSTOM_DIR}/kong.yml" "/etc/kong/kong.yml"
44+
chown -R adminapi:adminapi "/etc/kong/kong.yml"
45+
46+
chown -R adminapi:adminapi "${KONG_CUSTOM_DIR}"
47+
chmod g+wrx "${KONG_CUSTOM_DIR}"
48+
fi

docker/all-in-one/init/configure-pgbouncer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then
4242
ln -s "${PGBOUNCER_DIR}" "/etc/pgbouncer"
4343
chown -R pgbouncer:pgbouncer "/etc/pgbouncer"
4444
chown -R pgbouncer:pgbouncer "${PGBOUNCER_DIR}"
45-
chmod -R g+rx "${PGBOUNCER_DIR}"
45+
chmod -R g+wrx "${PGBOUNCER_DIR}"
4646
fi

docker/all-in-one/init/configure-postgrest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then
3232
chown -R postgrest:postgrest "/etc/postgrest"
3333

3434
chown -R postgrest:postgrest "${POSTGREST_CUSTOM_DIR}"
35-
chmod g+rx "${POSTGREST_CUSTOM_DIR}"
35+
chmod g+wrx "${POSTGREST_CUSTOM_DIR}"
3636
fi
3737

3838
PGRST_CONF=/etc/postgrest/generated.conf

docker/all-in-one/shutdown.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ SQL
5959
# This is to ensure that the WAL file is shipped, just in case
6060
sleep 1
6161

62-
/usr/bin/admin-mgr lsn-checkpoint-push || echo "Failed to push LSN checkpoint"
62+
/usr/bin/admin-mgr lsn-checkpoint-push --immediately || echo "Failed to push LSN checkpoint"
6363

6464
kill -s TERM "$(supervisorctl pid)"
6565
fi

0 commit comments

Comments
 (0)