Skip to content

Commit

Permalink
Fix postgres include path
Browse files Browse the repository at this point in the history
  • Loading branch information
dhelonious committed May 2, 2024
1 parent cd14da7 commit 31c38bc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
16 changes: 7 additions & 9 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
# Unofficial snap for Mastodon 4.2.8
# Unofficial snap for Mastodon 4.2.X

⚠️ This update changes registrations to be closed by default.

See also the release notes for Mastodon: https://github.com/mastodon/mastodon/releases/tag/v4.2.8
See also the release notes for Mastodon: https://github.com/mastodon/mastodon/releases/tag/v4.2.X

This release contains:

* Mastodon 4.2.8
* Mastodon 4.2.X
* Node 16.20.2 (see [#25787](https://github.com/mastodon/mastodon/discussions/25787#discussioncomment-6382898))
* Ruby 3.2.3
* Bundle 2.4.13
* *Yarn 1.22.22*
* Yarn 1.22.22
* Nginx 1.25.4
* PostgreSQL 16.2
* Redis 7.2.4
* Acme.sh 3.0.7
* *ImageMagick 7.1.1-29*
* ImageMagick 7.1.1-29
* OpenSSL 1.1.1w
* Curl 8.6.0
* Jemalloc 5.3.0
* *musl-libc 1.2.5*
* musl-libc 1.2.5
* mastodon-bird-ui 1.8.5
* tangerine-ui 1.9.4

As of this release, the snap package contains and is licensed under the AGPL-3.0 license.
⚠️ Previous versions of this snap set an incorrect path in the PostgreSQL configuration file. As a result, some settings may not be loaded after some updates. The snap will fix this when updated *after* this version. To fix this immediately, change the last line in `/var/snap/mastodon-server/current/postgres/data/postgres.conf` to `include_if_exists = '/var/snap/mastodon-server/current/postgres/config/postgresql.conf'` and restart the snap.
2 changes: 2 additions & 0 deletions src/postgres/bin/initdb.wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
mkdir -p "$PG_DATA_DIR"

exec initdb -D "$PG_DATA_DIR" -U postgres -A trust -E UTF8 --locale=C

$SNAP/bin/append "include_if_exists = '$(config_dir postgres)/postgresql.conf'" "$PG_DATA_DIR/postgresql.conf"
2 changes: 2 additions & 0 deletions src/postgres/bin/postgres.wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ fi

mkdir -p "$PG_SOCK_DIR"

sed -i -e "s|^include_if_exists = .*|include_if_exists = '$(config_dir postgres)/postgresql.conf'|" "$PG_DATA_DIR/postgresql.conf"

postgres \
-D "$PG_DATA_DIR" \
-k "$PG_SOCK_DIR" \
Expand Down
1 change: 0 additions & 1 deletion src/postgres/postgres.env
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ copy_postgres_config() {

setup_postgres_database() {
run_as_daemon_user initdb.wrapper
run_as_daemon_user $SNAP/bin/append "include_if_exists = '$SNAP_DATA/postgres/config/postgresql.conf'" "$SNAP_DATA/postgres/data/postgresql.conf"
snapctl restart "$SNAP_NAME.postgres"
}

0 comments on commit 31c38bc

Please sign in to comment.