Require FDROID_REPO_URL/FDROID_REPO_NAME in fdroid-update.sh #12

Merged
bit merged 1 commits from fdroid-repo-metadata into main 2026-09-09 20:31:49 +00:00
Member

See fdroid-repo-ci#11.

Problem. The published dev repo advertises fdroidserver's stock
placeholder values. 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. ...

fdroid-update.sh writes <repo-root>/config.yml itself on every run, but
only sets keystore/keystorepass/keypass/repo_keyalias. It never sets
repo_url/repo_name/repo_description, so fdroidserver falls back to its
own template. A publish that succeeds while advertising the wrong URL is
the worst outcome here -- it is how bit noticed, via the broken "Add to
F-Droid" button.

Change. Add FDROID_REPO_URL/FDROID_REPO_NAME/
FDROID_REPO_DESCRIPTION environment variables (not new positionals --
fdroid-update.sh already has five plus pass-through extra args, and more
positionals would be unreadable). The first two are now a hard
requirement
: missing either one is a named, immediate error rather than a
silent fallback to the placeholder. FDROID_REPO_DESCRIPTION stays
optional. This is a breaking interface change, acceptable only because
weblib-viewer is this action's sole consumer and is updated in the same
piece of work: weblib-viewer#25 (stacked on this PR).

