20 lines
914 B
Bash
Executable File
20 lines
914 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
mkdir -p /app/data/data /run/minio/config /run/minio/certs
|
|
|
|
# minio is used for backups at times and has a large number of files. optimize by checking if files
|
|
# are actually in correct chown state
|
|
echo "==> Changing ownership"
|
|
[[ $(stat --format '%U' /app/data/data) != "cloudron" ]] && chown -R cloudron:cloudron /app/data
|
|
|
|
[[ ! -f /app/data/env.sh ]] && echo -e "# Add custom minio configuration to this file. Restart the app for changes to take effect.\n\nexport CLOUDRON_MINIO_STARTUP_ARGS='server /app/data/data'" > /app/data/env.sh
|
|
|
|
source /app/data/env.sh
|
|
|
|
# the --config-dir is deprecated and not used. but without it, minio will try to create $HOME/.minio :/ same for --certs-dir
|
|
echo "==> Starting minio"
|
|
exec /usr/local/bin/gosu cloudron:cloudron /app/code/minio --certs-dir /run/minio/certs --config-dir /run/minio/config --quiet ${CLOUDRON_MINIO_STARTUP_ARGS} --address :8000
|
|
|