Skip to content

Commit 6edb1ba

Browse files
committed
docs(faq): update FTP/SFTP section for async upload queue
- Remove obsolete 'folder' and 'urlTemplate' config fields - Document SFTP support and type selector - Explain async upload queue (SQLite-backed, background worker) - Add systemd service setup and manual worker commands - Describe random remote filenames, directory listing protection - Document automatic QR URL building (no template needed) - Describe online gallery features: spinner, share button, lightbox nav - Add 'Delete on local delete' subsection
1 parent a7a8304 commit 6edb1ba

File tree

1 file changed

+54
-21
lines changed

1 file changed

+54
-21
lines changed

docs/faq/index.md

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -356,38 +356,71 @@ and enter/adjust the @chromium-browser entries as followed (adjust the value _19
356356

357357
---
358358

359-
## How does the connection to the FTP server work?
359+
## How does the connection to the FTP/SFTP server work?
360360

361-
The connection to the FTP server needs 4 distinct properties.
361+
### Connection settings
362362

363-
- `baseURL` which is the url where all requests will be made
364-
- `port` for ssl connection (the default value is 21)
365-
- `username` the username of the user authorized to interact to the FTP server
366-
- `password` the password of the user
363+
The following properties are required to connect to the remote server:
367364

368-
With these four variables you can test the connection to the FTP server to check if everything is alright.
365+
- `type` — protocol: `ftp` (default) or `sftp`
366+
- `baseURL` — hostname or IP address of the server
367+
- `port` — port number (default: `21` for FTP, `22` for SFTP)
368+
- `username` — username authorized to access the server
369+
- `password` — password for that user (stored encrypted on disk)
369370

370-
The next variables are for the place where you want the pictures to be stored:
371+
Use **Test Connection** in the admin panel to verify the credentials before saving.
371372

372-
- `baseFolder` is the folder of your website (if you have multiple websites living on the server with this property you can choose on which of these the file should be stored)
373-
- `folder` the folder dedicated to the upload of the files
374-
- `title` if you are doing an event you can set the title of the event to create another folder (the system will slugify the string)
373+
### Storage location
375374

376-
In the end the processed picture, and the thumbnails, will be uploaded in the folder according to these variables.
375+
- `baseFolder` — root folder on the server where all files are stored (e.g. `photobooth` or `www/gallery`). You can browse available folders using the folder picker in the admin panel.
376+
- `title` — optional event title; used as the page title of the online gallery
377377

378-
If you have a website, you can use the following variables to generate the qr codes that will point to the photos uploaded to the ftp server
378+
Photos are stored inside `<baseFolder>/images/` and thumbnails inside `<baseFolder>/thumbs/` using privacy-preserving random filenames so the original file names are never exposed on the server.
379379

380-
- `useForQr` to enable this functionality
381-
- `website` accessible from the internet, it will be the base of the qr code link
382-
- `urlTemplate` starting from the previous set of variables, you have to define the template which will be used to generate the qrcode link (each variable should be written whit '%' before e.g. %website/%folder/%date)
380+
### QR code integration
383381

384-
Last but not least you can upload a php file on the `title` folder on the FTP server to create an online gallery which is updated with every new picture (and collage) taken.
385-
The variable to manage this feature are the following:
382+
- `useForQr` — when enabled, QR codes point to the remote gallery instead of the local Photobooth
383+
- `website` — publicly accessible base URL of the remote server (e.g. `https://example.com`)
386384

387-
- `create_webpage` to enable this functionality
388-
- `template_location` which is the location of the index.php file, which is formatted with the title of the current event and uploaded to the FTP server
385+
The QR code URL is built automatically as `<website>/<baseFolder>/?img=<remote-filename>`. No manual URL template is required.
389386

390-
In the end you can enable the `delete` functionality that will delete photos (and collages) from the ftp server when they are deleted from the photobooth gallery (no admin reset)
387+
### Online gallery
388+
389+
- `create_webpage` — when enabled, Photobooth uploads a ready-to-use PHP gallery (`index.php` and `config.inc.php`) to the `baseFolder` on the server. The gallery is updated with every new photo.
390+
- `template_location` — path to the local `index.php` template that is uploaded (default: `resources/template/index.php`)
391+
392+
The gallery shows photos sorted newest-first and supports single-image deep links via `?img=<filename>`. While a photo is still being uploaded the visitor sees a spinner; the page reloads automatically once the image is available. A native share button (Web Share API) and a lightbox with keyboard navigation are included.
393+
394+
Directory listing for `images/` and `thumbs/` is blocked by `index.php` redirect guards that are uploaded automatically.
395+
396+
### Async upload queue
397+
398+
Uploads run **asynchronously** in a background worker so the Photobooth UI is never blocked while files are transferred. After a photo is taken, a job is added to a local SQLite queue. The worker processes jobs one by one and retries up to 5 times on failure.
399+
400+
To run the worker as a persistent background service, copy the provided systemd unit and enable it:
401+
402+
```bash
403+
sudo cp resources/config/photobooth-upload-worker.service /etc/systemd/system/
404+
sudo systemctl daemon-reload
405+
sudo systemctl enable --now photobooth-upload-worker
406+
sudo systemctl status photobooth-upload-worker
407+
```
408+
409+
The worker can also be run manually for testing:
410+
411+
```bash
412+
# Process all pending jobs once and exit
413+
sudo -u www-data php bin/photobooth photobooth:upload:worker --once
414+
415+
# Run continuously (polls every 5 seconds)
416+
sudo -u www-data php bin/photobooth photobooth:upload:worker
417+
```
418+
419+
Upload queue status (pending jobs, failed jobs) is visible in the Photobooth debug panel.
420+
421+
### Delete on local delete
422+
423+
Enable `delete` to automatically remove the photo and thumbnail from the FTP/SFTP server whenever a photo is deleted from the local Photobooth gallery (does not apply to admin reset).
391424

392425
---
393426

0 commit comments

Comments
 (0)