diff --git a/Dockerfile b/Dockerfile
index 3e0ee0f3..a7b7b5fd 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,7 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-ruby:3.3.6-alpine3.21} AS ruby-builder
-RUN apk --no-cache add build-base cmake postgresql16-dev git
+RUN apk --no-cache add build-base cmake postgresql17-dev git
COPY Gemfile Gemfile.lock ./
RUN gem i foreman && bundle install \
@@ -19,7 +19,7 @@ WORKDIR /app
RUN apk --no-cache add \
tzdata \
- postgresql16-client \
+ postgresql17-client \
vips ffmpeg \
sudo jemalloc
diff --git a/app/logical/docker_env.rb b/app/logical/docker_env.rb
index bd12cef5..92a7a40c 100644
--- a/app/logical/docker_env.rb
+++ b/app/logical/docker_env.rb
@@ -1,5 +1,5 @@
module DockerEnv
- NEEDED_PG_VERSION = "16"
+ NEEDED_PG_VERSION = "17"
module_function
@@ -16,11 +16,7 @@ def selenium_url
end
def pg_data_version
- File.read("/docker/db_data/PG_VERSION").strip
- rescue StandardError
- # On first boot the entrypoint was not yet able to modify permissions of the file.
- # Only subsequent ups will do that. The first start will have the correct version anyways
- NEEDED_PG_VERSION
+ `sudo cat /docker/db_data/PG_VERSION`.strip.presence || NEEDED_PG_VERSION
end
def specifies_docker_user?
diff --git a/app/views/application/pg_version_mismatch.erb b/app/views/application/pg_version_mismatch.erb
index c3be609a..fa85cbe9 100644
--- a/app/views/application/pg_version_mismatch.erb
+++ b/app/views/application/pg_version_mismatch.erb
@@ -1,6 +1,19 @@
-
Postgres database version mismatch: <%= DockerEnv.pg_data_version %> vs <%= DockerEnv::NEEDED_PG_VERSION %>
+ Postgres database version mismatch: <%= DockerEnv::NEEDED_PG_VERSION %> (wanted) vs <%= DockerEnv.pg_data_version %> (actual)
-FoxTrove updated its version of Postgres and requires action from your side:
-TODO (:
+FoxTrove updated its version of Postgres and requires action from your side. Please don't forget to make a backup before you start.
+
+
+ - Stop services (keep this tab open).
docker compose down
+ - Check out the last commit with previous postgres version.
git checkout 79d3cf242323ec5b0c228a1e3f9074f9f7599bf5
+ - Start postgres to take a backup.
docker compose up -d postgres
+ - Dump the data.
docker compose exec postgres pg_dump reverser_development -U reverser > backup.sql
+ - Stop postgres.
docker compose down
+ - Checkout out the current latest commit.
git checkout master
+ - Remove old data.
rm -R ${FOXTROVE_DATA_PATH}/db_data
+ - Start postgres to import the backup.
docker compose up -d postgres
+ - Import the backup.
docker compose exec -T postgres psql -U foxtrove -d foxtrove_development < backup.sql
+ - Start services.
docker compose up
+ - Reload the page, this error should now be gone.
+
<% page_title "Version Mismatch" %>
diff --git a/config/database.yml b/config/database.yml
index 6dfea51f..857b906a 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -1,7 +1,7 @@
default: &default
adapter: postgresql
encoding: unicode
- username: reverser
+ username: foxtrove
host: <%= ENV.fetch("POSTGRES_HOST") { "postgres" } %>
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
@@ -9,8 +9,8 @@ default: &default
development:
<<: *default
- database: reverser_development
+ database: foxtrove_development
test:
<<: *default
- database: reverser_test
+ database: foxtrove_test
diff --git a/docker-compose.yml b/docker-compose.yml
index e0835148..b8b07873 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -37,10 +37,10 @@ services:
command: foreman start --color
postgres:
- image: postgres:16.6-alpine3.21
+ image: postgres:17.2-alpine3.21
environment:
- - POSTGRES_USER=reverser
- - POSTGRES_DB=reverser_development
+ - POSTGRES_USER=foxtrove
+ - POSTGRES_DB=foxtrove_development
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ${REVERSER_DATA_PATH:-${FOXTROVE_DATA_PATH:-./data}}/db_data:/var/lib/postgresql/data
@@ -48,14 +48,10 @@ services:
ports:
- ${EXPOSED_POSTGRES_PORT:-34518}:5432
healthcheck:
- test: [CMD-SHELL, pg_isready -d reverser_development -U reverser]
+ test: [CMD-SHELL, pg_isready -d foxtrove_development -U foxtrove]
interval: 10s
timeout: 5s
retries: 5
- # Make the version file world readable. Will only happen on second boot when the data actually exists
- entrypoint: [/bin/sh, -c, chmod -f +r /var/lib/postgresql/data/PG_VERSION || true && docker-entrypoint.sh postgres]
- # By default the command is "postgres" but that wouldn't properly appended to the entrypoint anymore
- command: ""
iqdb:
image: ghcr.io/earlopain/iqdb:897214ffdc0b1ca18d1f9ca4749dff40d2dad2fc