fdroid-update.sh never sets repo_url/repo_name, so the published repo advertises fdroidserver's placeholder #11

Closed
opened 2026-09-09 20:16:54 +00:00 by claude · 2 comments
Member

fdroid-update.sh writes <repo-root>/config.yml itself on every run, but
only sets keystore, keystorepass, keypass and repo_keyalias. It never
sets repo_url, repo_name or repo_description, so fdroidserver falls
back to its own placeholder template.

Measured from the live index-v2.json in fdroid-weblib-dev:

repo.address      https://MyFirstFDroidRepo.org/fdroid/repo
repo.name         My First F-Droid Repo Demo
repo.description  This is a repository of apps to be used with F-Droid. ...

That is fdroidserver's stock demo text, not this repo. The "Add to F-Droid" /
fdroid.link button on the generated index.html is built from repo_url,
which is how bit noticed -- it points at MyFirstFDroidRepo.org, not at the
real bucket. This is silently wrong: the publish succeeds while advertising
someone else's URL, which is worse than failing.

Fix: add FDROID_REPO_URL/FDROID_REPO_NAME/FDROID_REPO_DESCRIPTION
environment variables (not new positionals -- the script already has five
plus pass-through extra args) that fdroid-update.sh writes into
config.yml. Make the first two a hard error when unset, naming the
variable -- defaulting would just move the silent-wrong-value bug rather
than fix it. FDROID_REPO_DESCRIPTION may stay optional.

This is a breaking change to a public composite action's interface, which is
acceptable only because weblib-viewer is the sole consumer and is updated
in the same piece of work.

`fdroid-update.sh` writes `<repo-root>/config.yml` itself on every run, but only sets `keystore`, `keystorepass`, `keypass` and `repo_keyalias`. It never sets `repo_url`, `repo_name` or `repo_description`, so fdroidserver falls back to its own placeholder template. Measured from the live `index-v2.json` in `fdroid-weblib-dev`: ``` repo.address https://MyFirstFDroidRepo.org/fdroid/repo repo.name My First F-Droid Repo Demo repo.description This is a repository of apps to be used with F-Droid. ... ``` That is fdroidserver's stock demo text, not this repo. The "Add to F-Droid" / `fdroid.link` button on the generated `index.html` is built from `repo_url`, which is how bit noticed -- it points at `MyFirstFDroidRepo.org`, not at the real bucket. This is silently wrong: the publish *succeeds* while advertising someone else's URL, which is worse than failing. Fix: add `FDROID_REPO_URL`/`FDROID_REPO_NAME`/`FDROID_REPO_DESCRIPTION` environment variables (not new positionals -- the script already has five plus pass-through extra args) that `fdroid-update.sh` writes into `config.yml`. Make the first two a hard error when unset, naming the variable -- defaulting would just move the silent-wrong-value bug rather than fix it. `FDROID_REPO_DESCRIPTION` may stay optional. This is a breaking change to a public composite action's interface, which is acceptable only because `weblib-viewer` is the sole consumer and is updated in the same piece of work.
Owner

@claude: close?

@claude: close?
Author
Member

Fixed and merged

4a25e36, merged as 760583b (PR #12). Consumer side wired in weblib-viewer#25.

What changed: fdroid-update.sh now requires FDROID_REPO_URL and FDROID_REPO_NAME — a named hard error if either is missing — and writes them, plus the optional FDROID_REPO_DESCRIPTION, into the config.yml it generates. Required rather than defaulted, because the old failure mode was a publish that succeeded while advertising MyFirstFDroidRepo.org: silently wrong, which is worse than not running.

One thing found during implementation that was not in the original diagnosis, and that changes the URLs: fdroidserver/common.py:662-664 refuses to run any fdroid command when repo_url does not end in the literal /repo, with no way to disable it.

if 'repo_url' in config:
    if not config['repo_url'].endswith('/repo'):
        raise FDroidException(_('repo_url needs to end with /repo'))

Both channels published to the bucket root, so neither spelling worked — a suffix-less URL makes fdroidserver refuse to start, a suffixed one names a path the bucket never served. Resolved by using publish.sh's existing <prefix> argument so the tree is served under .../repo/.

Tests: 104 passed / 4 skipped, up from 98/4. The new assertions cover a missing FDROID_REPO_URL/FDROID_REPO_NAME failing, a URL without /repo failing, index-v2.json carrying the configured repo.address/repo.name/repo.description with no placeholder text, and a name containing a single quote surviving the YAML round-trip.

Live confirmation is still in flight — the dev publish triggered by weblib-viewer#25 is running, and the real check is reading repo.address back from https://fdroid-weblib-dev.s3w.dev.chaosbit.de/repo/index-v2.json. Closing on the merged, unit-tested change; if that read comes back wrong I will reopen rather than leave it looking done.

Also noted for whoever does it: the pre-existing objects at the bucket root will survive the move to /repo/, because aws s3 sync --delete only prunes within its prefix. They will keep serving the old placeholder index at the root URL until deleted.

## Fixed and merged `4a25e36`, merged as `760583b` (PR #12). Consumer side wired in weblib-viewer#25. **What changed:** `fdroid-update.sh` now requires `FDROID_REPO_URL` and `FDROID_REPO_NAME` — a named hard error if either is missing — and writes them, plus the optional `FDROID_REPO_DESCRIPTION`, into the `config.yml` it generates. Required rather than defaulted, because the old failure mode was a publish that *succeeded* while advertising `MyFirstFDroidRepo.org`: silently wrong, which is worse than not running. **One thing found during implementation that was not in the original diagnosis**, and that changes the URLs: `fdroidserver/common.py:662-664` refuses to run *any* `fdroid` command when `repo_url` does not end in the literal `/repo`, with no way to disable it. ```python if 'repo_url' in config: if not config['repo_url'].endswith('/repo'): raise FDroidException(_('repo_url needs to end with /repo')) ``` Both channels published to the **bucket root**, so neither spelling worked — a suffix-less URL makes fdroidserver refuse to start, a suffixed one names a path the bucket never served. Resolved by using `publish.sh`'s existing `<prefix>` argument so the tree is served under `.../repo/`. **Tests:** 104 passed / 4 skipped, up from 98/4. The new assertions cover a missing `FDROID_REPO_URL`/`FDROID_REPO_NAME` failing, a URL without `/repo` failing, `index-v2.json` carrying the configured `repo.address`/`repo.name`/`repo.description` with no placeholder text, and a name containing a single quote surviving the YAML round-trip. **Live confirmation is still in flight** — the dev publish triggered by weblib-viewer#25 is running, and the real check is reading `repo.address` back from `https://fdroid-weblib-dev.s3w.dev.chaosbit.de/repo/index-v2.json`. Closing on the merged, unit-tested change; if that read comes back wrong I will reopen rather than leave it looking done. Also noted for whoever does it: the pre-existing objects at the **bucket root** will survive the move to `/repo/`, because `aws s3 sync --delete` only prunes within its prefix. They will keep serving the old placeholder index at the root URL until deleted.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weblib/fdroid-repo-ci#11