Compare commits

...

2 Commits

Author SHA1 Message Date
Donald Cheng Hong Zou
d52cd2b17c Doing a update 2022-03-22 17:28:19 -04:00
Donald Cheng Hong Zou
cefa80f317 Fixed redirect functionality 2022-03-22 16:17:12 -04:00
3 changed files with 13 additions and 6 deletions

View File

@@ -116,7 +116,7 @@
1. Download WGDashboard
```shell
git clone -b v3.0.5 https://github.com/donaldzou/WGDashboard.git wgdashboard
git clone -b v3.0.6 https://github.com/donaldzou/WGDashboard.git wgdashboard
2. Open the WGDashboard folder
@@ -302,7 +302,7 @@ Since version 2.0, WGDashboard will be using a configuration file called `wg-das
| `app_ip` | IP address the dashboard will run with | `0.0.0.0` | Yes |
| `app_port` | Port the the dashboard will run with | `10086` | Yes |
| `auth_req` | Does the dashboard need authentication to access, if `auth_req = false` , user will not be access the **Setting** tab due to security consideration. **User can only edit the file directly in system**. | `true` | **No** |
| `version` | Dashboard Version | `v3.0.5` | **No** |
| `version` | Dashboard Version | `v3.0.6` | **No** |
| `dashboard_refresh_interval` | How frequent the dashboard will refresh on the configuration page | `60000ms` | Yes |
| `dashboard_sort` | How configuration is sorting | `status` | Yes |
| | | | |
@@ -376,7 +376,7 @@ Endpoint = 0.0.0.0:51820
2. Update the dashboard
```shell
git pull https://github.com/donaldzou/WGDashboard.git v3.0.5 --force
git pull https://github.com/donaldzou/WGDashboard.git v3.0.6 --force
```
3. Install

View File

@@ -30,7 +30,7 @@ from util import regex_match, check_DNS, check_Allowed_IPs, check_remote_endpoin
check_IP_with_range, clean_IP_with_range
# Dashboard Version
DASHBOARD_VERSION = 'v3.0.5'
DASHBOARD_VERSION = 'v3.0.6'
# WireGuard's configuration path
WG_CONF_PATH = None
@@ -653,7 +653,10 @@ def auth_req():
else:
session['message'] = ""
conf.clear()
return redirect("/signin?redirect=" + str(request.url))
redirectURL = str(request.url)
redirectURL = redirectURL.replace("http://", "")
redirectURL = redirectURL.replace("https://", "")
return redirect("/signin?redirect=" + redirectURL)
else:
if request.endpoint in ['signin', 'signout', 'auth', 'settings', 'update_acct', 'update_pwd',
'update_app_ip_port', 'update_wg_conf_path']:

View File

@@ -67,7 +67,11 @@
if (res.status === true){
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.get("redirect")){
window.location.replace(urlParams.get("redirect"))
if (document.URL.substring(0, 5) == "http:"){
window.location.replace(`http://${urlParams.get("redirect")}`)
}else if (document.URL.substring(0, 5) == "https"){
window.location.replace(`https://${urlParams.get("redirect")}`)
}
}else{
window.location.replace("/");
}