-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:aldor007/mort
- Loading branch information
Showing
11 changed files
with
1,965 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM aldor007/mort | ||
ADD config.yml /etc/mort/mort.yml | ||
RUN mkdir -p /var/run/mort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Mort behind nginx | ||
|
||
## Scheme | ||
|
||
```apple js | ||
|==============| | ||
| Dark World | | ||
|==============| | ||
|||| | ||
|==============| | ||
| nginx | ||
|==============| | ||
| | ||
| | ||
/-----------\ | ||
| mort | | ||
\-----------/ | ||
``` | ||
## Assumptions | ||
* Object will be stored in /var/mort/data | ||
* You will use nginx with slice module | ||
* nginx will terminate SSL | ||
* prometheus job for mort has name "mort" | ||
|
||
## Files structure | ||
|
||
* config.yml - mort configuration file (copy of demo config) | ||
* deploy-mort.sh - bash script for building and running mort instance | ||
* Dockerfile - simple docker file with configuration for mort | ||
* mort-nginx.config - full nginx configuration that can be easy extanded for any use case | ||
* monitoring.json - example monitoring dashboard | ||
|
||
## Grafana dashboard | ||
|
||
<a href="https://mort.mkaciuba.com/demo/dashboard.png"><img src="https://mort.mkaciuba.com/demo/medium/dashboard.png" width="500px"/></a> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
server: | ||
listens: | ||
- ":8080" | ||
- "unix:/var/run//mort.sock" | ||
monitoring: "prometheus" | ||
plugins: | ||
webp: ~ | ||
compress: | ||
gzip: | ||
types: | ||
- text/plain | ||
- text/css | ||
- application/json | ||
- application/javascript | ||
- text/xml | ||
- application/xml | ||
- application/xml+rss | ||
- text/javascript | ||
- text/html; | ||
level: 4 | ||
brotli: | ||
types: | ||
- text/plain | ||
- text/css | ||
- application/json | ||
- application/javascript | ||
- text/xml | ||
- application/xml | ||
- application/xml+rss | ||
- text/javascript | ||
- text/html; | ||
level: 4 | ||
|
||
headers: | ||
- statusCodes: [200] | ||
values: | ||
"cache-control": "max-age=84000, public" | ||
- statusCodes: [404, 400] | ||
values: | ||
"cache-control": "max-age=60, public" | ||
- statusCodes: [500, 503] | ||
values: | ||
"cache-control": "max-age=10, public" | ||
|
||
buckets: | ||
media: | ||
keys: | ||
- accessKey: "acc" | ||
secretAccessKey: "sec" | ||
transform: | ||
path: "\\/(?P<presetName>[a-z0-9_]+)\\/(?P<parent>.*)" | ||
kind: "presets" | ||
parentBucket: "media" | ||
resultKey: "hash" | ||
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://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Imgur_logo.svg/150px-Imgur_logo.svg.png" | ||
position: "center-center" | ||
opacity: 0.5 | ||
storages: | ||
basic: | ||
kind: "http" | ||
url: "https://i.imgur.com/<item>" | ||
headers: | ||
"x--key": "sec" | ||
transform: | ||
kind: "local-meta" | ||
rootPath: "/data/buckets" | ||
pathPrefix: "transforms" | ||
|
||
query: | ||
keys: | ||
- accessKey: "acc" | ||
secretAccessKey: "sec" | ||
transform: | ||
kind: "query" | ||
resultKey: "hash" | ||
storages: | ||
basic: | ||
kind: "http" | ||
url: "https://i.imgur.com/<item>" | ||
headers: | ||
"x--key": "sec" | ||
transform: | ||
kind: "local-meta" | ||
rootPath: "/data/buckets/" | ||
pathPrefix: "transforms" | ||
local: | ||
keys: | ||
- accessKey: "acc" | ||
secretAccessKey: "sec" | ||
storages: | ||
basic: | ||
kind: "local-meta" | ||
rootPath: "/data/buckets/" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
docker pull aldor007/mort | ||
docker build . -t mort | ||
docker ps | grep mort | awk '{print $1 }' | xargs docker stop | ||
docker ps -a | grep mort | awk '{print $1 }' | xargs docker rm | ||
rm -rf /var/run/mort/mort.sock | ||
docker run --name mort -d -p "127.0.0.1:8080:8080" -p "127.0.0.1:8081:8081" -v /var/mort/data/:/data/buckets -v /var/run/mort/:/var/run/mort mort |
Oops, something went wrong.