Sign inSign up
nimg logo

engineerhub/nimg

By engineerhub

•Updated almost 4 years ago

No brainer image hosting.

Image
0

1.4K

engineerhub/nimg repository overview

⁠nimg

Source: https://github.com/TheEngineerhub/nimg⁠

nimg is a simple (~100 lines) self-hosted image hosting service written in nim⁠. I created this initally to store my screenshots captured with Flameshot⁠.

⁠How to use

It's basically a RESTful service. There is no complex auth mechanism such as JWT or a database. You just set a token with environment variable to manage images. To use with Flameshot simply download this script⁠, run after modifying the variables.

  • Get image:

    • GET: http://localhost:8080/i/myimage.png
  • Upload image:

    • POST: http://localhost:8080/u?token=super-secret
    • CURL: curl -F "[email protected]" http://localhost:8080/u
    • image key is required.
  • Delete image:

    • GET: http://localhost:8080/d/myimage.png?token=super-secret

⁠

  • token query string is always required for delete image.
  • If public upload is disabled, you must also use your token.

⁠How to setup

Easiest way to install nimg is using docker-compose⁠.

$ docker-compose up
  • After that you should use reverse proxy to expose nimg to world. Such as Nginx Proxy Manager⁠, it's easy to use, well known solution.

⁠

Build from source.

  • Install nim and nimble and command below should do the trick. Make sure to create .env⁠.
$ export NIMG_ENVIRONMENT=development
$ nimble run

⁠License

This repository is licensed under GPLv3 License⁠.

Tag summary

Content type

Image

Digest

sha256:0a3fb12a2…

Size

3 MB

Last updated

almost 4 years ago

docker pull engineerhub/nimg