summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2019-12-23cmd: Eliminate unintended use of cgoMatthew Holt
This means the stop command can only use the API to stop the instance; no more signaling, unless we find a cgo-free way of doing it.
2019-12-16admin: /stop endpoint gracefully shuts down; fixes caddy stop commandMatthew Holt
2019-12-12cmd: Fix validate command when JSON contains "@id" fieldsMatthew Holt
Also, don't run admin server when validating...
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-11-15cmd: Improve stop command by trying API before signaling processMatthew Holt
This allows graceful shutdown on all platforms
2019-11-08cmd: Print errors to stderrMatthew Holt
2019-11-04cmd: Move module imports into standard packagesMatthew Holt
This makes it easier to make "standard" caddy builds, since you'll only need to add a single import to get all of Caddy's standard modules. There is a package for all of Caddy's standard modules (modules/standard) and a package for the HTTP app's standard modules only (modules/caddyhttp/standard). We still need to decide which of these, if not all of them, should be kept in the standard build. Those which aren't should be moved out of this repo. See #2780.
2019-11-04core: Major refactor of admin endpoint and config handlingMatthew Holt
Fixed several bugs and made other improvements. All config changes are now mediated by the global config state manager. It used to be that initial configs given at startup weren't tracked, so you could start caddy with --config caddy.json and then do a GET /config/ and it would return null. That is fixed, along with several other general flow/API enhancements, with more to come.
2019-10-30admin listener as opt-in for initial config (#2834)Andreas Schneider
* Always cleanup admin endpoint first * Error out if no config has been set (#2833) * Ignore explicitly missing admin config (#2833) * Separate config loading from admin initialization (#2833) * Add admin option to specify admin listener address (#2833) * Use zap for reporting admin endpoint status
2019-10-29Plug in distributed STEK moduleMatthew Holt
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-15v2: Project-and-CI-wide linter config (#2812)Mohammed Al Sahaf
* v2: split golangci-lint configuration into its own file to allow code editors to take advantage of it * v2: simplify code * v2: set the correct lint output formatting * v2: invert the logic of linter's configuration of output formatting to allow the editor convenience over CI-specific customization. Customize the output format in CI by passing the flag. * v2: remove irrelevant golangci-lint config
2019-10-10cmd: Plug in the http.handlers.authentication moduleMatthew Holt
2019-10-10http: Add Starlark handlerMatthew Holt
This migrates a feature that was previously reserved for enterprise users, according to #2786. The Starlark integration needs to be updated since this was made before some significant changes in the v2 code base. When functional, it makes it possible to have very dynamic HTTP handlers. This will be a long-term ongoing project. Credit to Danny Navarro
2019-10-09http: Add work-in-progress cache handler moduleMatthew Holt
This migrates a feature that was previously reserved for enterprise users, according to https://github.com/caddyserver/caddy/issues/2786. The cache HTTP handler will be a high-performing, distributed cache layer for HTTP requests. Right now, the implementation is a very basic proof-of-concept, and further development is required.
2019-10-08cmd: Built-in commands all use RegisterCommand (#2794)yzongyue
2019-10-06cmd/main: Plug in json5 and jsonc config adaptersMatthew Holt
2019-10-06cmd: adapt: Default --adapter value is "caddyfile"Matthew Holt
2019-10-01cmd: CLI improvements; add --validate to adapt commandMatthew Holt
2019-09-30cmd: Add validate subcommand; list-modules --versions; some renamingMatthew Holt
Renames --config-adapter flag to --adapter, adapt-config command to adapt, --print-env flag to --environ, and --input flag to --config.
2019-09-30cmd: Refactor subcommands, add help, make them pluggableaca
* cli: Change command structure, add help subcommand (#328) * cli: improve subcommand structure - make help command as normal subcommand - add flag usage message for each command * cmd: Refactor subcommands and command line help; make commands pluggable
2019-09-19httpcaddyfile: Global storage configuration (closes #2758)Matthew Holt
2019-09-18http: Improve auto HTTP->HTTPS redirects, fix edge casesMatthew Holt
See https://caddy.community/t/v2-issues-with-multiple-server-blocks-in-caddyfile-style-config/6206/13?u=matt Also print pid when using `caddy start`
2019-09-13Use keybase fork of mitchellh/go-ps for bug fixes (#2750)Mohammed Al Sahaf
2019-09-10Experimental IETF-standard HTTP/3 support (known issue exists) (#2727)Matt Holt
* Begin WIP integration of HTTP/3 support * http3: Set actual Handler, make fakeClosePacketConn type for UDP sockets Also use latest quic-go for ALPN fix * Manually keep track of and close HTTP/3 listeners * Update quic-go after working through some http3 bugs * Fix go mod * Make http3 optional for now
2019-09-09Merge pull request #2737 from caddyserver/fastcgi (reverse proxy!)Matt Holt
v2: Refactor reverse proxy and add FastCGI support
2019-09-05cli: Fix run and start when no config file is availableMatthew Holt
2019-09-02reverse_proxy: WIP refactor and support for FastCGIMatthew Holt
2019-08-22caddyfile: Support global config block; allow non-empty blocks w/ 0 keysMatthew 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-24Add missing imports (#2688)Dreamacro
2019-07-20Force quit on Windows with taskkill /f (#2670)Toby Allen
* Force quit /f on windows, also check for processname '.exe' on windows. * Remove unneeded spaces * fix tabs * go fmt tabs * Return consistent appname which always includes .exe * Change func name
2019-07-18cmd: Add print-env flag to run commandMatthew Holt
2019-07-12Standardize exit codes and improve shutdown handling; update gitignoreMatthew Holt
2019-07-07Better error handling in CLI commandsMatthew Holt
2019-07-05cmd: New reload commandMatthew Holt
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-28Refactor code related to getting current versionMatthew Holt
And set version in CertMagic for User-Agent purposes
2019-06-28Caddy 2 gets a CLI! And admin endpoint is now configurable via JSONMatthew Holt
2019-06-18Implement templates handler; various minor cleanups and bug fixesMatthew Holt
2019-06-14Rename caddy2 -> caddyMatthew Holt
Removes the version from the package name
2019-06-13Implement brotli encoder; improve validation of other encodersMatthew Holt
2019-06-13Update go modulesMatthew Holt
2019-06-10Implement encode middleware (#2)Matt Holt
* Implement encode middleware * Add missing break; and add missing JSON struct field tag
2019-06-04Change import paths to GitHub package namesMatthew Holt
2019-06-03Customize admin endpoint address with -listen flagMatthew Holt
This is a temporary holdover for development purposes
2019-05-29Implement session ticket keys; default STEK module with rotationMatthew Holt
2019-05-23Add very simple markdown middleware for nowMatthew Holt
2019-05-22Change admin listener to :1234 for now; output message when listeningMatthew Holt