Skip to main content

About

Microservice for uploading all insecure images to Imgur by url.

Use Redis as cache backend and metadata storage.

Installation

Install uwsgi and python3 plugin:

sudo apt-get install uwsgi uwsgi-plugin-python3

Make virtualenv:

cd /opt
pyvenv-3.4 img_service
source img_service/bin/activate

Install from PyPI:

pip install imgtohttps

Create config file for app:

[uwsgi]
plugins = python34
master = true
enable-threads = true
processes = 4
module = imgtohttps.application:app
virtualenv = /opt/img_service
chdir = /opt/img_service
touch-reload = /opt/img_service/reload
env=APP_SETTINGS=settings.Production

Connect to nginx:

server {
    listen          127.0.0.1:2100;
    access_log off;
    location / {
        uwsgi_pass  unix:/run/uwsgi/app/img_service/socket;
        include             uwsgi_params;
    }
}

Usage

Request:

curl -X POST -H "Content-Type: application/json" -d '{"url": "http://example.com/image.png"}' http://localhost:2100

Response:

{"url": "https://i.imgur.com/AxQwu0h.png"}

Error:

{"error": "Some error message"}

Release files for imgtohttps 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imgtohttps 0.5.2
File Size Uploaded
imgtohttps-0.5.2.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imgtohttps 0.5.2
File Interpreter ABI Platform
imgtohttps-0.5.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 24.0 kB

Release files / imgtohttps-0.5.2.tar.gz

Download URL imgtohttps-0.5.2.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fd0c2eb35d1cdd26494d0e022338d67261fd6eab076413b5ac599ce3bfb1a971
BLAKE2b-256 checksum
How to use checksums
f57d3f8109a235b29d7c0e2d5b20ffec50efcafce72bd8e8360ac0b366561957
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / imgtohttps-0.5.2-py2.py3-none-any.whl

Download URL imgtohttps-0.5.2-py2.py3-none-any.whl
Size 7.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f43008a90b155407392ed5a3cdb85f5fdb92aee51997c8debc1b6081cff17a90
BLAKE2b-256 checksum
How to use checksums
c3cc4c57b51ed3bfe5f848701bb9158ca181efd5223d4204342416a92e609e99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page