Commit graph

4 commits

Author SHA1 Message Date
PerryLink
a97bc460cf
fileserver: hide the config directory when it is relative (#8398)
FileServer.Provision hides the data directory when it is relative (#8327),
because a relative data directory sits under the working directory and
holds private keys. The config directory falls back to the same relative
"./caddy" when no config home can be resolved, and it holds autosave.json,
which is the loaded configuration.

The two directories are resolved independently, so an absolute data
directory did not cover a relative config directory: with XDG_DATA_HOME set
and no HOME or XDG_CONFIG_HOME, the data directory is absolute while the
config directory is "./caddy" under the served root.

Both directories are now hidden through the existing fallback, each entry
added only once.

Refs #8381
2026-11-10 14:56:52 +00:00
Kévin Dunglas
af4d0c37d4
fileserver: ignore case for literal hide entries (#8378)
On case-insensitive filesystems (APFS and NTFS by default), a request using another letter case opens a hidden file anyway: the Caddyfile auto-hidden by httpcaddyfile is served for /caddyfile.

Entries without glob characters now match regardless of letter case. Glob patterns keep their case-sensitive matching. On case-sensitive filesystems, a literal entry also hides names that differ from it only by case.
2026-11-08 21:52:49 +00:00
Kévin Dunglas
9dd12fdb5d
fileserver: hide the data directory when it is relative (#8327) 2026-11-01 15:57:49 -05:00
ammann
d65583e6d2
fileserver: apply hide rules to browse entries and sidecars (#8155) 2026-10-08 13:26:26 +10:00