Keeping files private

← Previous Next →
Site Operations · 4 of 6

Keeping files private

Committed and published are different things, and .assetsignore is what separates them.

Key rule

Three separate questions: is a file on disk, is it committed to git, and is it served publicly. Each has its own control. Conflating them is how private material ends up online.

ControlGoverns
.gitignoreWhat gets committed
.assetsignoreWhat gets uploaded and served
noindex meta tagWhether search engines list it, if they choose to obey

The middle one is the important one and the least known. Without an .assetsignore, everything in the asset directory is uploaded and publicly served. Cloudflare excludes nothing by default. The file uses .gitignore syntax and lives at the project root.

Why this site needs it

The whole local folder was pushed to the repo at migration time, including pages that had never been published on the old host. They immediately became live, because being in the repo is all it takes.

An audit of everything publicly reachable found unfinished drafts, a document written for one specific recipient, internal dev notes describing the site's own infrastructure, and mockups advertising the existence of unlisted pages. None of it was linked from anywhere. All of it was one URL away.

Those are now listed in .assetsignore. They remain in the repo as archive. They are simply not uploaded, so they return 404.

noindex is not privacy

One of those drafts already carried <meta name="robots" content="noindex, nofollow"> and was linked from no page. That is a reasonable instinct, and it is not protection. It asks well-behaved search engines not to list a page. It does nothing to stop anyone who has the URL, and nothing to stop a crawler that ignores it.

Worse, the generated sitemap was listing that page with a clickable link, quietly undoing the precaution. The sitemap generator now skips any HTML file carrying a noindex tag, so a deliberately unlisted page cannot be advertised by the very index meant to be convenient.

Checking rather than assuming

The reliable test is a request, not a reading of config:

curl -o /dev/null -w "%{http_code}\n" https://areactor.org/path/to/file

404 means it is not being served. 200 means it is, whatever you believed. Worth running against anything you assume is private, particularly after changing hosts, since host-level protections do not travel with your files.