Add upload sanity check

This commit is contained in:
sn0w 2019-08-26 00:58:22 +02:00
parent daf8eeebc0
commit 9a4e89272c
2 changed files with 12 additions and 1 deletions

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: # 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 # dd if=/dev/urandom bs=1 count=128 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev
config :pleroma, Pleroma.Web.Endpoint, 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>" secret_key_base: "<key>"
### ###

View File

@ -33,6 +33,17 @@ while ! pg_isready -U pleroma -d postgres://db:5432/pleroma -t 1; do
sleep 1s sleep 1s
done 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..." log "Migrating database..."
mix ecto.migrate mix ecto.migrate