wip: slskd

This commit is contained in:
SansGuidon 2025-04-29 21:44:04 +02:00
parent 1575332062
commit 84f386a358
7 changed files with 111 additions and 130 deletions

View File

@ -1,18 +1,25 @@
{ {
"id": "org.zoemp.zikkenek", "id": "org.zoemp.slskd",
"title": "Zikkenek Soulseek", "title": "slskd",
"author": "Morgan Wattiez", "author": "Morgan",
"description": "file://DESCRIPTION.md", "description": "file://DESCRIPTION.md",
"changelog": "Initial release.", "changelog": "file://CHANGELOG.md",
"tagline": "Soulseek client packaged for Cloudron", "tagline": "A modern client-server application for the Soulseek file-sharing network.",
"version": "1.0.0", "version": "1.0.0",
"healthCheckPath": "/", "healthCheckPath": "/health",
"httpPort": 6080, "httpPort": 5030,
"addons": { "addons": {
"localstorage": {}, "localstorage": {}
"sendmail": {}
}, },
"manifestVersion": 2, "manifestVersion": 2,
"minBoxVersion": "9.0.0" "website": "https://zoemp.be/slskd",
"contactEmail": "morgan@zoemp.be",
"icon": "file://logo.png",
"tags": [
"file sharing",
"chat",
"music"
],
"minBoxVersion": "8.3.1"
} }

View File

