mirror of
https://github.com/willnorris/imageproxy.git
synced 2025-01-27 23:04:32 -05:00
More renames
This commit is contained in:
parent
3006d88d56
commit
30955dfcf4
3 changed files with 26 additions and 26 deletions
|
@ -8,4 +8,4 @@ COPY dist /opt
|
|||
# ADD ./swagger-ui /one/swagger-ui
|
||||
|
||||
CMD ["-addr", "0.0.0.0:9091"]
|
||||
ENTRYPOINT [ "/opt/imageproxy-linux" ]
|
||||
ENTRYPOINT [ "/opt/pixie-linux" ]
|
48
README.md
48
README.md
|
@ -1,11 +1,11 @@
|
|||
# pixie
|
||||
# Pixie
|
||||
(Formerly imageproxy)
|
||||
|
||||
[![GoDoc](https://godoc.org/willnorris.com/go/imageproxy?status.svg)](https://godoc.org/willnorris.com/go/imageproxy)
|
||||
[![Build Status](https://travis-ci.org/willnorris/imageproxy.svg?branch=master)](https://travis-ci.org/willnorris/imageproxy)
|
||||
[![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat)](LICENSE)
|
||||
|
||||
imageproxy is a caching image proxy server written in go. It features:
|
||||
Pixie is a caching image proxy server written in go. It features:
|
||||
|
||||
- basic image adjustments like resizing, cropping, and rotation
|
||||
- access control using host whitelists or request signing (HMAC-SHA256)
|
||||
|
@ -37,7 +37,7 @@ As this is forked project, this section details the scope of those changes, so t
|
|||
|
||||
## URL Structure ##
|
||||
|
||||
imageproxy URLs are of the form `http://localhost/{options}/{remote_url}`.
|
||||
Pixie URLs are of the form `http://localhost/{options}/{remote_url}`.
|
||||
|
||||
### Options ###
|
||||
|
||||
|
@ -101,7 +101,7 @@ Install the package using:
|
|||
Once installed, ensure `$GOPATH/bin` is in your `$PATH`, then run the proxy
|
||||
using:
|
||||
|
||||
imageproxy
|
||||
pixie
|
||||
|
||||
This will start the proxy on port 9091, without any caching and with no host
|
||||
whitelist (meaning any remote URL can be proxied). Test this by navigating to
|
||||
|
@ -110,7 +110,7 @@ you should see a 500px square coder octocat.
|
|||
|
||||
### Cache ###
|
||||
|
||||
By default, the imageproxy command does not cache responses, but caching can be
|
||||
By default, the pixie command does not cache responses, but caching can be
|
||||
enabled using the `-cache` flag. It supports the following values:
|
||||
|
||||
- `memory` - uses an in-memory LRU cache. By default, this is limited to
|
||||
|
@ -118,7 +118,7 @@ enabled using the `-cache` flag. It supports the following values:
|
|||
use the format `memory:size:age` where size is measured in mb and age is a
|
||||
duration. For example, `memory:200:4h` will create a 200mb cache that will
|
||||
cache items no longer than 4 hours.
|
||||
- directory on local disk (e.g. `/tmp/imageproxy`) - will cache images
|
||||
- directory on local disk (e.g. `/tmp/pixie`) - will cache images
|
||||
on disk
|
||||
- s3 URL (e.g. `s3://region/bucket-name/optional-path-prefix`) - will cache
|
||||
images on Amazon S3. This requires either an IAM role and instance profile
|
||||
|
@ -139,12 +139,12 @@ enabled using the `-cache` flag. It supports the following values:
|
|||
Rather than specify password in the URI, use the `REDIS_PASSWORD`
|
||||
environment variable.
|
||||
|
||||
For example, to cache files on disk in the `/tmp/imageproxy` directory:
|
||||
For example, to cache files on disk in the `/tmp/pixie` directory:
|
||||
|
||||
imageproxy -cache /tmp/imageproxy
|
||||
pixie -cache /tmp/pixie
|
||||
|
||||
Reload the [codercat URL][], and then inspect the contents of
|
||||
`/tmp/imageproxy`. Within the subdirectories, there should be two files, one
|
||||
`/tmp/pixie`. Within the subdirectories, there should be two files, one
|
||||
for the original full-size codercat image, and one for the resized 500px
|
||||
version.
|
||||
|
||||
|
@ -156,7 +156,7 @@ faster in-memory cache in front of a larger but slower on-disk cache. For
|
|||
example, the following will first check an in-memory cache for an image,
|
||||
followed by a gcs bucket:
|
||||
|
||||
imageproxy -cache memory -cache gcs://my-bucket/
|
||||
pixie -cache memory -cache gcs://my-bucket/
|
||||
|
||||
[tiered fashion]: https://godoc.org/github.com/die-net/lrucache/twotier
|
||||
|
||||
|
@ -166,7 +166,7 @@ You can limit images to only be accessible for certain hosts in the HTTP
|
|||
referrer header, which can help prevent others from hotlinking to images. It can
|
||||
be enabled by running:
|
||||
|
||||
imageproxy -referrers example.com
|
||||
pixie -referrers example.com
|
||||
|
||||
|
||||
Reload the [codercat URL][], and you should now get an error message. You can
|
||||
|
@ -181,7 +181,7 @@ your own hosts to prevent others from abusing it. Of course if you want to
|
|||
support fetching from any host, leave off the whitelist flag. Try it out by
|
||||
running:
|
||||
|
||||
imageproxy -whitelist example.com
|
||||
pixie -whitelist example.com
|
||||
|
||||
Reload the [codercat URL][], and you should now get an error message. You can
|
||||
specify multiple hosts as a comma separated list, or prefix a host value with
|
||||
|
@ -202,7 +202,7 @@ which contains the HMAC key.
|
|||
|
||||
Try it out by running:
|
||||
|
||||
imageproxy -signatureKey "secret key"
|
||||
pixie -signatureKey "secret key"
|
||||
|
||||
Reload the [codercat URL][], and you should see an error message. Now load a
|
||||
[signed codercat URL][] and verify that it loads properly.
|
||||
|
@ -223,7 +223,7 @@ However, if you commonly proxy images from a single source, you can provide a
|
|||
base URL and then specify remote images relative to that base. Try it out by
|
||||
running:
|
||||
|
||||
imageproxy -baseURL https://octodex.github.com/
|
||||
pixie -baseURL https://octodex.github.com/
|
||||
|
||||
Then load the codercat image, specified as a URL relative to that base:
|
||||
<http://localhost:9091/500/images/codercat.jpg>. Note that this is not an
|
||||
|
@ -233,18 +233,18 @@ specified, you can always provide the absolute URL of the image to be proxied.
|
|||
|
||||
### Scaling beyond original size ###
|
||||
|
||||
By default, the imageproxy won't scale images beyond their original size.
|
||||
By default, the Pixie won't scale images beyond their original size.
|
||||
However, you can use the `scaleUp` command-line flag to allow this to happen:
|
||||
|
||||
imageproxy -scaleUp true
|
||||
pixie -scaleUp true
|
||||
|
||||
### WebP and TIFF support ###
|
||||
|
||||
Imageproxy can proxy remote webp images, but they will be served in either jpeg
|
||||
Pixie can proxy remote webp images, but they will be served in either jpeg
|
||||
or png format (this is because the golang webp library only supports webp
|
||||
decoding) if any transformation is requested. If no format is specified,
|
||||
imageproxy will use jpeg by default. If no transformation is requested (for
|
||||
example, if you are just using imageproxy as an SSL proxy) then the original
|
||||
Pixie will use jpeg by default. If no transformation is requested (for
|
||||
example, if you are just using Pixie as an SSL proxy) then the original
|
||||
webp image will be served as-is without any format conversion.
|
||||
|
||||
Because so few browsers support tiff images, they will be converted to jpeg by
|
||||
|
@ -253,9 +253,9 @@ default if any transformation is requested. To force encoding as tiff, pass the
|
|||
conversion if no transformation is requested.
|
||||
|
||||
|
||||
Run `imageproxy -help` for a complete list of flags the command accepts. If
|
||||
Run `pixie -help` for a complete list of flags the command accepts. If
|
||||
you want to use a different caching implementation, it's probably easiest to
|
||||
just make a copy of `cmd/imageproxy/main.go` and customize it to fit your
|
||||
just make a copy of `cmd/pixie/main.go` and customize it to fit your
|
||||
needs... it's a very simple command.
|
||||
|
||||
## Deploying ##
|
||||
|
@ -264,7 +264,7 @@ In most cases, you can follow the normal procedure for building a deploying any
|
|||
go application. For example, I build it directly on my production debian server
|
||||
using:
|
||||
|
||||
- `go build github.com/d3sw/imageproxy/cmd/imageproxy`
|
||||
- `go build github.com/d3sw/pixie/cmd/pixie`
|
||||
- copy resulting binary to `/usr/local/bin`
|
||||
- copy [`etc/imageproxy.service`](etc/imageproxy.service) to
|
||||
`/lib/systemd/system` and enable using `systemctl`.
|
||||
|
@ -283,13 +283,13 @@ A docker image is available at [`willnorris/imageproxy`](https://registry.hub.do
|
|||
|
||||
You can run it by
|
||||
```
|
||||
docker run -p 9091:9091 willnorris/imageproxy -addr 0.0.0.0:9091
|
||||
docker run -p 8080:8080 willnorris/imageproxy -addr 0.0.0.0:8080
|
||||
```
|
||||
|
||||
Or in your Dockerfile:
|
||||
|
||||
```
|
||||
ENTRYPOINT ["/go/bin/imageproxy", "-addr 0.0.0.0:9091"]
|
||||
ENTRYPOINT ["/go/bin/imageproxy", "-addr 0.0.0.0:8080"]
|
||||
```
|
||||
|
||||
### nginx ###
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// limitations under the License.
|
||||
|
||||
// Package imageproxy provides an image proxy server. For typical use of
|
||||
// creating and using a Proxy, see cmd/imageproxy/main.go.
|
||||
// creating and using a Proxy, see cmd/pixie/main.go.
|
||||
package imageproxy // import "github.com/d3sw/pixie"
|
||||
|
||||
import (
|
||||
|
|
Loading…
Add table
Reference in a new issue