2019-09-16 12:33:25 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
enabled="$(snapctl get enabled)"
|
|
|
|
if [ -z "${enabled}" -o "${enabled}" != "true" ]
|
|
|
|
then
|
|
|
|
echo "Plume not yet enabled"
|
2019-11-16 13:19:46 +01:00
|
|
|
exit 0
|
2019-09-16 12:33:25 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
export BASE_URL="$(snapctl get base-url)"
|
|
|
|
database_type="$(snapctl get db.type)"
|
|
|
|
|
|
|
|
if [ z"${database_type}" = z"sqlite" ]
|
|
|
|
then
|
|
|
|
export DATABASE_URL=${SNAP_DATA}/plume.db
|
|
|
|
export MIGRATION_DIR=migrations/sqlite
|
|
|
|
else
|
|
|
|
# Must be postgres, so must have set db.url
|
|
|
|
export DATABASE_URL="$(snapctl get db.url)"
|
|
|
|
export MIGRATION_DIRECTORY=migrations/postgres
|
|
|
|
fi
|
|
|
|
|
|
|
|
ROCKET_ADDRESS="$(snapctl get listen.address)"
|
|
|
|
ROCKET_PORT="$(snapctl get listen.port)"
|
|
|
|
export ROCKET_SECRET_KEY="$(cat ${SNAP_COMMON}/rocket-secret-key)"
|
|
|
|
export SEARCH_INDEX="${SNAP_DATA}/search_index"
|
2019-11-16 13:19:46 +01:00
|
|
|
export MEDIA_UPLOAD_DIRECTORY="${SNAP_DATA}/media"
|
2019-09-16 12:33:25 +02:00
|
|
|
|
|
|
|
cd ${SNAP}
|
|
|
|
exec $@
|