So Codeberg Pages have finally moved to git-pages back-end. Which is nice, don’t get me wrong! It’s fast, it’s lean, it’s featureful. But… Codeberg Pages docs related to deployment are pretty obscure. And the maintainers don’t feel like fixing this. Thus this post: to explain my journey in setting up scheme-index.aartaka.me as a custom domain subdomain.
I have to link to Codeberg Pages docs for fairness. In case you can understand them all and set up your subdomain based on them, then nice! But I wasn’t able to get through them and had to experiment and make many mistakes in the process. Here’s what I did.
Important detail: I use Namecheap as my domain registrar and DNS provider.
So some things in this post are specific to Namecheap.
The notation is
I’m not going to explain Git here.
Just make a new repo on Codeberg.
Don’t add a
First, I needed to add some records.
I already had
I don’t use the
You have to prove that you own the subdomain and that it’s deployed from the right repository.
So
Another thing that docs recommend is setting up a
It’s enough it seems.
I honestly have no idea what I’m doing here.
Codeberg Docs mention that .domains file is no longer necessary.
But I added it just in case:
I guess just add it if something goes wrong?
Finally, we can try deploying to the subdomain.
This is done through the Forgejo webhook.
Codeberg docs explain it well enough.
One important gotcha: you should set the webhook target URL to the subdomain URL and not apex domain URL!
So
So the final webhook will look like:
Now you can create a
I hope that your experience will be better than mine!
Codeberg Pages deserve love and use.
Smooth sailing with no icebergs in sight ⛵
Subdomain: CNAME Record
ALIAS @ codeberg.page.
CNAME scheme-index scheme-index.aartaka.codeberg.page.
More DNS Records
TXT _git-pages-repository.scheme-index https://codeberg.org/aartaka/scheme-index.git
CAA @ 0 issue "letsencrypt.org"
(Optional) .domains File—Just to Be Safe
scheme-index.aartaka.me
scheme-index.aartaka.codeberg.page
pages.scheme-index.aartaka.codeberg.page
Add a Forgejo Hook
Target URL
Push and Enjoy!
<aartaka> Hi y'all. I'm trying to deploy one of my projects to a subdomain
from Codeberg repository consulting Codeberg Pages docs, and I seem
to be getting something wrong. In a minute, I'll list what I did:
[11:52]
<aartaka> - Created a repository: https://codeberg.org/aartaka/scheme-index
[11:53]
<aartaka> - Created a .domains file with scheme-index.aartaka.me in it (should
be unnecessary as per the docs)
<aartaka> - Created an ALIAS record scheme-index codeberg.page.
<aartaka> - Made a Forgejo hook to ping
https://aartaka.codeberg.page/scheme-index/ [11:54]
<aartaka> - Made another one to ping http://scheme-index.aartaka.me
<aartaka> - Then fixed it to ping http://aartaka.me
<aartaka> - Added _git-pages-repository.scheme-index TXT record with
https://codeberg.org/aartaka/scheme-index.git in it [11:55]
<aartaka> And it still fails to resolve at DNS stage, and when I ignore that,
it fails with SSL errors
<aartaka> I tried to set the CAA records, but Namecheap does not allow me to
set anything but "letsencrypt.org" [11:56]
<aartaka> So yeah, that's basically it.
<aartaka> Anyone has ideas on what's wrong?
<aartaka> Oh no, and now it fucked up https://aartaka.me [12:10]
<aartaka> > Then fixed it to ping http://aartaka.me [12:17]
<aartaka> This probably was the mistake that re-deployed scheme-index at
https://aartaka.me
<aartaka> But I triggeret the webhook in the main repository and now
https://aartaka.me is back
<aartaka> Can't say the same about scheme-index.aartaka.me: still unable to
set it up [12:18]
<aartaka> It works now. I'm going to send a patch to the docs. [12:23]