Skip to content

fix: list log/ in the repository root index - #5

Merged
Iamliuxiaozhen merged 1 commit into
mainfrom
fix/log-in-root-index
Dec 1, 2026
Merged

Iamliuxiaozhen merged 1 commit into
mainfrom
fix/log-in-root-index

Conversation

@Iamliuxiaozhen

Copy link
Copy Markdown
Member

The root listing at https://apt-general.zitzhen.cn showed dists/, pool/ and the two key files but no log/, even though /log/ and its five log files were published and reachable by direct URL.

Cause: the root index.html is generated by publish-repo.sh, which walks the staged tree and writes one index per directory. The logs were staged by a separate publish-logs job that uploaded straight to the R2 log/ prefix after the publish job had already generated and synced its indexes. The tree the index was built from never contained a log/ directory, so the listing could not include it. generate-index.sh was behaving correctly; it lists what exists.

Fix: stage the build logs into the repository tree inside the publish job, before publish-repo.sh runs, so the generated root index includes log/ and /log/index.html is produced by the same walk as every other directory. This also removes the second job, so nothing writes to the bucket concurrently.

The R2 sync now runs three passes by content type. The generic pass excludes both generated indexes and log/*.log: .log has no registered MIME type, so without an explicit type those objects would be served as application/octet-stream and download instead of rendering as text.

Verified locally by staging logs into a tree, running collect-logs.sh and generate-index.sh, and confirming the root index lists dists/, log/, pool/ and the key files, with /log/index.html listing both log files. Also checked that an empty or missing log directory still yields a log/ entry rather than failing the publish.

The root listing at https://apt-general.zitzhen.cn showed dists/, pool/ and
the two key files but no log/, even though /log/ and its five log files were
published and reachable by direct URL.

Cause: the root index.html is generated by publish-repo.sh, which walks the
staged tree and writes one index per directory. The logs were staged by a
separate publish-logs job that uploaded straight to the R2 log/ prefix after
the publish job had already generated and synced its indexes. The tree the
index was built from never contained a log/ directory, so the listing could
not include it. generate-index.sh was behaving correctly; it lists what
exists.

Fix: stage the build logs into the repository tree inside the publish job,
before publish-repo.sh runs, so the generated root index includes log/ and
/log/index.html is produced by the same walk as every other directory. This
also removes the second job, so nothing writes to the bucket concurrently.

The R2 sync now runs three passes by content type. The generic pass excludes
both generated indexes and log/*.log: .log has no registered MIME type, so
without an explicit type those objects would be served as
application/octet-stream and download instead of rendering as text.

Verified locally by staging logs into a tree, running collect-logs.sh and
generate-index.sh, and confirming the root index lists dists/, log/, pool/ and
the key files, with /log/index.html listing both log files. Also checked that
an empty or missing log directory still yields a log/ entry rather than
failing the publish.

Signed-off-by: Oliver Lin <oliver@liuxiaozhen.dev>
@Iamliuxiaozhen
Iamliuxiaozhen merged commit 75341e0 into main Dec 1, 2026
4 checks passed
@Iamliuxiaozhen
Iamliuxiaozhen deleted the fix/log-in-root-index branch December 1, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant