Skip to content

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

Open

Description

@mdmdj

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: [Bug]: Forgejo issue tracker fails on SSH host-alias remotes (alias:owner/repo.git) even when fj has a matching alias #38359 (SSH-alias matching and the misleading install hint), [Bug]: Forgejo/Gitea settings show "not authenticated" for HTTP-only (no TLS) hosts #33410 (HTTP-only probing; closed as "could not verify", not supported), Forgejo provider clone selects HTTPS and fails on an SSH-only setup #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)

Activity

  1. added
    via-triage
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions