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",
"title": "Zikkenek Soulseek",
"author": "Morgan Wattiez",
"id": "org.zoemp.slskd",
"title": "slskd",
"author": "Morgan",
"description": "file://DESCRIPTION.md",
"changelog": "Initial release.",
"tagline": "Soulseek client packaged for Cloudron",
"changelog": "file://CHANGELOG.md",
"tagline": "A modern client-server application for the Soulseek file-sharing network.",
"version": "1.0.0",
"healthCheckPath": "/",
"httpPort": 6080,
"healthCheckPath": "/health",
"httpPort": 5030,
"addons": {
"localstorage": {},
"sendmail": {}
"localstorage": {}
},
"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
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y curl ca-certificates xz-utils binutils patch && rm -rf /var/lib/apt/lists/*
# syntax=docker/dockerfile:1
FROM debian:bookworm-slim AS downloader
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl ca-certificates unzip jq \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
# Récupérer l'AppImage avec l'URL fournie
RUN curl -fL# 'https://drive.usercontent.google.com/download?id=1I7v1fh7jXa_YOh_AJ52XqRB3QJlqc1Hi&export=download&authuser=0' -o SoulseekQt-2024-2-4.AppImage && \
chmod +x SoulseekQt-2024-2-4.AppImage && \
./SoulseekQt-2024-2-4.AppImage --appimage-extract && \
mv squashfs-root /soulseek
ARG TARGETPLATFORM
RUN TAG=$(curl -fsSL https://api.github.com/repos/slskd/slskd/releases/latest \
| jq -r '.tag_name') \
&& case "${TARGETPLATFORM}" in \
"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
ENV LANG=C.UTF-8
ENV QT_XCB_NO_ACCESS_CONTROL=1
ENV QT_X11_NO_MITSHM=1
ENV DISPLAY=:1
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
xvfb \
x11vnc \
openbox \
wmctrl \
websockify \
ca-certificates \
curl \
libegl1-mesa \
libfontconfig1 \
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"]
FROM debian:bookworm-slim
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
COPY --from=downloader /tmp/slskd /app/code/slskd
COPY --from=downloader /tmp/wwwroot /app/code/wwwroot
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
WORKDIR /app/code
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["./start.sh"]

View File

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

18
dev.sh
View File

@ -1,11 +1,13 @@
#!/bin/bash
set -x
set -eu
#!/usr/bin/env bash
set -xeuo pipefail
# Construire l'image Docker
docker build --platform linux/amd64 -t dr.zoemp.be/soulseek:$(cat VERSION) -f Dockerfile.cloudron .
VERSION=$(cat VERSION)
docker build --platform linux/amd64 -t dr.zoemp.be/slskd:${VERSION} -f Dockerfile.cloudron .
# Lancer l'image Docker en mode développement
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 -p 6080:6080 -v /Users/morganwattiez/Code/soulseek/data:/app/data dr.zoemp.be/zikkenek:1.0.0
# Montez ./data qui doit contenir VOTRE slskd.yml
docker run --rm -it \
--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
set -e
#!/usr/bin/env bash
set -xeuo pipefail
# Prépare le répertoire de données
mkdir -p /app/data
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
# Lance Xvfb avec une résolution (ici 1920x1080, modifiable via env VNC_RESOLUTION si besoin)
Xvfb :1 -screen 0 ${VNC_RESOLUTION:-1920x1080x24} -dpi ${VNC_DPI:-120} &
sleep 2
# Si le fichier de conf n'existe PAS encore, on copie 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
# Lance Openbox pour gérer la fenêtre et maximiser automatiquement
openbox-session &
sleep 2
# Lance x11vnc pour partager le display :1 sur le port 5900 (sans mot de passe)
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
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}