From 6162813dab5568c58f65c9839419dd5c88807a03 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Thu, 3 Sep 2026 17:17:31 -0400 Subject: [PATCH] Add recreate script and Tailscale Gitea docs after server rebuild Co-authored-by: Cursor --- GITEA.md | 76 ++++++++++++++++++++++++++++++++++++++++--- recreate-on-gitea.ps1 | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 5 deletions(-) create mode 100644 recreate-on-gitea.ps1 diff --git a/GITEA.md b/GITEA.md index d1452ef..addb9b0 100644 --- a/GITEA.md +++ b/GITEA.md @@ -6,9 +6,71 @@ The Scribd downloader lives in the **`Scribd/`** folder. --- +## Tailscale access + +Gitea is also reachable over Tailscale from this network: + +| URL | Use | +|-----|-----| +| `https://git.masengr.com` | Public / DNS (preferred when nginx is set up) | +| `http://tower:3000` | Tailscale hostname (`tower` = `100.73.158.0`) | +| `http://100.73.158.0:3000` | Tailscale IP | + +Git remote examples: + +```powershell +git remote set-url origin https://git.masengr.com/Michael-A-Sloan/PDF-Downloaders.git +# or over Tailscale: +git remote set-url origin http://tower:3000/Michael-A-Sloan/PDF-Downloaders.git +``` + +--- + +## After replacing the Gitea server + +Your local `PDF-Downloaders` folder already has full git history. On the new server: + +### 1. Create an empty repo in Gitea + +1. Open Gitea (via Tailscale or `git.masengr.com`). +2. Sign in as **Michael-A-Sloan** (or create that user/org if this is a fresh install). +3. **New Repository** + - Name: `PDF-Downloaders` + - **Do not** add README, `.gitignore`, or license (empty repo) +4. Create. + +### 2. Create a Personal Access Token + +1. **Settings → Applications → Generate New Token** +2. Enable **repo** (and **write:repository** if listed) +3. Copy the token — use it as the **password** when Git asks (username = your Gitea username) + +### 3. Push from this PC + +```powershell +cd "C:\Users\Michael Sloan\Desktop\git\PDF-Downloaders" +.\recreate-on-gitea.ps1 +``` + +Or over Tailscale only: + +```powershell +.\recreate-on-gitea.ps1 -RemoteUrl "http://tower:3000/Michael-A-Sloan/PDF-Downloaders.git" +``` + +### 4. Re-enable Actions / runners (new server) + +1. Site admin: enable **Actions** +2. Register `act_runner` again on the new host (old registration tokens are invalid) +3. Labels for this project’s Linux CI: `ubuntu-latest` (and Docker if using Wine Windows builds) + +See [Scribd/BUILD.md](Scribd/BUILD.md#ci-builds-gitea--github-actions). + +--- + ## One-time: create a Personal Access Token -1. Sign in at [git.masengr.com](https://git.masengr.com). +1. Sign in at [git.masengr.com](https://git.masengr.com) (or Tailscale URL). 2. **Settings → Applications → Generate New Token** 3. Enable **repo** scope; copy the token. @@ -52,6 +114,7 @@ PDF-Downloaders/ ├── .gitignore ├── GITEA.md ├── push-to-gitea.ps1 +├── recreate-on-gitea.ps1 └── Scribd/ ← Scribd PDF Downloader (full project) ├── README.md ├── gui.py @@ -64,12 +127,12 @@ PDF-Downloaders/ ## CI builds (Actions) -Workflows in `.gitea/workflows/` build **Windows, macOS, and Linux** packages on push to `main`. +Workflows in `.gitea/workflows/` build on your Linux runner (Linux app + Windows packages). -1. Enable **Actions** for the repo on git.masengr.com. -2. Use the same runner labels as your other repos: `ubuntu-latest`, `windows-latest`, `macos-latest`. +1. Enable **Actions** for the repo. +2. Register a runner with label `ubuntu-latest` (Docker recommended for Windows Wine builds). 3. Push to `main` or open **Actions → Build Scribd → Run workflow**. -4. Download artifacts: `scribd-windows`, `scribd-macos`, `scribd-linux`. +4. Download artifacts: `scribd-linux`, `scribd-windows`, `scribd-windows-portable`. Details: [Scribd/BUILD.md](Scribd/BUILD.md#ci-builds-gitea--github-actions) @@ -79,6 +142,9 @@ Details: [Scribd/BUILD.md](Scribd/BUILD.md#ci-builds-gitea--github-actions) ```bash git clone https://git.masengr.com/Michael-A-Sloan/PDF-Downloaders.git +# or via Tailscale: +git clone http://tower:3000/Michael-A-Sloan/PDF-Downloaders.git + cd PDF-Downloaders/Scribd # follow Scribd/INSTALL.md ``` diff --git a/recreate-on-gitea.ps1 b/recreate-on-gitea.ps1 new file mode 100644 index 0000000..019a406 --- /dev/null +++ b/recreate-on-gitea.ps1 @@ -0,0 +1,59 @@ +# Recreate PDF-Downloaders on a fresh Gitea server, then push local history. +# +# Prerequisites: +# 1. Gitea is running (e.g. https://git.masengr.com or http://tower:3000 via Tailscale) +# 2. You created an EMPTY repo: Michael-A-Sloan/PDF-Downloaders +# (or update $Owner / $RepoName below) +# 3. Sign in when Git Credential Manager prompts (username + Personal Access Token) +# +# Usage: +# .\recreate-on-gitea.ps1 +# .\recreate-on-gitea.ps1 -RemoteUrl "http://tower:3000/Michael-A-Sloan/PDF-Downloaders.git" + +param( + [string]$RemoteUrl = "https://git.masengr.com/Michael-A-Sloan/PDF-Downloaders.git" +) + +$ErrorActionPreference = "Stop" +$RepoRoot = $PSScriptRoot +Set-Location $RepoRoot + +Write-Host "=== Recreate / push PDF-Downloaders ===" -ForegroundColor Cyan +Write-Host "Remote: $RemoteUrl" +Write-Host "" + +if (-not (Test-Path ".git")) { + throw "Not a git repo. Run this from PDF-Downloaders." +} + +$existing = git remote 2>$null +if ($existing -notcontains "origin") { + git remote add origin $RemoteUrl +} else { + git remote set-url origin $RemoteUrl +} + +Write-Host "Checking remote..." +$probe = git ls-remote origin HEAD 2>&1 +if ($LASTEXITCODE -ne 0) { + Write-Host "" + Write-Host "Remote repo not found or not authenticated yet." -ForegroundColor Yellow + Write-Host "Do this first:" + Write-Host " 1. Open Gitea in the browser" + Write-Host " 2. Create repository: PDF-Downloaders (empty, no README)" + Write-Host " 3. Owner/org: Michael-A-Sloan" + Write-Host " 4. Re-run this script (sign in with username + token when prompted)" + Write-Host "" + Write-Host "Tailscale URL example:" + Write-Host " .\recreate-on-gitea.ps1 -RemoteUrl `"http://tower:3000/Michael-A-Sloan/PDF-Downloaders.git`"" + Write-Host "" + Write-Host "Git said: $probe" + exit 1 +} + +Write-Host "Pushing main..." -ForegroundColor Cyan +git push -u origin main + +Write-Host "" +Write-Host "Done." -ForegroundColor Green +Write-Host " Web: $($RemoteUrl -replace '\.git$','')"