#302 add name field for uploads

This commit is contained in:
Alan Grainger
2026-10-19 15:43:29 +13:00
parent b1e053426f
commit a620d0b3ae
19 changed files with 257 additions and 24 deletions
+22 -3
View File
@@ -98,6 +98,22 @@ Set it to `""` to hide it.
The text is shown exactly as written, without HTML or links, so you can translate it into your gallery's language. The
reason for the delay is explained in [When do uploads appear](/visitor-uploads#when-do-uploads-appear).
### `askName`
**Type:** `bool` · **Default:** `true`
Whether the upload page has an optional "Your name" field. The name goes into each stored filename between the prefix
and the original name, followed by a comma, so `IMG_0042.jpg` from Jane Smith is stored as
`ipp_upload_jane-smith,IMG_0042.jpg`. A file sent without a name is stored as `ipp_upload_IMG_0042.jpg`, with no
comma. The visitor's browser remembers the name for the next share on the same install. With `false`, the field is
not shown and a name sent anyway is ignored.
The name is stored as a slug: lower case, letters and digits in any script, and a hyphen for anything else, at most 32
characters. A comma in the visitor's own filename is removed, so the comma always marks the end of the name. A
filename that already carries the prefix gets neither the prefix nor the name again. The name is the visitor's own
claim; IPP cannot check it. For what to do with it, see
[Find each visitor's uploads](/tag-and-review-uploads#find-each-visitors-uploads).
### `notifyUrl`
**Type:** `string` · **Default:** `""`
@@ -111,13 +127,14 @@ token in the URL never reaches the log.
```json
{
"title": "Photo sent to Holiday 2025",
"message": "ipp_upload_IMG_0042.jpg (3.0 MB) was uploaded to Holiday 2025.",
"message": "ipp_upload_jane-smith,IMG_0042.jpg (3.0 MB) was uploaded to Holiday 2025 by jane-smith.",
"data": {
"event": "upload",
"time": "2026-10-05T07:18:00.000Z",
"share": { "type": "album", "id": "9f1c…", "title": "Holiday 2025" },
"file": { "name": "ipp_upload_IMG_0042.jpg", "size": 3145728, "type": "image/jpeg" },
"asset": { "id": "4b2e…", "status": "created" }
"file": { "name": "ipp_upload_jane-smith,IMG_0042.jpg", "size": 3145728, "type": "image/jpeg" },
"asset": { "id": "4b2e…", "status": "created" },
"uploader": "jane-smith"
}
}
```
@@ -126,6 +143,8 @@ token in the URL never reaches the log.
album ID or the shared link ID.
- `asset.status` is `created`, or `duplicate` when the owner already had the same file. Immich adds a duplicate to the
share too.
- `uploader` is the visitor's name as it appears in the filename, or `""` when the visitor gave none or
[`askName`](#askname) is off.
- The body never contains the share key, the custom URL or a password.
ntfy reads the two fields through its inline templates:
+31 -1
View File
@@ -22,7 +22,37 @@ IPP talks to Immich with the visitor's share key and nothing else. Immich lets a
store a file into the share. Every tag endpoint needs an API key with tag permissions. The upload service holds no
API key, and giving one to a service that faces the public would let that service change your library.
There are some other options under discussion in [GitHub discussion #302](https://github.com/alangrainger/immich-public-proxy/discussions/302). Feedback is welcome.
A sidecar file could carry a tag without an API key, but Immich reads a sidecar's keywords in place of the
photo's own, so a visitor's existing keywords would be lost. The filename keeps the photo's metadata untouched.
## Find each visitor's uploads
The upload page asks each visitor for their name (see [`upload.askName`](/config/upload-service#askname)). A name
given is stored in the filename between the prefix and the original name, with a comma after it, as
`ipp_upload_jane-smith,IMG_0042.jpg`. So in Immich:
- Search for `ipp_upload_jane-smith,` to see everything Jane sent.
- Add a workflow per visitor to tag or sort their uploads: **Filter by filename**, match type `startsWith`, pattern
`ipp_upload_jane-smith,`, then **Add Tags** with a tag such as `Uploaded/Jane Smith`.
The comma matters: without it, `ipp_upload_jane` would also match `jane-smith` and `janet`. The name is whatever the
visitor typed, made lower case with hyphens for spaces and punctuation. A visitor who leaves the field empty is stored
with the prefix alone and no comma. A visitor can type any name, so treat it as a label, not proof.
### Why a comma
The filename is `<prefix><fields><original>`, where each field is followed by a comma. The separator had to be one
that a visitor's own filename never keeps, so that a stem with no comma has no fields, and otherwise the last comma
ends them. An underscore cannot do that: `ipp_upload_photo_1.jpg` would read as a visitor called `photo`. A tilde
was ruled out because Android names an edited photo `IMG_1234~2.jpg`. A comma is typeable, legal on every file
system, never written by a camera or a phone, and only rarely by a person. When a visitor's filename does contain
one, it is removed.
The fields are positional so that more can be added later, such as an event code the owner hands out. A new field
goes on the end, an empty one is written empty, and a file with no fields at all has no comma. So a future
`ipp_upload_jane-smith,34,IMG_0042.jpg` and `ipp_upload_,34,IMG_0042.jpg` would sit beside today's names, and a
script that splits on the comma reads all of them: the last piece is the original filename, the rest are the fields
in order.
## Review uploads before they appear
+6 -1
View File
@@ -47,6 +47,10 @@ What the owner sees in Immich:
- Each file name starts with `ipp_upload_`, so visitor uploads are easy to find in search or to
[tag with a workflow](/tag-and-review-uploads#tag-uploaded-photos). The prefix can be changed or
[turned off](/config/upload-service#filenameprefix).
- The upload page asks for the visitor's name, optionally. A name given is stored in the filename after the prefix,
as `ipp_upload_jane-smith,IMG_0042.jpg`, so you can see who sent what and
[find each visitor's uploads](/tag-and-review-uploads#find-each-visitors-uploads). The field can be
[turned off](/config/upload-service#askname).
- The owner removes unwanted files in Immich, like any other photo.
Other visitors see the new photos in the gallery within a few minutes. See
@@ -344,7 +348,8 @@ they reach the gallery, use a [review workflow](/tag-and-review-uploads#review-u
### Can visitors see who uploaded what, or remove photos
No. The upload page shows nothing from the share, only the visitor's own uploads in progress, and nothing can be
deleted or edited from it. The owner manages uploads in Immich.
deleted or edited from it. The owner manages uploads in Immich. The name a visitor types is stored in the filename
for the owner, and is not shown to other visitors.
### Why is uploading a separate container