diff --git a/README.md b/README.md index 02cecb5..14b7389 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,34 @@ # The Long Night -Increase Bus Factor by providing ssh access to server. \ No newline at end of file +Increase Bus Factor by providing ssh access to server. + +# How it works + ++ The server admin runs the installation and sets a password, ssh-key, number + of days to add the key after. ++ The server admin gives the "bus factor" the password. ++ In case of an incident, the "bus factor" visits the webpage and enters the + provided password. ++ If the correct password is entered, the server admin is notified via all the + configured backends that the correct password has been added. ++ If the server admin doesn't wish the ssh-key to be added, they can login and + run `cancel-adding-key.sh` in the installation directory. + + If the command is run within the configured number of days, then the key + is not added and everything returns back to normal and the server starts + listening for password again. No new setup is necessary. + + If the command is not run within the configured number of days, then the + ssh key is added. + + +# Installation + ++ Clone the repository. + + `git clone https://gitlab.com/ceda_ei/the-long-night.git` ++ Install the dependencies + + `pip3 install -r requirements.txt` ++ Create a config file by running `./installation.py`. ++ Install `gunicorn`. + + `pip3 install gunicorn` ++ Run `gunicorn3 -b 127.0.0.1:5000 server:app`. Change port if you want to run + gunicorn on a different port. ++ Set up a reverse proxy from your webserver to `localhost:5000`. diff --git a/installation.py b/installation.py index e0e3973..e41372b 100755 --- a/installation.py +++ b/installation.py @@ -54,7 +54,7 @@ config["telegram"]["enabled"] = tg_enable if tg_enable: print("\nEnter bot token\n") config["telegram"]["bot_token"] = input("> ") - print("\nEnter userid\n") + print("\nEnter user ID. (Send /info to @questable_bot to find out)\n") config["telegram"]["user_id"] = get_number("> ") print("\nAttempting to send a test message") from backends import telegram diff --git a/requirements.txt b/requirements.txt index 34b2c90..e10f431 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ bcrypt requests matrix_client +flask