diff --git a/plinth/modules/wireguard/forms.py b/plinth/modules/wireguard/forms.py index 3f03abb42..e81c954c1 100644 --- a/plinth/modules/wireguard/forms.py +++ b/plinth/modules/wireguard/forms.py @@ -32,32 +32,37 @@ class AddClientForm(forms.Form): class AddServerForm(forms.Form): """Form to add server.""" peer_endpoint = forms.CharField( - label=_('Endpoint'), strip=True, - help_text=_('Server endpoint with the form "ip:port".')) + label=_('Endpoint of the server'), strip=True, + help_text=_('Domain name and port in the form "ip:port". Example: ' + 'demo.wireguard.com:12912 .')) peer_public_key = forms.CharField( - label=_('Public key of the server'), strip=True, - help_text=_('Public key of the server.')) + label=_('Public key of the server'), strip=True, help_text=_( + 'Provided by the server operator, a long string of characters.')) ip_address = forms.CharField( label=_('Client IP address provided by server'), strip=True, - help_text=_('IP address assigned to the client on the VPN after ' - 'connecting to the endpoint.')) + help_text=_('IP address assigned to this machine on the VPN after ' + 'connecting to the endpoint. This value is usually ' + 'provided by the server operator. Example: 192.168.0.10.')) private_key = forms.CharField( - label=_('Private key of the client'), strip=True, - help_text=_('Optional. A new key is generated if left blank.'), - required=False) + label=_('Private key of this machine'), strip=True, help_text=_( + 'Optional. New public/private keys are generated if left blank. ' + 'Public key can then be provided to the server. This is the ' + 'recommended way. However, some server operators insist on ' + 'providing this.'), required=False) preshared_key = forms.CharField( - label=_('Pre-shared key'), strip=True, required=False, - help_text=_('Optional. A shared secret key provided by the server to ' - 'add an additional layer of encryption.')) + label=_('Pre-shared key'), strip=True, required=False, help_text=_( + 'Optional. A shared secret key provided by the server to add an ' + 'additional layer of security. Fill in only if provided.')) default_route = forms.BooleanField( label=_('Use this connection to send all outgoing traffic'), - required=False, - help_text=_('Use this connection to send all outgoing traffic.')) + required=False, help_text=_( + 'Typically checked for a VPN service though which all traffic ' + 'is sent.')) def get_settings(self): """Return NM settings dict from cleaned data.""" diff --git a/plinth/modules/wireguard/templates/wireguard.html b/plinth/modules/wireguard/templates/wireguard.html index 8a85d2030..c684a6101 100644 --- a/plinth/modules/wireguard/templates/wireguard.html +++ b/plinth/modules/wireguard/templates/wireguard.html @@ -22,9 +22,9 @@ {% load i18n %} {% block configuration %} -
{% trans "Peers allowed to connect to this server" %}
+{% trans "Peers allowed to connect to this server:" %}
| {{ client.public_key }} | |||
| {% trans "IP address to use:" %} | +{% trans "IP address to use for client:" %} | {{ client.allowed_ips|join:", " }} | |
|---|---|---|---|
| {% trans "Server's public key:" %} | +{% trans "Server public key:" %} | {{ server.public_key }} |
| {% trans "Endpoint:" %} | +{% trans "Server endpoint:" %} | {{ peer.endpoint }} |
|---|---|---|
| {% trans "Public Key:" %} | +{% trans "Server public key:" %} | {{ peer.public_key }} |
| {% trans "Pre-shared key:" %} | {{ peer.preshared_key }} | |
| {% trans "Public key of this machine:" %} | +{{ server.public_key }} | +|
| {% trans "IP address of this machine:" %} | +{{ server.ip_address }} | +
| {% trans "Data transmitted:" %} | {{ peer.status.transfer_tx|filesizeformat }} | @@ -52,21 +72,21 @@{% trans "Latest handshake:" %} | {{ peer.status.latest_handshake|default:'' }} |
|---|
- {% trans "Edit Server" %} + {% trans "Edit" %} - {% trans "Delete Server" %} + {% trans "Delete" %}
diff --git a/plinth/modules/wireguard/views.py b/plinth/modules/wireguard/views.py index 1558646a0..519bcab11 100644 --- a/plinth/modules/wireguard/views.py +++ b/plinth/modules/wireguard/views.py @@ -66,7 +66,7 @@ class AddClientView(SuccessMessageMixin, FormView): def get_context_data(self, **kwargs): """Return additional context for rendering the template.""" context = super().get_context_data(**kwargs) - context['title'] = _('Add Client') + context['title'] = _('Add Allowed Client') return context def form_valid(self, form): @@ -89,7 +89,7 @@ class ShowClientView(SuccessMessageMixin, TemplateView): def get_context_data(self, **kwargs): """Return additional context data for rendering the template.""" context = super().get_context_data(**kwargs) - context['title'] = _('Show Client') + context['title'] = _('Allowed Client') public_key = urllib.parse.unquote(self.kwargs['public_key']) server_info = utils.get_info()['my_server'] @@ -149,7 +149,7 @@ class DeleteClientView(SuccessMessageMixin, TemplateView): def get_context_data(self, **kwargs): """Return additional context data for rendering the template.""" context = super().get_context_data(**kwargs) - context['title'] = _('Delete Client') + context['title'] = _('Delete Allowed Client') context['public_key'] = urllib.parse.unquote(self.kwargs['public_key']) return context @@ -175,7 +175,7 @@ class AddServerView(SuccessMessageMixin, FormView): def get_context_data(self, **kwargs): """Return additional context for rendering the template.""" context = super().get_context_data(**kwargs) - context['title'] = _('Add Server') + context['title'] = _('Add Connection to Server') return context def form_valid(self, form): @@ -191,7 +191,7 @@ class ShowServerView(SuccessMessageMixin, TemplateView): def get_context_data(self, **kwargs): """Return additional context data for rendering the template.""" context = super().get_context_data(**kwargs) - context['title'] = _('Server Information') + context['title'] = _('Connection to Server') interface = self.kwargs['interface'] info = utils.get_info() @@ -214,7 +214,7 @@ class EditServerView(SuccessMessageMixin, FormView): def get_context_data(self, **kwargs): """Return additional context for rendering the template.""" context = super().get_context_data(**kwargs) - context['title'] = _('Modify Server') + context['title'] = _('Modify Connection to Server') return context def get_initial(self): @@ -255,7 +255,7 @@ class DeleteServerView(SuccessMessageMixin, TemplateView): def get_context_data(self, **kwargs): """Return additional context data for rendering the template.""" context = super().get_context_data(**kwargs) - context['title'] = _('Delete Server') + context['title'] = _('Delete Connection to Server') interface = self.kwargs['interface'] info = utils.get_nm_info()