What happen when "Apply Changes" is clicked
-
Hi,
after any FW modification on the webGUI the button "Apply Changes" appears, when the button is clicked the files /cf/conf/config.xml and /tmp/rules.debug are changed.I would like to know what happen under the hood, how these files are modified. I need to intercept the creation/modification of the rules.debug file.
-
@DGG said in What happen when "Apply Changes" is clicked:
I need to intercept the creation/modification of the rules.debug file.
You can't do that unless you physically rewrite the PHP code that drives the pfSense GUI. There are also a handful of custom binary executables that can get called by the PHP GUI code to perform certain tasks.
There is no programming API you can hook into. pfSense is not designed that way.
You will find the PHP GUI code mostly contained within these two paths on your firewall:
/usr/local/www /etc/inc
-
@bmeeks
I found what I was looking for in /etc/incThank you!
-
@DGG said in What happen when "Apply Changes" is clicked:
@bmeeks
I found what I was looking for in /etc/incThank you!
You probably already know this, but any future pfSense updates will overwrite changes you made to the PHP source files.
-
Side note extra learning
“Edit In Place
Editing the configuration in-place is also possible in a variety of ways. The general procedure is:
Edit /conf/config.xml
Run rm /tmp/config.cache to clear the configuration cache
Reboot, or use the GUI to save/reload whichever part of the firewall utilizes the edited settings”Ref:
https://docs.netgate.com/pfsense/en/latest/config/xml-configuration-file.html