GithubHelp home page GithubHelp logo

rogryza / servant-photo-gallery Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 48 KB

Blog-like photo gallery API server.

License: MIT License

Dockerfile 1.05% Haskell 92.75% Nix 4.85% Python 1.35%
servant selfhosted polysemy

servant-photo-gallery's Introduction

Servant Photo Gallery

Build Status

Blog-like photo gallery API server.

Quickstart

In order to run the server, you'll need an htpasswd file holding the users and a sqlite db with the correct schema. Note that the first user in the htpasswd file is considered an admin and can upload posts:

servant-photo-gallery$ htpasswd -nbBC 12 username password > htpasswd
servant-photo-gallery$ sqlite3 gallery.db < migrations/01_initial.sql

Now you can run a local instance with stack:

$ stack run
Starting gallery at 127.0.0.1:8000...
Showing media from static/media/

Configuration

The application accepts parameters from a config file and from the command line. See the builtin help for available parameters:

$ servant-photo-gallery --help

Roadmap to v1.0

  • OpenAPI specs
  • Remaining CRUD operations (delete and update posts)
  • Media caching and streaming upload/download of files
  • Handle proxies
  • More descriptive HTTP error responses
  • Add more logs and attach request ID and current user to them
  • Publish to hackage and dockerhub

Future Roadmap

  • Better configuration validation (htpasswd file, base URL)
  • Better configuration and startup error reporting in general
  • More than one media per POST
  • Other media types (Other image types, GIF/mp4)
  • Image resizing on upload and on download per requested size restrictions
  • Allow OAuth authentication
  • Improve auth token handling (remember me, persist and rotate secrets)
  • More fine-grained permissions
  • Database/filesystem integrity checks
  • Limits to prevent DoS: rate limits, file size limits
  • CLI tool for administrative tasks
  • Support for other databases and file storages

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.