t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Forgejo setup docs don't cover plain-HTTP local servers or SSH-alias remotes

Open mdmdj opened this issue 1 week ago • 0 comments

What happened

I run Forgejo on the same machine as my T3 Code server (WSL2), over plain HTTP on a nonstandard port (http://forgejo.local:13000), and use an SSH host alias for Git. Following the Forgejo setup and troubleshooting docs left me in a loop: fj was installed and signed in, but T3 Code kept reporting the provider as not authenticated, and the trace told me to install fj/tea. Rescanning, as troubleshooting suggests, never helped.

The setup only worked after changing the project's remote to the http:// web URL and adding an SSH pushurl — steps the docs never mention.

Diagnosis

  • Forgejo runs locally at http://forgejo.local:13000 (HTTP only). It is on the same machine as the T3 server and reachable over loopback/LAN, so TLS is unnecessary here.
  • fj 0.7.0 is signed in, and fj -H http://forgejo.local:13000 whoami succeeds.
  • fj stores the login scheme-less as forgejo.local:13000 in keys.json, as it does by design.
  • The repo remote was ssh://forgejo/owner/repo.git, with Host forgejo in ~/.ssh/config (port 222). T3 matches fj logins by web host, and for SSH remotes it assumes https://<host>. For a local HTTP-only server that can never authenticate.
  • With no matching login, T3 falls back to tea (not installed) and surfaces: Install Forgejo CLI (fj 0.6 or later) or Gitea CLI (tea 0.16 or later) and retry.
  • The docs' example uses fj --host https://your-server auth add-token, and troubleshooting says "run the provider's login command on the server, then rescan." Neither covers scheme, port, SSH aliases, or the HTTP-origin requirement, so there is no documented way out.
  • Related code issues: #38359 (SSH-alias matching and the misleading install hint), #33410 (HTTP-only probing; closed as "could not verify", not supported), #37428 (clone transport). This issue is specifically the documentation/troubleshooting gap that makes those dead ends unavoidable.

Steps to reproduce

  1. Run Forgejo on the same machine as the T3 server, over plain HTTP, e.g. http://forgejo.local:13000.
  2. Sign in: fj auth add-token -H http://forgejo.local:13000 (keys.json gets forgejo.local:13000).
  3. Configure the project remote as ssh://forgejo/owner/repo.git using an SSH host alias.
  4. Add the project and open Pull requests or Issues (PR sync triggers the same path).
  5. T3 reports the provider as not authenticated and the trace says to install fj/tea, despite fj being installed and signed in. Rescanning per troubleshooting changes nothing.
  6. Changing the remote to http://forgejo.local:13000/owner/repo.git with pushurl ssh://forgejo/owner/repo.git makes it work.

Version

0.1.11 (server and desktop app)

Environment

T3 Code Desktop on Windows; T3 server on WSL2 Linux (Node 26); self-hosted Forgejo on the same machine over HTTP on port 13000; fj 0.7.0; tea not installed; SSH host alias used for Git.

Evidence

SourceControlProviderError: Source control provider forgejo failed in listChangeRequests:
Install Forgejo CLI (`fj` 0.6 or later) or Gitea CLI (`tea` 0.16 or later) and retry.

The trace shows ForgejoCli.listLogins succeeding while reading the fj keys, then ForgejoCli.execute: tea failing with VcsProcessSpawnError, which produces the install hint. Outside T3, fj -H http://forgejo.local:13000 whoami succeeds.

Related issues

#38359, #33410, #37428. Not duplicates of the code bugs: this issue is the missing documentation and troubleshooting path.

Fix applied or workaround

git remote set-url <remote> http://forgejo.local:13000/owner/repo.git
git remote set-url --push <remote> ssh://forgejo/owner/repo.git
git config --local credential.helper store
# store the Forgejo token as the HTTP password for this host

Suggested docs: a "self-hosted over plain HTTP / local server" subsection covering scheme and port matching, the http:// origin requirement with SSH pushurl, and the token-as-HTTP-password step; plus troubleshooting entries for "fj is signed in but T3 says to install it / not authenticated" and "SSH alias remote".

Filed by

DeepSeek V4.1 Flash (opencode-go) via T3 Code triage (OpenCode agent)

mdmdj avatar Nov 20 '26 10:11 mdmdj