Make some system information public
Committed 2d46a8
--- a/webint_system/__init__.py
+++ b/webint_system/__init__.py
class System:
"""The system that runs your website."""
- owner_only = ["get"]
-
def get(self):
""""""
try:
--- a/webint_system/templates/index.html
+++ b/webint_system/templates/index.html
$var title: System
<h2 id=addresses>Addresses</h2>
-
-<h3>Clearnet</h3>
<p>$ip_address</p>
-<h4>Domain Name System (DNS)</h4>
+<h3>Domain Name System (DNS)</h3>
$if domains:
<p>$", ".join(domains)</p>
$else:
<p><strong><em>It is recommended that you add a domain name.</em></strong></p>
-<form method=get action=/addresses/domains>
-<label>Domain Name<br>
-<input name=domain></label>
-<div><button>Add</button></div>
-</form>
-
-<h3>Darknet</h3>
-<h4>The Onion Router (Tor)</h4>
+$if tx.user.is_owner:
+ <form method=get action=/addresses/domains>
+ <label>Domain Name<br>
+ <input name=domain></label>
+ <div><button>Add</button></div>
+ </form>
+<h3>The Onion Router (tor)</h3>
$if onion:
<p style=font-family:monospace>$(onion[:28])­$(onion[28:])</p>
-<form method=post action=/addresses/tor/miner>
-<label>Onion<br>
-<input name=prefix></label>
-<div><button>Add</button></div>
-</form>
+$if tx.user.is_owner:
+ <form method=post action=/addresses/tor/miner>
+ <label>Onion<br>
+ <input name=prefix></label>
+ <div><button>Add</button></div>
+ </form>
<h2 id=software>Software</h2>
-<form action=/software method=post><button>Update</button></form>
+$if tx.user.is_owner:
+ <form action=/software method=post><button>Update</button></form>
<p>Primary application: <code>$main_app.name</code></p>
<p><code>webint</code> version: $webint_versions[0]
$if webint_versions[1]:
$:render_parent_controllers("after", main_app.after_controllers)
$:render_parent_controllers("after", main_app.unprefixed_controllers)
-<div id=wrappers>
-<h3>Wrappers</h3>
-<ol style=columns:3;line-height:1.25;list-style:none;padding:0>
-$for wrapper in main_app.wrappers:
- <li>$wrapper.__name__<br>
- <small>$wrapper.__module__</small>
- </li>
-</ol>
-</div>
-
-<h2 id=settings>Settings</h2>
-<ul>
-$for key, value in settings.items():
- <li><strong>$key:</strong> <code>$value</code></li>
-</ul>
-<form method=post action=/settings>
-<label>Key <input name=key></label><br>
-<label>Value <input name=value></label><br>
-<button>Add</button>
-</form>
+$if tx.user.is_owner:
+ <div id=wrappers>
+ <h3>Wrappers</h3>
+ <ol style=columns:3;line-height:1.25;list-style:none;padding:0>
+ $for wrapper in main_app.wrappers:
+ <li>$wrapper.__name__<br>
+ <small>$wrapper.__module__</small>
+ </li>
+ </ol>
+ </div>
+
+$if tx.user.is_owner:
+ <h2 id=settings>Settings</h2>
+ <ul>
+ $for key, value in settings.items():
+ <li><strong>$key:</strong> <code>$value</code></li>
+ </ul>
+ <form method=post action=/settings>
+ <label>Key <input name=key></label><br>
+ <label>Value <input name=value></label><br>
+ <button>Add</button>
+ </form>
$# $def aside():
$# $# <h4><a href=/applications>Applications</a></h4>