Sign inSign up

unixunion/digitalhat

By unixunion

•Updated almost 5 years ago

A simple webapp to pull a "random" name from hat. e.g: for selecting meeting facilitators.

Image
0

339

unixunion/digitalhat repository overview

⁠Digital Hat

A simple webserver that allows you to drag names out of hat. Has a full UI which you can manage users, restart the hat, and so on.

⁠Running Examples

This example is mounting a "data" dir from the host. Leave out the volume mount if you dont need the persistence.

docker run -v `pwd`/data:/app/data -p 8000:8000 unixunion/digitalhat:latest

⁠Database

The database is just simple python pickled objects, other persistence engines might come in future.

⁠Python Server

If you shell into the container, you can explore the options on the python server

docker run -p 8000:8000 --entrypoint /bin/sh -ti digitalhat:latest   
/app # python hat-server.py --help

⁠Rest API

⁠/add

Adds a new facilitator to the database

curl -i -H "Content-Type: application/json" -X POST -d '{"name": "Testy Test"}' http://HOST:PORT/add 
⁠/remove

Remove facilitator from the db, and the hat

curl -i -H "Content-Type: application/json" -X POST -d '{"name": "Testy Test"}' http://HOST:PORT/remove 
⁠/next

Selects and returns the next facilitator

curl  http://HOST:PORT/next 
⁠/current

Shows the current ( previously selected ) facilitator

curl  http://HOST:PORT/current 
⁠/revert

Puts the current facilitator back in the hat, used for cases where a facilitator needs to be returned to the pile.

curl  http://HOST:PORT/revert 
⁠/tweak/hat/remove

Removes a name from the hat

curl -i -H "Content-Type: application/json" -X POST -d '{"name": "Testy Test"}' http://HOST:PORT/tweak/hat/remove 
⁠/tweak/hat/add

Add a name to the hat

curl -i -H "Content-Type: application/json" -X POST -d '{"name": "Testy Test"}' http://HOST:PORT/tweak/hat/add 
⁠/tweak/hat/select

Select a name in the hat specifically.

curl -i -H "Content-Type: application/json" -X POST -d '{"name": "Testy Test"}' http://HOST:PORT/tweak/hat/select 

Tag summary

Content type

Image

Digest

Size

22.7 MB

Last updated

almost 5 years ago

docker pull unixunion/digitalhat