Skip to content

Commit d645eb5

Browse files
authored
Merge branch 'develop' into feat/reland-vault-wo-pgsodium
2 parents 2968706 + de733aa commit d645eb5

File tree

10 files changed

+66
-40
lines changed

10 files changed

+66
-40
lines changed

Dockerfile-15

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8
3131
ARG vault_release=0.2.8
3232
ARG groonga_release=12.0.8
3333
ARG pgroonga_release=2.4.0
34-
ARG wrappers_release=0.3.0
34+
ARG wrappers_release=0.4.5
3535
ARG hypopg_release=1.3.1
3636
ARG pgvector_release=0.4.0
3737
ARG pg_tle_release=1.3.2
@@ -67,6 +67,7 @@ WORKDIR /nixpg
6767

6868
RUN nix profile install .#psql_15/bin
6969

70+
RUN nix store gc
7071

7172

7273
WORKDIR /

Dockerfile-kubernetes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM alpine:3.21
22

33
ADD ./output-cloudimg/packer-cloudimg /disk/focal.qcow2
44

5-
RUN apk add --no-cache qemu-system-aarch64 qemu-img openssh-client nftables cloud-utils-localds aavmf
5+
RUN apk add --no-cache qemu-system-aarch64 qemu-img openssh-client nftables cloud-utils-localds aavmf virtiofsd
66
# dev stuff
77
# RUN apk add --no-cache iproute2
88

Dockerfile-orioledb-17

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8
3131
ARG vault_release=0.2.8
3232
ARG groonga_release=12.0.8
3333
ARG pgroonga_release=2.4.0
34-
ARG wrappers_release=0.3.0
34+
ARG wrappers_release=0.4.5
3535
ARG hypopg_release=1.3.1
3636
ARG pgvector_release=0.4.0
3737
ARG pg_tle_release=1.3.2
@@ -68,7 +68,7 @@ WORKDIR /nixpg
6868

6969
RUN nix profile install .#psql_orioledb-17/bin
7070

71-
71+
RUN nix store gc
7272

7373
WORKDIR /
7474

ansible/files/postgresql_config/supautils.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ supautils.privileged_extensions = 'address_standardizer, address_standardizer_da
99
supautils.privileged_extensions_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'
1010
supautils.privileged_extensions_superuser = 'supabase_admin'
1111
supautils.privileged_role = 'postgres'
12-
supautils.privileged_role_allowed_configs = 'auto_explain.*, log_lock_waits, log_min_duration_statement, log_min_messages, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression'
12+
supautils.privileged_role_allowed_configs = 'auto_explain.*, log_lock_waits, log_min_duration_statement, log_min_messages, log_replication_commands, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression'
1313
supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator'
1414
supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*'

ansible/vars.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ postgres_major:
88

99
# Full version strings for each major version
1010
postgres_release:
11-
postgresorioledb-17: "17.0.1.042-orioledb"
12-
postgres15: "15.8.1.048"
11+
postgresorioledb-17: "17.0.1.048-orioledb"
12+
postgres15: "15.8.1.055"
1313

1414
# Non Postgres Extensions
1515
pgbouncer_release: "1.19.0"
@@ -22,8 +22,8 @@ postgrest_release: "12.2.3"
2222
postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9
2323
postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05
2424

25-
gotrue_release: 2.169.0
26-
gotrue_release_checksum: sha1:1419b94683aac7ddc30355408b8e8b79e61146c4
25+
gotrue_release: 2.170.0
26+
gotrue_release_checksum: sha1:a5741163de7d8da490c013cc8566c7210ed9f6fe
2727

2828
aws_cli_release: "2.23.11"
2929

@@ -52,7 +52,7 @@ postgres_exporter_release_checksum:
5252
arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0
5353
amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84
5454

55-
adminapi_release: 0.74.0
55+
adminapi_release: 0.75.0
5656
adminmgr_release: 0.24.1
5757

5858
vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb"

ebssurrogate/scripts/qemu-bootstrap-nix.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,5 @@ install_nix
145145
execute_stage2_playbook
146146
# we do not want to ship an initialized DB as this is performed as needed
147147
rm -rf /data/pgdata
148+
clean_system
148149
cloud-init clean --logs

