New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FRR Copy Running to Saved option for the raw config page. Issue #9003 #777
Conversation
} else { | ||
$config['installedpackages']['frrglobalraw']['config'][0][$module . "running"] = base64_encode("!!!!! {$module}.conf does not exist or is empty."); | ||
} | ||
write_config( $desc = gettext("FRR: Wrote {$module}.conf startup-config to pfSense config file."), $backup = false, $write_config_only = true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this setting variables by name here in the function call? Seems like it could be problematic. If this was copied directly over from quagga I suspect this may also be why on quagga I see lots of config writes which update the running config with a broken description of (system): 1
.
This will need tested and maybe fixed both here and in quagga.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I wrote that function for Quagga, the idea of the variable being part of the function call was to reduce/simplify the code, allowing the function to be used to write the config for any module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed & rebased
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more I think about it, this should be optional and off by default. This is going to cause as many as five extra config writes any time the package resyncs.
The function should not do a write config itself, it should do a single write at the end, and it should only be done if the user enabled the function to do so. For example if you're using the GUI to manage settings, this is completely unnecessary. It only makes sense if someone is using a manually added config and maybe making changes in vtysh occasionally.
And the same logic should also be added to quagga so it doesn't make these excessive writes (and has the save description fixed)
Now it uses 'Update RUNNING' button on the frr_global_raw.xml page to put base64-encoded configs to config.xml |
Redmine Issue: https://redmine.pfsense.org/issues/9003
Ready for review
I do not understand why quagga-way (saving configuration in base64 format in config.xml) may be error prone. Both *.conf and config.xml contains same data.
This is the port from Quagga with a 'copy all' button.