Recently I was moving my projects from GitLab to my self-hosted Forgejo instance. I wanted to use fj 1 like
I use glab and gh, but fj auth login couldn’t find a client ID for my instance.
I created an OAuth app in Forgejo, and that got the browser to open, but the login still failed.
Go to Settings → Applications in Forgejo and create an OAuth2 app with Confidential Client
unchecked. Set the redirect URI to http://127.0.0.1:26218/ (including the trailing slash).
Then add your Forgejo hostname and the client ID to ~/.config/forgejo-cli/client_ids:
forgejo.example.com YOUR_CLIENT_IDThen sign in:
fj auth login -H forgejo.example.comUse the hostname you open in your browser. In my setup
fjwas picking up the SSH host and port from my Git remote, so I had to pass-Hexplicitly.
I put the client_ids file in my Home Manager config. The client ID isn’t a secret, so you can put it there
in plain text.
That’s it!