33 lines
998 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
chown -R cloudron:cloudron /app/data
chmod -R 755 /app/data
ls -ld /app/data
stat /app/data
# 1) Préparer le cache d'extraction .NET
export DOTNET_BUNDLE_EXTRACT_BASE_DIR=/run/slskd/cache
mkdir -p "${DOTNET_BUNDLE_EXTRACT_BASE_DIR}"
chown cloudron:cloudron "${DOTNET_BUNDLE_EXTRACT_BASE_DIR}"
# 2) Mode globalization invariant
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
# 3) Copier la config si nécessaire
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) Lancer slskd sous l'utilisateur 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}"