build process (via Dockerfile) now timestamps build and that is exposed on about page

This commit is contained in:
2023-01-03 11:46:53 +11:00
parent be3e2ae19e
commit 0684f4725a
4 changed files with 16 additions and 5 deletions

14
main.py
View File

@@ -199,7 +199,19 @@ def about():
todo=fp.read()
except FileNotFoundError:
todo="No TODOs defined - cannot find TODO file!?"
return render_template("about.html", commits=commits, bugs=bugs, todo=todo)
try:
with open( 'internal/build-date.txt', 'r' ) as fp:
if 'ENV' in os.environ:
build_info=os.environ['ENV']
else:
build_info="Development"
build_info = build_info + " version built on: " + fp.read()
except FileNotFoundError:
if 'ENV' not in os.environ or os.environ['ENV'] == "development":
build_info="Development version"
else:
build_info="No build info found!?"
return render_template("about.html", commits=commits, bugs=bugs, todo=todo, build_info=build_info)
@app.route('/logout')
@login_required