2016-07-28 18:44:59 -04:00

174 lines
4.5 KiB
HTML

{% extends "simple_service.html" %}
{% comment %}
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% block page_head %}
{% if config_running %}
<meta http-equiv="refresh" content="3" />
{% endif %}
<style type="text/css">
.loader {
border: 16px solid #f3f3f3; /* Light grey */
border-top: 16px solid #3498db; /* Blue */
border-radius: 50%;
width: 80px;
height: 80px;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
{% endblock %}
{% block configuration %}
<h3>{% trans "Status" %}</h3>
{% if config_running %}
<p class="running-status-parent">
<span class="running-status active"></span>
{% trans "Tor configuration is being updated" %}
</p>
<div class="loader"></div>
{% else %}
<p class="running-status-parent">
{% if status.is_running %}
<span class="running-status active"></span>
{% trans "Tor is running" %}
{% else %}
<span class="running-status inactive"></span>
{% trans "Tor is not running" %}
{% endif %}
</p>
{% include "diagnostics_button.html" with module="tor" %}
{% if status.hs_enabled %}
<div class="row">
<div class="col-sm-3">
<table class="table table-bordered table-condensed table-striped">
<thead>
<tr>
<th>{% trans "Hidden Service" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Ports" %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ status.hs_hostname }}</td>
<td>{{ status.hs_status }}</td>
<td>
{% for service in status.hs_services %}
{{ service }}
{% endfor %}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{% endif %}
<h3>{% trans "Configuration" %}</h3>
<form class="form" method="post">
{% csrf_token %}
{{ form|bootstrap }}
<input type="submit" class="btn btn-primary btn-md"
value="{% trans "Update setup" %}"/>
</form>
{% if status.relay_enabled %}
<h3>{% trans "Relay" %}</h3>
<p>
{% blocktrans trimmed %}
If your {{ box_name }} is behind a router or firewall, you should
make sure the following ports are open, and port-forwarded, if
necessary:
{% endblocktrans %}
</p>
<div class="row">
<div class="col-sm-3">
<table class="table table-bordered table-condensed table-striped">
<thead>
<tr>
<th>{% trans "Service" %}</th>
<th>{% trans "Port" %}</th>
</tr>
</thead>
<tbody>
{% for name, port in status.ports.items %}
<tr>
<td>{{ name }}</td>
<td>{{ port }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
<h3>{% trans "SOCKS" %}</h3>
<p>
{% blocktrans trimmed %}
A Tor SOCKS port is available on your {{ box_name }} on TCP port
9050.
{% endblocktrans %}
</p>
{% endif %}
{% endblock %}
{% block page_js %}
<script type="text/javascript">
(function($) {
$('#id_tor-relay_enabled').change(function() {
var bridge = $('#id_tor-bridge_relay_enabled');
var disable = ! $('#id_tor-relay_enabled').prop('checked');
bridge.prop('disabled', disable);
if (disable) {
$('#id_tor-bridge_relay_enabled').prop('checked', false);
}
}).change();
})(jQuery);
</script>
{% endblock %}