summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/rewrite
AgeCommit message (Collapse)Author
2019-12-23Improve godocs all aroundMatthew Holt
These will be used in the new automated documentation system
2019-12-17rewrite: Attempt query string fix (#2891)Matthew Holt
2019-12-12rewrite: strip_prefix, strip_suffix, and uri_replace dirs (closes #2906)Matthew Holt
2019-12-12try_files, rewrite: allow query string in try_files (fix #2891)Matthew Holt
Also some minor cleanup/improvements discovered along the way
2019-12-12rewrite: query string enh.; substring replace; add tests (see #2891)Matthew Holt
2019-12-10v2: Module documentation; refactor LoadModule(); new caddy struct tags (#2924)Matt Holt
This commit goes a long way toward making automated documentation of Caddy config and Caddy modules possible. It's a broad, sweeping change, but mostly internal. It allows us to automatically generate docs for all Caddy modules (including future third-party ones) and make them viewable on a web page; it also doubles as godoc comments. As such, this commit makes significant progress in migrating the docs from our temporary wiki page toward our new website which is still under construction. With this change, all host modules will use ctx.LoadModule() and pass in both the struct pointer and the field name as a string. This allows the reflect package to read the struct tag from that field so that it can get the necessary information like the module namespace and the inline key. This has the nice side-effect of unifying the code and documentation. It also simplifies module loading, and handles several variations on field types for raw module fields (i.e. variations on json.RawMessage, such as arrays and maps). I also renamed ModuleInfo.Name -> ModuleInfo.ID, to make it clear that the ID is the "full name" which includes both the module namespace and the name. This clarity is helpful when describing module hierarchy. As of this change, Caddy modules are no longer an experimental design. I think the architecture is good enough to go forward.
2019-10-28v2: Logging! (#2831)Matt Holt
* logging: Initial implementation * logging: More encoder formats, better defaults * logging: Fix repetition bug with FilterEncoder; add more presets * logging: DiscardWriter; delete or no-op logs that discard their output * logging: Add http.handlers.log module; enhance Replacer methods The Replacer interface has new methods to customize how to handle empty or unrecognized placeholders. Closes #2815. * logging: Overhaul HTTP logging, fix bugs, improve filtering, etc. * logging: General cleanup, begin transitioning to using new loggers * Fixes after merge conflict
2019-10-19rewrite: Options to strip prefix/suffix and issue redirectsMatthew Holt
Fixes #2011
2019-10-16Minor enhancements/fixes to rewrite directive and template virt req'sMatthew Holt
2019-10-06rewrite: Return parse error if too many Caddyfile args (fixes #2791)Matthew Holt
2019-09-10rewrite: Caddyfile directive should always invoke a rehandleMatthew Holt
This is unless each route's matcher is dynamically executed after previous handlers...
2019-08-21Refactor Caddyfile adapter and module registrationMatthew Holt
Use piles from which to draw config values. Module values can return their name, so now we can do two-way mapping from value to name and name to value; whereas before we could only map name to value. This was problematic with the Caddyfile adapter since it receives values and needs to know the name to put in the config.
2019-08-09Fix module-related errorsMatthew Holt
2019-08-09Implement config adapters and beginning of Caddyfile adapterMatthew Holt
Along with several other changes, such as renaming caddyhttp.ServerRoute to caddyhttp.Route, exporting some types that were not exported before, and tweaking the caddytls TLS values to be more consistent. Notably, we also now disable automatic cert management for names which already have a cert (manually) loaded into the cache. These names no longer need to be specified in the "skip_certificates" field of the automatic HTTPS config, because they will be skipped automatically.
2019-07-11Flatten HTTP handler config (#2662) (#2663)Matt Holt
Differentiating middleware and responders has one benefit, namely that it's clear which module provides the response, but even then it's not a great advantage. Linear handler config makes a little more sense, giving greater flexibility and simplifying the core a bit, even though it's slightly awkward that handlers which are responders may not use the 'next' handler that is passed in at all.
2019-07-02go.mod: Append /v2 to module name; update all import pathsMatthew Holt
See https://github.com/golang/go/wiki/Modules#semantic-import-versioning
2019-06-30Add licenseMatthew Holt
2019-06-14Rename caddy2 -> caddyMatthew Holt
Removes the version from the package name
2019-06-04Change import paths to GitHub package namesMatthew Holt
2019-05-23Add request_body middleware and some limits to HTTP serversMatthew Holt
2019-05-22Export types and fields necessary to build configs (for config adapters)Matthew Holt
Also flag most fields with 'omitempty' for JSON marshaling
2019-05-21Module.New() does not need to return an errorMatthew Holt
2019-05-21Fix up matchers tests and take care of TODO in rewriteMatthew Holt
2019-05-20Implement rewrite middleware; fix middleware stack bugsMatthew Holt