Pages: Add more notes to custom domain article: subdomains

This commit is contained in:
Artyom Bologov 2026-08-07 12:35:07 +04:00
parent 12c7b61d35
commit 88ad37d0c5

View file

@ -30,6 +30,8 @@ This means you need to add two extra CAA records.
The first record has a value of `letsencrypt.org;accounturi=https://acme-v02.api.letsencrypt.org/acme/acct/292520050;validationmethods=tls-alpn-01,http-01`. The first record has a value of `letsencrypt.org;accounturi=https://acme-v02.api.letsencrypt.org/acme/acct/292520050;validationmethods=tls-alpn-01,http-01`.
The second record has a value of `letsencrypt.org;accounturi=https://acme-staging-v02.api.letsencrypt.org/acme/acct/272029763;validationmethods=tls-alpn-01,http-01`. The second record has a value of `letsencrypt.org;accounturi=https://acme-staging-v02.api.letsencrypt.org/acme/acct/272029763;validationmethods=tls-alpn-01,http-01`.
This wont work for providers like Namecheap that restrict CAA records. For Namecheap, one CAA with value of `letsencrypt.org` should be sufficient.
{% endadmonition %} {% endadmonition %}
{% admonition "info" "Notice" %} {% admonition "info" "Notice" %}
@ -167,6 +169,7 @@ If you were relying on the old server's multi-domain redirection implementation,
**If you deploy from a webhook,** **If you deploy from a webhook,**
set a TXT record on the `_git-pages-repository` subdomain of your domain with the HTTPS Git clone URL for your repository. set a TXT record on the `_git-pages-repository` subdomain of your domain with the HTTPS Git clone URL for your repository.
Here are examples:
<table class="table"> <table class="table">
<thead> <thead>
@ -183,7 +186,12 @@ set a TXT record on the `_git-pages-repository` subdomain of your domain with th
<tr> <tr>
<td>_git-pages-repository.www.example.org</td> <td>_git-pages-repository.www.example.org</td>
<td>TXT</td> <td>TXT</td>
<td>https://codeberg.org/username/repository.git</td> <td>https://codeberg.org/username/repository.git (might be different from the toplevel domain)</td>
</tr>
<tr>
<td>_git-pages-repository.sub.example.org</td>
<td>TXT</td>
<td>https://codeberg.org/username/another-repository.git (another subdomain for another project, might be different from the toplevel domain)</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -214,9 +222,18 @@ set a TXT record on the `_git-pages-forge-allowlist` subdomain of your domain wi
### Step 3: Set your webhook or Forgejo Actions deploy target ### Step 3: Set your webhook or Forgejo Actions deploy target
**If you deploy from a webhook,** **If you deploy from a webhook,**
the webhook **Target URL** should be set to the domain you want to deploy your website to. the webhook **Target URL** should be set to the (sub)domain you want to deploy your website to.
For technical reasons, the first deployment needs to go over HTTP and you need to specify the `http://` scheme. For technical reasons, the first deployment needs to go over HTTP and you need to specify the `http://` scheme.
After the first successful deployment you can change it to the `https://` scheme. After the first successful deployment you can change it to the `https://` scheme.
So, for toplevel domain, the link should be e.g. `http://example.org`, while for subdomain it should be `http://sub.example.org`.
{% admonition "Warning" %}
Mixing these up might result in your toplevel website being overwritten with project page.
So if you want to deploy to a subdomain, list it as hook target directly.
{% endadmonition %}
**If you deploy from Forgejo Actions,** **If you deploy from Forgejo Actions,**
the `site` parameter to the git-pages action should be set to the URL of your custom domain, and the `server` parameter should be set to `codeberg.page`. The [Forgejo Actions guide](/codeberg-pages/forgejo-actions/) includes example workflows and more information. the `site` parameter to the git-pages action should be set to the URL of your custom domain, and the `server` parameter should be set to `codeberg.page`. The [Forgejo Actions guide](/codeberg-pages/forgejo-actions/) includes example workflows and more information.