All Projects → hauxir → Imgpush

hauxir / Imgpush

Licence: mit
Minimalist Self-hosted Image Service for user submitted images in your app

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Imgpush

Pictshare
📷 PictShare is an open source image, mp4, pastebin hosting service with a simple resizing and upload API that you can host yourself. 🎑
Stars: ✭ 576 (+300%)
Mutual labels:  selfhosted, images, picture
Vanilla Lazyload
LazyLoad is a lightweight, flexible script that speeds up your website by deferring the loading of your below-the-fold images, backgrounds, videos, iframes and scripts to when they will enter the viewport. Written in plain "vanilla" JavaScript, it leverages IntersectionObserver, supports responsive images and enables native lazy loading.
Stars: ✭ 6,596 (+4480.56%)
Mutual labels:  images, picture
Deck
🗂 Kanban-style project & personal management tool for Nextcloud, similar to Trello
Stars: ✭ 675 (+368.75%)
Mutual labels:  selfhosted, hacktoberfest
Sms Responsive Images
This TYPO3 extension provides ViewHelpers and configuration to render valid responsive images based on TYPO3's image cropping tool.
Stars: ✭ 35 (-75.69%)
Mutual labels:  images, picture
Laravel Medialibrary
Associate files with Eloquent models
Stars: ✭ 4,743 (+3193.75%)
Mutual labels:  hacktoberfest, images
Appwrite
Appwrite is a secure end-to-end backend server for Web, Mobile, and Flutter developers that is packaged as a set of Docker containers for easy deployment 🚀
Stars: ✭ 14,592 (+10033.33%)
Mutual labels:  hacktoberfest, selfhosted
Lozad.js
🔥 Highly performant, light ~1kb and configurable lazy loader in pure JS with no dependencies for responsive images, iframes and more
Stars: ✭ 6,932 (+4713.89%)
Mutual labels:  hacktoberfest, images
wp-github-gos
利用 github api 实现的一个存储图片/附件的 wordpress 插件
Stars: ✭ 42 (-70.83%)
Mutual labels:  picture, images
Lsky Pro
☁️Lsky Pro - Your photo album on the cloud.
Stars: ✭ 1,174 (+715.28%)
Mutual labels:  images, picture
Tinyraycaster
486 lines of C++: old-school FPS in a weekend
Stars: ✭ 1,383 (+860.42%)
Mutual labels:  images, picture
Docat
Host your docs. Simple. Versioned. Fancy.
Stars: ✭ 115 (-20.14%)
Mutual labels:  selfhosted, hacktoberfest
Bubblepictures
Bubble Pictures for iOS done in Swift
Stars: ✭ 434 (+201.39%)
Mutual labels:  images, picture
Yii2 Imagine
Yii 2 imagine extension
Stars: ✭ 271 (+88.19%)
Mutual labels:  hacktoberfest, images
Stegbrute
Fast Steganography bruteforce tool written in Rust useful for CTF's
Stars: ✭ 134 (-6.94%)
Mutual labels:  hacktoberfest, images
ImageOnMap
Repo for ImageOnMap, a bukkit plugin created to display any image using a map
Stars: ✭ 162 (+12.5%)
Mutual labels:  picture, images
Kroki
Creates diagrams from textual descriptions!
Stars: ✭ 774 (+437.5%)
Mutual labels:  hacktoberfest, images
Parsr
Transforms PDF, Documents and Images into Enriched Structured Data
Stars: ✭ 2,736 (+1800%)
Mutual labels:  hacktoberfest, images
Ohmyform
✏️ Free open source alternative to TypeForm, TellForm, or Google Forms ⛺
Stars: ✭ 1,065 (+639.58%)
Mutual labels:  selfhosted, hacktoberfest
Tinyrenderer
A brief computer graphics / rendering course
Stars: ✭ 11,776 (+8077.78%)
Mutual labels:  images, picture
Picpic
A awesome image host service driven by github pages and github actions.
Stars: ✭ 135 (-6.25%)
Mutual labels:  images, picture
Screenshot 2019-06-19 at 17 56 29 Minimalist Self-hosted Image Service for user submitted images in your app (e.g. avatars).

