Skip to content

codelitdev/medialit

 
 

Repository files navigation

Introduction

MediaLit is a Node.js based app to store, convert and optimise the media files on any AWS S3 compatible storage.

Enable trust proxy

This app is based on Express which cannot work reliably when it is behind a proxy. For example, it cannot detect if it behind a proxy.

Hence, we need to enable it on our own. To do that, set the following environment variable.

ENABLE_TRUST_PROXY=true

Creating a local user

In order to interact with the API, you need to have an API key. To create one, execute the following command.

docker exec <container_id> dist/scripts/create-local-user.js

After running the above command, you will get an API key which you can use to interact with the app.

You can only run this script once.

CAUTION: Keep the generated API key confidential as anyone could be able to store files on your instance.

Development

We build on Linux based systems. Hence the instructions are for those system only. If you are on Windows, we recommend using WSL.

Install the utilities

sudo apt install ffmpeg imagemagick webp

Install dependencies

pnpm install

Build packages

pnpm --filter=@medialit/images build
pnpm --filter=@medialit/thumbnail build

Run the service

pnpm --filter=@medialit/api dev

About

Effortless file uploads, optimization and delivery via any AWS S3 compatible storage

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors