From 12a0b1efe5475d2b7140343d05bbb87f9c1c9cdf Mon Sep 17 00:00:00 2001 From: b3yond Date: Fri, 11 Jan 2019 13:38:47 +0100 Subject: [PATCH] added call to GET version (commit hash) --- README.md | 2 +- frontend.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 680285d..0a68e78 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ virtualenv -p python3 . Install the dependencies: ```shell -pip install tweepy pytoml Mastodon.py bottle pyjwt pylibscrypt Markdown twx +pip install tweepy pytoml Mastodon.py bottle pyjwt pylibscrypt Markdown twx gitpython ``` Configure the bot: diff --git a/frontend.py b/frontend.py index 37144d3..8f86d1e 100755 --- a/frontend.py +++ b/frontend.py @@ -63,6 +63,13 @@ def confirm(city, token): return dict(error='Email confirmation failed.') +@get('/version') +def version(): + import git + repo = git.Repo(search_parent_directories=True) + return repo.head.object.hexsha + + @post('/login') @view('template/login.tpl') def login_post():