Add key and onion getters
Committed 6a1ef0
--- a/webint_system/__init__.py
+++ b/webint_system/__init__.py
yield
+def get_key():
+ """Return site's keyring."""
+ return None
+
+
+def get_onion():
+ """Return site's onion."""
+ try:
+ with open("/home/admin/app/run/onion") as fp:
+ return fp.read().strip()
+ except FileNotFoundError:
+ pass
+
+
@app.control("")
class System:
"""The system that runs your website."""
def get(self):
""""""
try:
- with open("/home/admin/app/run/onion") as fp:
- onion = fp.read().strip()
+ onion = get_onion()
except FileNotFoundError:
onion = None
try: