{"id":13413205,"url":"https://github.com/aldor007/mort","last_synced_at":"2025-05-16T13:08:06.801Z","repository":{"id":27221188,"uuid":"111298448","full_name":"aldor007/mort","owner":"aldor007","description":"Storage and image processing server written in Go","archived":false,"fork":false,"pushed_at":"2023-05-22T08:40:30.000Z","size":6620,"stargazers_count":513,"open_issues_count":6,"forks_count":24,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-12T10:57:55.530Z","etag":null,"topics":["crop-image","docker","dockerfile","go","golang","image-processing","jpeg","libvips","png","resize","resize-images","s3","storage","tranform","webp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aldor007.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-11-19T13:37:58.000Z","updated_at":"2025-03-30T17:55:25.000Z","dependencies_parsed_at":"2024-01-08T15:34:40.631Z","dependency_job_id":null,"html_url":"https://github.com/aldor007/mort","commit_stats":null,"previous_names":[],"tags_count":84,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldor007%2Fmort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldor007%2Fmort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldor007%2Fmort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldor007%2Fmort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aldor007","download_url":"https://codeload.github.com/aldor007/mort/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535829,"owners_count":22087399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crop-image","docker","dockerfile","go","golang","image-processing","jpeg","libvips","png","resize","resize-images","s3","storage","tranform","webp"],"created_at":"2024-07-30T20:01:35.119Z","updated_at":"2025-05-16T13:08:06.780Z","avatar_url":"https://github.com/aldor007.png","language":"Go","funding_links":[],"categories":["Images","Images 图像处理","Go","Relational Databases","图片","图像"],"sub_categories":["Search and Analytic Databases","SQL 查询语句构建库","Advanced Console UIs","检索及分析资料库","交流"],"readme":"# Mort\n[![Tests](https://github.com/aldor007/mort/actions/workflows/ci.yaml/badge.svg)](https://github.com/aldor007/mort/actions/workflows/ci.yaml) [![Codecov](https://img.shields.io/codecov/c/github/aldor007/mort.svg)](https://codecov.io/gh/aldor007/mort) [![Go Report Card](https://goreportcard.com/badge/github.com/aldor007/mort)](https://goreportcard.com/report/github.com/aldor007/mort)  [![Godoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/aldor007/mort) [![Releases](https://img.shields.io/github/release/aldor007/mort/all.svg?style=flat-square)](https://github.com/aldor007/mort/releases)  [![LICENSE](https://img.shields.io/github/license/aldor007/mort.svg?style=flat-square)](https://github.com/aldor007/mort/blob/master/LICENSE.md)\n\n\u003cimg src=\"https://mort.mkaciuba.com/demo/medium/gopher.png\" width=\"500px\"/\u003e\n\n\nAn S3-compatible image processing server written in Go. Still in active development.\n\n# Features\n\n* HTTP server\n* Resize, Rotate, SmartCrop\n* Convert (JPEG, PNG , BMP, Webp)\n* Multiple storage backends (disk, S3, http)\n* Fully modular\n* S3 API for listing and uploading files\n* Requests collapsing\n* Build in rate limiter\n* HTTP Range and Conditional requests\n* Compression (gzip, brotli)\n* Env variables driven configuration\n* Write you own transform parser using [tengo](https://github.com/d5/tengo)\n* cloudinary image transformation and upload\n\nAnd more see [changelog](CHANGELOG.md) for more info\n\n# Demo\n-------\n[Original image](https://mort.mkaciuba.com/demo/img.jpg)\n\nClick on result image to see URL. More examples can be found in [Image Operations list](doc/Image-Operations.md)\n\u003ctable\u003e\n    \u003cthead\u003e\n    \u003ctr\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n        \u003cth\u003eResult (to see result click on image)\u003c/th\u003e\n     \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\n                \u003cp\u003epreset: small\u003c/p\u003e\n                \u003cp\u003e(preserve aspect ratio)\n                 width: 75 \u003c/p\u003e\n            \u003c/td\u003e\n            \u003ctd\u003e\n               \u003ca href=\"https://mort.mkaciuba.com/demo/small/img.jpg\" target=\"_blank\"\u003e\n                \u003cimg src=\"https://mort.mkaciuba.com/demo/small/img.jpg\" width=\"75px\" /\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\n                \u003cp\u003epreset: blur\u003c/p\u003e\n                \u003cul\u003e\n                \u003cli\u003e\u003cp\u003eresize image (preserve aspect ratio)\n                 width: 700\u003c/p\u003e\u003c/li\u003e\n                 \u003cli\u003e\u003cp\u003eblur image with sigma 5.0\u003c/p\u003e\u003c/li\u003e\n                 \u003c/ul\u003e\n            \u003c/td\u003e\n            \u003ctd\u003e\n                  \u003ca href=\"https://mort.mkaciuba.com/demo/blur/img.jpg\" target=\"_blank\"\u003e\n                \u003cimg src=\"https://mort.mkaciuba.com/demo/blur/img.jpg\" width=\"700px\" /\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\n                \u003cp\u003epreset: webp\u003c/p\u003e\n                \u003cul\u003e\n                \u003cli\u003e                \u003cp\u003eresize image (preserve aspect ratio)\n                 width: 1000\u003c/p\u003e\u003c/li\u003e\n                 \u003cli\u003e\u003cp\u003eand change format to webp\u003c/p\u003e\u003c/li\u003e\n                 \u003c/ul\u003e\n            \u003c/td\u003e\n            \u003ctd\u003e\n                \u003ca href=\"https://mort.mkaciuba.com/demo/webp/img.jpg\" target=\"_blank\"\u003e\n               \u003cimg src=\"https://mort.mkaciuba.com/demo/webp/img.jpg\" width=\"1000px\" /\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\n                \u003cp\u003epreset: watermark\u003c/p\u003e\n                \u003cul\u003e\n                \u003cli\u003e                \u003cp\u003eresize image (preserve aspect ratio)\n                 width: 1300\u003c/p\u003e\u003c/li\u003e\n                 \u003cli\u003e\u003cp\u003eand add watermark\u003c/p\u003e\u003c/li\u003e\n                 \u003c/ul\u003e\n            \u003c/td\u003e\n            \u003ctd\u003e\n                \u003ca href=\"https://mort.mkaciuba.com/demo/watermark/img.jpg\" target=\"_blank\"\u003e\n                  \u003cimg src=\"https://mort.mkaciuba.com/demo/watermark/img.jpg\" width=\"1300px\" /\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n     \u003c/tbody\u003e\n\u003c/table\u003e\n\n# Usage\n\nMort can be used directly from the Internet and behind any proxy.\n\n\n## Install\n\n```bash\ngo get github.com/aldor007/mort/cmd/\n```\n\n\n## Command line help\n```bash\n$ ./mort\nUsage of  mort\n  -config string\n    \tPath to configuration (default \"/etc/mort/mort.yml\")\n```\n\n## Configuration\nExample configuration used for providing demo images:\n\n```yaml\nheaders: #  add or overwrite all response headers of given status. This field is optional\n  - statusCodes: [200]\n    values:\n      \"cache-control\": \"max-age=84000, public\"\n\nbuckets: # list of available buckets\n    demo:    # bucket name\n        keys: # list of S3 keys (optional)\n          - accessKey: \"access\"\n            secretAccessKey: \"random\"\n        transform: # config for transforms\n            path: \"\\\\/(?P\u003cpresetName\u003e[a-z0-9_]+)\\\\/(?P\u003cparent\u003e[a-z0-9-\\\\.]+)\" # regexp for transform path\n            kind: \"presets-query\" #  type of transform or \"query\"\n            presets: # list of presets\n                small:\n                    quality: 75\n                    filters:\n                        thumbnail:\n                            width: 150\n                blur:\n                    quality: 80\n                    filters:\n                        thumbnail:\n                            width: 700\n                        blur:\n                          sigma: 5.0\n                webp:\n                    quality: 100\n                    format: webp\n                    filters:\n                        thumbnail:\n                            width: 1000\n                watermark:\n                    quality: 100\n                    filters:\n                        thumbnail:\n                            width: 1300\n                        watermark:\n                            image: \"https://i.imgur.com/uomkVIL.png\"\n                            position: \"top-left\"\n                            opacity: 0.5\n                smartcrop:\n                    quality: 80\n                    filters:\n                      crop:\n                        width: 200\n                        height: 200\n        storages:\n             basic: # retrieve originals from s3\n                 kind: \"s3\"\n                 accessKey: \"acc\"\n                 secretAccessKey: \"sec\"\n                 region: \"\"\n                 endpoint: \"http://localhost:8080\"\n             transform: # and store it on disk\n                 kind: \"local-meta\"\n                 rootPath: \"/var/www/domain/\"\n                 pathPrefix: \"transform\"\n\n```\nList of all image operations can be found in [Image-Operations.md](doc/Image-Operations.md)\n\nMore details about configuration can be found in [Configuration.md](doc/Configuration.md)\n\n\n## Write you own URL parser\n\n- Using golang (custom mort version needed) [UrlParsers.md](doc/UrlParsers.md)\n- Using tengo [TengoUrlParser.md](doc/TengoUrlParser.md)\n\n## Docker\nSee [Dockerfile](Dockerfile) for image details.\n\nPull docker image\n\n```bash\ndocker pull ghcr.io/aldor007/mort\n\n```\n\n### Create you custom docker deployment\n\nCreate Dockerfile or use Dockerfile.service\n```\n# Dockerfile.service \nFROM ghcr.io/aldor007/mort:latest\n\n# add your config\nADD config.yml /etc/mort/mort.yml\n```\n\nBuild container\n```bash\ndocker build -f Dockerfile.service -t myusername/mort\n```\n\nRun docker\n```\ndocker run -p 8080:8080 myusername/mort\n```\n\nFull example you can find [here](example/)\n\n# Development\n1. Make sure you have a Go language compiler \u003e= 1.9 (required) and git installed.\n2. Install libvips like described on [bimg page](https://github.com/h2non/bimg)\n3. Ensure your GOPATH is properly set.\n4. Download it\n```bash\ngit clone  https://github.com/aldor007/mort.git $GOPATH/src/github.com/aldor007/mort\ncd $GOPATH/src/github.com/aldor007/mort\n```\n5. Install dependencies:\n```bash\ngo mod vendor\n```\nRun unit tests:\n```bash\nmake unit\n```\nRun integration tests:\n```bash\nmake integrations\n```\n\nIf you encounter following problem `go build gopkg.in/h2non/bimg.v1: invalid flag in pkg-config --cflags: -Xpreprocessor`\nwhile running tests in your IDE add this to your environment:\n```\nexport CGO_CFLAGS_ALLOW=\"-Xpreprocessor\"\n```\n\nRun tests using docker image\n```bash\nmake docker-tests\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Inspirations\n\n* [picfit](https://github.com/thoas/picfit)\n* [imaginary](https://github.com/h2non/imaginary)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldor007%2Fmort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faldor007%2Fmort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldor007%2Fmort/lists"}