Matthew Holt
ccb5d19c25
Get module name at runtime, and tidy up modules
6 years ago
Matthew Holt
b780f0f49b
Standardize exit codes and improve shutdown handling; update gitignore
6 years ago
Matthew Holt
7512ea1a64
Change storage module key from "system" to "module"
6 years ago
Matthew Holt
fdd871e177
go.mod: Append /v2 to module name; update all import paths
See https://github.com/golang/go/wiki/Modules#semantic-import-versioning
6 years ago
Matthew Holt
3177ee8010
Add license
6 years ago
Matthew Holt
31ab737bf2
Refactor code related to getting current version
And set version in CertMagic for User-Agent purposes
6 years ago
Matthew Holt
a4bdf249db
Caddy 2 gets a CLI! And admin endpoint is now configurable via JSON
6 years ago
Matthew Holt
5137859e47
Rename caddy2 -> caddy
Removes the version from the package name
6 years ago
Matthew Holt
2265db9028
Fix bug unmarshaling custom duration values
6 years ago
Matthew Holt
bc00d840e8
Export types and fields necessary to build configs (for config adapters)
Also flag most fields with 'omitempty' for JSON marshaling
6 years ago
Matthew Holt
fec7fa8bfd
Implement most of static file server; refactor and improve Replacer
6 years ago
Matthew Holt
1f0c061ce3
Architectural shift to using context for config and module state
6 years ago
Matthew Holt
ff5b4639d5
Some minor updates, and get rid of OnLoad/OnUnload
6 years ago
Matthew Holt
5859cd8dad
Instantiate apps that are needed but not explicitly configured
6 years ago
Matthew Holt
2d056fbe66
Initial commit of Storage, TLS, and automatic HTTPS implementations
6 years ago
Matthew Holt
545f28008e
Begin implementing error handling and re-handling
6 years ago
Matthew Holt
402f423693
Implement "global" state for modules, OnLoad and OnUnload callbacks
Tested for memory leaks and performance. Obviously the added locking and
global state is not awesome, but the alternative is a little uglier IMO:
we'd have to make some sort of "liaison" value which stores the state,
then pass it around to every module, and so LoadModule becomes a lot
less accessible, and each module would need to maintain a reference to
it... nope, just ugly. I think this is the cleaner solution: just make
sure only one Start() happens at a time, and keep global things global.
Very simple log middleware is an example.
Might need to reorder the operations in Start() and handle errors
differently, etc. Otherwise, I'm mostly happy with this solution...
6 years ago
Matthew Holt
59a5d0db28
Close listeners which are no longer used
6 years ago
Matt Holt
f976aa7443
Merged in deadlines (pull request #1 )
Cleanly fake-close listeners
* WIP debugging listener deadlines
* Fix listener deadlines
6 years ago
Matthew Holt
6621406fa8
Very basic middleware and route matching functionality
6 years ago
Matthew Holt
27ff6aeccb
Fix goroutine leak in Run
D'oh, the servers' Shutdown() would never be called because they were
never added to the list of servers.
Thanks Danny for finding this.
6 years ago
Matthew Holt
a8dc73b4d9
Performance testing Load function
6 years ago
Matthew Holt
86e2d1b0a4
Rudimentary start of HTTP servers
6 years ago