wip: slskd perm runtime still nok

This commit is contained in:
SansGuidon 2025-04-29 23:24:41 +02:00
parent 84f386a358
commit 87d0c755be
8 changed files with 98 additions and 22 deletions

View File

@ -5,13 +5,14 @@
"description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG.md",
"tagline": "A modern client-server application for the Soulseek file-sharing network.",
"version": "1.0.0",
"version": "1.0.3",
"manifestVersion": 2,
"minBoxVersion": "8.3.1",
"healthCheckPath": "/health",
"httpPort": 5030,
"addons": {
"localstorage": {}
},
"manifestVersion": 2,
"website": "https://zoemp.be/slskd",
"contactEmail": "morgan@zoemp.be",
"icon": "file://logo.png",
@ -19,7 +20,6 @@
"file sharing",
"chat",
"music"
],
"minBoxVersion": "8.3.1"
]
}

View File

@ -21,14 +21,23 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
tini jq ca-certificates gosu libstdc++6 \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /app/code /app/data /run/slskd \
&& useradd -u 1000 -m -d /app/data -s /bin/bash cloudron
# créer les dossiers et l'utilisateur cloudron
RUN mkdir -p /app/code /app/data /run/slskd/cache \
&& useradd -u 1000 -m -d /app/data -s /bin/bash cloudron \
&& chmod -R 777 /app/data /run/slskd/cache
# copier binaire + UI
COPY --from=downloader /tmp/slskd /app/code/slskd
COPY --from=downloader /tmp/wwwroot /app/code/wwwroot
# config exemple & script de démarrage
COPY slskd.yml.example /app/code/slskd.yml.example
COPY start.sh /app/code/start.sh
RUN chmod +x /app/code/slskd /app/code/start.sh \
&& chown -R cloudron:cloudron /app/code /app/data /run/slskd
&& chown -R cloudron:cloudron /app/code
WORKDIR /app/code
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["./start.sh"]

View File

@ -1,2 +1 @@
1.0.0
1.0.3

View File

@ -1,8 +1,26 @@
#!/usr/bin/env bash
set -xeuo pipefail
VERSION=$(cat VERSION)
docker build --platform linux/amd64 -t dr.zoemp.be/slskd:${VERSION} -f Dockerfile.cloudron .
docker push dr.zoemp.be/slskd:${VERSION}
cloudron update --image dr.zoemp.be/slskd:${VERSION} --app slskd
VERSION=$(<VERSION)
IMAGE="dr.zoemp.be/slskd:${VERSION}"
LOCATION="slskd" # sous-domaine ⇒ slskd.ton-domaine.be
FQDN="${LOCATION}.${CLOUDRON_APP_DOMAIN:-zoemp.be}"
# 1) build + push
docker build --platform linux/amd64 -t "${IMAGE}" -f Dockerfile.cloudron .
docker push "${IMAGE}"
# 2) install ou update sur Cloudron
if cloudron status --app "${FQDN}" &>/dev/null; then
echo "🔄 Mise à jour de ${FQDN}${IMAGE}"
cloudron update \
--image "${IMAGE}" \
--app "${FQDN}"
else
echo "🚀 Installation de lapp sur ${FQDN}"
cloudron install \
--image "${IMAGE}" \
--location "${LOCATION}" \
"${CLOUDRON_MANIFEST_ID:-slskd.zoemp.be}"
fi

32
bump_version.sh Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -xeuo pipefail
# Lit la version courante
VERSION=$(cat VERSION)
# Sépare en MAJOR.MINOR.PATCH
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
case "${1:-}" in
major)
((MAJOR++))
MINOR=0
PATCH=0
;;
minor)
((MINOR++))
PATCH=0
;;
patch)
((PATCH++))
;;
*)
echo "Usage: $0 {major|minor|patch}"
exit 1
;;
esac
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
echo "$NEW_VERSION" > VERSION
echo "Version bumpée en $NEW_VERSION"

11
dev.sh
View File

@ -1,13 +1,16 @@
#!/usr/bin/env bash
set -xeuo pipefail
VERSION=$(cat VERSION)
docker build --platform linux/amd64 -t dr.zoemp.be/slskd:${VERSION} -f Dockerfile.cloudron .
VERSION=$(<VERSION)
IMAGE=dr.zoemp.be/slskd:${VERSION}
# Montez ./data qui doit contenir VOTRE slskd.yml
# build
docker build --platform linux/amd64 -t ${IMAGE} -f Dockerfile.cloudron .
# run localement en mappant ./data
docker run --rm -it \
--platform linux/amd64 \
-v "$(pwd)/data:/app/data" \
-p 8080:5030 \
dr.zoemp.be/slskd:${VERSION}
${IMAGE}

7
patch.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env sh
set -xeu
# On bump seulement la partie patch et on relance le build
./bump_version.sh patch
./build.sh

View File

@ -1,20 +1,28 @@
#!/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
# Si le fichier de conf n'existe PAS encore, on copie l'exemple
# 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)"
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}
--http-port "${SLSKD_HTTP_PORT:-5030}" \
--https-port "${SLSKD_HTTPS_PORT:-5031}" \
--listen-port "${SLSKD_SLSK_LISTEN_PORT:-50300}"