2.0 KiB
2.0 KiB
Connecting Codemagic to our self-hosted Gitea (SSH)
We build the iOS app on Codemagic's macOS cloud (no Mac needed). Codemagic must clone the repo from
code.bizgaze.com, but that Gitea only exposes HTTPS (443) — its SSH port is not reachable from
the internet, so Codemagic can't connect yet. This is a one-time infra + Codemagic setup.
Part 1 — IT: expose Gitea's SSH port (git host 118.95.33.93)
- Find Gitea's SSH port. In
app.ini→[server]→SSH_PORT/SSH_LISTEN_PORT. Or open a repo in the Gitea web UI → clone dropdown → SSH and read the port in the URL, e.g.ssh://git@code.bizgaze.com:2222/Sravan/BizGaze_Remote.git. - Port-forward a public TCP port → that Gitea SSH port. Suggested public port: 2222.
- ⚠️ Nginx Proxy Manager proxies HTTP/HTTPS only. SSH needs a raw TCP forward at the firewall/router (or an NPM Stream rule) — not an HTTP proxy host.
- Confirm reachable, then send the DevOps/AI the SSH clone URL (with port) to verify.
Security: Gitea SSH is key-only (no password auth), same model as GitHub's public port 22. Access is further limited to a read-only deploy key (below), so a leaked key could only read this one repo.
Part 2 — Codemagic: connect the repo (once the port is open)
- Codemagic → Add application → "Other" (self-hosted / SSH) → paste the SSH clone URL.
- Copy the SSH public key Codemagic shows.
- Gitea → this repo → Settings → Deploy Keys → Add Deploy Key → paste it, Enable write access = OFF.
- Codemagic Test connection → it clones and reads
codemagic.yaml.
Then follow IOS_SETUP.md for the App Store Connect key + first build.
Auto-build on push (optional, later)
Manual Start build works immediately. Automatic builds on push work natively only for GitHub/GitLab/Bitbucket; for Gitea we'd add a webhook Codemagic can accept — a later nicety, not required.