Skip to content

Commit a4439f6

Browse files
authored
Merge branch 'develop' into PSQL-773
2 parents 4a4a1bd + a431c10 commit a4439f6

32 files changed

+765
-90
lines changed

Dockerfile-15

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ COPY . /nixpg
113113

114114
WORKDIR /nixpg
115115

116-
RUN nix profile install .#psql_15/bin
116+
RUN nix profile add path:.#psql_15/bin
117117

118118
RUN nix store gc
119119

@@ -167,7 +167,7 @@ FROM base as groonga
167167

168168
WORKDIR /nixpg
169169

170-
RUN nix profile install .#supabase-groonga && \
170+
RUN nix profile add path:.#supabase-groonga && \
171171
mkdir -p /tmp/groonga-plugins && \
172172
cp -r /nix/var/nix/profiles/default/lib/groonga/plugins /tmp/groonga-plugins/
173173

@@ -209,7 +209,7 @@ COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins
209209
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
210210
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf
211211
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf
212-
COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/
212+
COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/conf.d
213213
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf
214214
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
215215
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
@@ -227,7 +227,6 @@ RUN sed -i \
227227
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
228228
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
229229
usermod -aG postgres wal-g && \
230-
mkdir -p /etc/postgresql-custom/conf.d && \
231230
chown -R postgres:postgres /etc/postgresql-custom
232231

233232
# # Include schema migrations

Dockerfile-17

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ COPY . /nixpg
116116

117117
WORKDIR /nixpg
118118

119-
RUN nix profile install .#psql_17/bin
119+
RUN nix profile add path:.#psql_17/bin
120120

121121
RUN nix store gc
122122

@@ -171,7 +171,7 @@ FROM base as groonga
171171

172172
WORKDIR /nixpg
173173

174-
RUN nix profile install .#supabase-groonga && \
174+
RUN nix profile add path:.#supabase-groonga && \
175175
mkdir -p /tmp/groonga-plugins && \
176176
cp -r /nix/var/nix/profiles/default/lib/groonga/plugins /tmp/groonga-plugins/
177177

@@ -213,7 +213,7 @@ COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins
213213
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
214214
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf
215215
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf
216-
COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/
216+
COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/conf.d
217217
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf
218218
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
219219
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
@@ -231,7 +231,6 @@ RUN sed -i \
231231
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
232232
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
233233
usermod -aG postgres wal-g && \
234-
mkdir -p /etc/postgresql-custom/conf.d && \
235234
chown -R postgres:postgres /etc/postgresql-custom
236235

237236
# Remove items from postgresql.conf

Dockerfile-orioledb-17

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ COPY . /nixpg
116116

117117
WORKDIR /nixpg
118118

119-
RUN nix profile install .#psql_orioledb-17/bin
119+
RUN nix profile add path:.#psql_orioledb-17/bin
120120

121121
RUN nix store gc
122122

@@ -171,7 +171,7 @@ FROM base as groonga
171171

172172
WORKDIR /nixpg
173173

174-
RUN nix profile install .#supabase-groonga && \
174+
RUN nix profile add path:.#supabase-groonga && \
175175
mkdir -p /tmp/groonga-plugins && \
176176
cp -r /nix/var/nix/profiles/default/lib/groonga/plugins /tmp/groonga-plugins/
177177

@@ -213,7 +213,7 @@ COPY --from=groonga /tmp/groonga-plugins/plugins /usr/lib/groonga/plugins
213213
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
214214
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf
215215
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf
216-
COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/
216+
COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql-custom/conf.d
217217
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf
218218
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
219219
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
@@ -231,7 +231,6 @@ RUN sed -i \
231231
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
232232
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
233233
usermod -aG postgres wal-g && \
234-
mkdir -p /etc/postgresql-custom/conf.d && \
235234
chown -R postgres:postgres /etc/postgresql-custom
236235

