I generated a certificate, then added it to luci and then to the browser. Now there is a green icon in the address bar, and browsers no longer swear with an insecure connection.
The disadvantage of this method is that I need to manually add a certificate to each browser. Can I skip the step of adding a certificate to browsers? If so, how to do it?
Opening LuCI to the Internet is not recommended. Realize that https even with a certificate will only protect the user (from eavesdropping, fake sites, or man in the middle attacks)-- it does nothing to prevent the server from being hacked.
Another way is to use something like XCA to create your own CA, then add the CA certificate to the system trusted and build a custom preconfigured OpenWrt image.
You can also deploy the required configuration via SSH if you set up it properly beforehand.
And if you need remote access, VPN should be your preferred option.