Browse Source

Add upload sanity check

pull/6/head
sn0w 2 years ago
parent
commit
9a4e89272c
2 changed files with 12 additions and 1 deletions
  1. +1
    -1
      config.dist.exs
  2. +11
    -0
      entrypoint.sh

+ 1
- 1
config.dist.exs View File

@ -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
- 0
entrypoint.sh View File

@ -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