Skip to content

net/frr: add manual config#5521

Open
Monviech wants to merge 11 commits into
masterfrom
frr-manual-config
Open

net/frr: add manual config#5521
Monviech wants to merge 11 commits into
masterfrom
frr-manual-config

Conversation

@Monviech

Copy link
Copy Markdown
Member

Important notices

Before you submit a pull request, we ask you kindly to acknowledge the following:

If AI was used, please disclose:

  • Model used:
  • Extent of AI involvement:

Describe the problem

Fixes: #5519

We only show a banner here since it's separate models and it's a global general option, and we probably don't want more complex javascript in each individual volt template to hide stuff just for the manual option.

Only difference is the general page in which we hide all options that do not influence the rc.conf.d file anymore.

@Monviech Monviech requested a review from fichtner June 23, 2026 15:06
@Monviech Monviech self-assigned this Jun 23, 2026
@Monviech Monviech added the feature Adding new functionality label Jun 23, 2026
@Monviech Monviech changed the title Frr manual config net/frr: add manual config Jun 23, 2026
if (!(new General())->manual_config->isEmpty()) {
$this->internalMessage = gettext(
'Manual FRR configuration is enabled. Configuration file generation is disabled. Settings configured here may no longer affect the active FRR configuration.'
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to hide configuration entries in the menu when manual mode is selected, we have options for that now and it avoids throwing messages on each page one can't use anyway.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same but the issue is each daemon has its on model with its own "enabled" key. So we either have to reflect these or do lots of javascript magic to hide everything except enabled on every page.

This here definitely needs some more thought.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't planning in hiding options in the forms, I was thinking of hiding these options in the menu when their not used. We just need to move some glue to the menu system in order to support that, but I think we have all we need already.

When I have a bit of time, I can give it a shot.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont we have to reflect all enabled keys inside the frr general model as volatile fields? If the whole daemon specific menu items hide completely there is no way for the user to change these anymore as they are still owned by the rc.d script which is still regenerated by the template system here:

if helpers.exists('OPNsense.quagga.ospf.enabled') and OPNsense.quagga.ospf.enabled == '1' %} ospfd{% endif %}{%

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably have to think this through before committing anything, I assume the intention of the general "use manual config" option is to not write any configurations at all anymore, which the template system isn't very helpful in achieving due to some different spots flushing them out (e.g. boot).

For KEA this was rather easy as it's not bound to the template system, but our current template generation language doesn't really offer the flexibility yet which we would need in this particular case.

Logically, we would like to have some "break" on the template generation to skip it when not specifically requested and have the menu system cope with the options that are not relevant when in manual mode (effectively making the service boilerplate only responsible for the usual rc stuff).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think that's what the PR mostly offers by splitting the rc.conf template into a subdirectory. It's pretty effective although we have more boilerplate in the plugin backend to pull this off, but it's also not different from Kea or other legacy services.

A more unified template approach would be nice to have as an additional stage in the reconfigureAction() but it requires a bit of preparation and unification between services that should to use it. There are already a few.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, a bootup will still regenerate the frr.conf and vtysh.conf files, which is likely unintended when the user manages its own set of settings.

We could smarten the +TARGETS construction a bit to bail-out of the "generate all unconditional" option to solve that part of the puzzle, using the subdirectory for the rc part is indeed a practical boundary to use for splitting the functions.

Just need to think about this for a bit, as a general pattern, I think it makes sense to have some easy glue to support this scenario.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, thank you. No rush here at all. I'll leave this open until there is a good way forward.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, a bootup will still regenerate the frr.conf and vtysh.conf files, which is likely unintended when the user manages its own set of settings.

Fair point. There are a number of ways to deal with this :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "make upgrade" of a plugin also regenerates all templates unconditionally. I don't know if that's the same path as boot.

@Monviech

Copy link
Copy Markdown
Member Author

@AdSchellevis I added a commit here that tries the issue with the individual enabled keys in each model:

c1ca8d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adding new functionality

Development

Successfully merging this pull request may close these issues.

os-frr: Add GUI options for conditional advertisement

3 participants