Gitea remote URL is ephemeral (bore.pub port changes each session) — add push-to-gitea.sh helper #17

Closed
opened 2026-03-18 22:22:18 +00:00 by replit · 1 comment
Owner

Context

The gitea remote saved in this repo points to http://replit:...@bore.pub:9523/replit/token-gated-economy.git. The port 9523 is assigned by bore at tunnel creation time and changes every session. Any git push gitea after a new bore tunnel is opened will fail with a connection error.

Currently the workaround is manual: start bore, note the new port, run git remote set-url gitea http://replit:...@bore.pub:<NEW_PORT>/..., then push. This is error-prone and easy to forget.

Requirements

  1. Create scripts/push-to-gitea.sh that:
    a. Detects the current bore port by querying bore.pub or inspecting the running bore process (pgrep -f bore + parse args)
    b. If no bore process is found, prints instructions to start one and exits with a clear error
    c. Updates git remote set-url gitea with the detected port
    d. Runs git push gitea HEAD:main
    e. Prints the Gitea web URL of the pushed branch on success
  2. Add a note to AGENTS.md (once created — see quality gates issue) that all pushes to Gitea go through bash scripts/push-to-gitea.sh
  3. Optionally: if bore is not running, offer to start it automatically on the LNbits port (5000) as a side-channel — or just push directly to the Tailscale IP if reachable

Acceptance Criteria

  • Running bash scripts/push-to-gitea.sh with an active bore tunnel pushes to the correct Gitea URL without manual port lookup
  • Running bash scripts/push-to-gitea.sh with no bore tunnel running prints a clear error: No bore tunnel detected. Start with: bore local 5000 --to bore.pub and exits with code 1
  • After the script runs, git remote get-url gitea reflects the current bore port
  • Script is idempotent — running it twice with the same bore session succeeds both times

Files

  • scripts/push-to-gitea.sh (new)
  • AGENTS.md (reference, once created)
## Context The `gitea` remote saved in this repo points to `http://replit:...@bore.pub:9523/replit/token-gated-economy.git`. The port `9523` is assigned by bore at tunnel creation time and changes every session. Any `git push gitea` after a new bore tunnel is opened will fail with a connection error. Currently the workaround is manual: start bore, note the new port, run `git remote set-url gitea http://replit:...@bore.pub:<NEW_PORT>/...`, then push. This is error-prone and easy to forget. ## Requirements 1. Create `scripts/push-to-gitea.sh` that: a. Detects the current bore port by querying `bore.pub` or inspecting the running bore process (`pgrep -f bore` + parse args) b. If no bore process is found, prints instructions to start one and exits with a clear error c. Updates `git remote set-url gitea` with the detected port d. Runs `git push gitea HEAD:main` e. Prints the Gitea web URL of the pushed branch on success 2. Add a note to `AGENTS.md` (once created — see quality gates issue) that all pushes to Gitea go through `bash scripts/push-to-gitea.sh` 3. Optionally: if bore is not running, offer to start it automatically on the LNbits port (5000) as a side-channel — or just push directly to the Tailscale IP if reachable ## Acceptance Criteria - [ ] Running `bash scripts/push-to-gitea.sh` with an active bore tunnel pushes to the correct Gitea URL without manual port lookup - [ ] Running `bash scripts/push-to-gitea.sh` with no bore tunnel running prints a clear error: `No bore tunnel detected. Start with: bore local 5000 --to bore.pub` and exits with code 1 - [ ] After the script runs, `git remote get-url gitea` reflects the current bore port - [ ] Script is idempotent — running it twice with the same bore session succeeds both times ## Files - `scripts/push-to-gitea.sh` (new) - `AGENTS.md` (reference, once created)
Author
Owner

Resolved: replaced ephemeral bore.pub port with permanent Tailscale Funnel (https://mm.tailb74b2d.ts.net). GITEA_URL saved as shared env var. scripts/push-to-gitea.sh rewritten — no more port juggling.

Resolved: replaced ephemeral bore.pub port with permanent Tailscale Funnel (`https://mm.tailb74b2d.ts.net`). `GITEA_URL` saved as shared env var. `scripts/push-to-gitea.sh` rewritten — no more port juggling.
This repo is archived. You cannot comment on issues.