237236
# Remove items from postgresql.conf

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ This is the same PostgreSQL build that powers [Supabase](https://supabase.io), b
294294
| Goodie | Version | Description |
295295
| ------------- | :-------------: | ------------- |
296296
| [PgBouncer](https://www.pgbouncer.org/) | [1.19.0](http://www.pgbouncer.org/changelog.html#pgbouncer-119x) | Set up Connection Pooling. |
297-
| [PostgREST](https://postgrest.org/en/stable/) | [v13.0.4](https://github.com/PostgREST/postgrest/releases/tag/v13.0.4) | Instantly transform your database into an RESTful API. |
297+
| [PostgREST](https://postgrest.org/en/stable/) | [v14.1](https://github.com/PostgREST/postgrest/releases/tag/v14.1) | Instantly transform your database into an RESTful API. |
298298
| [WAL-G](https://github.com/wal-g/wal-g#wal-g) | [v2.0.1](https://github.com/wal-g/wal-g/releases/tag/v2.0.1) | Tool for physical database backup and recovery. | -->
299299

300300

ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ BEGIN
1414
SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow
1515
WHERE usename = p_usename;
1616
END;
17-
$$ LANGUAGE plpgsql SECURITY DEFINER;
17+
$$ LANGUAGE plpgsql
18+
SET search_path = ''
19+
SECURITY DEFINER;
1820

1921
REVOKE ALL ON FUNCTION pgbouncer.get_auth(p_usename TEXT) FROM PUBLIC;
2022
GRANT EXECUTE ON FUNCTION pgbouncer.get_auth(p_usename TEXT) TO pgbouncer;

ansible/tasks/setup-postgrest.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
state: 'present'
55

66
- name: PostgREST - add Postgres PPA gpg key
7-
ansible.builtin.apt_key:
7+
ansible.builtin.get_url:
8+
dest: /etc/apt/trusted.gpg.d/ppdg.asc
9+
force: true
10+
mode: '0644'
811
url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
9-
state: 'present'
1012

1113
- name: PostgREST - add Postgres PPA main
1214
ansible.builtin.apt_repository:
@@ -30,9 +32,9 @@
3032
msg: "Installed libpq5 version: {{ ansible_facts['packages']['libpq5'][0]['version'] }}"
3133

3234
- name: PostgREST - remove Postgres PPA gpg key
33-
ansible.builtin.apt_key:
35+
ansible.builtin.file:
36+
path: /etc/apt/trusted.gpg.d/ppdg.asc
3437
state: 'absent'
35-
url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
3638

3739
- name: PostgREST - remove Postgres PPA
3840
ansible.builtin.apt_repository:
@@ -58,7 +60,7 @@
5860
{%- if platform == "arm64" -%}
5961
ubuntu-aarch64
6062
{%- elif platform == "amd64" -%}
61-
inux-static-x86-64
63+
linux-static-x86-64
6264
{%- endif -%}
6365
6466
- name: PostgREST - unpack archive in /opt

ansible/tasks/setup-system.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@
6464
dest: '/etc/apt/apt.conf.d/10periodic'
6565
src: 'files/apt_periodic'
6666

67+
- name: Set local ssh policy
68+
ansible.builtin.copy:
69+
content: |
70+
Match Address 127.0.0.1,::1
71+
ForceCommand /bin/false
72+
DisableForwarding yes
73+
PermitTunnel no
74+
dest: /etc/ssh/sshd_config.d/local.conf
75+
mode: '0644'
76+
owner: 'root'
77+
group: 'root'
78+
6779
- name: Install other useful tools
6880
ansible.builtin.apt:
6981
pkg:
@@ -154,6 +166,13 @@
154166
value: 60
155167
state: 'present'
156168

169+
# postgres_exporter runs on port 9187 and postgresT occasionlly chooses it as random srcport
170+
- name: Set net.ipv4.ip_local_reserved_ports=9187
171+
ansible.builtin.sysctl:
172+
name: 'net.ipv4.ip_local_reserved_ports'
173+
value: 9187
174+
state: 'present'
175+
157176
- name: Execute tasks when (debpkg_mode or nixpkg_mode)
158177
when:
159178
- (debpkg_mode or nixpkg_mode)

ansible/vars.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ postgres_major:
1010

1111
# Full version strings for each major version
1212
postgres_release:
13-
postgresorioledb-17: "17.6.0.014-orioledb"
14-
postgres17: "17.6.1.057"
15-
postgres15: "15.14.1.057"
13+
postgresorioledb-17: "17.6.0.020-orioledb"
14+
postgres17: "17.6.1.063"
15+
postgres15: "15.14.1.063"
1616

1717
# Non Postgres Extensions
1818
pgbouncer_release: 1.19.0
@@ -21,9 +21,9 @@ pgbouncer_release_checksum: sha256:af0b05e97d0e1fd9ad45fe00ea6d2a934c63075f67f7e
2121
# The checksum can be found under "Assets", in the GitHub release page for each version.
2222
# The binaries used are: ubuntu-aarch64 and linux-static.
2323
# https://github.com/PostgREST/postgrest/releases
24-
postgrest_release: 13.0.5
25-
postgrest_arm_release_checksum: sha256:7b4eafdaf76bc43b57f603109d460a838f89f949adccd02f452ca339f9a0a0d4
26-
postgrest_x86_release_checksum: sha256:05be2bd48abee6c1691fc7c5d005023466c6989e41a4fc7d1302b8212adb88b5
24+
postgrest_release: 14.1
25+
postgrest_arm_release_checksum: sha256:68885d936873059b946afadaae697467daedacd7d8e697a80b7f0f6881c9c92f
26+
postgrest_x86_release_checksum: sha256:bdab6ab3389ca0d6c1f3b8363491674dbca71875c3f30261d92d8fecdde35277
2727

2828
gotrue_release: 2.182.1
2929
gotrue_release_checksum: sha1:38a12109ad62df32460d88e4c7b2a475b88e7865
@@ -53,7 +53,7 @@ postgres_exporter_release_checksum:
5353
arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0
5454
amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84
5555

56-
adminapi_release: "0.93.0"
56+
adminapi_release: "0.94.0"
5757
adminmgr_release: "0.32.3"
5858
supabase_admin_agent_release: 1.6.0
5959
supabase_admin_agent_splay: 30s

migrations/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ nix run github:supabase/postgres/mybranch#dbmate-tool -- --version 15
3838
- supabase/postgres
3939
- supabase/supabase
4040
- supabase/cli
41-
- supabase/infrastructure (internal)
41+
- supabase/platform (internal)
4242

4343
aiming to provide a single source of truth for migrations on the platform that can be depended upon by those components. For more information on goals see [the RFC](https://www.notion.so/supabase/Centralize-SQL-Migrations-cd3847ae027d4f2bba9defb2cc82f69a)
4444

@@ -48,8 +48,8 @@ aiming to provide a single source of truth for migrations on the platform that c
4848

4949
Migrations were pulled (in order) from:
5050

51-
1. [init-scripts/postgres](https://github.com/supabase/infrastructure/tree/develop/init-scripts/postgres) => [db/init-scripts](db/init-scripts)
52-
2. [init-scripts/migrations](https://github.com/supabase/infrastructure/tree/develop/init-scripts/migrations) => [db/migrations](db/migrations)
51+
1. [init-scripts/postgres](https://github.com/supabase/platform/tree/develop/init-scripts/postgres) => [db/init-scripts](db/init-scripts)
52+
2. [init-scripts/migrations](https://github.com/supabase/platform/tree/develop/init-scripts/migrations) => [db/migrations](db/migrations)
5353

5454
For compatibility with hosted projects, we include [migrate.sh](migrate.sh) that executes migrations in the same order as ami build:
5555

migrations/db/migrations/20220317095840_pg_graphql.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- migrate:up
22
create schema if not exists graphql_public;
33

4-
-- obsolete signature: https://github.com/supabase/infrastructure/pull/5524/files
4+
-- obsolete signature: https://github.com/supabase/platform/pull/5524/files
55
drop function if exists graphql_public.graphql(text, text, jsonb);
66
-- GraphQL Placeholder Entrypoint
77
create or replace function graphql_public.graphql(

0 commit comments

Comments
 (0)