diff --git a/README.md b/README.md index 0126340..8d7fccd 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ The OPNsense page **Services -> RustProxy** exposes the runtime listeners used b - HTTP listen: `0.0.0.0:8080` - HTTPS/TLS listen: `0.0.0.0:8181` (toggleable) -- Admin listen: `127.0.0.1:9090` -- Allow remote admin: off by default; enable it when binding admin to a non-loopback address such as `0.0.0.0:9090` +- Admin listen: `0.0.0.0:9090` +- Allow remote admin: on by default so the RustProxy panel can be reached from other hosts; OPNsense firewall rules still decide which networks can connect The service runs as the unprivileged `rustproxy` user and keeps `/var/db/rustproxy` mode `0700`, as required by RustProxy. Package installation restarts `configd` so `configctl rustproxy ...` actions are immediately available even after direct `pkg add`. diff --git a/docs/FIRST_RUN.md b/docs/FIRST_RUN.md index 33226e3..dead62e 100644 --- a/docs/FIRST_RUN.md +++ b/docs/FIRST_RUN.md @@ -146,10 +146,10 @@ After installation open **Services -> RustProxy**. Defaults are: - HTTP listen: `0.0.0.0:8080` - HTTPS/TLS enabled: yes - HTTPS/TLS listen: `0.0.0.0:8181` -- Admin listen: `127.0.0.1:9090` -- Allow remote admin: no +- Admin listen: `0.0.0.0:9090` +- Allow remote admin: yes -If you want the RustProxy administration UI reachable from another host, set the admin listener to an address such as `0.0.0.0:9090` and enable **Allow remote admin**. Apply restarts/reloads the service with the corresponding RustProxy CLI flags. +The RustProxy administration UI is reachable from other hosts by default on port `9090`, subject to OPNsense firewall rules. Use **Open RustProxy Admin** after Apply to open the panel in a new browser tab. If `Admin listen` is `0.0.0.0:9090`, the button uses the hostname or IP address through which you opened OPNsense. Direct `pkg add` is supported: the package post-install script restarts OPNsense `configd`, flushes the plugin cache and renders `/usr/local/etc/rustproxy/opnsense.conf` so `configctl rustproxy status/start/stop` is available immediately. diff --git a/opnsense-plugin/www/rustproxy/src/etc/rc.d/rustproxy b/opnsense-plugin/www/rustproxy/src/etc/rc.d/rustproxy index 048581f..3ea5613 100755 --- a/opnsense-plugin/www/rustproxy/src/etc/rc.d/rustproxy +++ b/opnsense-plugin/www/rustproxy/src/etc/rc.d/rustproxy @@ -22,8 +22,8 @@ load_rc_config "$name" : ${rustproxy_proxy_listen:="0.0.0.0:8080"} : ${rustproxy_tls_enabled:="1"} : ${rustproxy_tls_listen:="0.0.0.0:8181"} -: ${rustproxy_admin_listen:="127.0.0.1:9090"} -: ${rustproxy_allow_remote_admin:="0"} +: ${rustproxy_admin_listen:="0.0.0.0:9090"} +: ${rustproxy_allow_remote_admin:="1"} enabled="0" config_file="/usr/local/etc/rustproxy/opnsense.conf" diff --git a/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/controllers/OPNsense/RustProxy/forms/general.xml b/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/controllers/OPNsense/RustProxy/forms/general.xml index 8feb8ad..291db73 100644 --- a/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/controllers/OPNsense/RustProxy/forms/general.xml +++ b/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/controllers/OPNsense/RustProxy/forms/general.xml @@ -42,12 +42,12 @@ rustproxy.general.adminListen text - RustProxy administration listener passed as --admin-listen. Default: 127.0.0.1:9090. + RustProxy administration listener passed as --admin-listen. Default: 0.0.0.0:9090 so the panel can be reached from other hosts. OPNsense firewall rules still control who can connect. rustproxy.general.allowRemoteAdmin checkbox - Required when Admin listen is not a loopback address, for example 0.0.0.0:9090. This passes --allow-remote-admin. + Pass --allow-remote-admin so the RustProxy panel accepts non-loopback clients. Keep firewall access restricted to trusted networks; do not expose the admin port to WAN unless this is intentional. diff --git a/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/models/OPNsense/RustProxy/RustProxy.xml b/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/models/OPNsense/RustProxy/RustProxy.xml index 5435f2d..bf3053d 100644 --- a/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/models/OPNsense/RustProxy/RustProxy.xml +++ b/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/models/OPNsense/RustProxy/RustProxy.xml @@ -1,6 +1,6 @@ //OPNsense/rustproxy - 1.1.0 + 1.2.0 RustProxy service settings @@ -23,12 +23,12 @@ Enter a valid HTTPS/TLS listen address and port, for example 0.0.0.0:8181. - 127.0.0.1:9090 + 0.0.0.0:9090 Y - Enter a valid administration listen address and port, for example 127.0.0.1:9090. + Enter a valid administration listen address and port, for example 0.0.0.0:9090. - 0 + 1 Y diff --git a/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/views/OPNsense/RustProxy/index.volt b/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/views/OPNsense/RustProxy/index.volt index 844a7d3..2f4b957 100644 --- a/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/views/OPNsense/RustProxy/index.volt +++ b/opnsense-plugin/www/rustproxy/src/opnsense/mvc/app/views/OPNsense/RustProxy/index.volt @@ -1,5 +1,79 @@ @@ -37,7 +115,16 @@ $(document).ready(function() { data-label="{{ lang._('Apply') }}" data-error-title="{{ lang._('Error reconfiguring RustProxy') }}" type="button"> +

