moving pgsodium_root.key
to its own directory to allow it to be mou…
#901
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Currently, the main docker-compose.yml file does not allow
pgsodium_root.key
to survive a cycle ofdocker compose down
/docker compose up
.The problem is, the key (current location within container:
/etc/postgresql-custom/pgsodium_root.key
) is being overwritten. See supabase/vault#27 and supabase/vault#30.Previous (unworking) attempts at solving this problem:
/etc/postgresql-custom/pgsodium_root.key
to/volumes/db/pgsodium_root.key
(see here and here)/volumes/db/pgsodium_root.key
will not exist on the firstdocker compose up
, this causes the path/volumes/db/pgsodium_root.key
to be treated as a directory even when the:Z
flag is supplied/volumes/db/pgsodium_root.key
and using the method aboveWhat is the new behavior?
The new behavior would store
/etc/postgresql-custom/pgsodium_root.key
in its own directory:/etc/postgresql-custom/pgsodium
. The full path of the key would become:/etc/postgresql-custom/pgsodium/pgsodium_root.key
.This way, the key file can be mounted in docker compose as follows:
In the above scenario:
/etc/postgresql-custom/pgsodium/pgsodium_root.key
would not exist and would be created; since the entire parent directory (/etc/postgresql-custom/pgsodium
) can be mounted in docker-compose, the/etc/postgresql-custom/pgsodium/pgsodium_root.key
file would survive the initialdocker compose down
./etc/postgresql-custom/pgsodium/pgsodium_root.key
will exist (from/volumes/db/pgsodium/pgsodium_root.key
and be utilized instead of a new keyAdditional context
The point of this is to solve supabase/vault#27 and supabase/vault#30, where self-hosted supabase vault instances cannot survive a
docker compose down
.