Commit Graph

2355 Commits

Author SHA1 Message Date
Daniel
af82141808 caddyhttp: Add 'permission' plugin directive (#2639) 2019-06-12 10:15:17 -06:00
Jared Ririe
d11b648137 caddytls: Fix goroutine leak when restarting Caddy (#2644)
Each time the Caddyfile reloads and Caddy is restarted,
caddytls.NewConfig starts a goroutine for cleaning the
certificate storage. This goroutine ranges over a time.Ticker
channel; although Stop is called on this ticker, Stop does
not close the underlying channel so the goroutine never exits.

This change adds an additional channel that is listened to
in the certificate cleaning goroutine so it can exit
on restarts.
2019-06-11 15:24:35 -06:00
Matthew Holt
14a8ffedd8
Fix panic serving index file if HTTP request is malformed 2019-05-27 08:12:19 -06:00
Matthew Holt
b5906135c7
Move PR template in attempt to fix (sigh)
https://github.community/t5/How-to-use-Git-and-GitHub/Our-pull-request-templates-aren-t-showing-up-for-any-PRs/m-p/22958
2019-05-27 08:11:33 -06:00
AndreKR
4bad5c79be Simple rewrite regex captures (#2592)
* More informative rewrite test output

When running rewrite tests, the output in case of a test failure now
includes not only the rewritten URLs but also the from URL.

* Move re-escaping to regexpMatches

This commit moves the code to post-process the match replacements from
ComplexRule to regexpMatches, so it can later be re-used for SimpleRule.

Also changes the comment in an attempt to better explain the reasoning
behind that code.

The required strings.Replacer is now built only once.

* Support regex captures in simple rewrite rules

Closes #2586
2019-05-24 12:00:27 -06:00
Łukasz Nowak
81430e4aff gzip: Add .wasm (WebAssembly files) (#2624) 2019-05-24 09:59:06 -06:00
Anthony Plunkett
c238b72d5d readme: clarify about Go file to build Caddy (#2611) 2019-05-13 22:17:36 -06:00
Kurt Jung
a2ed91bc45 httpserver: Add pubsub plugin (#2589) 2019-04-26 12:32:43 -06:00
Matthew Holt
15fecbc161
1.0 release 2019-04-24 11:24:40 -06:00
Taufiq Rahman
c32a0f5f71 fix lint warnings (issue 2541) (#2551)
* Lint: fix some errcheck #2541

* Lint: fix passing structcheck #2541

* Lint: update fix structcheck #2541

* Lint: fix errcheck for basicauth, browse, fastcgi_test #2541

* Lint: fix errcheck for browse, fastcgi_test, fcgiclient, fcgiclient_test #2541

* Lint: fix errcheck for responsefilter_test, fcgilient_test #2541

* Lint: fix errcheck for header_test #2541

* Lint: update errcheck for fcgiclient_test #2541

* Lint: fix errcheck for server, header_test, fastcgi_test, https_test, recorder_test #2541

* Lint: fix errcheck for tplcontext, vhosttrie_test, internal_test, handler_test #2541

* Lint: fix errcheck for log_test, markdown mholt#2541

* Lint: fix errcheck for policy, body_test, proxy_test #2541

* Lint: fix errcheck for on multiple packages #2541

- reverseproxy
- reverseproxy_test
- upstream
- upstream_test
- body_test

* Lint: fix errcheck in multiple packages mholt#2541
- handler_test
- redirect_test
- requestid_test
- rewrite_test
- fileserver_test

* Lint: fix errcheck in multiple packages mholt#2541

- websocket
- setup
- collection
- redirect_test
- templates_test

* Lint: fix errcheck in logger test #2541

run goimports against #2551
- lexer_test
- log_test
- markdown

* Update caddyhttp/httpserver/logger_test.go

Co-Authored-By: Inconnu08 <taufiqrx8@gmail.com>

* Update log_test.go

* Lint: fix scope in logger_test #2541

* remove redundant err check in logger_test #2541

* fix alias in logger_test #2541

* fix import for format #2541

* refactor variable names and error check #2541
2019-04-22 10:20:37 -06:00
Matthew Holt
0c3d90ed21
I just learned about go mod tidy 2019-04-20 17:34:10 -06:00
Matthew Holt
fb31669261 Release beta2 2019-04-20 13:13:42 -06:00
Matt Holt
917d9bc9da
tls: Update to match CertMagic refactor (#2571)
* Update to match CertMagic's refactoring

* mod: CertMagic v0.5.0
2019-04-20 12:11:27 -06:00
Matthew Holt
fd6e4516dc
Remove now-unnecessary build.go
Caddy can be built, even with plugins, without modifying the source
code and without special build scripts, thanks to Go modules. See
the README or wiki.
2019-04-20 11:40:22 -06:00
Abiola Ibrahim
86205efcfe
Merge pull request #2570 from whalehub/patch-1
Fix instructions for building Caddy from source
2019-04-20 13:26:12 +01:00
Aaron
701e77514f
Fix instructions for building Caddy from source 2019-04-20 13:42:23 +02:00
Matthew Holt
018105eec9
readme: Update build-from-source instructions for Go modules 2019-04-20 01:19:44 -06:00
Matthew Holt
bf6ec2bbfd
main: Use embedded version, debug.BuildInfo 2019-04-20 00:52:53 -06:00
Matthew Holt
13d0454f71
Remove now-unused gitcookie 2019-04-20 00:52:23 -06:00
Marten Seemann
db2741c6e0 mod: import the right version of quic-go and tidy (#2562)
* run go mod tidy

* import the right version of quic-go
2019-04-17 12:13:44 -06:00
elcore
605787f671 readme: Update build instructions (#2565)
Fix #2560
2019-04-12 14:31:38 -06:00
Matthew Holt
657780bcdf Prepare 1.0beta1 release 2019-04-09 11:29:06 -06:00
Toby Allen
9d767e768a readme: Add link to Good First Issue (#2481)
* Add link to Good First Issue

 in Contributing Section

* Fix heading
2019-04-09 11:11:26 -06:00
johncming
15268e8cdb caddytls: sort import statement (#2552) 2019-04-07 10:39:52 -06:00
Matthew Holt
04789a2446 ci: Enable use of Go modules
Temporary until Go 1.13
2019-04-06 16:31:06 -06:00
johncming
e28ee90c2a httpserver: remove unused listener field (#2527) 2019-03-29 22:29:17 -06:00
Michael Grosser
3841517ce1 Migrate to Go modules - remove vendor folder (#2504)
* Migrate to gomods

* Fix conflict

* gomod: Switch xenolf/lego to go-acme/lego
2019-03-29 20:30:48 -06:00
Matt Holt
bea48b80ce
readme: Replace CI badges 2019-03-29 19:16:42 -06:00
Matthew Holt
9f525af210
ci: Remove Travis and AppVeyor manifests 2019-03-29 19:04:56 -06:00
Matt Holt
c00b3a520c
ci: Azure Pipelines CI system (#2540)
* Set up CI with Azure Pipelines [skip ci]

* Add other platforms [skip ci]

* Oops, add vmImage back in [skip ci]

* Fix goVersion [skip ci]

* Use sudo to install Go [skip ci]

* Attempt platform-specific Go isntalls [skip ci]

* Try sharing the variable a different way [skip ci]

* Trying this again... [skip ci]

* Fix the PATH [skip ci]

* Fix GOROOT, hopefully [skip ci]

* More fixing [skip ci]

* Still fixing [skip ci]

* Add golang-ci [skip ci]

* asdfasdfasf [skip ci]

* Sigh, work around broken golangci-lint installer [skip ci]

* Try again [skip ci]

* ahhhhhh [skip ci]

* sooooo close! cleanup [skip ci]

* oh c'mon [skip ci]

* thought I had it for a sec [skip ci]

* yaaaayyyy [skip ci]

ship it
2019-03-29 18:57:02 -06:00
johncming
f6e6a6be04 caddy: improve error naming (#2526) 2019-03-16 23:33:11 -06:00
johncming
bc5df3b383 onevent: add missing return error (#2525) 2019-03-15 22:43:28 -06:00
Linkonoid
1a0292b830 httpserver: Register dyndns directive (#2521) 2019-03-15 17:43:01 -06:00
M. Ángel Jimeno
e6a3e5e1f3 cmd: rename -env to -envfile and use -env to print the environment (#2517)
* caddy: Rename env flag to envfile

* caddy: Add env flag to print environment variables
2019-03-11 17:50:04 -06:00
Aka.Why
397d67876c caddy: Start all servers only after all listeners successful (#2508) 2019-03-10 21:01:56 -06:00
comp500
47b78714b8 proxy: Change headers using regex (#2144)
* Add upstream header replacements (TODO: tests, docs)

* Add tests, fix a few bugs

* Add more tests and comments

* Refactor header_upstream to use a fallthrough; return regex errors
2019-03-06 14:35:07 -07:00
Toby Allen
fda7350a43 github: Change name to ensure PR template is seen (#2501)
as per https://help.github.com/en/articles/creating-a-pull-request-template-for-your-repository
2019-03-04 19:14:18 -07:00
Matthew Holt
80dfb8b2a7
vendor: Update lego; notes for v0.11.5 2019-03-04 12:14:25 -07:00
Toby Allen
98f160e39c httpserver: More organized startup output (#2497)
* Move SiteOutput to a seperate function sorted by port.

* Rename vars and tidy up

* Move loopback note to output loop

* Fix Typo

* Remove unneeded var

* Readability Change

* Change to other port string.

* Simplify as all sites in Server use the same port

* Ensure -quiet supresses fmt.Println calls

* Prevent double output of siteinfo to log - improve log message

* change name of log in comment

* Remove spaces

* Remove extra line output

* final tidy!

* Use caddy.LogDestination to setup log

* Ensure Log is still output if quiet.

* Correct case of functions and make function param bool

* Remove conditional check for LogDestination

* Revert output to simple blocks

* comment update
2019-03-04 12:06:04 -07:00
Toby Allen
4f8020a94c basicauth: Simplify user replacement on auth failure (#2470)
* Can simply add user to replacer before Replace call.  user is then also added to logs

* use fmt.Errorf

* fix how fmt.Errorf is called.
2019-03-04 12:02:24 -07:00
Toby Allen
b295aab2d8 errors: Return parse error if more than one argument (#2472)
* Check errors directive only has 1 argument

* Added Tests
2019-03-04 12:00:28 -07:00
Matthias Schneider
448edcca8e caddytls: removed useless code in selfsigned (#2494)
removed "names": is not used
2019-03-01 08:35:05 -07:00
Wèi Cōngruì
72d0debde6 caddytls: add TLS 1.3 support and remove CBC ciphers (#2399) 2019-02-25 18:39:30 -07:00
Matt Holt
9037d3ab85
appveyor: Use Go 1.12 2019-02-25 18:31:08 -07:00
Matthew Holt
8a511989a0
vendor: Update CertMagic; fix bug related to accounts with empty emails 2019-02-24 23:28:34 -07:00
Toby Allen
44e3a97a67 Revert "Modify Startup Output (#2469)" (#2482)
This reverts commit c0190a3460.
2019-02-24 14:44:17 -07:00
Toby Allen
c0190a3460
Modify Startup Output (#2469)
* Move SiteOutput to a seperate function.

* Simplify as all sites in Server use the same port

* Ensure -quiet supresses fmt.Println calls

* Prevent double output of siteinfo to log - improve log message

* Use caddy.LogDestination to setup log

* Ensure Log is still output if quiet.
2019-02-24 10:04:24 +00:00
magikstm
396d8e989f internal: add internal paths to HiddenFiles (#2133)
* Append Internal paths to Caddy config HiddenFiles

* gofmt

* Reuse a variable

* Update caddyhttp/internalsrv/setup.go

Co-Authored-By: magikstm <myskina@gmail.com>
2019-02-17 14:32:22 -07:00
Matthew Holt
33b00dc8b1
staticfiles: HEAD, not OPTIONS 2019-02-16 08:22:04 -07:00
Matthew Holt
eb9857137a
staticfiles: Re-allow HEAD requests 2019-02-16 07:42:44 -07:00