Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    What happen when "Apply Changes" is clicked

    Scheduled Pinned Locked Moved webGUI
    5 Posts 3 Posters 474 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DGG
      last edited by DGG

      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.

      bmeeksB 1 Reply Last reply Reply Quote 0
      • bmeeksB
        bmeeks @DGG
        last edited by bmeeks

        @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
        
        D 1 Reply Last reply Reply Quote 0
        • D
          DGG @bmeeks
          last edited by

          @bmeeks
          I found what I was looking for in /etc/inc

          Thank you!

          bmeeksB 1 Reply Last reply Reply Quote 0
          • bmeeksB
            bmeeks @DGG
            last edited by

            @DGG said in What happen when "Apply Changes" is clicked:

            @bmeeks
            I found what I was looking for in /etc/inc

            Thank you!

            You probably already know this, but any future pfSense updates will overwrite changes you made to the PHP source files.

            1 Reply Last reply Reply Quote 0
            • JonathanLeeJ
              JonathanLee
              last edited by

              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

              Make sure to upvote

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.