What is needed to tweak the code of the captive_portal.inc files?
-
Hi everyone,
I'm quite new to PfSense.
I wanted to intercept the Captive Portal user sign in process to make some configuration of my own (with regards to bandwidth assignment in particular).
Upon manually changing the captiveportal.inc file using the vim editor. I'd found that the captiveportal tab stopworking completely. (It was some error indicating that there are some sort of security issues).
Is it because PfSense has some mechanism built-in to prevent these edit? What does it take to edit these .inc file? Do I have to rebuild the whole thing from source code?Thank you!
Cheers! -
There is no such mechanism. If you edited the file and it broke, the breakage was caused by your edit.
-
@steve_b Hi,
I've tried it again and it works.The last time I was copying the entire folder from the Virtual Machine to my ubuntu host and use VSCode to edit, then copy the entire text back to the .inc file.
I suppose that should not be the problem but I'm putting it here just in case.
Anyways I can edit this now
Thanks!Also if I can ask this here. I'm unable to install vim or neovim on the pfsense server. Is there a reason for it? How would you set up an editor for this type of customization?
-
Normally you would not edit files in that way on the firewall directly.
Many of us work in one of the following ways:
- Edit remotely by loading and saving over ssh or scp which is supported by many popular editors
- Edit a file in a local copy of the Git repository and then copy the edited file to the firewall by scp
- Edit a file in a local copy of the Git repository and then load the file in Diagnostics > Edit File and paste the new content
- Making minor/simple on the firewall directly changes using
vi
,ee
, or Diagnostics > Edit File without extra steps