Code Monkey home page Code Monkey logo

hephaestus's Introduction

Hephaestus

Introduction

A simple image host I wrote to manage the huge number of screenshots, snips and snaps I upload and share with others on a regular basis. Images are saved to a local sqlite3 database after being uploaded via POST using the application of your choice (ShareX, curl, etc) along with an authorization key to prevent rogue uploads.

I wrote this primarily as an exercise in using Pyramid for the first time, but also because I was tired of hosting large amounts of unmanaged raw images with random filenames. Perhaps someone else will find this useful, or expand upon it.

Code Samples

For testing, you can simply leave the defaults in the configuration file (add your own authorization password/hash/string/phrase) and connect to http://localhost:9001

Send a POST request with your key in the authorization header as a form POST request with the id of 'item' (adjustable) to upload an image into the database. This will return a UUID to request the image at a later date.

example: http://localhost:9001/upload returns a UUID when the upload is complete, 'cbbafd8d-96a4-4af9-866e-40bb6f5a1436' meaning that the image is now accessible from http://localhost:9001/img/cbbafd8d-96a4-4af9-866e-40bb6f5a1436.

A bad request, either due to an invalid URL or a bad authorization token always returns 404. This is intentional.

Installation

Virtual Environments are awesome. Use one.

Clone this repository and run hephaestus.py after adding your own key to config.toml. You might even feel like binding to a different adapter, changing the port, or changing the database, log file location, or temp directory if you're feeling wild.

hephaestus's People

Contributors

shatteredbeam avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.