Matthew Holt
788462bd4c
file-server command: Use safer defaults; http: improve host matcher docs
5 years ago
Matthew Holt
5a0603ed72
Config auto-save; run --resume flag; update environ output ( close #2903 )
Config auto-saving is on by default and can be disabled. The --environ
flag (or environ subcommand) now print more useful information from
Caddy and the runtime, including some nifty paths.
5 years ago
Matthew Holt
984d384d14
Change storage paths to follow OS conventions; migrate folder ( #2955 )
5 years ago
Matthew Holt
fdabac51a8
Improve docs, especially w.r.t. placeholders and template actions
5 years ago
Matthew Holt
95d944613b
Export Replacer and use concrete type instead of interface
The interface was only making things difficult; a concrete pointer is
probably best.
5 years ago
Matthew Holt
2b33d9a5e5
http: Enable TLS for servers listening only on HTTPS port
It seems silly to have to add a single, empty TLS connection policy to
a server to enable TLS when it's only listening on the HTTPS port. We
now do this for the user as part of automatic HTTPS (thus, it can be
disabled / overridden).
See https://caddy.community/t/v2-catch-all-server-with-automatic-tls/6692/2?u=matt
5 years ago
Matthew Holt
5c8b502964
fastcgi: Set SERVER_SOFTWARE, _NAME, and _PORT properly ( fixes #2952 )
5 years ago
Matthew Holt
82bebfab8a
templates: Change functions, add front matter support, better markdown
5 years ago
Matthew Holt
be3849c267
Remove markdown module
5 years ago
Matthew Holt
16ee985c22
admin: Only write most CORS headers in OPTIONS requests
5 years ago
Matthew Holt
95ed603de7
Improve godocs all around
These will be used in the new automated documentation system
5 years ago
Matthew Holt
cbb405f6aa
cmd: Eliminate unintended use of cgo
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.
5 years ago
Matthew Holt
724c728678
rewrite: Attempt query string fix ( #2891 )
5 years ago
Matthew Holt
21408212da
http: query and query_string placeholders should use RawQuery, probably
5 years ago
Matthew Holt
fe516575db
core: Add ReplaceFunc method to Replacer to allow dynamic replacements
5 years ago
Matthew Holt
080a62d5c5
Update go.mod; use CertMagic v0.9.0
5 years ago
Matthew Holt
dae4913fe3
http: Patch path matcher to ignore dots and spaces ( #2917 )
(Try saying "patch path match" ten times fast)
5 years ago
Matthew Holt
6455efa5d3
admin: POST /... expands and appends all array elements
Makes it easy to append many items to an array in one command
5 years ago
Matthew Holt
5ab17a3a37
admin: /stop endpoint gracefully shuts down; fixes caddy stop command
5 years ago
Abdelmalek Ihdene
c3bcd967bd
logging: Implement net writer ( #2884 )
* Implement UDP writer
* Implement Net Writer
* Utilize Caddy's address parsing functions
* A couple little fixes (see #2884 )
5 years ago
Matthew Holt
6ea121ddf8
tls: Ensure conn policy is created when providing certs in Caddyfile
Fixes #2929
5 years ago
Matthew Holt
8005b7ab73
Couple of quick fixes
5 years ago
Matthew Holt
b1a456cfe3
rewrite: strip_prefix, strip_suffix, and uri_replace dirs ( closes #2906 )
5 years ago
Matthew Holt
5e9d81b507
try_files, rewrite: allow query string in try_files ( fix #2891 )
Also some minor cleanup/improvements discovered along the way
5 years ago
Matthew Holt
09a8517065
rewrite: query string enh.; substring replace; add tests (see #2891 )
5 years ago
Matthew Holt
87b6cf470b
Minor improvements; comments and shorter placeholders & module IDs
5 years ago
Matthew Holt
f935458e3e
cmd: Fix validate command when JSON contains "@id" fields
Also, don't run admin server when validating...
5 years ago
Matt Holt
2e0615270d
fuzz: Remove Caddyfile adapter from fuzz corpus ( #2925 )
The Caddyfile adapter does not need to be fuzzed, as all it really does
is invoke the Caddyfile parser, which is already fuzzed
5 years ago
Matthew Holt
fab5e4372a
core: Add godoc examples for LoadModule
5 years ago
Matt Holt
3c90e370a4
v2: Module documentation; refactor LoadModule(); new caddy struct tags ( #2924 )
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.
5 years ago
Marten Seemann
a8533e5630
update quic-go to v0.14.1 ( #2918 )
5 years ago
Matthew Holt
b07f6958ac
Use "IsUnixNetwork" function instead of repeating the logic
5 years ago
Matthew Holt
33a318d173
Don't append port to unix sockets
See https://caddy.community/t/caddy-v2-php-fpm-502-error/6571?u=matt
5 years ago
lu4p
68adfdc559
Fix misspellings ( #2908 )
5 years ago
Marten Seemann
a841688cc0
update quic-go to v0.14.0 ( #2916 )
5 years ago
Matthew Holt
52ae5f70d2
Merge branch 'v2' of ssh://github.com/caddyserver/caddy into v2
5 years ago
Matthew Holt
44f23a67bb
http: Don't listen 1 port beyond port range
5 years ago
Mark Sargent
8b7d6a9ee8
v2: fixes query matcher parsing ( #2901 )
* fixes query matcher parsing
* return correct argument error when parsing query matcher
5 years ago
Matthew Holt
7c7ef8d40e
http: Shorten regexp matcher placeholders; allow "=/" for simple matcher
5 years ago
Matthew Holt
14d3fd7d03
http: path matcher supports exact matching with = prefix
5 years ago
Matthew Holt
512b004332
http: header matcher supports fast prefix and suffix matching ( #2888 )
5 years ago
Matthew Holt
db4293cb5f
reverse_proxy: Add flush_interval to caddyfile syntax ( #1460 )
Also add godoc for Caddyfile syntax for file_server
5 years ago
Matthew Holt
6e10586303
admin: Preserve "@id" fields through partial changes ( fixes #2902 )
5 years ago
Matthew Holt
8de1a76227
reverse_proxy: Fix invalid argument to Intn in RandomChoice selection
5 years ago
Matthew Holt
9fe54e1c60
file_server: Use HTTPS port when a qualifying domain is specified
Also little comment cleanups
5 years ago
Matthew Holt
b43e986a52
file_server: Optional pass_thru mode
If enabled, will call the next handler in the chain instead of returning
a 404.
5 years ago
Matthew Holt
1228dd7d93
reverse_proxy: Allow buffering of client requests
This is a bad idea, but some backends apparently require it. See
discussion in #176 .
5 years ago
Matthew Holt
af26a03da1
http: Only enable access logs if configured
5 years ago
Matthew Holt
8025ad9107
cmd: Disable admin endpoint for file-server and reverse-proxy commands
This makes it easier to use multiple instances on the same machine
5 years ago
Matthew Holt
6cdb2392d7
cmd: Improve stop command by trying API before signaling process
This allows graceful shutdown on all platforms
5 years ago