Skip to content
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

Adding support for ROUTE/FWD actions #9

Open
SimTechLP opened this issue Jan 8, 2025 · 1 comment
Open

Adding support for ROUTE/FWD actions #9

SimTechLP opened this issue Jan 8, 2025 · 1 comment

Comments

@SimTechLP
Copy link

- Feature request -

Hey there!

First of all, thanks for the amazing GUI editor! :)

For special Docker rules I mostly use "ALLOW FWD" and "DENY FWD" rules at the moment.
These rules are currently getting read and handled as "ALLOW IN" and so on. Is it possible to implement ufw route allow/deny handling as well?

I thought of something like this:

   func (t *Tui) CreateForm() {
   [...]
---        AddDropDown("Action *", []string{"ALLOW IN", "DENY IN", "REJECT IN", "LIMIT IN", "ALLOW OUT", "DENY OUT", "REJECT OUT", "LIMIT OUT"}, 0, nil).
+++        AddDropDown("Action *", []string{"ALLOW IN", "DENY IN", "REJECT IN", "LIMIT IN", "ALLOW OUT", "DENY OUT", "REJECT OUT", "LIMIT OUT", "ALLOW FWD", "DENY FWD"}, 0, nil).
   [...]
           case "LIMIT-OUT":
               actionOptionIndex = 7
+++        case "ALLOW-FWD":
+++            actionOptionIndex = 8
+++        case "DENY-FWD":
+++            actionOptionIndex = 9
           }
   t.form.AddInputField("To", toValue, 20, nil, nil).SetFieldTextColor(tcell.ColorWhite).
   [...]
---            AddDropDown("Action *", []string{"ALLOW IN", "DENY IN", "REJECT IN", "LIMIT IN", "ALLOW OUT", "DENY OUT", "REJECT OUT", "LIMIT OUT"}, actionOptionIndex, nil).
+++            AddDropDown("Action *", []string{"ALLOW IN", "DENY IN", "REJECT IN", "LIMIT IN", "ALLOW OUT", "DENY OUT", "REJECT OUT", "LIMIT OUT", "ALLOW FWD", "DENY FWD"}, actionOptionIndex, nil).

...with according changes in func (t *Tui) CreateRule(position ...int), as rule inserts and edits require route as the first parameter.

Let me know about your thoughts! ;)

BR,
Andy

@peltho
Copy link
Owner

peltho commented Jan 8, 2025

Hi Andy,
Thanks for using it!

I'm gonna have a look during my spare time 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants