first commit
This commit is contained in:
@@ -0,0 +1,209 @@
|
||||
# Dolphin FTP Share Tab
|
||||
|
||||
Ein KDE Dolphin Properties-Dialog Plugin zum Erstellen und Verwalten von FTP-Freigaben — direkt über die GUI.
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
- **FTP-Tab** in Dolphins Ordner-Eigenschaften (Rechtsklick → Eigenschaften)
|
||||
- Freigabe per Checkbox aktivieren/deaktivieren
|
||||
- Freigabename konfigurierbar (Standard = Ordnername)
|
||||
- Anonymen Zugang erlauben
|
||||
- Berechtigungen pro Benutzer: Read Only / Read-Write
|
||||
- Nutzt das Helper-Script `dolphin-ftp-share` — **kein Root nötig!**
|
||||
- Erkennt bestehende Freigaben und lädt deren Einstellungen
|
||||
|
||||
## Voraussetzungen
|
||||
|
||||
- Ein FTP-Server (z.B. `vsftpd`)
|
||||
- Das Helper-Script `dolphin-ftp-share` im PATH
|
||||
- Build-Dependencies (siehe unten)
|
||||
|
||||
### FTP-Server installieren (vsftpd)
|
||||
|
||||
```bash
|
||||
sudo apt install vsftpd
|
||||
```
|
||||
|
||||
### vsftpd konfigurieren
|
||||
|
||||
In `/etc/vsftpd.conf`:
|
||||
|
||||
```ini
|
||||
listen=YES
|
||||
anonymous_enable=YES
|
||||
local_enable=YES
|
||||
write_enable=YES
|
||||
anon_root=/home/DEIN_USER/.local/share/dolphin-ftp-root
|
||||
local_root=/home/DEIN_USER/.local/share/dolphin-ftp-root
|
||||
chroot_local_user=YES
|
||||
allow_writeable_chroot=YES
|
||||
pasv_enable=YES
|
||||
```
|
||||
|
||||
Danach: `sudo systemctl restart vsftpd`
|
||||
|
||||
### Helper-Script installieren
|
||||
|
||||
```bash
|
||||
sudo cp scripts/dolphin-ftp-share /usr/local/bin/
|
||||
sudo chmod +x /usr/local/bin/dolphin-ftp-share
|
||||
```
|
||||
|
||||
### sudo für Bind-Mounts erlauben
|
||||
|
||||
Das Helper-Script nutzt `sudo mount --bind` und `sudo umount`, um Ordner in das FTP-Root einzubinden (Symlinks funktionieren nicht in vsftpd's chroot-Umgebung).
|
||||
|
||||
Damit das ohne Passwort-Eingabe funktioniert:
|
||||
|
||||
```bash
|
||||
sudo visudo -f /etc/sudoers.d/dolphin-ftp-share
|
||||
```
|
||||
|
||||
Folgendes eintragen (DEIN_USER ersetzen):
|
||||
|
||||
```
|
||||
DEIN_USER ALL=(root) NOPASSWD: /usr/bin/mount --bind *
|
||||
DEIN_USER ALL=(root) NOPASSWD: /usr/bin/umount /home/DEIN_USER/.local/share/dolphin-ftp-root/*
|
||||
```
|
||||
|
||||
## Versionen
|
||||
|
||||
| Verzeichnis | Zielplattform | KDE Frameworks | Qt |
|
||||
|---|---|---|---|
|
||||
| `kf5/` | Debian 12 Bookworm | KF5 | Qt5 |
|
||||
| `kf6/` | Debian 13 Trixie | KF6 | Qt6 |
|
||||
|
||||
Der C++ Quellcode ist identisch — nur die CMake-Konfiguration unterscheidet sich.
|
||||
|
||||
## Build & Installation
|
||||
|
||||
### Debian 12 (KF5)
|
||||
|
||||
**Build-Dependencies:**
|
||||
|
||||
```bash
|
||||
sudo apt install build-essential cmake extra-cmake-modules \
|
||||
libkf5kio-dev libkf5coreaddons-dev libkf5i18n-dev \
|
||||
qtbase5-dev
|
||||
```
|
||||
|
||||
**Bauen:**
|
||||
|
||||
```bash
|
||||
cd kf5
|
||||
bash build.sh
|
||||
```
|
||||
|
||||
**Installieren:**
|
||||
|
||||
```bash
|
||||
sudo cp build/bin/ftpshareplugin.so \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/propertiesdialog/
|
||||
```
|
||||
|
||||
**Dolphin neustarten:**
|
||||
|
||||
```bash
|
||||
killall dolphin; dolphin &
|
||||
```
|
||||
|
||||
### Debian 13 Trixie (KF6)
|
||||
|
||||
**Build-Dependencies:**
|
||||
|
||||
```bash
|
||||
sudo apt install build-essential cmake extra-cmake-modules \
|
||||
libkf6kio-dev libkf6coreaddons-dev libkf6i18n-dev \
|
||||
qt6-base-dev
|
||||
```
|
||||
|
||||
**Bauen:**
|
||||
|
||||
```bash
|
||||
cd kf6
|
||||
bash build.sh
|
||||
```
|
||||
|
||||
**Installieren:**
|
||||
|
||||
```bash
|
||||
sudo cp build/bin/ftpshareplugin.so \
|
||||
/usr/lib/x86_64-linux-gnu/qt6/plugins/kf6/propertiesdialog/
|
||||
```
|
||||
|
||||
**Dolphin neustarten:**
|
||||
|
||||
```bash
|
||||
killall dolphin; dolphin &
|
||||
```
|
||||
|
||||
## Deinstallation
|
||||
|
||||
```bash
|
||||
# KF5
|
||||
sudo rm /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/propertiesdialog/ftpshareplugin.so
|
||||
|
||||
# KF6
|
||||
sudo rm /usr/lib/x86_64-linux-gnu/qt6/plugins/kf6/propertiesdialog/ftpshareplugin.so
|
||||
|
||||
# Helper-Script
|
||||
sudo rm /usr/local/bin/dolphin-ftp-share
|
||||
```
|
||||
|
||||
## Projektstruktur
|
||||
|
||||
```
|
||||
kde-dolphin-ftp-sharing-tab/
|
||||
├── README.md
|
||||
├── scripts/
|
||||
│ └── dolphin-ftp-share # Helper-Script für Share-Verwaltung
|
||||
├── kf5/ # Debian 12 (KDE Plasma 5)
|
||||
│ ├── CMakeLists.txt
|
||||
│ ├── build.sh
|
||||
│ └── src/
|
||||
│ ├── CMakeLists.txt
|
||||
│ ├── ftpshareplugin.json
|
||||
│ ├── ftpshareplugin.h
|
||||
│ └── ftpshareplugin.cpp
|
||||
└── kf6/ # Debian 13 (KDE Plasma 6)
|
||||
├── CMakeLists.txt
|
||||
├── build.sh
|
||||
└── src/
|
||||
├── CMakeLists.txt
|
||||
├── ftpshareplugin.json
|
||||
├── ftpshareplugin.h
|
||||
└── ftpshareplugin.cpp
|
||||
```
|
||||
|
||||
## Wie es funktioniert
|
||||
|
||||
Das Plugin nutzt das Helper-Script `dolphin-ftp-share`:
|
||||
|
||||
- `dolphin-ftp-share add <name> <path> <anonymous> <acl>` — Freigabe erstellen
|
||||
- `dolphin-ftp-share delete <name>` — Freigabe löschen
|
||||
- `dolphin-ftp-share info` — bestehende Freigaben auflisten
|
||||
|
||||
Das Script speichert Freigabe-Konfigurationen in `~/.local/share/dolphin-ftp-shares/` und erstellt Symlinks in `~/.local/share/dolphin-ftp-root/`. Der FTP-Server (z.B. vsftpd) dient dieses Root-Verzeichnis aus.
|
||||
|
||||
### Konfigurationsformat
|
||||
|
||||
Jede Freigabe wird als `.conf`-Datei gespeichert:
|
||||
|
||||
```ini
|
||||
path=/pfad/zum/ordner
|
||||
anonymous=y
|
||||
user_acl=user1:rw,user2:ro
|
||||
```
|
||||
|
||||
### Berechtigungen
|
||||
|
||||
| Level | Beschreibung |
|
||||
|---|---|
|
||||
| `ro` | Read Only — nur Download |
|
||||
| `rw` | Read-Write — Upload und Download |
|
||||
|
||||
## Lizenz
|
||||
|
||||
GPLv2+
|
||||
Reference in New Issue
Block a user