S3 compatible image processing server written in Go. Still in active development.
- HTTP server
- Resize
- Rotate
- SmartCrop
- Convert (JPEG, , PNG , BMP, TIFF, ...)
- Multiple storage backends (disk, S3, http)
- Fully modular
- S3 API for listing and uploading files
- Request collapsing
- Build in rate limiter
Mort can be used direct from Internet and behind any proxy.
go get github.com/aldor007/mort/cmd/
$ ./mort
Usage of mort
-config string
Path to configuration (default "configuration/config.yml")
-listen string
Listen addr (default ":8080")
Example configuration used for providing demo images:
headers: # overwritten all response headers of given status. This field is optional
- statusCodes: [200]
values:
"cache-control": "max-age=84000, public"
buckets: # list of available buckets
demo: # bucket name
keys: # list of S3 keys (optional)
- accessKey: "access"
secretAccessKey: "random"
transform: # config for transforms
path: "\\/(?P<presetName>[a-z0-9_]+)\\/(?P<parent>[a-z0-9-\\.]+)" # regexp for transform path
kind: "presets-query" # type of transform or "query"
presets: # list of presets
small:
quality: 75
filters:
thumbnail:
width: 150
blur:
quality: 80
filters:
thumbnail:
width: 700
blur:
sigma: 5.0
webp:
quality: 100
format: webp
filters:
thumbnail:
width: 1000
watermark:
quality: 100
filters:
thumbnail:
width: 1300
watermark:
image: "https://i.imgur.com/uomkVIL.png"
position: "top-left"
opacity: 0.5
smartcrop:
quality: 80
filters:
crop:
width: 200
height: 200
storages:
basic: # retrieve originals from s3
kind: "s3"
accessKey: "acc"
secretAccessKey: "sec"
region: ""
endpoint: "http://localhost:8080"
transform: # and store it on disk
kind: "local-meta"
rootPath: "/var/www/domain/"
pathPrefix: "transform"
List of all image operations can be found in Image-Operationsmd More examples of configuration and use case can be found in TODO
I will provide Debian package when we will be completely stable ;)
Pull docker image
docker pull aldor007/mort
Create Dockerfile
FROM aldor007/mort:latest
ADD config.yml /go/configuration/config.yml # add yours config
Run docker
- Make sure you have a Go language compiler >= 1.9 (required) and git installed.
- Install libvips like described on bimg page
- Ensure your GOPATH is properly set.
- Download it
go get -d github.com/aldor007/mort
cd $GOPATH/src/github.com/aldor007/mort
5, Install dependencies:
dep ensure
Run unit tests:
make unit
Run integration tests:
make integrations
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details