Erik Thuning
e9f180805a
Started sending some serverside configuration to the client-side javascript
...
The information is sent via the cookie 'server_settings'. The value is a
base64-encoded json object containing the data necessary
for site-specific customization.
Also fixed a bug that was preventing the 'add new client' button from being
disabled when the client limit is reached.
2025-03-06 15:08:37 +01:00
Erik Thuning
ebc430407a
Added rudimentary logging
...
Only logging creation and deletion of configs for the time being,
log goes straight to stdout
2025-03-04 15:30:11 +01:00
Erik Thuning
c72d079342
Fixing a wireguard warning
...
by setting restrictive access to the interface config file.
2025-03-04 14:06:24 +01:00
Erik Thuning
b6865f9635
Working around an issue with configparser insisting on a default section
2025-03-04 14:02:25 +01:00
Erik Thuning
f43aa53ca8
Added support for multiple entitlements granting site access
2025-03-04 13:53:56 +01:00
Erik Thuning
ee83905291
Typo
2025-03-04 13:28:49 +01:00
Erik Thuning
edcabb3160
Configparser does some interpolations by default
...
They interfere with wildcards passed to wireguard, so disabling it.
2025-03-04 13:27:09 +01:00
Erik Thuning
44dad4430c
Fixed a type error
2025-03-04 13:12:38 +01:00
Erik Thuning
27b7b5d7de
Made user_client_limit be truly optional in config.ini
2025-03-04 13:10:21 +01:00
Erik Thuning
f0169b89bb
Accidentally committed some debug changes, reverting
2025-03-04 13:06:07 +01:00
Erik Thuning
dc051e9439
Implemented support for configurable client configuration fragments
2025-03-04 13:05:51 +01:00
Erik Thuning
49abf8ad21
Implemented handling of client limits, and some general tweaks
...
- The create button is now disabled when reaching the client limit
- The client list is now always sorted by case-insensitive config name
- Focus moves to the form when opening a dialog
- Fixed some inconsistent use of snake_case vs perlCase
2025-03-04 11:14:02 +01:00
Erik Thuning
d8dcbc6d6b
Improved page accessibility
2025-03-04 11:12:22 +01:00
Erik Thuning
c886a7b32c
Implemented support for limiting number of clients per user
...
The setting is global for all users and optional.
2025-03-03 13:49:42 +01:00
Erik Thuning
d56e5e2cb2
Folded all failure responses into a single function
2025-03-03 13:15:52 +01:00
Erik Thuning
311ae0276e
Implemented support for entitlements-based access control
...
If configured, anyone missing the required entitlement will now be denied
access to the application and its api endpoints. If unset, any authenticated
user is accepted.
2025-02-27 17:25:32 +01:00
Erik Thuning
a636f4f84a
Apparently shell=True caused problems instead of solving them
2025-02-27 15:35:44 +01:00
Erik Thuning
59ae5f96a5
Fixed a typo and hopefully prevented sudo issues with shell=True
2025-02-27 15:29:25 +01:00
Erik Thuning
9b925faec3
Updated example config file to reflect reality
2025-02-27 15:26:23 +01:00
Erik Thuning
1d639fd09f
Added a sanity check on config id:s
...
Config id:s must now match the regex ^[A-Za-z0-9-]$ in order to be considered
valid. Also rearranged early declarations to make more sense and removed
some dead code.
2025-02-27 15:21:35 +01:00
Erik Thuning
116a480e41
Fixed a typo, added a comment regarding sudo safety and set commands.sh executable
2025-02-27 15:05:16 +01:00
Erik Thuning
bc44648c30
Setting routes and dealing more robustly with privileged operations
...
- Created commands.sh, which is now responsible for all operations that
require root permissions: addin/deleting routes and reloading wireguard
- Added creation and deletion of routes when creating or deleting a client.
This *feels* like a bug in wg-quick, considering that the routes are
created/deleted as expected on start/stop. Reload informs wireguard of a
peer's existence but fails to set routes. For now, this is
a suitable workaround.
2025-02-27 14:59:21 +01:00
Erik Thuning
2a3e529111
Calling systemctl with fully qualified path
2025-02-25 16:55:39 +01:00
Erik Thuning
1a3d13e503
Started creating the ini data in a slightly more structured way
2025-02-25 16:25:16 +01:00
Erik Thuning
372f258b01
Revert "Trying to get the tunnel working"
...
This reverts commit 1374533819 .
2025-02-25 15:22:55 +01:00
Erik Thuning
f13e78cc91
Revert "Still trying to get the tunnel going"
...
This reverts commit 2bdb6e35c6 .
2025-02-25 15:22:45 +01:00
Erik Thuning
2bdb6e35c6
Still trying to get the tunnel going
2025-02-20 18:07:00 +01:00
Erik Thuning
1374533819
Trying to get the tunnel working
2025-02-20 17:56:40 +01:00
Erik Thuning
443ec025f7
Updated example config to reflect reality.
...
Also comments.
2025-02-20 16:23:07 +01:00
Erik Thuning
432fe8955b
Using the wireguard service instead of direct wg call for reload
2025-02-20 16:11:54 +01:00
Erik Thuning
48fc34d315
Added optional support for extra server settings to be included in the server config
2025-02-20 16:04:11 +01:00
Erik Thuning
683cce3fdd
FIX: Config boxes now shrink to their content
2025-02-20 16:00:24 +01:00
Erik Thuning
3eb8663e06
Defaulting the instructions to open again
2025-02-20 15:59:57 +01:00
Erik Thuning
4759fdeabc
CSS Tweaking and housekeeping
2025-02-20 15:09:40 +01:00
Erik Thuning
dc50409d29
Eliminated the <main> element
2025-02-19 23:32:10 +01:00
Erik Thuning
39ba84bf2e
CSS tweaks
2025-02-19 23:02:30 +01:00
Erik Thuning
b1ff300fc8
Expanded locking to the entire config creation function
...
This to eliminate certain race conditions. Also initial attempt at
dealing with the wireguard interface.
2025-02-19 21:11:41 +01:00
Erik Thuning
2616c59769
The collected serverside config should work now
...
Also did some type hint housekeeping and formatting tweaks
2025-02-19 18:29:42 +01:00
Erik Thuning
255e9db7d4
Added 'work' subdir to gitignore
2025-02-19 18:11:53 +01:00
Erik Thuning
e3d6e52217
Added a thread-safe solution to finding the next free ip
2025-02-19 18:10:04 +01:00
Erik Thuning
8c9842484f
Added type hints
2025-02-19 18:08:08 +01:00
Erik Thuning
288d941123
Added a work directory intended to contain data written by the application
2025-02-19 16:10:08 +01:00
Erik Thuning
463fc62d60
Added example config and made wireguard.py read its server keys from disk
2025-02-19 15:35:11 +01:00
Erik Thuning
1b44178084
FIX: Fat fingers
2025-02-19 15:19:36 +01:00
Erik Thuning
27277968be
Removed broken code that should have sorted the configs by name
...
Something about async/promises is tripping me up again
2025-02-19 15:14:24 +01:00
Erik Thuning
6b4b923c3c
FIX: Implemented the download button functionality
2025-02-19 15:13:59 +01:00
Erik Thuning
1e5bf1aa9a
Set samesite attribute as appropriate on all cookies.
2025-02-19 15:11:21 +01:00
Erik Thuning
9b5a752e1a
FIX: Enter in the input field now triggers the correct form action.
...
The first button in the form tree is always the default button. In order for
the save button to become default, the footers were reorganized in backwards
order and then flexbox-ed to be laid out backwards.
This in order to keep the association of right -> forwards/accept
and left -> backwards/cancel.
2025-02-19 14:51:50 +01:00
Erik Thuning
86efda498e
Layout fixes.
...
Mostly a consistency change - now using rem anv vh/vw units as far as
reasonable. Also made some tweaks to the modal box.
2025-02-19 14:50:50 +01:00
Erik Thuning
b33da9f7d8
Updated instructions
2025-02-19 14:47:21 +01:00