wip: init packaging, build & run

This commit is contained in:
SansGuidon 2025-03-31 02:33:53 +02:00
commit ebdb347297
12 changed files with 183 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
data

5
CHANGELOG.md Normal file
View File

@ -0,0 +1,5 @@
# Changelog
## [1.0.0] - 2023-XX-XX
- Initial release of Soulseek on Cloudron.

18
CloudronManifest.json Normal file
View File

@ -0,0 +1,18 @@
{
"id": "org.zoemp.zikkenek",
"title": "Zikkenek Soulseek",
"author": "Morgan Wattiez",
"description": "file://DESCRIPTION.md",
"changelog": "Initial release.",
"tagline": "Soulseek client packaged for Cloudron",
"version": "1.0.0",
"healthCheckPath": "/",
"httpPort": 6080,
"addons": {
"localstorage": {},
"sendmail": {}
},
"manifestVersion": 2,
"minBoxVersion": "9.0.0"
}

17
DESCRIPTION.md Normal file
View File

@ -0,0 +1,17 @@
# Zikkenek Soulseek
Soulseek client packagé pour Cloudron.
## Vue d'ensemble
Cette application permet d'accéder au client Soulseek via une interface web (noVNC).
## Configuration
- Le fichier de configuration par défaut se trouve dans `/app/code/soulseek.conf`.
- Pour le surcharger, place ton propre fichier `soulseek.conf` dans `/app/data` (il écrasera le défaut).
## Accès
Accède à l'application via l'URL fournie par Cloudron.

72
Dockerfile.cloudron Normal file
View File

@ -0,0 +1,72 @@
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/*
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
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 \
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"]

4
README.md Normal file
View File

@ -0,0 +1,4 @@
1. Construisez l'image Docker en utilisant le script build.sh.
2. Installez l'application sur Cloudron en utilisant la commande suivante :
`cloudron install --image dr.zoemp.be/soulseek:$(command cat VERSION) --location soulseek
`

2
VERSION Normal file
View File

@ -0,0 +1,2 @@
1.0.0

13
build.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -x
set -eu
# 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

11
dev.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -x
set -eu
# Construire l'image Docker
docker build --platform linux/amd64 -t dr.zoemp.be/soulseek:$(cat 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

11
docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: "3"
services:
soulseek:
build:
context: .
dockerfile: Dockerfile.cloudron
ports:
- "6080:6080"
volumes:
- ./data:/app/data

7
soulseek.conf Normal file
View File

@ -0,0 +1,7 @@
# Configuration Soulseek par défaut (remplace les placeholders)
soulseek:
address: vps.slsknet.org
port: 2271
username: USERNAME
password: PASSWORD

22
start.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -e
# Créer le répertoire de données persistant
mkdir -p /app/data
# Lancer le framebuffer virtuel sur DISPLAY :1
Xvfb :1 -screen 0 1280x720x24 &
sleep 2
# Lancer x11vnc pour partager le display :1 sur le port 5900 (sans mot de passe)
x11vnc -display :1 -rfbport 5900 -nopw -forever -shared &
sleep 2
# Lancer websockify (noVNC) pour exposer x11vnc sur le port 6080
websockify --web /usr/share/novnc 6080 localhost:5900 &
sleep 2
# Exporter le DISPLAY et lancer l'application en tant que user cloudron
export DISPLAY=:1
exec gosu cloudron /app/code/SoulseekQt