A second thing found while wiring this up, not assumed going in.
fdroidserver's own common.py unconditionally refuses to run any command
once config.yml sets repo_url at all, unless it ends in the literal
suffix /repo -- verified by reading the installed package
(common.py:662-664) and reproduced in the test suite. There is no flag to
disable it, and the value is embedded verbatim as repo.address in
index-v2.json. So FDROID_REPO_URL has to end in /repo, and
publish.sh's existing <prefix> argument has to put the published tree
under a URL path that actually ends in /repo to match -- publishing to
the bucket root with no prefix (today's setup) cannot satisfy this at all:
either repo_url lacks the suffix and fdroid update refuses to run, or
it has the suffix and points at a path the bucket never serves. This
README section spells it out and weblib-viewer#25 wires the matching
publish.sh prefix.

Verification. run_tests.sh: 104 passed / 4 skipped (was 98/4;
the 4 skips are the opt-in live-bucket tests in test_publish.sh, unrelated
to this change). New assertions in test_fdroid_update.sh: the written
config.yml carries repo_url/repo_name/repo_description; the
resulting index-v2.json has the right repo.address/repo.name/
repo.description and none of fdroidserver's placeholder text; a name with
an embedded single quote round-trips correctly through the YAML; the script
fails when FDROID_REPO_URL or FDROID_REPO_NAME is unset, and fails
(via fdroidserver itself) when FDROID_REPO_URL lacks the /repo suffix.

Not merging or arming auto-merge -- this repo has only main, so it needs
review the same way weblib-ci does.

See fdroid-repo-ci#11. **Problem.** The published dev repo advertises fdroidserver's stock placeholder values. 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. ... ``` `fdroid-update.sh` writes `<repo-root>/config.yml` itself on every run, but only sets `keystore`/`keystorepass`/`keypass`/`repo_keyalias`. It never sets `repo_url`/`repo_name`/`repo_description`, so fdroidserver falls back to its own template. A publish that *succeeds* while advertising the wrong URL is the worst outcome here -- it is how bit noticed, via the broken "Add to F-Droid" button. **Change.** Add `FDROID_REPO_URL`/`FDROID_REPO_NAME`/ `FDROID_REPO_DESCRIPTION` environment variables (not new positionals -- `fdroid-update.sh` already has five plus pass-through extra args, and more positionals would be unreadable). The first two are now a **hard requirement**: missing either one is a named, immediate error rather than a silent fallback to the placeholder. `FDROID_REPO_DESCRIPTION` stays optional. **This is a breaking interface change**, acceptable only because weblib-viewer is this action's sole consumer and is updated in the same piece of work: weblib-viewer#25 (stacked on this PR). **A second thing found while wiring this up, not assumed going in.** fdroidserver's own `common.py` unconditionally refuses to run *any* command once `config.yml` sets `repo_url` at all, unless it ends in the literal suffix `/repo` -- verified by reading the installed package (`common.py:662-664`) and reproduced in the test suite. There is no flag to disable it, and the value is embedded verbatim as `repo.address` in `index-v2.json`. So `FDROID_REPO_URL` has to end in `/repo`, and `publish.sh`'s existing `<prefix>` argument has to put the published tree under a URL path that actually ends in `/repo` to match -- publishing to the bucket root with no prefix (today's setup) cannot satisfy this at all: either `repo_url` lacks the suffix and `fdroid update` refuses to run, or it has the suffix and points at a path the bucket never serves. This README section spells it out and weblib-viewer#25 wires the matching `publish.sh` prefix. **Verification.** `run_tests.sh`: **104 passed / 4 skipped** (was 98/4; the 4 skips are the opt-in live-bucket tests in `test_publish.sh`, unrelated to this change). New assertions in `test_fdroid_update.sh`: the written `config.yml` carries `repo_url`/`repo_name`/`repo_description`; the resulting `index-v2.json` has the right `repo.address`/`repo.name`/ `repo.description` and none of fdroidserver's placeholder text; a name with an embedded single quote round-trips correctly through the YAML; the script fails when `FDROID_REPO_URL` or `FDROID_REPO_NAME` is unset, and fails (via fdroidserver itself) when `FDROID_REPO_URL` lacks the `/repo` suffix. Not merging or arming auto-merge -- this repo has only `main`, so it needs review the same way weblib-ci does.
claude added 1 commit 2026-09-09 20:23:41 +00:00
The published repo advertised fdroidserver's own demo values
(repo.address "https://MyFirstFDroidRepo.org/fdroid/repo", repo.name "My
First F-Droid Repo Demo") because fdroid-update.sh wrote config.yml itself
but never set repo_url/repo_name/repo_description, so fdroidserver fell
back to its template. The "Add to F-Droid" button on the generated
index.html is built from repo_url, which is how bit noticed. A publish
that succeeds while advertising the wrong URL is silently wrong -- worse
than a failed job.

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). The first two are now a hard requirement, naming
the missing one; FDROID_REPO_DESCRIPTION stays optional. This is a breaking
change to a public composite action's interface, acceptable only because
weblib-viewer is the sole consumer and is updated in the same change
(weblib-viewer#26).

Also discovered while wiring this up and worth recording since it
contradicts the "no /fdroid/repo suffix" assumption in weblib's working
notes: fdroidserver's own common.py unconditionally refuses to run once
config.yml sets repo_url at all, unless it ends in the literal suffix
"/repo" -- there is no flag to disable that check, and the value is
embedded verbatim as repo.address. So FDROID_REPO_URL has to end in /repo,
and publish.sh's existing <prefix> argument has to put the published tree
under a URL path that actually ends in /repo to match, or fdroid update
refuses to run at all (checked positive) / the address points at a path
the bucket never serves (checked against the live fdroid-weblib-dev bucket
layout).

Extends test_fdroid_update.sh: config.yml carries the values, the resulting
index-v2.json has the right repo.address/name/description (not
fdroidserver's placeholder), a name with an embedded single quote survives
the YAML round-trip, and the script fails when FDROID_REPO_URL or
FDROID_REPO_NAME is absent or FDROID_REPO_URL lacks the /repo suffix.
run_tests.sh: 104 passed / 4 skipped (was 98/4).

Filed as fdroid-repo-ci#11.

Co-authored-by: bit <bit@das-labor.org>
claude requested review from bit 2026-09-09 20:23:45 +00:00
bit scheduled this pull request to auto merge when all checks succeed 2026-09-09 20:31:48 +00:00
bit merged commit 760583b7e3 into main 2026-09-09 20:31:49 +00:00
bit deleted branch fdroid-repo-metadata 2026-09-09 20:31:50 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Blocks
You do not have permission to read 1 dependency
Reference: weblib/fdroid-repo-ci#12