A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
docs: document signed downloads and lifetime gift codes
Hampus1cb906553538
diff --git a/fluxer_docs/src/content/docs/admin-api/archives.mdx b/fluxer_docs/src/content/docs/admin-api/archives.mdxindex 9a4eaf315..307afb4ce 100644--- a/fluxer_docs/src/content/docs/admin-api/archives.mdx+++ b/fluxer_docs/src/content/docs/admin-api/archives.mdx@@ -75,8 +75,6 @@ An archive is in one of these lifecycle states. It is building while `completed_| user | The archive captures one user account || guild | The archive captures one guild |-[List archives](#list-archives) also accepts `all` as a filter value, and it is the default there. No path segment accepts it.-## Archive download objectThis object uses camelCase field names, unlike every other Admin response body.@@ -88,7 +86,7 @@ This object uses camelCase field names, unlike every other Admin response body.| downloadUrl<sup>1</sup> | string | The time-limited URL the archive file is fetched from || expiresAt<sup>2</sup> | ISO8601 timestamp | The time this URL stops working |-<sup>1</sup> The URL is a presigned object storage link with no Admin credential, so possession of it grants access until it expires+<sup>1</sup> A presigned object storage link, or a [signed download](#download-signed-file) link on the API while presigned harvest downloads are disabled. Neither carries an Admin credential, so possession of it grants access until it expires<sup>2</sup> The value is seven days after the grant was issued, regardless of the archive's own `expires_at`@@ -202,14 +200,6 @@ Issues a temporary download URL for a completed archive. Returns an [archive dowThe URL has its own signature and works for seven days for anyone who holds it. It is bound to no Admin account, and no operation revokes it. Each repeat of the operation issues a further independent grant.:::-### Path parameters--| Field | Type | Description |-| --- | --- | --- |-| subject_type | string | The [archive subject type](#archive-subject-types), either `user` or `guild` |-| subject_id | snowflake | The user or guild the archive was taken of |-| archive_id | snowflake | The ID of a completed archive |-### Response| Status | Body | Condition |@@ -225,10 +215,61 @@ The URL has its own signature and works for seven days for anyone who holds it.### Side effects-The operation creates a presigned download URL valid for seven days and changes no field of the archive, including `download_url_expires_at`.+The operation creates a download URL valid for seven days and changes no field of the archive, including `download_url_expires_at`. While presigned harvest downloads are disabled, which is the self-hosted default, the URL points at [Download signed file](#download-signed-file) on the public API endpoint instead of object storage.The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `get_archive_download_url`, target type equal to `subject_type`, target ID equal to `subject_id`, and metadata key `archive_id`. The entry has no URL. A request that returns 400 or 404 records no entry.### Rate limit200 requests per minute for each authenticated user, on the `admin:lookup` bucket.++## Download signed file++<RouteHeader method="GET" path="/v1/signed-downloads/{filename}" unauthenticated />++Streams an archive or a file kept with a report, from a link the Admin API issued in place of a presigned object storage link.++[Create archive download](#create-archive-download), and the attachment and profile image URLs of a [report](/admin-api/reports/), use this route while presigned harvest downloads are disabled. The `token` query parameter names the stored file and its expiry, and is signed by the instance. Use the complete issued URL and keep it secret.++:::note[Every rejection looks identical]+A missing, malformed, forged, or expired token and an object that no longer exists all return 404 with the plain text body `Not Found`. So does every request while the instance issues presigned URLs.+:::++### Path parameters++| Field | Type | Description |+| --- | --- | --- |+| filename | string | File name the download is saved as (1-512 characters) |++### Query parameters++| Field | Type | Description |+| --- | --- | --- |+| token | string | Signed download token issued with the link (1-2,048 characters) |++### Request headers++| Field | Type | Description |+| --- | --- | --- |+| Range? | string | Standard byte range, answered with 206 and a `Content-Range` header |++### Response++| Status | Body | Condition |+| --- | --- | --- |+| 200 | file bytes | The complete file was streamed |+| 206 | file bytes | The requested byte range was streamed |+| 404 | `Not Found` | The token is missing, invalid, or expired, the file is gone, or the instance issues presigned URLs instead |+| 416 | `Range Not Satisfiable` | The requested range lies outside the file |++### Response headers++The 200 has the stored `Content-Type`, `Content-Disposition: attachment` with the file name from the path, `Content-Length`, `Accept-Ranges: bytes`, `Cache-Control: private, no-store`, `X-Content-Type-Options: nosniff`, and a sandboxing `Content-Security-Policy`. The 206 adds `Content-Range`.++### Side effects++The file is read and streamed. The token is not consumed, so it stays usable until its own expiry, which is seven days for an archive and five minutes for a report file.++### Rate limit++60 requests per minute for each client IP address, or for the authenticated account when the request has a resolvable credential, on the `user:harvest:download_file` bucket.diff --git a/fluxer_docs/src/content/docs/admin-api/gift-codes.mdx b/fluxer_docs/src/content/docs/admin-api/gift-codes.mdxindex f9a753403..063e1fc20 100644--- a/fluxer_docs/src/content/docs/admin-api/gift-codes.mdx+++ b/fluxer_docs/src/content/docs/admin-api/gift-codes.mdx@@ -16,7 +16,7 @@ A self-hosted instance whose [premium mode](/admin-api/instance/#premium-modes)## Gift duration units-The unit and the quantity together define the span a redeemed code grants. At redemption, Fluxer adds the span to the entitlement anchor, which is the latest of the current time, the end of the redeemer's premium, and the end of any earlier gift extension. Lifetime gifts are not supported.+The unit and the quantity together define the span a redeemed code grants. At redemption, Fluxer adds the span to the entitlement anchor, which is the latest of the current time, the end of the redeemer's premium, and the end of any earlier gift extension. A `lifetime` code grants premium that never ends instead.| Value | Description || --- | --- |@@ -24,9 +24,12 @@ The unit and the quantity together define the span a redeemed code grants. At re| weeks | The quantity counts weeks added to the entitlement anchor || months<sup>1</sup> | The quantity counts calendar months added to the entitlement anchor || years<sup>1</sup> | The quantity counts calendar years, applied as twelve calendar months each |+| lifetime<sup>2</sup> | The code grants lifetime premium, and the quantity is ignored |<sup>1</sup> A calendar month is added in UTC and clamped to the last day of the target month, so an anchor of 31 January extended by one month lands on 28 or 29 February+<sup>2</sup> Accepted only when generating codes. The stored code reports `duration_type` `months` with `duration_quantity` `0`, the shape every lifetime gift has, and a redeemer who already has lifetime premium cannot redeem it. Redeeming one takes no lifetime sequence number, so the redeemer's `premium_lifetime_sequence` stays null+## Create gift codes<RouteHeader method="POST" path="/v1/admin/gift-codes" auditReason />@@ -39,7 +42,7 @@ Generates the requested number of unredeemed gift codes. Requires `gift_codes:ge| --- | --- | --- || count | integer | The number of codes to generate (1-100) || duration_type | string | The [gift duration unit](#gift-duration-units) the quantity is counted in |-| duration_quantity | integer | The quantity of the selected unit (1-3650) |+| duration_quantity | integer | The quantity of the selected unit (1-3650), ignored for `lifetime` |### Response body@@ -70,15 +73,3 @@ Generates the requested number of unredeemed gift codes. Requires `gift_codes:ge:::caution[The codes are returned once]Reading a code back requires presenting it to [Get gift](/http-api/gifts/#get-gift), so a lost response cannot be recovered.:::--### Side effects--Each code is 32 characters drawn from the uppercase letters, the lowercase letters, and the digits. Fluxer creates it unredeemed and records the system account with ID `0` as its creator, which is the creator the [gift object](/http-api/gifts/#gift-object) reports to the redeemer.--A failed request can leave some codes redeemable without returning them. Retrying can therefore create additional codes.--The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `generate_gift_codes`, target type `gift_code`, target ID `0`, and metadata keys `count`, `duration_type`, and `duration_quantity`. The codes are not recorded. It emits no Gateway Dispatch.--### Rate limit--30 requests per minute for each authenticated user, on the `admin:code:generation` bucket.diff --git a/fluxer_docs/src/content/docs/admin-api/jobs.mdx b/fluxer_docs/src/content/docs/admin-api/jobs.mdxindex 114f918da..bb891c582 100644--- a/fluxer_docs/src/content/docs/admin-api/jobs.mdx+++ b/fluxer_docs/src/content/docs/admin-api/jobs.mdx@@ -16,8 +16,6 @@ Mention processing, link previews, announcement delivery and copy updates, messa## Admin job object-One object describes one recorded job. These routes can only change `cancel_requested`.-### Structure| Field | Type | Description |@@ -126,7 +124,7 @@ The queue drops a job 7 days after it was queued. A job still recorded as `queueUse the returned `task_type` value to filter [List jobs](#list-jobs).-The tasks queued by [Bulk jobs](/admin-api/bulk-jobs/) are `bulkUpdateUserFlags`, `bulkUpdateGuildFeatures`, `bulkAddGuildMembers`, and `bulkScheduleUserDeletion`. `harvestUserData` and `harvestGuildData` build [archives](/admin-api/archives/), `sendSystemDm` delivers a [system DM broadcast](/admin-api/system-dms/), and `refreshSearchIndex` rebuilds a [search index](/admin-api/search-indexes/). `guildProcessDeletion` removes the records of a deleted guild after [Delete guild](/admin-api/guilds/#delete-guild) or the owner deletes it. `removeChannelFollowers` runs on the `crosspost` lane after an announcement channel is deleted or converted into a text channel, and removes the channel follower webhooks that follow it.+The tasks queued by [Bulk jobs](/admin-api/bulk-jobs/) are `bulkUpdateUserFlags`, `bulkUpdateGuildFeatures`, `bulkAddGuildMembers`, and `bulkScheduleUserDeletion`. `harvestUserData` and `harvestGuildData` build [archives](/admin-api/archives/), `sendSystemDm` delivers a [system DM broadcast](/admin-api/system-dms/), `refreshSearchIndex` rebuilds a [search index](/admin-api/search-indexes/). `guildProcessDeletion` removes the records of a deleted guild after [Delete guild](/admin-api/guilds/#delete-guild) or the owner deletes it. `removeChannelFollowers` runs on the `crosspost` lane after an announcement channel is deleted or converted into a text channel, and removes the channel follower webhooks that follow it.Thread work runs on the `batch` lane. `deleteChannelThreads` deletes the threads of a deleted parent channel, `removeThreadMembershipsForGuildMember` removes the thread memberships of a user who is no longer a guild member, and `syncThreadSearchDocument` and `backfillThreadSearch` keep the thread search index current. `archiveInactiveThreads` runs every minute with no job record and archives the threads whose auto archive time has passed. `repairThreadIndexes` rebuilds the thread list entries of the threads it names. `seedThreadPermissions` runs once for a guild. It clears the thread permission bits from every overwrite mask. It then adds `CREATE_PUBLIC_THREADS`, `CREATE_PRIVATE_THREADS`, and `SEND_MESSAGES_IN_THREADS` to each overwrite mask that has `SEND_MESSAGES`, and to the everyone role when that role has `SEND_MESSAGES`.@@ -254,8 +252,6 @@ Requests cooperative cancellation of a job and reports whether the request was r| --- | --- | --- || cancelled | boolean | Whether a cancellation request was recorded |-Returns false for a missing or terminal job. Repeating a request for a queued or running job returns true.-### Response| Status | Body | Condition |diff --git a/fluxer_docs/src/content/docs/admin-api/reports.mdx b/fluxer_docs/src/content/docs/admin-api/reports.mdxindex a9682c180..77270ea7e 100644--- a/fluxer_docs/src/content/docs/admin-api/reports.mdx+++ b/fluxer_docs/src/content/docs/admin-api/reports.mdx@@ -465,19 +465,6 @@ One entry of the [report reason](/http-api/reports/#report-reasons) catalogue, a| legacy_category_user | string | The category a user report stores || legacy_category_guild | string | The category a guild report stores |-### Example--```json-{- "key": "csam",- "label": "Child sexual abuse material",- "highest_priority": true,- "legacy_category_message": "child_safety",- "legacy_category_user": "child_safety",- "legacy_category_guild": "child_safety"-}-```-## Report resolution objectA report resolution is the reduced view [Update report](#update-report) returns. It has the fields the update writes and nothing else.@@ -512,16 +499,6 @@ A report resolution is the reduced view [Update report](#update-report) returns.| legal_hold_until | ?ISO8601 timestamp | When the hold ends, or null when the report has no hold || legal_hold_reason | ?string | Why the report is held, or null when the report has no hold |-### Example--```json-{- "report_id": "1502771904419102720",- "legal_hold_until": "2027-06-30T00:00:00.000Z",- "legal_hold_reason": "Preservation request from a court"-}-```-## Report note objectA note is internal context a staff member adds to a report. Notes are staff only. Fluxer never shows them to the reporter or the reported account, and never puts them in a notice, email or direct message. A note never changes once it is written. Notes have no retention period of their own and are deleted together with the report.@@ -535,17 +512,6 @@ A note is internal context a staff member adds to a report. Notes are staff only| body | string | The note || created_at | ISO8601 timestamp | When it was written |-### Example--```json-{- "note_id": "1502771904419102999",- "author_id": "1483920011884392001",- "body": "Reporter sent more context by email",- "created_at": "2026-03-05T09:14:02.118Z"-}-```-## Report retentionA pending report is kept until it is resolved. Once a report is resolved, Fluxer deletes it when its retention period ends, together with its notes and its stored evidence: the captured message context, the profile snapshot and its images, the attachment copies, and its search index entry. The reporter's duplicate-report reservation for it goes too, so the reporter can report the same message, account or guild again.@@ -563,7 +529,7 @@ An evidence copy that a retained report also uses is kept for that report.The job runs once a day in `worker`. Each run logs one `Processed report retention` line with the counts it found, deleted and cleared and the periods it used. A report that fails to delete or clear keeps its record and is retried on the next run. [Delete report](#delete-report) deletes one report straight away.:::caution[Deleted evidence cannot be restored]-Retention deletes for real unless `FLUXER_REPORT_RETENTION_DRY_RUN` is `true` on `worker`. In a dry run each run only counts what it would delete or clear and changes nothing. The [operator configuration](/operator/configuration/#moderation-and-abuse) describes the two settings.+Retention deletes for real unless `FLUXER_REPORT_RETENTION_DRY_RUN` is `true` on `worker`. In a dry run each run only counts what it would delete or clear and changes nothing.:::## List reports@@ -748,7 +714,7 @@ The report moves to RESOLVED and records `resolved_at`, `resolved_by_admin_id`,Fluxer records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with target type `report`, target ID equal to the report ID, and action `resolve_report`. The metadata is `report_id`, `report_type`, `notify_reporter`, `reporter_dm_sent`, `reporter_email_sent`, `reporter_dsa_email_sent`, `resolution`, `duplicate_of` for a duplicate, and `outcome`, which a duplicate of a report with no outcome leaves out. When Fluxer does not attempt a notice, `reporter_notice_skipped` names the reason: `reporter_account_deleted`, `reporter_report_banned`, `reporter_lookup_failed`, `no_reporter_email`, or `duplicate_outcome_unknown`.-Fluxer tells the reporter the decision about the item they reported: that the content was removed, that the account was restricted without saying how, that action was taken without saying what, or that it broke no rule and was left as it is. A reporter with an account receives a system direct message, and an email when the account has an address. A Digital Services Act notice has no reporter account, so its verified address receives the same decision by email. Each notice gives the report ID, the comment when one is shared, and on hosted instances how to appeal within 60 days and the EU redress routes. It never names a decision, a sanction or the other account's history. Nothing is sent when the reporter account is deleted, or was barred from reporting when the report was filed.+Fluxer tells the reporter the decision about the item they reported: that the content was removed, that the account was restricted without saying how, that action was taken without saying what, or that it broke no rule and was left as it is. A reporter with an account receives a system direct message, and an email when the account has an address. A Digital Services Act notice has no reporter account, so its verified address receives the same decision by email. Each notice gives the report ID and the comment when one is shared. It never names a decision, a sanction or the other account's history. Nothing is sent when the reporter account is deleted, or was barred from reporting when the report was filed.A reporter who does not already have the system channel open receives [Channel Create](/gateway/events/#channel-create), and every session of the reporter receives [Message Create](/gateway/events/#message-create). Fluxer logs a delivery failure, and the request still succeeds.diff --git a/fluxer_docs/src/content/docs/http-api/reports.mdx b/fluxer_docs/src/content/docs/http-api/reports.mdxindex 3fcc22dd8..e0cb923f2 100644--- a/fluxer_docs/src/content/docs/http-api/reports.mdx+++ b/fluxer_docs/src/content/docs/http-api/reports.mdx@@ -127,8 +127,6 @@ A submission stores the locale the reporter saw, resolved the same way from its## Report flow object-[Get report flow](#get-report-flow) returns every screen of one variant in this object.-### Structure| Field | Type | Description |@@ -144,12 +142,10 @@ A submission stores the locale the reporter saw, resolved the same way from its<sup>1</sup> 16 lowercase hexadecimal characters-<sup>2</sup> The guidelines URL the operator set. Without one, a hosted instance links its own guidelines page and a self-hosted instance has null. A client links its summary disclaimer to it+<sup>2</sup> The guidelines URL the operator set, or null without one. A client links its summary disclaimer to it### Example-An abridged user flow:-```json{"target_type": "user",@@ -157,24 +153,8 @@ An abridged user flow:"revision_hash": "9c41d2a07e5b18f3","locale": "en-US","start_screen_id": "profile_intro",- "guidelines_url": "https://fluxer.app/guidelines",+ "guidelines_url": "https://example.com/guidelines","screens": [- {- "id": "profile_intro",- "title": "Report profile",- "subtitle": "Tell us what's wrong with this profile. They won't be told who reported them.",- "urgent": false,- "options": [- {- "id": "learn_more",- "label": "Read the Fluxer Community Guidelines",- "outcome": {"type": "link", "screen_id": null, "reason": null, "notice_id": null, "url": "https://fluxer.app/guidelines"}- }- ],- "options_heading": "Learn more",- "checklist": null,- "next_screen_id": "profile_parts"- },{"id": "profile_parts","title": "Which parts of their profile are a problem?",@@ -206,8 +186,6 @@ An abridged user flow:## Report flow screen object-One question, checklist, or information page in a [report flow](#report-flows).-### Structure| Field | Type | Description |@@ -221,8 +199,6 @@ One question, checklist, or information page in a [report flow](#report-flows).| checklist | ?[report flow checklist](#report-flow-checklist-object) object | The checklist, set only on a checklist screen || next_screen_id | ?string | The screen the Next button leads to, set only on an info screen |-<sup>1</sup> Empty on a checklist screen, and holding only link options on an info screen-## Report flow option object### Structure@@ -247,8 +223,6 @@ Every member is always present. The members that do not apply to `type` are null| notice_id | ?string | The notice to show when `type` is `end`, or null for the thank-you screen || url | ?string | The page to open when `type` is `link` |-<sup>1</sup> A plain string, so a client MUST tolerate a reason the [catalogue](#report-reasons) does not list yet-## Report flow checklist object### Structure@@ -308,8 +282,6 @@ One answered screen in a submission. A submission lists its steps in walk order.## Report object-Fluxer returns this receipt when it records a submission.-### Structure| Field | Type | Description |@@ -334,8 +306,6 @@ Fluxer returns this receipt when it records a submission.## Success object-The fixed acknowledgement returned by [Send DSA report email](#send-dsa-report-email).-### Structure| Field | Type | Description |@@ -352,8 +322,6 @@ The fixed acknowledgement returned by [Send DSA report email](#send-dsa-report-e## Ticket object-The single credential [Create DSA report](#create-dsa-report) accepts. Fluxer binds the ticket to the verified address it was issued for, and that address becomes the reporter identity on the resulting notice.-### Structure| Field | Type | Description |@@ -500,8 +468,6 @@ A user report only ever stores `harassment`, `hate_speech`, `spam_account`, `imp## EU country codes-No instance configuration changes this registry. A value outside it returns 400 `INVALID_FORM_BODY`.-| Value | Description || --- | --- || AT | Austria |