diff --git a/app/routes.py b/app/routes.py index 5646f64..40fb068 100644 --- a/app/routes.py +++ b/app/routes.py @@ -775,9 +775,22 @@ def status(): filen = url_for('static', filename='img/open.png') caniregister = True - version = config['version'] + try: + with open ("version.txt", "r") as versionFile: + hsh=versionFile.readlines()[0] + update=versionFile.readlines()[1] + #tag=versionFile.readlines()[2] + except: + try: + tag = str(subprocess.check_output(["git", "describe", "--tags"]).strip())[2:-1] + hsh = str(subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]).strip())[2:-1] + update = str(subprocess.check_output(["git", "log", "-1", "--format=%cd"]).strip())[2:-1] + except: + hsh="Unknown" + update="Unknown" + tag="Unknown" return render_template('status.html', title='STATUS', count=count, max=config['maxInstanceUsers'], file=filen, - cani=caniregister, version=config['version']) + cani=caniregister, hash=hsh, update=update, tag=tag) @app.route('/error/') diff --git a/app/templates/status.html b/app/templates/status.html index b534b99..381ae58 100644 --- a/app/templates/status.html +++ b/app/templates/status.html @@ -46,7 +46,9 @@
-

Yotter version: {{version}}

+

Yotter version: {{tag}}

+

Latest update: {{update}}

+

Commit hash: {{hash}}

diff --git a/yotter-config.json b/yotter-config.json index 751096f..7ae8e0b 100644 --- a/yotter-config.json +++ b/yotter-config.json @@ -11,6 +11,5 @@ "admin_message":"Message from the admin text", "admin_user":"admin_username", "max_old_user_days": 60, - "donate_url": "", - "version": "2020.11.05" + "donate_url": "" }