Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

LIBDRUM-882. Renamed "drum_pg_restore.sh" script to "pg_restore_drum.sh" #231

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dspace/src/main/docker/nginx/certs/*
# Ignore database dump directory to be used with docker-compose for initializing
postgres-init/*
!postgres-init/README.md
!postgres-init/drum_pg_restore.sh
!postgres-init/pg_restore_drum.sh
## End UMD Customization

## Ignore the MVN compiled output directories from version tracking
Expand Down
2 changes: 1 addition & 1 deletion dspace/docs/DrumDBRestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ with DRUM running DSpace 7.
```

**Note:** The output file MUST use a ".dump" extension, in order for the
"drum_pg_restore.sh" script to process it, see
"pg_restore_drum.sh" script to process it, see
"[postgres-init/README.md](../../postgres-init/README.md)"

3) (Optional) This step can be skipped, if you are following the instructions in
Expand Down
10 changes: 5 additions & 5 deletions postgres-init/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Database initialization for docker-compose

Place your database dump file in this directory, and the "dspacedb" container
will use it to initialize the database, via the "drum_pg_restore.sh" script.
will use it to initialize the database, via the "pg_restore_drum.sh" script.

## drum_pg_restore.sh and CVE-2023-2454
## pg_restore_drum.sh and CVE-2023-2454

Prior to DSpace 7.6.2, it was possible to use "pg_dump" to create a "plain" SQL
file (with a ".sql" extension), and the "postgres" Docker image
Expand All @@ -16,12 +16,12 @@ process running as the "postgres" user, and the use of the "pgcrypto"
extension). Note that plain SQL dumps *will* work when run from the Docker
container's command-line.

The workaround was to create the "postgres-init/drum_pg_restore.sh", script
The workaround was to create the "postgres-init/pg_restore_drum.sh", script
which uses "pg_restore" to populate the database with a Postgres "custom" dump
file. This is used in preference to a plain SQL file, to keep the automatic
Docker initialization from interfering with the process.

The "postgres-init/drum_pg_restore.sh" will run automatically when the Docker
The "postgres-init/pg_restore_drum.sh" will run automatically when the Docker
container starts, *if* a database doesn't already exist.

## Creating the Postgres dump
Expand All @@ -33,7 +33,7 @@ $ kubectl exec drum-db-0 -- pg_dump -Fc -C -O -U drum -d drum > postgres-init/dr
```

**Note:** The output file MUST use a ".dump" extension, in order for the
"drum_pg_restore.sh" script to process it.
"pg_restore_drum.sh" script to process it.

## Delete local database data

Expand Down
File renamed without changes.
Loading