diff --git a/README.md b/README.md index dec0978..b3f213c 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,9 @@ wireguard interface stats. See the `cap_add` and `network_mode` options on the d Set the `SESSION_SECRET` environment variable to a random value. -In order to sent the wireguard configuration to clients via email (using sendgrid api) set the following environment variables +In order to sent the wireguard configuration to clients via email, set the following environment variables: + +- using SendGrid API ``` SENDGRID_API_KEY: Your sendgrid api key @@ -41,6 +43,18 @@ EMAIL_FROM_ADDRESS: the email address you registered on sendgrid EMAIL_FROM_NAME: the sender's email address ``` +- using SMTP + +``` +SMTP_HOSTNAME +SMTP_PORT +SMTP_USERNAME +SMTP_PASSWORD +SMTP_AUTH_TYPE +EMAIL_FROM_ADDRESS: the sender's email address +EMAIL_FROM_NAME: the sender's name +``` + ### Using binary file Download the binary file from the release and run it with command: diff --git a/custom/js/helper.js b/custom/js/helper.js index 6ce7f60..9dff4ee 100644 --- a/custom/js/helper.js +++ b/custom/js/helper.js @@ -24,11 +24,15 @@ function renderClientList(data) {
-
Download
+
+ +
+
+ + +
@@ -293,6 +298,12 @@ const allocated_ips = $("#client_allocated_ips").val().split(","); const allowed_ips = $("#client_allowed_ips").val().split(","); let use_server_dns = false; + let extra_allowed_ips = []; + + if ($("#client_extra_allowed_ips").val() !== "") { + extra_allowed_ips = $("#client_extra_allowed_ips").val().split(","); + } + if ($("#use_server_dns").is(':checked')){ use_server_dns = true; @@ -305,7 +316,7 @@ } const data = {"name": name, "email": email, "allocated_ips": allocated_ips, "allowed_ips": allowed_ips, - "use_server_dns": use_server_dns, "enabled": enabled}; + "extra_allowed_ips": extra_allowed_ips, "use_server_dns": use_server_dns, "enabled": enabled}; $.ajax({ cache: false, @@ -376,6 +387,16 @@ 'placeholderColor': '#666666' }); + $("#client_extra_allowed_ips").tagsInput({ + 'width': '100%', + 'height': '75%', + 'interactive': true, + 'defaultText': 'Add More', + 'removeWithBackspace': true, + 'minChars': 0, + 'placeholderColor': '#666666' + }); + // New client form validation $(document).ready(function () { $.validator.setDefaults({ @@ -414,6 +435,7 @@ $("#client_name").val(""); $("#client_email").val(""); $("#client_allocated_ips").importTags(''); + $("#client_extra_allowed_ips").importTags(''); updateIPAllocationSuggestion(); }); }); diff --git a/templates/clients.html b/templates/clients.html index 2426fb7..16d2057 100644 --- a/templates/clients.html +++ b/templates/clients.html @@ -57,6 +57,24 @@ Wireguard Clients
+ + + +