{% extends "base.html" %} {% import "_macros.html" as m with context %} {% block title %}Firewall{% endblock %} {% block content %}

Firewall

Incoming connections are blocked unless a rule below allows them. Rules for SSH and this panel are protected.

{% if fw.installed %}
{% endif %}
{% if not fw.installed %}
{% call m.empty("ufw is not installed", "Run the installer with FIREWALL=1 to set up the firewall.") %}{% endcall %}
{% else %} {% if not fw.active %}

The firewall is turned off. Every port of the server is reachable. Turn it on with ufw enable.

{% endif %}
{% for r in fw.rules %} {% set base = r.to.split('/')[0].split(' ')[0] %} {% else %}{% endfor %}
#PortActionFromNote
{{ r.num }} {{ r.to }} {% if r.action == "ALLOW" %}Allow{% elif r.action == "LIMIT" %}Limit{% else %}{{ r.action|capitalize }}{% endif %} {{ r["from"] }} {{ r.comment }} {% if base in fw.protected and r.action in ("ALLOW", "LIMIT") %}{{ m.icon("lock") }}Protected {% else %}
{{ m.csrf_field() }}
{% endif %}
No rules.
{% endif %} {% endblock %}