Skip to content

Commit

Permalink
Auto merge of #12853 - weihanglo:cname-warning, r=ehuss
Browse files Browse the repository at this point in the history
ci: big ⚠️ to ensure the CNAME file is always there

### What does this PR try to resolve?

A request from <https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/doc.2Ecrates.2Eio.20CNAME.20missing>

The CNAME file is for GitHub to redirect requests to the custom domain.
Missing this may entail security hazard and domain takeover.
See <https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#securing-your-custom-domain>
  • Loading branch information
bors committed Oct 19, 2023
2 parents 5fab767 + ec9c5b0 commit 5225467
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
# Generate HTML for link redirections.
python3 "$GENERATE_PY"
git add *.html
# WARN: The CNAME file is for GitHub to redirect requests to the custom domain.
# Missing this may entail security hazard and domain takeover.
# See <https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#securing-your-custom-domain>
git add CNAME
git commit -m "Deploy $GITHUB_SHA to gh-pages"
Expand Down
3 changes: 3 additions & 0 deletions ci/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def main():
mapped = "https://doc.rust-lang.org/cargo/reference/{}".format(name)
f.write(TEMPLATE.format(name=name, mapped=mapped))

# WARN: The CNAME file is for GitHub to redirect requests to the custom domain.
# Missing this may entail security hazard and domain takeover.
# See <https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#securing-your-custom-domain>
with open('CNAME', 'w') as f:
f.write('doc.crates.io')

Expand Down

0 comments on commit 5225467

Please sign in to comment.