git-pages/src/overview.md

41 lines
2 KiB
Markdown

# Codeberg Pages
Codeberg Pages users can easily deploy static websites on Codeberg using Git.
The Codeberg Pages server responds to four different URLs:
- https://raw.codeberg.org/username/reponame/: raw content, uses correct MIME types (HTML is forbidden though) & is accessible with CORS.
- https://username.codeberg.page: user page, points the default branch of a user's or organization's pages repository
- https://username.codeberg.page/reponame/: repo page, points to the pages branch of the repository
- https://example.org: custom domain, points to a repo of choice as outlined below
In all cases append a branch is done using an @ (e.g.
https://username.codeberg.page/@develop/README.md).
## Custom Domains
WARNING: Custom domains aren't fully tested yet and users may run into Let's
Encrypt Rate Limits for their domains. It is recommended to try it out on an
unused subdomain first so as to complete one request, and if it fails, contact the
maintainers who can
check what the problem is. A better process for such errors is being worked on.
Currently known pitfalls:
- Either not have a `CAA` record, or explicitly allow letsencrypt.org
For custom domains, two things are required:
- A `.domains` file in the repository (in the branch in question), containing a list of domains that shall be usable to access that repository:
- One domain per line, leaving lines empty and comment out lines with #.
- All domains (including \*.codeberg.page) will be redirected to the first domain in that file.
- A `CNAME` record pointing to one of the following targets:
- username.codeberg.page → https://username.codeberg.page
- reponame.username.codeberg.page → https://username.codeberg.page/reponame/
- branchname.reponame.username.codeberg.page → https://username.codeberg.page/reponame/@branchname/
If a `CNAME` record cannot be used to configure the target (e.g. for a zone
root), a A/AAAA/ALIAS record to codeberg.page with an additional TXT record
for the target (just as shown above for `CNAME` records) can be used.