Self-Hosted file converter server.
Today we are forced to rely on third party services to convert files to other formats. This is a serious threat to our privacy, if we use such services to convert files with highly sensitive personal data. It can be used against us, sooner or later. Morphos server aims to solve the problem mentioned above, by providing a self-hosted server to convert files privately. The project provides an user-friendly web UI. For now, Morphos only supports images. Documents will be added soon.
docker run --rm -p 8080:8080 -v /tmp:/tmp ghcr.io/danvergara/morphos-server:latest
- Serves a nice web UI
- Simple installation (distributed as a Docker image)
Run the server as mentioned above and open up your favorite browser. You'll see something like this:
Hit the file input section on the form to upload an image.
You'll see the filed uploaded in the form.
Then, you can select from a variety of other formats you can convert the current image to.
After hitting Upload
button you will see a view like the one below, asking you to download the converted file.
A modal will pop up with a preview of the converted image.
You can consume morphos through an API, so other systems can integrate with it.
GET /api/v1/formats
This returns a JSON that shows the supported formats at the moment.
e.g.
{"documents": ["docx", "xls"], "image": ["png", "jpeg"]}
POST /api/v1/upload
This is the endpoint that converts files to a desired format. It is basically a multipart form data in a POST request. The API simply writes the converted files to the response body.
e.g.
curl -F 'targetFormat=epub' -F 'uploadFile=@/path/to/file/foo.pdf' localhost:8080/api/v1/upload --output foo.epub
The form fields are:
- targetFormat: the target format the file will be converted to
- uploadFile: The path to the file that is going to be converted
The configuration is only done by the environment varibles shown below.
MORPHOS_PORT
changes the port the server will listen to (default is8080
)MORPHOS_UPLOAD_PATH
defines the temporary path the files will be stored on disk (default is/tmp
)
PNG | JPEG | GIF | WEBP | TIFF | BMP | AVIF | |
---|---|---|---|---|---|---|---|
PNG | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
JPEG | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
GIF | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
WEBP | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
TIFF | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
BMP | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
AVIF | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
PNG | ✅ |
JPEG | ✅ |
GIF | ✅ |
WEBP | ✅ |
TIFF | ✅ |
BMP | ✅ |
AVIF |
PNG | JPEG | GIF | WEBP | TIFF | BMP | AVIF | |
---|---|---|---|---|---|---|---|
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
DOCX | XLSX | CSV | ||
---|---|---|---|---|
✅ | ||||
DOCX | ✅ | |||
CSV | ✅ | |||
XLSX | ✅ |
MOBI | EPUB | |
---|---|---|
EPUB | ✅ | |
MOBI | ✅ |
EPUB | MOBI | |
---|---|---|
✅ | ✅ | |
DOCX | ||
CSV | ||
XLSX |
EPUB | ✅ |
MOBI | ✅ |
The MIT License (MIT). See LICENSE file for more details.