Closed paulb-smartit closed 2 years ago
This will probably be from the config change that I made to fix the -config
bug.
I was originally managing the state with IPtables and it was horrific, eBPF and XDP really work quite well in this instance, Im hoping to move the forwarding into the eBPF program if at all possible to further reduce the IPtables rules that I have to add.
As for centralised management, I think that'll be my next goal, at the moment its finding and fixing pain points like these.
Thanks for your compliments!
I can replicate this, but only when the configuration file is moved after wag has been started.
From a UX perspective I suppose having the reload
command take the -config
argument may be misleading, as the reload command does not take arguments and purely reloads from previous file location.
I'm not moving anything, just an edit (with vi) and reload. Don't know if it causes a change in the file descriptor or something the process is referencing.
Hmmmm, I cant replicate that. The program only references the filepath, so nothing fancy is going on with the descriptors.
Im assuming you're running wag with everything in one folder?
Ahhh, actually I see. On reload its wiping the path it tries to read. So then on the subsequent reload it has no path.
Sweet. latest commits should fix that.
Hmmmm, I cant replicate that. The program only references the filepath, so nothing fancy is going on with the descriptors.
Im assuming you're running wag with everything in one folder?
Yes, all in /opt/wag
Currently, two terminal windows side by side, so I can see wag running and the effect of reload.
As for centralised management, I think that'll be my next goal, at the moment its finding and fixing pain points like these.
If you get this core stable, it'll be a great base to build on. It just seems very slick in the way it handles the acl's. It's very well suited to my needs.
Boom, result!
2022/09/08 19:40:53 able to reload config
2022/09/08 19:40:53 Config reloaded
The line able to reload config
should no longer be printed in the fixed version. Can you just make sure that reloading twice works?
(Otherwise I may have pushed an old version of wag into release)
Ohh
2022/09/08 19:43:15 Wag started successfully, Ctrl + C to stop
2022/09/08 19:43:45 able to reload config
2022/09/08 19:43:45 Config reloaded
2022/09/08 19:44:00 Unable to reload config: Unable to load configuration file from : open : no such file or directory
Yep, thats still the old version!
$ git pull
From https://github.com/NHAS/wag
* [new tag] v1.0.4 -> v1.0.4
Already up to date.
Should look like this on multiple config reloads now:
2022/09/09 07:43:38 Wag started successfully, Ctrl + C to stop
2022/09/09 07:43:41 Config reloaded
2022/09/09 07:45:32 Config reloaded
2022/09/09 07:45:33 Config reloaded
2022/09/09 07:45:33 Config reloaded
Have you rerun go build
?
I did also do a binary release here: https://github.com/NHAS/wag/releases/tag/v1.0.4
I said I was a go
novice
2022/09/08 19:46:51 Wag started successfully, Ctrl + C to stop
2022/09/08 19:46:55 Config reloaded
2022/09/08 19:46:56 Config reloaded
2022/09/08 19:46:57 Config reloaded
2022/09/08 19:46:57 Config reloaded
Sweet! Glad thats all working for ya
Many thanks
Edited
config.json
and added an IP address to a policy -10.0.4.125/32
then tried to use reload.Stop and start wag and if fires up as it should with the new rule.
Have to say I'm rather impressed by this so far. I was expecting it to add in lots of
iptables
rules that I could see happening, but I see it uses xdp ebpf - which must be where the cleverness hides.If you have a mind for future expansion, I'd consider further authentication modules, maybe as plugins. LDAP, OpenIDC, maybe SAML, even a simple database auth.
Keep up the excellent work