summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver
AgeCommit message (Collapse)Author
2023-05-22fileserver: Don't set Etag if mtime is 0 or 1 (close #5548) (#5550)Matt Holt
2023-05-20fileserver: browse: minor tweaks for grid view, dark mode (#5545)pistasjis
* Make grid entries take up full width on mobile and fix breadcrumb color issue in dark mode Signed-off-by: Pistasj <odyssey346@disroot.org> * Do mholt's suggestions Signed-off-by: Pistasj <odyssey346@disroot.org> --------- Signed-off-by: Pistasj <odyssey346@disroot.org>
2023-05-20fileserver: Only set Etag if not already set (fix #5546) (#5547)Charles Duffy
2023-05-19fileserver: Fix file browser breadcrumb font (#5543)pistasjis
Signed-off-by: Pistasj <odyssey346@disroot.org>
2023-05-19fileserver: More filetypes for browse iconsMatthew Holt
2023-05-19fileserver: Fix file browser footer in grid mode (#5536)pistasjis
* Fix file browser footer in grid Signed-off-by: Odyssey <odyssey346@disroot.org> * Fix file browser footer while in grid mode Signed-off-by: Pistasj <odyssey346@disroot.org> * Do mholt's suggestions Signed-off-by: Odyssey <odyssey346@disroot.org> --------- Signed-off-by: Odyssey <odyssey346@disroot.org> Signed-off-by: Pistasj <odyssey346@disroot.org>
2023-05-15fileserver: Use EscapedPath for browse (#5534)Matt Holt
* fileserver: Use EscapedPath for browse Fix #5143 * Fixes if filter element is not present * Remove extraneous line
2023-04-26caddyhttp: Impl `ResponseWriter.Unwrap()`, prep for Go 1.20's ↵Kévin Dunglas
`ResponseController` (#5509) * feat: add support for ResponseWriter.Unwrap() * cherry-pick Francis' code
2023-04-25fix some comments (#5508)cui fliter
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-04-02fileserver: Add color-scheme meta tag (#5475)Kid
2023-03-27log: Make sink logs encodable (#5441)Mohammed Al Sahaf
* log: make `sink` encodable * deduplicate logger fields * extract common fields into `BaseLog` and embed it into `SinkLog` * amend godoc on `BaseLog` and `SinkLog` * minor style change --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-03-10fileserver: New file browse template (#5427)Matt Holt
* fileserver: New file browse template * Redo extension/icon logic; minor color tweaks * Fine-tune image display
2023-03-03fileserver: Remove trailing slash on fs filenames (#5417)esell
2023-02-24cmd: Expand cobra support, add short flags (#5379)Francis Lavoie
* cmd: Expand cobra support * Convert commands to cobra, add short flags * Fix version command typo Co-authored-by: Emily Lange <git@indeednotjames.com> * Apply suggestions from code review Co-authored-by: Matt Holt <mholt@users.noreply.github.com> --------- Co-authored-by: Emily Lange <git@indeednotjames.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2023-02-08go.mod: Upgrade various dependencies (#5362)Francis Lavoie
* chore: Upgrade various dependencies * Support CEL file matcher with no args * Document `http.request.orig_uri.path.*`, reorder placeholders in docs --------- Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2023-01-04fileserver: Add a couple test casesMatthew Holt
With placeholders
2022-10-24fileserver: Reject non-GET/HEAD requests (close #5166) (#5167)Matt Holt
* fileserver: Reject non-GET/HEAD requests (close #5166) * Set Allow header according to RFC 9110 10.2.1
2022-10-18fileserver: Reject ADS and short name paths; trim trailing dots and spaces ↵Matt Holt
on Windows (#5148) * fileserver: Reject ADS and short name paths * caddyhttp: Trim trailing space and dot on Windows Windows ignores trailing dots and spaces in filenames. * Fix test * Adjust path filters * Revert Windows test * Actually revert the test * Just check for colons
2022-10-08fileserver: stop listing dir when request context is cancelled (#5131)Abdussamet Koçak
Prevents caddy from performing disk IO needlessly when the request is cancelled before the listing is finished. Closes #5129
2022-10-04fileserver: Treat invalid file path as NotFound (#5099)xufanglu
treat invalid file path as notFound so that PassThru can work
2022-10-01fileserver: better dark mode visited link contrast (#5105)iliana etaoin
PR #4066 added a dark color scheme to the file_server browse template. PR #4356 later set the links for the `:visited` pseudo-class, but did not set anything for the dark mode, resulting in poor contrast. I selected some new colors by feel. This commit also adds an `a:visited:hover` for both, to go along with the normal blue hover colors.
2022-09-20fileserver: Reinstate --debug flagMatthew Holt
I think it got lost during a rebase or something
2022-09-16core: Variadic Context.Logger(); soft deprecationMatthew Holt
Ideally I'd just remove the parameter to caddy.Context.Logger(), but this would break most Caddy plugins. Instead, I'm making it variadic and marking it as partially deprecated. In the future, I might completely remove the parameter once most plugins have updated.
2022-09-15caddyhttp: Add --debug flag to commandsMatthew Holt
file-server and reverse-proxy This might be useful!
2022-09-07fileserver: Ignore EOF when browsing empty dirMatthew Holt
Thanks to @WeidiDeng for reporting this
2022-09-05Drop requirement for filesystems to implement fs.StatFSDave Henderson
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2022-09-05fileserver: Support glob expansion in file matcher (#4993)Matt Holt
* fileserver: Support glob expansion in file matcher * Fix tests * Fix bugs and tests * Attempt Windows fix, sigh * debug Windows, WIP * Continue debugging Windows * Another attempt at Windows * Plz Windows * Cmon... * Clean up, hope I didn't break anything
2022-08-16caddyhttp: Smarter path matching and rewriting (#4948)Matt Holt
Co-authored-by: RussellLuo <luopeng.he@gmail.com>
2022-08-15fileserver: reset buffer before using it (#4962) (#4963)Abdussamet Koçak
2022-08-08fileserver: Better fix for Etag of compressed filesMatthew Holt
2022-08-08fileserver: Generate Etag from sidecar fileMatthew Holt
Don't use the primary/uncompressed file for Etag when serving sidecars. This was just overlooked initially.
2022-08-02chore: Bump up to Go 1.19, minimum 1.18 (#4925)Francis Lavoie
2022-08-01caddyhttp: Implement `caddy respond` command (#4870)Matt Holt
2022-07-31fileserver: Support virtual file system in CaddyfileMatthew Holt
2022-07-30fileserver: Support virtual file systems (#4909)Matt Holt
* fileserver: Support virtual file systems (close #3720) This change replaces the hard-coded use of os.Open() and os.Stat() with the use of the new (Go 1.16) io/fs APIs, enabling virtual file systems. It introduces a new module namespace, caddy.fs, for such file systems. Also improve documentation for the file server. I realized it was one of the first modules written for Caddy 2, and the docs hadn't really been updated since! * Virtualize FS for file matcher; minor tweaks * Fix tests and rename dirFS -> osFS (Since we do not use a root directory, it is dynamic.)
2022-07-28Finish fixing lint errors from ea8df6ffMatthew Holt
Follows up #4915
2022-07-28caddyhttp: Use new CEL APIs (fix #4915)Matthew Holt
Hahaha this is the ultimate "I have no idea what I'm doing" commit but it compiles and the tests pass and I declare victory! ... probably broke something, should be tested more. It is nice that the protobuf dependency becomes indirect now.
2022-07-07fileserver: Use safe redirects in file browserMatthew Holt
2022-06-22Expose several Caddy HTTP Matchers to the CEL Matcher (#4715)Tristan Swadell
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2022-04-25httpcaddyfile: Deprecate paths in site addresses; use zap logs (#4728)Francis Lavoie
2022-04-07staticfiles: Expand placeholder for index files (#4679)Y.Horie
2022-03-04fileserver: Add `pass_thru` Caddyfile option (#4613)Francis Lavoie
2022-03-01fileserver: Canonical redir when whole path is stripped (#4549)Francis Lavoie
2021-12-11fileserver: do not double-escape paths (#4447)Mohammed Al Sahaf
2021-12-05docs: use backticks to not italicise glob path (#4460)Adam Burgess
2021-11-23fileserver: browse: do not encode the paths in breadcrumbs and page title ↵Mohammed Al Sahaf
(#4410)
2021-11-22fileserver: Fix handling of symlink sizes in directory listings (#4415)Jeremy Lin
2021-11-15fileserver: Move default browse template into a separate file (#4417)Jeremy Lin
This makes it easier for users to find the default browse template if they want to create a custom template based on that. It also makes it easier to view the template with proper syntax highlighting.
2021-10-20fileserver: Prevent focusing filter from scrolling on page load (#4393)Klaus Helenius
2021-09-19fileserver: Make file listing links purple once visited (#4356)Slavik