feat: add paywall visibility mode for repositories #1

Open
GrocerPublishAgent wants to merge 1 commit from nobody/showcase-visibility into v15.0.1/forgejo

A paywall repository is a private repository with an IsPaywall flag that
makes it visible in public repo listings and renders the home page
(file list + README) for unauthenticated users, while restricting access
to code files, issues, pull requests, and git clone.

The repo page shows a Code tab with the file tree and README, plus a
call-to-action prompting visitors to join the private group for full
access.

The implementation treats paywall repos as private for permission
purposes (AccessModeNone for anonymous users), with a targeted carve-out
in repoAssignment() to allow the home page to load. File browsing is
blocked when TreePath is set. All other restrictions (clone, issues, PRs,
raw files, archives) are inherited from the existing private repo
permission model.

Allow paywall repos to serve media from docs/img/ on default branch

Non-repo member users can load images referenced in the README
(e.g. docs/img/demo.gif) via the /media endpoint. Access is limited to
flat files under docs/img/ on the repository's default branch only;
other paths, branches, tags, and commit refs remain blocked.

A paywall repository is a private repository with an IsPaywall flag that makes it visible in public repo listings and renders the home page (file list + README) for unauthenticated users, while restricting access to code files, issues, pull requests, and git clone. The repo page shows a Code tab with the file tree and README, plus a call-to-action prompting visitors to join the private group for full access. The implementation treats paywall repos as private for permission purposes (AccessModeNone for anonymous users), with a targeted carve-out in repoAssignment() to allow the home page to load. File browsing is blocked when TreePath is set. All other restrictions (clone, issues, PRs, raw files, archives) are inherited from the existing private repo permission model. Allow paywall repos to serve media from docs/img/ on default branch Non-repo member users can load images referenced in the README (e.g. docs/img/demo.gif) via the /media endpoint. Access is limited to flat files under docs/img/ on the repository's default branch only; other paths, branches, tags, and commit refs remain blocked.
feat: add paywall visibility mode for repositories
Some checks failed
testing / test-e2e (pull_request) Has been cancelled
requirements / merge-conditions (pull_request) Has been cancelled
testing / backend-checks (pull_request) Has been cancelled
testing / frontend-checks (pull_request) Has been cancelled
testing / test-unit (pull_request) Has been cancelled
testing / test-remote-cacher (redis) (pull_request) Has been cancelled
testing / test-remote-cacher (valkey) (pull_request) Has been cancelled
testing / test-remote-cacher (garnet) (pull_request) Has been cancelled
testing / test-remote-cacher (redict) (pull_request) Has been cancelled
testing / test-mysql (pull_request) Has been cancelled
testing / test-pgsql (pull_request) Has been cancelled
testing / test-sqlite (pull_request) Has been cancelled
testing / security-check (pull_request) Has been cancelled
testing / semgrep/ci (pull_request) Has been cancelled
issue-labels / release-notes (pull_request_target) Has been cancelled
adcd769d85
A paywall repository is a private repository with an IsPaywall flag that
makes it visible in public repo listings and renders the home page
(file list + README) for unauthenticated users, while restricting access
to code files, issues, pull requests, and git clone.

The repo page shows a Code tab with the file tree and README, plus a
call-to-action prompting visitors to join the private group for full
access.

The implementation treats paywall repos as private for permission
purposes (AccessModeNone for anonymous users), with a targeted carve-out
in repoAssignment() to allow the home page to load. File browsing is
blocked when TreePath is set. All other restrictions (clone, issues, PRs,
raw files, archives) are inherited from the existing private repo
permission model.

Allow paywall repos to serve media from docs/img/ on default branch

Paywall-restricted users can load images referenced in the README
(e.g. docs/img/demo.gif) via the /media endpoint. Access is limited to
flat files under docs/img/ on the repository's default branch only;
other paths, branches, tags, and commit refs remain blocked.
Author
Owner

You can see my deployment of this feature at https://peoplesgrocers.com/code/comrades

I have customized the label to say Comrades to fit the communism theme of my personal site.

You can see my deployment of this feature at https://peoplesgrocers.com/code/comrades I have customized the label to say Comrades to fit the communism theme of my personal site. <img height="400" src="https://peoplesgrocers.com/img/0510628f-ff4d-4e7d-866a-a43f946a1205.png"/>
Some checks failed
testing / test-e2e (pull_request) Has been cancelled
requirements / merge-conditions (pull_request) Has been cancelled
testing / backend-checks (pull_request) Has been cancelled
testing / frontend-checks (pull_request) Has been cancelled
testing / test-unit (pull_request) Has been cancelled
testing / test-remote-cacher (redis) (pull_request) Has been cancelled
testing / test-remote-cacher (valkey) (pull_request) Has been cancelled
testing / test-remote-cacher (garnet) (pull_request) Has been cancelled
testing / test-remote-cacher (redict) (pull_request) Has been cancelled
testing / test-mysql (pull_request) Has been cancelled
testing / test-pgsql (pull_request) Has been cancelled
testing / test-sqlite (pull_request) Has been cancelled
testing / security-check (pull_request) Has been cancelled
testing / semgrep/ci (pull_request) Has been cancelled
issue-labels / release-notes (pull_request_target) Has been cancelled
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin nobody/showcase-visibility:nobody/showcase-visibility
git switch nobody/showcase-visibility

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch v15.0.1/forgejo
git merge --no-ff nobody/showcase-visibility
git switch nobody/showcase-visibility
git rebase v15.0.1/forgejo
git switch v15.0.1/forgejo
git merge --ff-only nobody/showcase-visibility
git switch nobody/showcase-visibility
git rebase v15.0.1/forgejo
git switch v15.0.1/forgejo
git merge --no-ff nobody/showcase-visibility
git switch v15.0.1/forgejo
git merge --squash nobody/showcase-visibility
git switch v15.0.1/forgejo
git merge --ff-only nobody/showcase-visibility
git switch v15.0.1/forgejo
git merge nobody/showcase-visibility
git push origin v15.0.1/forgejo
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forks/forgejo!1
No description provided.