collection_opnsense icon indicating copy to clipboard operation
collection_opnsense copied to clipboard

Feature: Add support for Nginx plugin

Open atammy-narmi opened this issue 11 months ago • 3 comments

Link to API

https://docs.opnsense.org/development/api/plugins/nginx.html

Description

Only squid proxy seems to have a plugin, I'd like to have nginx support as well. I'm happy to help with the development as well, will start by making some PRs 😸

Modules

  • [ ] nginx_http_server
  • [ ] nginx_http_rewrite
  • [ ] nginx_upstream
  • [x] nginx_upstream_server
  • [ ] nginx_location
  • [ ] nginx_security_header
  • [ ] nginx_logs
  • [ ] nginx_bans
  • [ ] nginx_limit_zone
  • [ ] nginx_limit_request_connection
  • [ ] nginx_credential
  • [ ] nginx_cache_path
  • [ ] nginx_naxsi_rule
  • [ ] nginx_ipacl
  • [ ] nginx_sni_fwd
  • [ ] nginx_stream_server
  • [ ] nginx_syslog_target
  • [ ] nginx_tls_finterprint
  • [ ] nginx_user_list
  • [ ] nginx_error_page
  • [ ] nginx_custom_policy

atammy-narmi avatar Mar 18 '24 18:03 atammy-narmi

Greetings!

I have planned to prioritize other APIs - so I don't think I'll find time in the next few months/this year..

But I am open to helping you implement it yourself! The developer docs should give you a basic overview of how to do that. But these infos are far from perfect/complete. Feel free to contact me if you have troubles understanding any relations.

We'll need to create multiple modules - one for each functionality the service/API provides. Of course - you can stick to the ones you practically need.. (I haven't used it yet as I keep my services strictly separated from the firewall itself)

So these may be the modules:

  • nginx_http_server
  • nginx_http_rewrite
  • nginx_upstream
  • nginx_upstream_server
  • nginx_location
  • nginx_security_header
  • nginx_logs
  • nginx_bans
  • nginx_limit_zone
  • nginx_limit_request or nginx_limit_request_connection (?)
  • nginx_credential
  • nginx_cache_path
  • nginx_naxsi_rule
  • nginx_ipacl
  • nginx_sni_fwd
  • nginx_stream_server
  • nginx_syslog_target
  • nginx_tls_finterprint
  • nginx_user_list
  • nginx_error_page
  • nginx_custom_policy

ansibleguy avatar Mar 18 '24 20:03 ansibleguy

Thanks, I was able to get the upstream_server working, I've also added some tests FWIW. Will also start working on other modules.

What is the documentation procedure?

atammy-narmi avatar Mar 20 '24 16:03 atammy-narmi

What is the documentation procedure?

Greetings!

I've pushed the basic docs template. Please (at least) add the existing module arguments with a little description.

ansibleguy avatar Apr 24 '24 18:04 ansibleguy