Skip to content

Initialize pgsodium #589

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

lawso017
Copy link
Contributor

Ok probably the last suggestion for a bit... the final step in building a production-grade supabase cluster was enabling "batteries included" pgsodium initialization to support the supabase vault.

My vault operations were initially failing due to lack of a pgsodium master key.

Looking through the codebase didn't show that initialization happening, so I referenced the way Supabase handles this initialization in their dockerized PG (I'm using pg 15):

https://github.com/supabase/postgres/blob/develop/Dockerfile-15

Following their example, this PR initializes a server-managed secret key for the database with a new task, pgsodium.yml.

This task runs after pg_util if pgsodium is in pg_extension_list.

I have tested this on ubuntu 22 for a new cluster, and adding pgsodium to an existing cluster.

I am not sure how long this will be needed because:

https://supabase.com/docs/guides/database/extensions/pgsodium

However, our current vault still requires pgsodium so this was a necessary fix.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant