Giter Club home page Giter Club logo

mattermore's Introduction

Mattermore

Mattermost integrations

Installation guide

  1. Clone this repository
git clone ssh://[email protected]:2222/mattermost/mattermore.git
cd mattermore
  1. Create a virtual environment
virtualenv -p python3 venv
  1. Install the pip requirements
./venv/bin/pip install -r requirements.txt
  1. Create the database
./venv/bin/python setup_database.py
  1. Start the server
./venv/bin/python run_dev.py

Development guide

Format your code with black app/ before committing

mattermore's People

Contributors

redfast00 avatar tibo-ulens avatar rien avatar robbe7730 avatar fbegyn avatar jenstimmerman avatar niknetniko avatar fkd13 avatar jan-pieterbaert avatar timodw avatar mcbloch avatar

Stargazers

 avatar

Watchers

James Cloos avatar lorin avatar Wout Schellaert avatar  avatar  avatar  avatar  avatar

Forkers

fbegyn xerbalind

mattermore's Issues

Authenticate based on userid instead of username

Right now, we check the identity of a user based on their username instead of their userid. This is kinda bad: if a user leaves, then a new user can sign up and claim the old username, and all privileges associated with that username. To fix this, we want to authenticate based on userid instead of username.

You will probably need to edit the authenticating decorators in app/app.py, and the User model in app/models.py

Add a per-user API to open/close the door

To open the door without a key, you need to use /door open on Mattermost. Unfortunately, the Mattermost app is quite slow, so this takes ~30 seconds for me. It would be nice if this were faster, for example by using https://github.com/mwarning/trigger. To be able to use that app, we need an HTTP API to open/close the door

Flow:

  1. User is authorized on Mattermost by the board
  2. User uses /door links and receives the links of the open and close endpoint in an ephemeral message, with their personal token prefilled
  3. User copies these URL's into the app, then uses the app to open/close the door

Steps to get this done:

  • add a user_token field per user, make sure the migration and adding of new users fills these with secure random values
  • add a /door links subcommand
  • add authorized open and close endpoints
  • write some documentation in the Zeus wiki

Some notes:

Using this API would only be allowed after the user does an action themselves (for example, tapping a button in an app). The user needs to be aware that they opened/closed the door. Building a system with this that would allow other persons (even if authorized) to open the door with your token would be strictly prohibited (talk to the board/sysadmins if you want to build such an integration, we'll help you get this done if it's a good idea).

Make the bot posts of the door more user friendly

Currently, there are 2 mattermost channels in which door updates appear:

  • ~kelder: here, messages like door was open, redfast00 tried to lock door via the API get posted
  • ~verbose-mattermore: here, messages like "open" command from Mattermost handled, The door is now open and logging messages get posted

This approach was easy to implement (it's stateless, so we don't have to keep any state between requests in the mattermore backend), but is not that friendly for humans:

  • if you see a message in ~kelder and want to know if the action succeeded, you have to look in ~verbose-mattermore
  • it's hard to see when the door was manually opened: you have to look in ~verbose-mattermore and then discard all updates that are because of users electronically opening the door

Just changing the door was open, redfast00 tried to lock door into door was open, redfast00 locked the door is a bad approach: locking the door can fail (for example, if the door is misaligned and the dead bolt hits the strike plate), this would not be correct.

A possible approach is to use a state machine and a background task, but I'll leave it up to you on how you want to solve it.

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.