Repository navigation
fix: list log/ in the repository root index - #5
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.