Features

  • One simple API endpoint for uploading images
  • Automatic Conversion to an image format of your choice
  • Automatic resizing to any size of your liking
  • Built-in Rate limiting
  • Built-in Allowed Origin whitelisting
  • Liveness API

Usage

Uploading an image:

> curl -F '[email protected]/some/file.jpg' http://some.host
{"filename":"somename.png"}

Fetching a file in a specific size(e.g. 320x240):

http://some.host/somename.png?w=320&h=240

returns the image cropped to the desired size

Running

imgpush requires docker

docker run -v <PATH TO STORE IMAGES>:/images -p 5000:5000 hauxir/imgpush:latest

Kubernetes

This is fully optional and is only needed if you want to run imgpush in Kubernetes.

If you want to deploy imgpush in Kubernetes, there is an example deployment available in the Kubernetes directory. In case you do not have a running Kubernetes cluster yet, you can use Minikube to setup a local single-node Kubernetes cluster. Otherwise you can just use your existing cluster.

  1. Verify that your cluster works:
$ kubectl get pods
# Should return without an error, maybe prints information about some deployed pods.
  1. Apply the kubernetes/deployment-example.yaml file:
$ kubectl apply -f kubernetes/deployment-example.yaml
namespace/imgpush created
deployment.apps/imgpush created
persistentvolumeclaim/imgpush created
service/imgpush created
  1. It will take a moment while your Kubernetes downloads the current imgpush image.
  2. Verify that the deployment was successful:
$ kubectl -n imgpush get deployments.
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
imgpush   1/1     1            1           3m41s

$ kubectl -n imgpush get svc
NAME      TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)    AGE
imgpush   ClusterIP   10.10.10.41   <none>        5000/TCP   3m57s
  1. When the deployment is finished, the READY column should be 1/1.
  2. Afterwards you can forward the port to your local machine and upload an image via your webbrowser (visit http://127.0.0.1:5000/).
$ kubectl -n imgpush port-forward service/imgpush 5000
Forwarding from 127.0.0.1:5000 -> 5000
Handling connection for 5000
Handling connection for 5000
Handling connection for 5000
Handling connection for 5000
  1. To expose imgpush to the internet you need to configure an Ingress. The exact configuration depends on you cluster but you can find an example in the kubernetes/deployment-example.yaml file that you can adapt to your setup.

Liveness

imgpush provides the /liveness endpoint that always returns 200 OK that you can use for docker Healthcheck and kubernetes liveness probe.

For Docker, as curl is install in the image :

healthcheck:
    start_period: 0s
    test: ['CMD-SHELL', 'curl localhost:5000/liveness -s -f -o /dev/null || exit 1']
    interval: 30s

For Kubernetes

livenessProbe:
    httpGet:
    path: /liveness
    port: 5000            
    initialDelaySeconds: 5
    periodSeconds: 30

Configuration

Setting Default value Description
OUTPUT_TYPE Same as Input file An image type supported by imagemagick, e.g. png or jpg
MAX_SIZE_MB "16" Integer, Max size per uploaded file in megabytes
MAX_UPLOADS_PER_DAY "1000" Integer, max per IP address
MAX_UPLOADS_PER_HOUR "100" Integer, max per IP address
MAX_UPLOADS_PER_MINUTE "20" Integer, max per IP address
ALLOWED_ORIGINS "['*']" array of domains, e.g ['https://a.com']
VALID_SIZES Any size array of integers allowed in the h= and w= parameters, e.g "[100,200,300]". You should set this to protect against being bombarded with requests!
NAME_STRATEGY "randomstr" randomstr for random 5 chars, uuidv4 for UUIDv4

Setting configuration variables is all set through env variables that get passed to the docker container.

Example:

docker run -e ALLOWED_ORIGINS="['https://a.com', 'https://b.com']" -s -v <PATH TO STORE IMAGES>:/images -p 5000:5000 hauxir/imgpush:latest

or to quickly deploy it locally, run

docker-compose up -d
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].