Skip to content

Commit

Permalink
Merge branch 'master' of github.com:aldor007/mort
Browse files Browse the repository at this point in the history
  • Loading branch information
aldor007 committed Mar 9, 2018
2 parents ce5e74c + e47c178 commit 8449073
Show file tree
Hide file tree
Showing 21 changed files with 861 additions and 143 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
* 0.9.0
* Feature: Allow to define placeholder for error response
* 0.8.0
* Feature: Added support for AWS presigned url
* Bugfix: Fixed reporting collaped reqeuest to promethues
* Feature: Update golang to 1.10 update libvips 8.6.2
* 0.7.0
* Feature: Remove mutex from time monitoring
* 0.6.1
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM ubuntu:16.04 as builder


ENV LIBVIPS_VERSION 8.5.9
ENV DEP_VERSION v0.3.2
ENV GOLANG_VERSION 1.9.2
ENV LIBVIPS_VERSION 8.6.2
ENV DEP_VERSION v0.4.1
ENV GOLANG_VERSION 1.10


# Installs libvips + required libraries
Expand Down Expand Up @@ -78,6 +77,7 @@ COPY --from=builder /usr/local/lib /usr/local/lib
RUN ldconfig
COPY --from=builder /go/mort /go/mort
COPY --from=builder /go/src/github.com/aldor007/mort/configuration/config.yml /etc/mort/mort.yml
RUN /go/mort -version
# add mime types
ADD http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/conf/mime.types?view=co /etc/mime.types

Expand Down
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ format:

tests: unit integrations

docker-build:
docker build -t aldo007/mort -f Dockerfile .

docker-push: docker-build
docker push aldor007/mort:latest
docker-push:
docker build -t aldor007/mort -f Dockerfile . -t aldor007/mort:latest; docker push aldor007/mort:latest

run-server:
mkdir -p /tmp/mort
Expand Down
21 changes: 11 additions & 10 deletions cmd/mort/mort.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

const (
// Version of mort
Version = "0.7.0"
Version = "0.9.0"
// BANNER just fancy command line banner
BANNER = `
/\/\ ___ _ __| |_
Expand Down Expand Up @@ -74,13 +74,7 @@ func handleSignals(servers []*http.Server, socketPaths []string, wg *sync.WaitGr
for {
sig := <-signalChan
switch sig {
case syscall.SIGTERM:
fallthrough
case syscall.SIGKILL:
fallthrough
case syscall.SIGINT:
fallthrough
case os.Kill:
case os.Kill, syscall.SIGTERM, syscall.SIGKILL, syscall.SIGINT:
for _, s := range servers {
s.Close()
wg.Done()
Expand Down Expand Up @@ -150,8 +144,14 @@ func startServer(s *http.Server, ln net.Listener) {
func main() {
configPath := flag.String("config", "/etc/mort/mort.yml", "Path to configuration")
debug := flag.Bool("debug", false, "enable debug mode")
version := flag.Bool("version", false, "get mort version")
flag.Parse()

if version != nil && *version == true {
fmt.Println(Version)
return
}

router := chi.NewRouter()
imgConfig := config.GetInstance()
err := imgConfig.Load(*configPath)
Expand All @@ -178,12 +178,13 @@ func main() {
obj, err := object.NewFileObject(req.URL, imgConfig)
if err != nil {
monitoring.Logs().Errorf("Unable to create file object err = %s", err)
response.NewError(400, err).SetDebug(debug, nil).Send(resWriter)
response.NewError(400, err).SetDebug(&object.FileObject{Debug: debug}).Send(resWriter)
return
}
obj.Debug = debug

res := rp.Process(req, obj)
res.SetDebug(debug, obj)
res.SetDebug(obj)
if debug {
res.Set("X-Mort-Version", Version)
}
Expand Down
Binary file added favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8449073

Please # to comment.