flake.nix

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
# pull them from the overlays/ directory automatically, but we don't
3939
# want to have an arbitrary order, since it might matter. being
4040
# explicit is better.
41+
(final: prev: {
42+
xmrig = throw "The xmrig package has been explicitly disabled in this flake.";
43+
})
4144
(import rust-overlay)
4245
(final: prev: {
4346
cargo-pgrx = final.callPackage ./nix/cargo-pgrx/default.nix {
@@ -565,6 +568,21 @@
565568
wrapProgram $out/bin/dbmate-tool \
566569
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]}
567570
'';
571+
show-commands = pkgs.runCommand "show-commands" {
572+
nativeBuildInputs = [ pkgs.makeWrapper ];
573+
buildInputs = [ pkgs.nushell ];
574+
} ''
575+
mkdir -p $out/bin
576+
cat > $out/bin/show-commands << 'EOF'
577+
#!${pkgs.nushell}/bin/nu
578+
let json_output = (nix flake show --json --quiet --all-systems | from json)
579+
let apps = ($json_output | get apps.${system})
580+
$apps | transpose name info | select name | each { |it| echo $"Run this app with: nix run .#($it.name)" }
581+
EOF
582+
chmod +x $out/bin/show-commands
583+
wrapProgram $out/bin/show-commands \
584+
--prefix PATH : ${pkgs.nushell}/bin
585+
'';
568586
update-readme = pkgs.runCommand "update-readme" {
569587
nativeBuildInputs = [ pkgs.makeWrapper ];
570588
buildInputs = [ pkgs.nushell ];
@@ -838,8 +856,8 @@
838856
start-server = mkApp "start-server" "start-postgres-server";
839857
start-client = mkApp "start-client" "start-postgres-client";
840858
start-replica = mkApp "start-replica" "start-postgres-replica";
841-
migrate-postgres = mkApp "migrate-tool" "migrate-postgres";
842-
sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions";
859+
# migrate-postgres = mkApp "migrate-tool" "migrate-postgres";
860+
# sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions";
843861
pg-restore = mkApp "pg-restore" "pg-restore";
844862
local-infra-bootstrap = mkApp "local-infra-bootstrap" "local-infra-bootstrap";
845863
dbmate-tool = mkApp "dbmate-tool" "dbmate-tool";
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- migrate:up
2+
alter function pgbouncer.get_auth owner to supabase_admin;
3+
grant execute on function pgbouncer.get_auth(p_usename text) to postgres;
4+
5+
-- migrate:down

nix/ext/wrappers/default.nix

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44
, openssl
55
, pkg-config
66
, postgresql
7-
, buildPgrxExtension_0_12_6
7+
, buildPgrxExtension_0_12_9
88
, cargo
99
, darwin
1010
, jq
1111
, rust-bin
1212
, git
1313
}:
1414
let
15-
rustVersion = "1.80.0";
15+
rustVersion = "1.81.0";
1616
cargo = rust-bin.stable.${rustVersion}.default;
1717
in
18-
buildPgrxExtension_0_12_6 rec {
18+
buildPgrxExtension_0_12_9 rec {
1919
pname = "supabase-wrappers";
20-
version = "0.4.4";
20+
version = "0.4.5";
2121
# update the following array when the wrappers version is updated
2222
# required to ensure that extensions update scripts from previous versions are generated
23-
previousVersions = ["0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"];
23+
previousVersions = ["0.4.4" "0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"];
2424
inherit postgresql;
2525
src = fetchFromGitHub {
2626
owner = "supabase";
2727
repo = "wrappers";
2828
rev = "v${version}";
29-
hash = "sha256-QoGFJpq8PuvMM8SS+VZd7MlNl56uFivRjs1tCtwX+oE=";
29+
hash = "sha256-IgDfVFROMCHYLZ/Iqj12MsQjPPCdRoH+3oi3Ki/iaRI=";
3030
};
3131

3232
nativeBuildInputs = [ pkg-config cargo git ];

nix/tests/expected/security.out

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,27 @@ from pg_catalog.pg_proc p
77
where p.proowner = (select oid from pg_catalog.pg_roles where rolname = 'supabase_admin')
88
and p.prosecdef = true
99
order by 1,2;
10-
nspname | proname
11-
----------+--------------------------------
12-
graphql | get_schema_version
13-
graphql | increment_schema_version
14-
pgsodium | disable_security_label_trigger
15-
pgsodium | enable_security_label_trigger
16-
pgsodium | get_key_by_id
17-
pgsodium | get_key_by_name
18-
pgsodium | get_named_keys
19-
pgsodium | mask_role
20-
pgsodium | update_mask
21-
public | dblink_connect_u
22-
public | dblink_connect_u
23-
public | pgaudit_ddl_command_end
24-
public | pgaudit_sql_drop
25-
public | st_estimatedextent
26-
public | st_estimatedextent
27-
public | st_estimatedextent
28-
repack | repack_trigger
29-
vault | create_secret
30-
vault | update_secret
31-
(19 rows)
10+
nspname | proname
11+
-----------+--------------------------------
12+
graphql | get_schema_version
13+
graphql | increment_schema_version
14+
pgbouncer | get_auth
15+
pgsodium | disable_security_label_trigger
16+
pgsodium | enable_security_label_trigger
17+
pgsodium | get_key_by_id
18+
pgsodium | get_key_by_name
19+
pgsodium | get_named_keys
20+
pgsodium | mask_role
21+
pgsodium | update_mask
22+
public | dblink_connect_u
23+
public | dblink_connect_u
24+
public | pgaudit_ddl_command_end
25+
public | pgaudit_sql_drop
26+
public | st_estimatedextent
27+
public | st_estimatedextent
28+
public | st_estimatedextent
29+
repack | repack_trigger
30+
vault | create_secret
31+
vault | update_secret
32+
(20 rows)
3233

0 commit comments

Comments
 (0)