Commit Graph

1420 Commits

Author SHA1 Message Date
6908136092 browse: Split ServeHTTP into small specialized functions 2016-04-19 00:20:44 +02:00
da016f8d5a Merge pull request #760 from Burmudar/hostname-placeholder
Add hostname placeholder. Headers use replacer
2016-04-18 15:54:31 -06:00
2f2d357fb6 browse: Fix known bugs (#770)
* browse: Catch the case of a directory disappearing before having been read

* browse: Revert to old pass-through behaviour

PROPFIND is a request for an alternate view on a directory's contents, which
response is indeed not implemented but ideally allowed to ask for.
OPTIONS would ideally return (at least) what methods the requestor could use,
which is an allowed request method, too.

This addresses #767.
2016-04-18 11:42:36 -06:00
924b53eb3c Minor changes 2016-04-18 09:43:28 -06:00
2b51be7fd7 Better error message. (#768)
* Fix PrivateKeyBytes to error out and fail tests on error.

* Better error message.
2016-04-17 15:15:14 -06:00
376e1090a3 Fix PrivateKeyBytes to error out and fail tests on error. 2016-04-17 14:17:42 -06:00
dd4de698cf Better search for config.
Handle LastModifiedHeader better.
Handle HEAD/GET.
2016-04-17 10:58:51 -07:00
a682100c5e Merge pull request #765 from mholt/elcore-error-ecdsa
Error if we are unable to marshal the ECDSA private key
2016-04-17 18:40:02 +02:00
aba3d37c88 Error if we are unable to marshal the ECDSA private key 2016-04-17 18:19:41 +02:00
0890e330e2 Merge pull request #759 from mholt/paths-cleanup
Tell usage of 'path' from 'filepath' and fix *path checking
2016-04-17 14:16:57 +02:00
19a85d08c6 Merge branch 'master' into md_changes 2016-04-16 19:43:50 -07:00
5a0d373fcd Missed fixing setup. 2016-04-16 17:13:13 -07:00
ecf91f525f Fix gofmt -s and ineffassign. 2016-04-16 17:07:06 -07:00
b541c717ca Add ability to markdown a directory with a template. 2016-04-16 16:50:45 -07:00
c05c5163e2 browse: Don't leak Cookies to sessions in HTTP from HTTPS 2016-04-17 01:16:17 +02:00
3513b6f2f7 fileserver: When out of filedescriptors, spread retry attempts 2016-04-17 01:16:17 +02:00
4a6121f989 Tell usage of 'path' from 'filepath' and fix *path checking 2016-04-17 01:16:16 +02:00
e652d12cfc Move Metadata load into NewMetadata function. 2016-04-16 15:36:52 -07:00
b97a7909d8 Nuke more redundant things. 2016-04-16 15:18:17 -07:00
7c9867917a Fixup tests and move metadata into own package 2016-04-16 14:45:32 -07:00
a762bec06d Add hostname placeholder. Header uses replacer
On matched header rules, replacer is used to replace any placeholders
defined in header rules iex. X-Backend {hostname} where {hostname} will
be replaced by the hostname key present in the replacer

hostname key added to replacer. The value is determined by the output of
`os.Hostname()`
2016-04-16 19:06:39 +02:00
b75016e646 Fix lint warning 2016-04-15 15:13:44 -06:00
ddf4b1fd3b Merge pull request #757 from mholt/extend-tls-client-auth
Extend tls client auth
2016-04-15 22:57:45 +02:00
69c2d78f69 Support configuring less restrictive TLS client auth requirements
Caddyfile parameter "clients" of "tls" henceforth accepts a special
first modifier. It is one of, and effects:

 * request         = tls.RequestClientCert
 * require         = tls.RequireAnyClientCert
 * verify_if_given = tls.VerifyClientCertIfGiven
 * (none)          = tls.RequireAndVerifyClientCert

The use-case for this is as follows: A middleware would serve items to the
public, but if a certificate were given the middleware would permit file
manipulation.

And, in a different plugin such as a forum or blog, not verifying a client
cert would be nice for registration: said blog would subsequently only
compare the SPKI of a client certificate.
2016-04-15 22:21:55 +02:00
f31875dfde Move sanitization of URL.Path to Server
No need to have this in every plugin. And, even in flat filesystems
filenames with dots and slashes are best avoided.
2016-04-15 21:02:36 +02:00
4e98cc3005 browse: Return HTTP errors on unhandled HTTP methods
For example, a HTTP POST should not be answered with StatusOK,
and a response to HTTP OPTIONS should not carry any contents.
2016-04-15 18:22:51 +02:00
d3a77ce3c3 Use binExt 2016-04-13 15:21:18 -06:00
48d294a695 Better default template. 2016-04-12 18:53:15 -07:00
b149a86bc2 server: Rotate TLS ticket "keys" (#742) 2016-04-12 10:09:45 -06:00
ac80f6edc3 Merge pull request #744 from tboerger/feature/breadcrumb
browse: Dropped LinkedPath and updated browse template
2016-04-12 10:01:01 -06:00
ef95173827 Dropped LinkedPath and updated browse template
As discussed with @mholt I have dropped the old LinkedPath function and
replaced it within the browse template with the new BreadcrumbMap
function. Visually it looks exactly the same as before, now the template
functionality is just more powerful.

Signed-off-by: Thomas Boerger <tboerger@suse.de>
2016-04-12 17:18:21 +02:00
36a3e204b6 Merge pull request #740 from tboerger/feature/browse-breadcrumb
Added breadcrumb map function to browse
2016-04-11 14:08:18 -06:00
e0b63d92f4 Added breadcrumb map function to browse
In order to being able to really build a custom template for the browse
directive I have added another function to build even custom breadcrumb
paths. The other function `LinkedPath` is not that easy styleable as
this map function. That way we are able to build the breadcrumb path
matching different CSS frameworks like Bootstrap.

Signed-off-by: Thomas Boerger <thomas@webhippie.de>
2016-04-11 21:47:44 +02:00
004a7f84ef Make test case less dependent on exact error string (#741) 2016-04-11 13:08:30 -06:00
ed8a48e7f1 Merge pull request #739 from tboerger/feature/browse-go-up
Added "go up" link to browse template
2016-04-11 12:28:13 -06:00
c86c26a056 Added "go up" link to browse template
In order to have directly a link within the browse listing I have added
a link to the top of the table to get one level up in the tree. Added
that after a chat with @mholt.

Signed-off-by: Thomas Boerger <thomas@webhippie.de>
2016-04-11 20:10:41 +02:00
0a7ca64f53 gzipResponseWriter should also be a Flusher
To be consistent with 3faad41b437c48cea37863123fab425169bc0c6e and c64cf218b0a82d144e779454817eb0371a5002a8
2016-04-11 00:24:26 -06:00
c4e2cf96e7 Merge pull request #737 from tw4452852/closeNotifier
http.CloseNotifier implementation for http.ResponseWriter wrapper
2016-04-11 00:18:06 -06:00
42b7d57421 Fix more tests, and fix template parsing. 2016-04-10 23:17:01 -07:00
Tw
c64cf218b0 http.CloseNotifier implementation for http.ResponseWriter wrapper
Signed-off-by: Tw <tw19881113@gmail.com>
2016-04-11 14:10:33 +08:00
027f697fdf Revamp markdown processing.
Nuke pre-generation.  This may come back in the form of a more general
caching layer at some later stage.

Nuke index generation.  This should likely be rethought and re-implemented.
2016-04-10 17:47:55 -07:00
6a7b777f14 panic if not a Flusher
Caddy recovers panics that occur in the middleware stack so this is not a risk to process termination. This way is also preferable to hiding the error. See 3faad41b43 (commitcomment-17035158)
2016-04-09 22:11:36 -06:00
67b137175e Replaced automate.sh with Go program 2016-04-09 10:02:16 -06:00
dfa3b8645d Who uses 32-bit Mac anyway. :P 2016-04-09 00:40:37 -06:00
2dca50dee8 Rewrite automate.sh as Go program; add init folder to release archives
Easier parallelism and more control over platforms we build for, but
more importantly, we can do parallel builds using the build script which
properly embeds version information into the binaries. We also produce
the archive files ourselves and in parallel rather than using external
tar and zip commands.
2016-04-09 00:21:55 -06:00
3faad41b43 middleware: ResponseRecorder now is an http.Flusher (fixes #677)
Flush every 250ms. This should keep latency somewhat low but there is
still buffering; maybe in the future we can make this configurable.
2016-04-09 00:17:15 -06:00
c21ff8343c Apparently vet ships with Go now 2016-04-06 17:29:53 -06:00
2072eec11f Merge pull request #731 from wjkohnen/host-caseinsensitive
Handle host names case insensitively.
2016-04-06 15:56:34 -06:00
497ebb9ccb Handle host names case insensitively.
RFC 3986 3.2.2: The host subcomponent is case-insensitive.
2016-04-06 21:36:46 +00:00
e4e773c9ea Merge pull request #730 from tpng/restart-refactor
Extract restartInProc to its own file
2016-04-06 11:51:44 +08:00