+

+ {{ lang._('Remote administration is controlled by the RustProxy listener and OPNsense firewall rules. The plugin does not automatically create a WAN firewall rule for the admin port.') }} +

diff --git a/opnsense-plugin/www/rustproxy/src/opnsense/service/templates/OPNsense/RustProxy/rustproxy.conf b/opnsense-plugin/www/rustproxy/src/opnsense/service/templates/OPNsense/RustProxy/rustproxy.conf index faedc11..893a477 100644 --- a/opnsense-plugin/www/rustproxy/src/opnsense/service/templates/OPNsense/RustProxy/rustproxy.conf +++ b/opnsense-plugin/www/rustproxy/src/opnsense/service/templates/OPNsense/RustProxy/rustproxy.conf @@ -2,5 +2,5 @@ enabled="{% if not helpers.empty('OPNsense.rustproxy.general.enabled') %}1{% els rustproxy_proxy_listen="{% if not helpers.empty('OPNsense.rustproxy.general.proxyListen') %}{{ OPNsense.rustproxy.general.proxyListen }}{% else %}0.0.0.0:8080{% endif %}" rustproxy_tls_enabled="{% if not helpers.empty('OPNsense.rustproxy.general.tlsEnabled') %}1{% else %}0{% endif %}" rustproxy_tls_listen="{% if not helpers.empty('OPNsense.rustproxy.general.tlsListen') %}{{ OPNsense.rustproxy.general.tlsListen }}{% else %}0.0.0.0:8181{% endif %}" -rustproxy_admin_listen="{% if not helpers.empty('OPNsense.rustproxy.general.adminListen') %}{{ OPNsense.rustproxy.general.adminListen }}{% else %}127.0.0.1:9090{% endif %}" +rustproxy_admin_listen="{% if not helpers.empty('OPNsense.rustproxy.general.adminListen') %}{{ OPNsense.rustproxy.general.adminListen }}{% else %}0.0.0.0:9090{% endif %}" rustproxy_allow_remote_admin="{% if not helpers.empty('OPNsense.rustproxy.general.allowRemoteAdmin') %}1{% else %}0{% endif %}" diff --git a/pkg/os-rustproxy-latest.pkg b/pkg/os-rustproxy-latest.pkg new file mode 100644 index 0000000..b37553c Binary files /dev/null and b/pkg/os-rustproxy-latest.pkg differ