Skip to content

Instantly share code, notes, and snippets.

@hgl
Last active May 20, 2020 18:25
Show Gist options
  • Select an option

  • Save hgl/abbaf35f96b70e276725 to your computer and use it in GitHub Desktop.

Select an option

Save hgl/abbaf35f96b70e276725 to your computer and use it in GitHub Desktop.
Suggestions to OpenWrt's znc package

After spending much time configurating znc on OpenWrt with the helps from people on znc channel, I believe I have a pretty decent configration, and would like to suggest the following modifications to the znc package so other people can benefit from it.

  • Drop UCI config, and use znc's config directly.

    • With UCI config, it means the used config dir is temporary, and it makes modules like webadmin less useful. Also it makes remembering password for the sasl module very hard, which doesn't support specifying the password when loading the module. The same goes for using a pem file for the cert module and making it stick.

      I know the znc package currently supports external config. But the problem is that the pid file is specified to live in /tmp/etc/znc/znc.pid. I'm not sure if this directory will be created when the external config is used. Ideally, it should live in /var/run/znc/znc.pid with /var/run/znc be owned by a limited user znc (more on this later).

  • Use sudo instead of su

    • Using su to switch user seems to be broken on CC r2. I constantly get error like "can not drop controlling terminal".
  • Drop the droproot module

    • People on the znc channel urge me not to use the droproot module. It's removed since znc v1.0. It's best to create a limited znc user and run znc with that user. The whole config dir should be owned by that user and the pid dir should be owned by that user too. Although I'm not sure if it's ok to make the znc package depend on shadow-useradd and sudo.
  • Other issues

    • The cert package should depend on ca-certificates otherwise it will fail to auth.
    • If you decide to keep UCI config. The add_network function in the init script is broken. It doesn't close the Network tag, I can submit a PR if you want.
@Be-ing
Copy link

Be-ing commented Mar 10, 2016

I would be grateful if you fixed these issues. This package is really confusing for me, coming from having set up ZNC on Pidora (Raspberry Pi Fedora Spin) previously. I don't understand why a UCI config system was implemented without a LuCI frontend; it just makes setup overcomplicated. I don't think a LuCI frontend would be very helpful anyway considering how straightforward ZNC's configuration file is. The way the OpenWRT package is now, I don't understand how to use ZNC's own configuration generator (znc --makeconf), which is straightforward and suggested on ZNC's website, with the OpenWRT package.

@tojestzart
Copy link

tojestzart commented May 20, 2020

for me that script provided with openwrt doesnt work at all, enabling encryption + doesnt work , cant create network, settings dissapearing after service znc stop , no info whats happening behind, -useless

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