This is a note to record a problem I’m having with Codeberg (which I think originates in forgejo, the software Codeberg is built on).
I recently installed elementary, an Ubuntu based operating system, on an old Mac Mini, the idea being to use it as a file server. That went pretty smoothly.
I could have just stopped at installing the file server with Samba, but I wanted to give elementary a proper work out. Part of that involved seeing if I could edit and publish my website using its default apps. elementary’s main strengths are its old OS X-ish look, opinionated UX and commitment to making its f…
This is a note to record a problem I’m having with Codeberg (which I think originates in forgejo, the software Codeberg is built on).
I recently installed elementary, an Ubuntu based operating system, on an old Mac Mini, the idea being to use it as a file server. That went pretty smoothly.
I could have just stopped at installing the file server with Samba, but I wanted to give elementary a proper work out. Part of that involved seeing if I could edit and publish my website using its default apps. elementary’s main strengths are its old OS X-ish look, opinionated UX and commitment to making its features as accessible as possible – for example, you can tell it to make the cursor bigger, an absolute godsend. It comes with a set of its own apps, including a tidied up version of Geary, an IDE and a terminal.
Everything seemed OK. I pulled the website from Codeberg, made some edits and pushed it back before tweaking some other OS and app settings. All fine.
A bit later I returned to the site to make another change. I have a bash script that uploads it to my host and then pushes the changes to Codeberg. That’s when I got this error message:
remote: Credentials are incorrect or have expired. Retry your command or see https://codeberg.org/forgejo/forgejo/issues/2809 for more information
fatal: Authentication failed for [repo name]
That’s a helpful error message as it provides a link to some more info. Unfortunately, the temporary fix you’ll find near the bottom of the ticket doesn’t work for me. Furthermore, I can use git to push, pull and revert, and save login credentials, but that’s about it – anything requiring a deeper knowledge will pose a problem.
At first I thought this must be an elementary thing, but it also occurs on a fresh Ubuntu install I made on another old Mac Mini (I’m swimming in them).
From what I can tell, this is something to do with how forgejo stores credentials. Eventually they expire, locking you out of the remote repo (in this case living on Codeberg). My existing laptop running Mint is fine, presumably because it’s cached the credentials. Unfortunately, I don’t have the technical skills to renew them on a new install, which means I’m locked out of my website repo if I use a new PC.
If this is a general problem rather than something specific to me, I think it’s quite serious. If for example you’re using Codeberg to push your site to Statichost you would find it wouldn’t work on a new laptop.
There’s a workaround
It’s not ideal, but this worked for me. I created a new user on Codeberg and added them as an administrative collaborator to the repo. When I entered these new credentials on elementary, they worked. forgejo presumably stored a new set of credentials.