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:
12
debian/build-deb.sh
vendored
12
debian/build-deb.sh
vendored
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user