feat: built-in CDN asset delivery platform #561
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Summary
Add a built-in CDN/asset delivery platform to MokoGitea that serves repository content, release artifacts, and static sites through cacheable HTTP endpoints with proper headers, access control, and analytics. All UI lives within existing MokoGitea repo/org settings and tabs.
Motivation
CDN is a natural extension of a git hosting platform and one of the easiest infrastructure features to meter for commercial licensing (bandwidth, storage, custom domains). Self-hosted alternatives (GitHub Pages, GitLab Pages/Package Registry) charge premium tier pricing for equivalent features.
Feature Scope
Core: CDN Endpoints
/:owner/:repo/cdn/:ref/*filepathserves repo files with properCache-Control,ETag, andContent-TypeheadersRepo-Level UI (new "CDN" tab or sub-tab under Settings)
/docs,/public,/dist, etc.cdn.acme.com) to a repo's CDN endpointOrg-Level UI (under org settings)
Analytics (visible in repo CDN tab)
API for CI/CD
POST /:owner/:repo/cdn/purge)Architecture Notes
cdn_analytics)Commercial Licensing Angle
Update Stream Integration
The CDN system should integrate with the existing update stream infrastructure so repos act as distribution origins, not just code repositories.
Flow
dist/app.js, release binaries, static assets)manifest.xmldefines which files/directories are CDN-published via a new<cdn>block (served paths, cache TTL, access level)manifest.xml CDN block (example)
Why this matters
CDN Settings Page - Remote Address Allowlist
Add a CDN settings page (repo-level and org-level) with an allowed remote addresses configuration to prevent CDN overusage and abuse:
Repo Settings > CDN > Access Control
10.0.0.0/8,203.0.113.0/24)Org Settings > CDN > Defaults