0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-16 21:56:43 -05:00
Commit graph

319 commits

Author SHA1 Message Date
Will Norris
dfcfda52de add contribution guidelines for style and tests 2019-05-26 11:47:59 -07:00
Will Norris
e4a571d144 add status of plugin design to set expectation 2019-05-26 11:31:18 -07:00
Will Norris
69df3f68d8 initial sketch of registering plugins 2019-05-26 11:30:22 -07:00
Will Norris
627d27df2f doc: initial draft of plugin design 2019-05-26 11:30:22 -07:00
Will Norris
86915f1076 add minimal contributing file 2019-05-26 11:28:39 -07:00
Will Norris
6ec1036afb docs: make url signing examples more consistent
use consistent values for url and key and similar calling styles
(passing values as command line arguments.  Also use more utilities from
the language standard library, such as java.util.Base64.
2019-05-13 13:11:40 -05:00
Ethan Mick
7af1b52eef Fix signature documentation link location (#180)
Correct link from non-existent wiki page to new doc location on master
branch.
2019-05-13 08:28:08 -07:00
Will Norris
30534fb6d4 readme: suggest a simpler nginx config
the old nginx config was designed to prevent url canonicalization, which
is no longer a concern, and was causing problems with non-latin
characters.

Fixes #178
2019-05-12 11:09:26 -07:00
Harrison Healey
d4246a08fd allow overriding the Logger used by Proxy 2019-04-22 16:49:45 -07:00
Will Norris
e1558d5626 add imageproxy-sign tool for calculating signatures
it's a little bit rough, but seems to work pretty well.

Ref #145
2019-03-27 21:56:21 +00:00
Will Norris
38d3bcc7fe allow request signatures to cover options
URL-only signatures are still accepted, though no longer recommended.

Fixes #145
2019-03-27 21:00:14 +00:00
Will Norris
ae2a31cc01 sort options before converting to string
This makes the options string more predictable, and easier to compute by
other programs.  This is primarily  being done to enable signatures that
include option values (see #145).
2019-03-27 17:20:16 +00:00
Will Norris
cf54b2cf2c detect content type if response header is missing
Some misconfigured servers will fail to properly set the content-type in
the response header.  In those cases, detect the content-type from the
response body.

Refs #132
2019-03-26 22:50:38 +00:00
Will Norris
6aca1e0b20 set Accept header on requests if contentTypes set
If the imageproxy instance is configured to only accept certain content
types (which defaults to "image/*"), set that as the accept header on
outbound requests.

Also log more information about the outbound request when the `Verbose`
option is set, so the request headers can be seen in the logs.

Fixes #165
Refs #132
2019-03-24 18:14:28 +00:00
Will Norris
a27bf242c0 update all dependencies to latest versions 2019-03-22 19:39:05 +00:00
Will Norris
969ce986d2 update to latest version of the smartcrop package
Fixes #172
2019-03-22 19:17:22 +00:00
Will Norris
0791f8ceec add more tests: mostly trivial checks 2019-03-22 08:46:34 +00:00
Will Norris
b984bd0796 upload test converage report to codecov 2019-03-22 08:12:18 +00:00
Will Norris
c661aad66b travis: enforce go fmt and go vet 2019-03-22 08:09:51 +00:00
Will Norris
4a6b8653b6 fix minor go fmt and go vet issues 2019-03-22 08:05:59 +00:00
Will Norris
7d53c5100d remove vendor directory
imageproxy should be built with go1.11 or later with modules support
enabled.
2019-03-22 07:53:04 +00:00
Will Norris
44e7b31616 travis: build as module with latest go versions 2019-03-22 07:48:38 +00:00
Will Norris
a5297ae319 remove deprecated whitelist flag and struct field 2019-03-22 07:36:41 +00:00
Will Norris
5a07762971 docker: update to go1.12 and build imageproxy as a module 2019-03-22 07:33:24 +00:00
Will Norris
b7975bcbe8 docker: only copy the ca-certificates file from /etc/ssl 2019-03-22 07:13:00 +00:00
Will Norris
be01bc1d27 docker: run imageproxy as non-privileged user 2019-03-22 07:07:32 +00:00
Will Norris
bfa1f74337 add a changelog 2019-03-22 06:02:05 +00:00
Will Norris
24a2dda8e0 add tests for denyHosts flag 2019-03-22 04:45:31 +00:00
Will Norris
7e19b5ca6b remove specific denial error from response
the specific denial error message reveals more about the imageproxy
configuration than it should, such as what hosts are denied.  Instead,
log the full error, but return a generic message that the requested URL
is not allowed.
2019-03-22 04:45:31 +00:00
Will Norris
2612fa4111 rename several validFoo method to fooMatches
this more accurately describes what the methods are actually doing:
verifying if the value matches, without making any judgement amount
validity.
2019-03-22 04:45:31 +00:00
yvind Ngai Johnsen
7264d177a1 Add denyHosts flag to deny URLs for certain hosts
For example, when running in a Docker swarm cluster we dont want it to
have access to our internal services available under *.weave.local

Closes #85
2019-03-22 04:44:08 +00:00
Will Norris
127a621c8a finish renaming remoteHosts to allowHosts 2019-03-22 03:27:19 +00:00
Will Norris
6cb27fcbbc go.sum: fix checksum for gifresize 2019-03-22 03:26:57 +00:00
Will Norris
7ca6319cc9 move wiki content to docs directory 2019-03-21 23:23:24 +00:00
Will Norris
b18d156894 readme: add reference and link to signature option
Closes #140
2019-03-17 03:09:05 +00:00
Will Norris
5eab3024c6 rename RemoteHosts to AllowHosts
This is what I probably should have called this when I renamed it back
in 70276f36, since this makes it more obvious that it's a list of
allowed hosts.  Renaming now to make room for a `DenyHosts` variable as
part of #85.
2019-03-17 03:05:13 +00:00
Will Norris
4acc0b24ce save and restore original url fragment 2019-03-17 02:51:55 +00:00
Hugues Alary
3444fd9cb4 allow custom User-Agent when fetching remote image
Closes #83
2019-03-17 01:24:41 +00:00
Will Norris
ab8916a938 making smart crop docs more prominent
Fixes #138
2019-03-17 01:10:30 +00:00
Will Norris
e860748032 s3cache: expose add'l config options as URL params
this should allow using at least some s3-compatible services like minio.

Fixes #120, #147
2019-03-16 22:55:06 +00:00
Will Norris
a903995ee7 empty ContentTypes allows all types 2018-10-02 16:14:14 +00:00
Will Norris
7a20dd2cd9 update travis config for go modules 2018-09-15 16:27:07 +00:00
Will Norris
e3dff050fb update to recent aws package with mod support 2018-09-15 07:56:49 +00:00
Will Norris
9c3cbc1733 switch to use go module support
versions of all dependencies remain the same, but now use `go mod` to
manage them rather than govendor.  This does result in a few extra files
being checked in, since govendor would ignore non-build files and go mod
does not.
2018-09-15 07:56:49 +00:00
Will Norris
bc59afcf2a vendor: remove unused file like shell scripts 2018-09-15 07:24:24 +00:00
Will Norris
3f8364feac vendor: remove unused dep github.com/satori/uuid 2018-09-15 06:46:55 +00:00
Will Norris
70276f36bc rename 'Whitelist' to 'RemoteHosts"
This better describes what exactly is being allowed.
2018-09-15 05:55:02 +00:00
Will Norris
0370572130 change how content-type enforcement is handled
If no content types are specified, then accept all responses, regardless
of content type (this is the behavior imageproxy has historically had).
Change default value for the contentTypes flag to be "image/*", so that
the new default when running cmd/imageproxy is that only images will be
proxied.  The old default behavior can be achieved by passing an empty
string for the contentTypes flag:

    imageproxy -contentTypes ""

Do not send the "XCTO: nosniff" header, since all documentation that I
can find still says that it can cause problems when served with images.
If it's effectively a noop when an explicit content-type is specified in
the response, then this shouldn't actually matter for us either way.
But in the absence of certainty, I'd rather err on the side of following
the spec.

Also add documentation for the new functionality.

Fixes #141
2018-09-15 05:36:25 +00:00
Christopher Brown
39a4e1813d content-type checking 2018-09-15 04:00:34 +00:00
Wilrik
74c16f575e fixed tcp_mem resource leak when sending 304 2018-07-06 08:14:09 -07:00