Fix .deb install path and Gitea upload auth

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.
This commit is contained in:
Carlos
2026-04-24 00:55:11 -04:00
parent 90790b648d
commit 76e89a7313
2 changed files with 24 additions and 11 deletions

View File

@@ -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:<your-token> -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 |

12
debian/build-deb.sh vendored
View File

@@ -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)"