Skip to content

Commit 70a42f6

Browse files
flacoonbandi34
authored andcommitted
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 6d9f8ce commit 70a42f6

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
@@ -362,38 +362,71 @@ and enter/adjust the @chromium-browser entries as followed (adjust the value _19
362362

363363
---
364364

365-
## How does the connection to the FTP server work?
365+
## How does the connection to the FTP/SFTP server work?
366366

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

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

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

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

378-
- `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)
379-
- `folder` the folder dedicated to the upload of the files
380-
- `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)
379+
### Storage location
381380

382-
In the end the processed picture, and the thumbnails, will be uploaded in the folder according to these variables.
381+
- `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.
382+
- `title` — optional event title; used as the page title of the online gallery
383383

384-
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
384+
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.
385385

386-
- `useForQr` to enable this functionality
387-
- `website` accessible from the internet, it will be the base of the qr code link
388-
- `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)
386+
### QR code integration
389387

390-
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.
391-
The variable to manage this feature are the following:
388+
- `useForQr` — when enabled, QR codes point to the remote gallery instead of the local Photobooth
389+
- `website` — publicly accessible base URL of the remote server (e.g. `https://example.com`)
392390

393-
- `create_webpage` to enable this functionality
394-
- `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
391+
The QR code URL is built automatically as `<website>/<baseFolder>/?img=<remote-filename>`. No manual URL template is required.
395392

396-
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)
393+
### Online gallery
394+
395+
- `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.
396+
- `template_location` — path to the local `index.php` template that is uploaded (default: `resources/template/index.php`)
397+
398+
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.
399+
400+
Directory listing for `images/` and `thumbs/` is blocked by `index.php` redirect guards that are uploaded automatically.
401+
402+
### Async upload queue
403+
404+
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.
405+
406+
To run the worker as a persistent background service, copy the provided systemd unit and enable it:
407+
408+
```bash
409+
sudo cp resources/config/photobooth-upload-worker.service /etc/systemd/system/
410+
sudo systemctl daemon-reload
411+
sudo systemctl enable --now photobooth-upload-worker
412+
sudo systemctl status photobooth-upload-worker
413+
```
414+
415+
The worker can also be run manually for testing:
416+
417+
```bash
418+
# Process all pending jobs once and exit
419+
sudo -u www-data php bin/photobooth photobooth:upload:worker --once
420+
421+
# Run continuously (polls every 5 seconds)
422+
sudo -u www-data php bin/photobooth photobooth:upload:worker
423+
```
424+
425+
Upload queue status (pending jobs, failed jobs) is visible in the Photobooth debug panel.
426+
427+
### Delete on local delete
428+
429+
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).
397430

398431
---
399432

0 commit comments

Comments
 (0)