Chocobozzz / Chocobozzz/PeerTube
Video unblock (DELETE /videos/{id}/blacklist) destroys all moderation history with no actor record
- Dominant language
- TypeScript
- Stars
- 15.3k
- Forks
- 1.8k
- Avg merge
- 8d 8h
- Merged PRs (30d)
- 2
Description
### Describe the problem to be solved
When a moderator unblocks a video via DELETE /videos/{id}/blacklist, the block record is permanently deleted. There is no record that a block ever existed, no record of who placed the block, no record of who removed it, and no timestamp for either action.
This is a correctness problem for any deployment where moderation accountability matters. The auto-blacklist feature (type: 2, AUTO_BEFORE_PUBLISHED) is specifically designed for institutional use — it holds all uploaded content for moderator review before it becomes public. This is a common requirement in K-12, higher education, and enterprise deployments. When a moderator approves a held video by calling the unblock endpoint, there is zero record that any human reviewed it. The video goes from held to public with no audit trail whatsoever.
The abuse report system has full actor attribution, timestamps, and message history — but it is semantically wrong to use it here. A video held for pre-publication review is not an abuse report. There is currently no correct mechanism in PeerTube to record who approved a held video and when.
Moderator accountability for publish/block decisions is not an optional feature — it is a basic expectation of any content moderation system, and is often a compliance requirement for institutions using PeerTube in managed environments.
### Describe the solution you would like
The DELETE /videos/{id}/blacklist endpoint should be replaced with PUT /videos/{id}/blacklist, following the same pattern already established by PUT /abuses/{id}.
The PUT endpoint should accept a body with:
• blocked: Boolean — the new state
• reason: String? — optional note from the moderator
The block record should never be deleted. Each state transition should persist:
• The authenticated actor (account) performing the action
• A timestamp of the action
• The reason if provided
This gives administrators a complete, tamper-evident history of who blocked a video, who approved it, and when — across every state change.
GET /videos/blacklist should continue to return only currently-active blocks by default. An additional parameter (e.g. includeHistory=true) or a dedicated GET /videos/{id}/blacklist/history endpoint should expose the full transition log, with each entry containing account, createdAt, blocked, and reason.
This is not a new concept in PeerTube — the abuse report system already handles moderation state transitions correctly, recording actor and timestamp on each update. The video block system should be consistent with it.
Contributor guide
Research direction
Start by inspecting the DELETE /videos/{id}/blacklist endpoint and compare its behavior with PUT /abuses/{id}. Define how the PUT body, persisted actor and timestamp history, and active-only GET response should work, including whether history uses a parameter or a dedicated endpoint. Done means block transitions retain account, createdAt, blocked, and reason data and the API exposes current blocks and history as specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100