Fix Podman rootless permissions and improve setup

- Remove downloads folder creation from Dockerfile to avoid permission conflicts
- Remove user directive from docker-compose.yml (incompatible with rootless)
- Add :Z flag to volume mount for proper SELinux labeling
- Add fix-permissions.sh script for easy Podman setup
- Update documentation with correct Podman rootless instructions
- Update changelog for v2.0.2

This fixes the "Permission denied" error when downloading files in Podman
rootless mode by properly configuring UID mapping.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
main
Raynoxis 10 months ago
parent 1fcf32223e
commit 42790c6850

@ -16,7 +16,7 @@ RUN pip install --no-cache-dir flask
# Création d'un utilisateur non-root
RUN useradd -m -u 1000 appuser && \
mkdir -p /app/downloads /app/templates && \
mkdir -p /app/templates && \
chown -R appuser:appuser /app
# Création des répertoires

@ -55,10 +55,16 @@ podman run -d -p 5000:5000 --name ytdlp-web raynoxis/yt-dlp-web-interface:latest
```bash
git clone https://github.com/Raynoxis/yt-dlp-Web-Interface.git
cd yt-dlp-Web-Interface
# Pour Docker
docker-compose up -d
# Pour Podman (rootless)
./fix-permissions.sh # Configure les permissions
podman compose up -d
```
**Note pour WSL2** : Un fichier `.env` est inclus pour éviter les problèmes de permissions. Le conteneur s'exécutera avec votre UID/GID au lieu de root.
**Note pour WSL2 & Podman** : Un script `fix-permissions.sh` est fourni pour configurer automatiquement les permissions du dossier downloads avec Podman rootless.
Accédez à l'interface : **http://localhost:5001** (ou 5000 si vous utilisez la commande docker run directe)
@ -311,12 +317,23 @@ N'ajoutez **JAMAIS** `user: root` dans docker-compose.yml :
- ❌ Fichiers téléchargés appartiennent à root
- ❌ Vous ne pouvez pas les supprimer sans sudo
### Erreur de permissions avec Podman
### Erreur de permissions avec Podman (rootless)
Podman en mode rootless utilise un mapping d'UID. Pour que le conteneur puisse écrire dans le dossier downloads :
```bash
# Avec Podman, ajuster les permissions du volume
podman unshare chown -R 1000:1000 downloads/
# Utiliser le script fourni (recommandé)
./fix-permissions.sh
# OU manuellement :
podman unshare chown 1000:1000 downloads/
podman unshare chmod 755 downloads/
# Puis démarrer le conteneur
podman compose up -d
```
**Explication** : Podman mappe l'UID 1000 du conteneur (appuser) vers l'UID 100999 sur l'hôte. Le script configure automatiquement cette permission.
### Le healthcheck échoue
- Attendez 40 secondes (start_period)
- Vérifiez que le port 5000 est accessible
@ -344,6 +361,15 @@ Ce projet est sous licence MIT. Voir le fichier [LICENSE](LICENSE) pour plus de
## 📈 Changelog
### v2.0.2 (2025-11-28)
- 🐛 Fix permissions issues with Podman rootless mode
- 📝 Add `fix-permissions.sh` script for easy setup
- 🔧 Update Dockerfile to not pre-create downloads folder
- 📚 Improve documentation for Podman users
### v2.0.1 (2025-11-27)
- 📝 Update documentation with WSL2 permissions fix
### v2.0.0 (2025-11-25)
- ✨ Ajout de la barre de progression en temps réel avec SSE
- 🔒 Amélioration majeure de la sécurité (validation URL, path traversal)

@ -4,11 +4,10 @@ services:
ytdlp-webinterface:
image: raynoxis/yt-dlp-web-interface:latest
container_name: ytdlp-webinterface
user: "${UID:-1000}:${GID:-1000}"
ports:
- "5001:5000"
volumes:
- ./downloads:/app/downloads
- ./downloads:/app/downloads:Z
restart: unless-stopped
environment:
- FLASK_ENV=production

@ -0,0 +1,21 @@
#!/bin/bash
# Fix permissions for Podman rootless mode
# This script sets the correct ownership for the downloads folder
set -e
echo "Fixing permissions for Podman rootless mode..."
# Create downloads directory if it doesn't exist
mkdir -p downloads
# Set correct ownership using podman unshare
# This maps UID 1000 in the container namespace to the correct UID on the host
podman unshare chown 1000:1000 downloads
podman unshare chmod 755 downloads
echo "✓ Permissions fixed successfully!"
echo "The downloads folder is now owned by UID 100999 on the host,"
echo "which maps to UID 1000 (appuser) in the container."
echo ""
echo "You can now start the container with: podman compose up -d"
Loading…
Cancel
Save