Closed NovianPutera closed 2 weeks ago
Uh oh.. this is my bad.. you can add this line into your JSON body to prevent this issue:
{
"bulkAdd": false, // This line
"name": "testing",
"allowed_ips": [
"{pick avalaible IP from api/getAvailableIPs}"
],
"private_key": "{manual wg genkey on server}",
"public_key": "{pubkey from manual wg genkey on server}",
"preshared_key": "{manual wg genpsk on server}",
"DNS": "1.1.1.1",
"endpoint_allowed_ip": "0.0.0.0/0",
"keepalive": 21,
"mtu": 1420
}
This won't need in the next release :)
Thanks, I tried that. But it still doesn't seem to work. The current error requires 'bulkAddAmount' in error.log
Error Log
ERROR in app: Exception on /api/addPeers/wg2 [POST]
Traceback (most recent call last):
File "/home/folder/WGDashboard/src/venv/lib/python3.11/site-packages/flask/app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/folder/WGDashboard/src/venv/lib/python3.11/site-packages/flask/app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/folder/WGDashboard/src/venv/lib/python3.11/site-packages/flask_cors/extension.py", line 194, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
^^^^^^^^^^^^^^^^^^
File "/home/folder/WGDashboard/src/venv/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/folder/WGDashboard/src/venv/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/folder/WGDashboard/src/dashboard.py", line 1812, in API_addPeers
bulkAddAmount = data['bulkAddAmount']
~~~~^^^^^^^^^^^^^^^^^
KeyError: 'bulkAddAmount'
Success when adding value to 'bulkAddAmount'. But Profile name is not as expected.
Sorry my bad, please use the following JSON body
{
"bulkAdd": false,
"bulkAddAmount": 0,
"name": "Peer name",
"allowed_ips": [
"10.24.4.3/32"
],
"private_key": "yJ/VvhOhlyBG6D4nvCpLGCIPBAK4IiEhB9CdnWtIB0o=",
"public_key": "1qiiC1agXcjbldt//eLrJ//d1L7bxNHD5CGkiOQ7yWY=",
"DNS": "1.1.1.1",
"endpoint_allowed_ip": "0.0.0.0/0",
"keepalive": 21,
"mtu": 1420,
"preshared_key": "",
"preshared_key_bulkAdd": false
}
Sorry my bad, please use the following JSON body
{ "bulkAdd": false, "bulkAddAmount": 0, "name": "Peer name", "allowed_ips": [ "10.24.4.3/32" ], "private_key": "yJ/VvhOhlyBG6D4nvCpLGCIPBAK4IiEhB9CdnWtIB0o=", "public_key": "1qiiC1agXcjbldt//eLrJ//d1L7bxNHD5CGkiOQ7yWY=", "DNS": "1.1.1.1", "endpoint_allowed_ip": "0.0.0.0/0", "keepalive": 21, "mtu": 1420, "preshared_key": "", "preshared_key_bulkAdd": false }
Ahh, great solution. Thank you very much 🎊
500 Internal Server Error after test addPeers
Method Post, URL:
wg2 = our name configuration wg-dashboard-apikey = included in header
Error Log
Version Information:
Body Params