You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe The Problem
Wireguard allows interfaces names that match the following regex: ^[a-zA-Z0-9_=+.-]{1,15}$
In dashboard.py the on line 490 the create_table function crashes when using an interface name such as wg-test.
The reason for this is that SQlite does not allow dashes in database names unless they are quoted. As reference see this {stackoverflow answer](https://stackoverflow.com/a/3694291).
The fix is to replace CREATE TABLE IF NOT EXISTS {i} ( with CREATE TABLE IF NOT EXISTS \"{i}\" (
This will fix the login error. However there are some more locations in the code that still need escaping. For example opening an interface wont work.
Expected Error / Traceback
Dec 17 23:01:02 wireguard python3[40351]: File "/srv/wgdashboard/src/dashboard.py", line 501, in get_conf_list
Dec 17 23:01:02 wireguard python3[40351]: g.cur.execute(create_table)
Dec 17 23:01:02 wireguard python3[40351]: sqlite3.OperationalError: near "-": syntax error
To Reproduce
Run the dashboard with an interface with dashes in the name such as wg-test
Describe The Problem
Wireguard allows interfaces names that match the following regex:
^[a-zA-Z0-9_=+.-]{1,15}$
In dashboard.py the on line 490 the create_table function crashes when using an interface name such as
wg-test
.The reason for this is that SQlite does not allow dashes in database names unless they are quoted. As reference see this {stackoverflow answer](https://stackoverflow.com/a/3694291).
The fix is to replace
CREATE TABLE IF NOT EXISTS {i} (
withCREATE TABLE IF NOT EXISTS \"{i}\" (
This will fix the login error. However there are some more locations in the code that still need escaping. For example opening an interface wont work.
Expected Error / Traceback
To Reproduce
Run the dashboard with an interface with dashes in the name such as
wg-test
OS Information:
Sample of your
.conf
fileThe text was updated successfully, but these errors were encountered: