From 76e89a7313683aa539ac941faa9dc9c78808dfa6 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 24 Apr 2026 00:55:11 -0400 Subject: [PATCH] Fix .deb install path and Gitea upload auth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .deb install instructions in the README pointed at a URL that doesn't exist — Gitea exposes the Debian registry as an apt repo, not as plain file downloads. Switched the README to the apt-repo flow (add a sources.list line, then apt install). Also fixed build-deb.sh: Gitea's Debian package endpoint returns HTTP 405 for token-bearer auth; it requires HTTP basic auth (user + token-as-password) and the literal /upload suffix on the URL. Package built and pushed to the registry — apt install works now. --- README.md | 23 ++++++++++++++++++----- debian/build-deb.sh | 12 ++++++------ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 229822e..39653b3 100644 --- a/README.md +++ b/README.md @@ -38,17 +38,30 @@ All three installs end up running the same Docker container. **What you need:** Docker Engine. If you don't have it: `curl -fsSL https://get.docker.com | sh`. ```bash -# 1. Install the package -wget http://192.168.1.64:3000/tocmo0nlord/-/packages/debian/dupfinder/1.0.0/files/amd64/dupfinder_1.0.0_amd64.deb -sudo apt install ./dupfinder_1.0.0_amd64.deb +# 1. Add the Gitea apt repo +echo "deb [trusted=yes] http://192.168.1.64:3000/api/packages/tocmo0nlord/debian bookworm main" \ + | sudo tee /etc/apt/sources.list.d/dupfinder.list -# 2. Run first-time setup (asks for photos path + data path) +# 2. Install +sudo apt update +sudo apt install dupfinder + +# 3. Run first-time setup (asks for photos path + data path) sudo dupfinder setup -# 3. Start it +# 4. Start it sudo dupfinder start ``` +> The repo says `bookworm` (Debian 12). For Ubuntu/other distros the package still works — the codename in the URL is just how Gitea organizes the registry. + +> **One-shot install without the apt repo:** +> ```bash +> curl -u tocmo0nlord: -O \ +> http://192.168.1.64:3000/api/packages/tocmo0nlord/debian/pool/bookworm/main/dupfinder_1.0.0_amd64.deb +> sudo apt install ./dupfinder_1.0.0_amd64.deb +> ``` + **Manage the service:** | Command | What it does | diff --git a/debian/build-deb.sh b/debian/build-deb.sh index b8624ca..3174229 100644 --- a/debian/build-deb.sh +++ b/debian/build-deb.sh @@ -99,14 +99,14 @@ if [[ "$NO_UPLOAD" == "true" ]]; then fi info "Uploading to Gitea package registry..." -UPLOAD_URL="$GITEA_URL/api/packages/$GITEA_OWNER/debian/pool/$DISTRO/$COMPONENT" +# Gitea's Debian registry requires HTTP basic auth (user + token-as-password) +# and the literal /upload endpoint — token-bearer auth returns 405. +UPLOAD_URL="$GITEA_URL/api/packages/$GITEA_OWNER/debian/pool/$DISTRO/$COMPONENT/upload" HTTP_STATUS=$(curl -s -o /tmp/gitea_upload_response.txt -w "%{http_code}" \ - -X PUT \ - -H "Authorization: token $GITEA_TOKEN" \ - -H "Content-Type: application/octet-stream" \ - --data-binary @"$BUILD_DIR/$DEB_FILE" \ - "$UPLOAD_URL/$DEB_FILE") + -u "$GITEA_OWNER:$GITEA_TOKEN" \ + --upload-file "$BUILD_DIR/$DEB_FILE" \ + "$UPLOAD_URL") if [[ "$HTTP_STATUS" == "201" || "$HTTP_STATUS" == "200" ]]; then ok "Uploaded successfully (HTTP $HTTP_STATUS)"