Documentation/content/codeberg-pages/troubleshooting.md

127 lines
3.7 KiB
Markdown
Raw Normal View History

2021-04-03 13:29:01 -07:00
---
eleventyNavigation:
key: Troubleshooting
2021-04-03 13:29:01 -07:00
title: Troubleshooting
parent: CodebergPages
order: 99
---
Lint the documentation (#626) # Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## Removed - Disable the Markdownlint rule MD024 (`Multiple headings with the same content`). ## Fixed - Syntax errors in `.markdownlint.yaml`. - Markdownlint issues: - Heading levels should only increment by one level at a time([MD001](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md001.md)) - Hard tabs ([MD010](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md010.md)) - Reversed link syntax ([MD011](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md011.md)) - Dollar signs used before commands without showing output ([MD014](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md014.md)) - Multiple top-level headings in the same document ([MD025](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md025.md)) - Trailing punctuation in heading ([MD026](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md026.md)) - Ordered list item prefix([MD029](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md029.md)) - Emphasis used instead of a heading([MD036](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md036.md)) - Fenced code blocks should have a language specified ([MD040](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md040.md)) - Link fragments should be valid ([MD051](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md051.md)) - Link text should be descriptive ([MD059](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md059.md)) - Prettier issues. Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/626 Reviewed-by: Patrick Schratz <pat-s@noreply.codeberg.org> Co-authored-by: Javier Pérez <walpo@noreply.codeberg.org> Co-committed-by: Javier Pérez <walpo@noreply.codeberg.org>
2025-06-14 06:39:01 -07:00
## My web browser displays a security warning when I try to access my Codeberg Pages
2022-08-04 19:27:57 -07:00
If your user name or repository name contains a dot, your Codeberg Pages URL (<https://user.name.codeberg.page>
or <https://repo.sitory.username.codeberg.page>)
contains a sub-sub-domain which does not work with Let's Encrypt wildcard certificates.
Use the alternative URL <https://pages.codeberg.org/user.name/> as a workaround or rename you repository
(e.g. replace `.` by `_`).
## My content is not updated
The Codeberg Pages v2 server caches files under a certain size (currently 1 MiB).
2022-08-04 19:27:57 -07:00
Please wait a few minutes until the cache has been invalidated.
This is done to improve performance, reduce cost and server load, and save energy.
## Cloudflare and Codeberg Pages
It is important that when you use [Cloudflare](https://cloudflare.com) to manage your Domain's DNS records,
that every DNS record used for Codeberg Pages needs to be set to **DNS only** (Have a gray cloud).
This ensures that Codeberg pages can properly handle everything necessary for your site such as SSL-Certificate and
redirects from other (sub-)domains.
## Troubleshooting post-git-pages errors
Given that Codeberg has moved to [git-pages](https://git-pages.org/) entirely, some behaviors changed.
Some things broke.
Including some undocumented behaviors website authors depended on.
This needs troubleshooting.
Luckily, git-pages allows troubleshooting.
Say, we add this (broken) [redirect rule](/codeberg-pages/advanced-usage/#redirects) to simulate old pages server redirection to `.html` pages:
```
/*/ /:splat.html 301
```
After committing it and opening a page like `https://example.org/hello`, we are redirected to a 404 page.
Something must be broken in redirects.
However, we dont know that for sure.
Need to check.
There are two ways to find out whats broken in the website:
```
# Plain web request
curl https://example.org/.git-pages/manifest.json
# Or a dedicated tool from git-pages
git-pages-cli --debug-manifest https://example.org
```
In either case, you get huge JSONs with meta-information about the website.
The structure is roughly:
```json
{
"repoUrl": "https://codeberg.org/.../pages.git",
"branch": "pages",
"commit": "abcdef...",
"contents": {
"": {
"type": "Directory"
},
".domains": {
// ...
},
".gitignore": {
// ...
},
"assets": {
"type": "Directory"
},
"assets/...png": {
"type": "ExternalFile",
"originalSize": "...",
"compressedSize": "...",
"data": "...",
"transform": "Identity",
"contentType": "image/png",
"gitHash": "..."
},
"index.html": {
"type": "ExternalFile",
"originalSize": "...",
"compressedSize": "...",
"data": "...",
"transform": "Zstd",
"contentType": "text/html; charset=utf-8",
"gitHash": "..."
}
// ...
},
"originalSize": "...",
"compressedSize": "...",
"storedSize": "...",
"redirects": [
{
"from": "/foo",
"to": "/bar",
"status": 301,
"force": false
}
// ...
],
"headers": [],
"basicAuth": [],
"problems": [
{
"path": "_redirects",
"cause": "rule #1 \"/*/ /:splat.html 301\": splat * must be its own final segment of the path"
}
]
}
```
And heres the problem, under the `"problems"` key: the redirect is malformed!
In the end, this is one of the [changes and deprecations](/codeberg-pages/migrating-from-pages-v2/#breaking-changes-and-deprecations) that happened in migration.
But lamenting that is a story for another time.
Problem diagnosed through the useful git-pages manifest!
Use it to diagnose errors from now on!