@ -1,74 +1,35 @@
FROM ubuntu:20.04 AS builder # syntax=docker/dockerfile:1
ENV DEBIAN_FRONTEND=noninteractive FROM debian:bookworm-slim AS downloader
RUN apt-get update && apt-get install -y curl ca-certificates xz-utils binutils patch && rm -rf /var/lib/apt/lists/* RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl ca-certificates unzip jq \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp WORKDIR /tmp
# Récupérer l'AppImage avec l'URL fournie ARG TARGETPLATFORM
RUN curl -fL# 'https://drive.usercontent.google.com/download?id=1I7v1fh7jXa_YOh_AJ52XqRB3QJlqc1Hi&export=download&authuser=0' -o SoulseekQt-2024-2-4.AppImage && \ RUN TAG=$(curl -fsSL https://api.github.com/repos/slskd/slskd/releases/latest \
chmod +x SoulseekQt-2024-2-4.AppImage && \ | jq -r '.tag_name') \
./SoulseekQt-2024-2-4.AppImage --appimage-extract && \ && case "${TARGETPLATFORM}" in \
mv squashfs-root /soulseek "linux/amd64") URL="https://github.com/slskd/slskd/releases/download/${TAG}/slskd-${TAG}-linux-x64.zip" ;; \
"linux/arm64") URL="https://github.com/slskd/slskd/releases/download/${TAG}/slskd-${TAG}-linux-arm64.zip" ;; \
*) echo "Unsupported PLATFORM: ${TARGETPLATFORM}" >&2; exit 1 ;; \
esac \
&& curl -fsSL "$URL" -o slskd.zip \
&& unzip slskd.zip
FROM ubuntu:20.04 FROM debian:bookworm-slim
ENV LANG=C.UTF-8 RUN apt-get update \
ENV QT_XCB_NO_ACCESS_CONTROL=1 && apt-get install -y --no-install-recommends \
ENV QT_X11_NO_MITSHM=1 tini jq ca-certificates gosu libstdc++6 \
ENV DISPLAY=:1 && rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=noninteractive RUN mkdir -p /app/code /app/data /run/slskd \
RUN apt-get update && apt-get install -y \ && useradd -u 1000 -m -d /app/data -s /bin/bash cloudron
xvfb \ COPY --from=downloader /tmp/slskd /app/code/slskd
x11vnc \ COPY --from=downloader /tmp/wwwroot /app/code/wwwroot
openbox \ COPY slskd.yml.example /app/code/slskd.yml.example
wmctrl \ COPY start.sh /app/code/start.sh
websockify \ RUN chmod +x /app/code/slskd /app/code/start.sh \
ca-certificates \ && chown -R cloudron:cloudron /app/code /app/data /run/slskd
curl \ WORKDIR /app/code
libegl1-mesa \ ENTRYPOINT ["/usr/bin/tini", "--"]
libfontconfig1 \ CMD ["./start.sh"]
libxcb-cursor0 \
libx11-xcb1 \
libxcomposite1 \
libxcursor1 \
libxi6 \
libxinerama1 \
libxrandr2 \
libxkbcommon-x11-0 \
libxrender1 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-shape0 \
libxcb-shm0 \
libxcb-xfixes0 \
libxcb-xinerama0 \
libxcb-xkb1 \
libxshmfence1 \
libgl1 \
libdbus-1-3 \
libxtst6 \
libxss1 \
libxv1 \
libxvmc1 \
libxxf86dga1 \
libxxf86vm1 \
gosu \
xauth \
x11-xserver-utils \
&& rm -rf /var/lib/apt/lists/*
# Créer les répertoires nécessaires
RUN mkdir -p /app/code /app/data /usr/share/novnc
# Télécharger noVNC
RUN curl -fL# "https://github.com/novnc/noVNC/archive/master.tar.gz" -o /tmp/novnc.tar.gz && \
tar -xf /tmp/novnc.tar.gz --strip-components=1 -C /usr/share/novnc && \
rm /tmp/novnc.tar.gz
# Copier l'app Soulseek depuis le builder
COPY --from=builder /soulseek /app/code
# Copier nos fichiers Cloudron spécifiques
COPY start.sh /app/code/start.sh
COPY soulseek.conf /app/code/soulseek.conf
# Créer l'utilisateur non-root Cloudron et régler les droits sur les dossiers persistants
RUN useradd -u 1000 -m -d /app/data -s /bin/false cloudron && \
chown -R cloudron:cloudron /app/code /app/data
EXPOSE 6080
CMD ["/app/code/start.sh"]

View File

@ -1,13 +1,8 @@
#!/bin/bash #!/usr/bin/env bash
set -x set -xeuo pipefail
set -eu
# Construire l'image Docker VERSION=$(cat VERSION)
docker build --platform linux/amd64 -t dr.zoemp.be/soulseek:$(cat VERSION) -f Dockerfile.cloudron . docker build --platform linux/amd64 -t dr.zoemp.be/slskd:${VERSION} -f Dockerfile.cloudron .
docker push dr.zoemp.be/slskd:${VERSION}
# Pousser l'image vers le registre cloudron update --image dr.zoemp.be/slskd:${VERSION} --app slskd
docker push dr.zoemp.be/soulseek:$(cat VERSION)
# Installer l'application sur Cloudron
cloudron update --image dr.zoemp.be/soulseek:$(cat VERSION) --app soulseek

18
dev.sh
View File

@ -1,11 +1,13 @@
#!/bin/bash #!/usr/bin/env bash
set -x set -xeuo pipefail
set -eu
# Construire l'image Docker VERSION=$(cat VERSION)
docker build --platform linux/amd64 -t dr.zoemp.be/soulseek:$(cat VERSION) -f Dockerfile.cloudron . docker build --platform linux/amd64 -t dr.zoemp.be/slskd:${VERSION} -f Dockerfile.cloudron .
# Lancer l'image Docker en mode développement # Montez ./data qui doit contenir VOTRE slskd.yml
docker run --platform linux/amd64 --rm -it -v $(pwd)/data:/app/data/ -p 8080:80 dr.zoemp.be/soulseek:$(cat VERSION) docker run --rm -it \
#docker run --rm -it -p 6080:6080 -v /Users/morganwattiez/Code/soulseek/data:/app/data dr.zoemp.be/zikkenek:1.0.0 --platform linux/amd64 \
-v "$(pwd)/data:/app/data" \
-p 8080:5030 \
dr.zoemp.be/slskd:${VERSION}

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

30
slskd.yml.example Normal file
View File

@ -0,0 +1,30 @@
soulseek:
address: vps.slsknet.org
port: 2271
username: changeme
password: changeme
web:
authentication:
disabled: false
username: admin
password: changeme
http:
host: 0.0.0.0
port: 5030
https:
enabled: true
port: 5031
cert: /app/data/cert.pem
key: /app/data/key.pem
listenPort: 50300
remoteConfiguration: true
paths:
data: /app/data
downloads: /app/data/downloads
incomplete: /app/data/incomplete

View File

@ -1,34 +1,20 @@
#!/bin/sh #!/usr/bin/env bash
set -e set -xeuo pipefail
# Prépare le répertoire de données export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
mkdir -p /app/data
# Lance Xvfb avec une résolution (ici 1920x1080, modifiable via env VNC_RESOLUTION si besoin) # Si le fichier de conf n'existe PAS encore, on copie l'exemple
Xvfb :1 -screen 0 ${VNC_RESOLUTION:-1920x1080x24} -dpi ${VNC_DPI:-120} & if [ ! -f /app/data/slskd.yml ]; then
sleep 2 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
# Lance Openbox pour gérer la fenêtre et maximiser automatiquement exec gosu cloudron /app/code/slskd \
openbox-session & --config /app/data/slskd.yml \
sleep 2 --http-port ${SLSKD_HTTP_PORT:-5030} \
--https-port ${SLSKD_HTTPS_PORT:-5031} \
# Lance x11vnc pour partager le display :1 sur le port 5900 (sans mot de passe) --listen-port ${SLSKD_SLSK_LISTEN_PORT:-50300}
x11vnc -display :1 -rfbport 5900 -nopw -forever -shared &
sleep 2
# Lance noVNC pour exposer l'interface web sur le port 6080
websockify --web /usr/share/novnc 6080 localhost:5900 &
sleep 2
# Exporte le DISPLAY et lance l'application SoulseekQt en arrière-plan
export DISPLAY=:1
/app/code/SoulseekQt &
# Attendre que l'application se lance
sleep 5
# Utilise wmctrl pour maximiser la fenêtre active
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz || true
# Garde le container actif
tail -f /dev/null