29 lines
920 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -xeuo pipefail
# 0) on s'assure que /app/data et /run/slskd/cache sont écrits par cloudron
chmod -R 777 /app/data /run/slskd/cache
# 1) répertoire d'extraction pour dotnet
export DOTNET_BUNDLE_EXTRACT_BASE_DIR=/run/slskd/cache
# 2) invariant globalization
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
# 3) si la conf n'existe pas, on la copie depuis l'exemple
if [ ! -f /app/data/slskd.yml ]; then
echo " Copie de la config d'exemple dans /app/data/slskd.yml"
cp /app/code/slskd.yml.example /app/data/slskd.yml
chown cloudron:cloudron /app/data/slskd.yml
else
echo " Utilisation de /app/data/slskd.yml existant"
fi
# 4) on lance en user cloudron
exec gosu cloudron /app/code/slskd \
--config /app/data/slskd.yml \
--http-port "${SLSKD_HTTP_PORT:-5030}" \
--https-port "${SLSKD_HTTPS_PORT:-5031}" \
--listen-port "${SLSKD_SLSK_LISTEN_PORT:-50300}"