Browse Source

Add upload sanity check

pull/6/head
sn0w 3 years ago
parent
commit
9a4e89272c
  1. 2
      config.dist.exs
  2. 11
      entrypoint.sh

2
config.dist.exs

@ -44,7 +44,7 @@ config :pleroma, Pleroma.Upload.Filter.Mogrify, @@ -44,7 +44,7 @@ config :pleroma, Pleroma.Upload.Filter.Mogrify,
# On Linux, you can use the following command to get a random key base:
# dd if=/dev/urandom bs=1 count=128 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev
config :pleroma, Pleroma.Web.Endpoint,
url: [host: "ihatedocker.io", scheme: "https", port: 443],
url: [host: "example.com", scheme: "https", port: 443],
secret_key_base: "<key>"
###

11
entrypoint.sh

@ -33,6 +33,17 @@ while ! pg_isready -U pleroma -d postgres://db:5432/pleroma -t 1; do @@ -33,6 +33,17 @@ while ! pg_isready -U pleroma -d postgres://db:5432/pleroma -t 1; do
sleep 1s
done
log "Performing sanity checks..."
if ! touch /uploads/.sanity-check; then
log "\
The uploads datadir is NOT writable by `id -u`:`id -g`!\n\
This will break all upload functionality.\n\
Please fix the permissions and try again.\
"
exit 1
fi
rm /uploads/.sanity-check
log "Migrating database..."
mix ecto.migrate

Loading…
Cancel
Save