scan_repo_files() in fdroidserver picks up any .json file under repo/
whose name isn't in its ignore list. Our renamed index-v2-<hash>.json
from the prior rehash run isn't in that list, so the next fdroid update
indexed it as an installable "package" with packageName == its sha256.
cleanup_stale_indexes in rehash.py already does the right thing — it
just ran too late, after the bogus entry was already in the new index.
Move the same sweep into the entrypoint, before fdroid update runs, so
scan_repo_files() sees a clean directory.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Without this, every update left another renamed index lying in repo/
forever — pinning the repo to IPFS would keep re-pinning all of them.
Also strip a pre-existing -<hex12> suffix from the stem before computing
the new one, so re-running rehash standalone (without an intervening
fdroid update) is idempotent instead of producing index-v2-abc-def.json.
diff/*.json doesn't need the same treatment: fdroidserver's make_v2()
already wipes the whole diff/ directory at the start of every update.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Downstream of registry.gitlab.com/fdroid/docker-executable-fdroidserver:master,
patched for publishing F-Droid repos over IPFS:
- install Debian ipfs-cid so fdroidserver populates ipfsCIDv1 on every
package file (APKs, icons, screenshots), which fdroidclient with an
IPFS-gateway mirror routes via CID natively
- rehash.py wrapper that adds ipfsCIDv1 to entry["index"], renames the
index to a content-addressed filename, and re-signs entry.jar after
`fdroid update` — closes the cache-busting gap on the index file itself
- entrypoint.sh chains rehash automatically after any `fdroid update`,
so existing fdroid-via-docker wrappers need no changes
See SPEC.md for the rationale and Change 2's algorithm; README.md for
end-user usage.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>