Skip to content

Commit aabe264

Browse files
committed
chore: use local socket for postgres and disable localhost access from db
1 parent 084b914 commit aabe264

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ansible/files/postgresql_config/postgresql.service.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@ RestartSec=5
2121
OOMScoreAdjust=-1000
2222
EnvironmentFile=-/etc/environment.d/postgresql.env
2323
LimitNOFILE=16384
24+
{% if supabase_internal is defined %}
25+
IPAddressDeny=localhost
26+
IPAddressAllow=127.0.0.53/32
27+
{% endif %}
2428
[Install]
2529
WantedBy=multi-user.target

testinfra/test_ami_nix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"0000000000000000000000000000000000000000000000000000000000000000"
107107
)
108108
postgrest_base_conf_content = """
109-
db-uri = "postgres://authenticator:postgres@localhost:5432/postgres?application_name=postgrest"
109+
db-uri = "postgres://authenticator:postgres@/postgres?host=/var/run/postgresql/&application_name=postgrest"
110110
db-schema = "public, storage, graphql_public"
111111
db-anon-role = "anon"
112112
jwt-secret = "my_jwt_secret_which_is_not_so_secret"
@@ -124,7 +124,7 @@
124124
GOTRUE_API_HOST=0.0.0.0
125125
GOTRUE_SITE_URL=
126126
GOTRUE_DB_DRIVER=postgres
127-
GOTRUE_DB_DATABASE_URL=postgres://supabase_auth_admin@localhost/postgres?sslmode=disable
127+
GOTRUE_DB_DATABASE_URL=postgres://supabase_auth_admin@/postgres?host=/var/run/postgresql/&sslmode=disable
128128
GOTRUE_JWT_ADMIN_ROLES=supabase_admin,service_role
129129
GOTRUE_JWT_AUD=authenticated
130130
GOTRUE_JWT_SECRET=my_jwt_secret_which_is_not_so_secret

0 commit comments

Comments
 (0)