feat: add paywall visibility mode for repositories #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nobody/showcase-visibility"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.