openwrt / telephony

The telephony packages feed
104 stars 240 forks source link

asterisk: Need simpler conffiles definitions #808

Open pprindeville opened 1 year ago

pprindeville commented 1 year ago

Maintainer: @jslachta Environment: x86_64, generic, HEAD Description:

Looking at the conffiles definition in the Makefile, it's not clear it's correct.

Instead of enumerating the files in /etc/asterisk/ it would make more sense to just name that directory. For instance, if you make a copy of a config file as:

% cp -a extensions.conf extensions.conf.orig

before editing the file, or perhaps (periodically) a timestamped version of it like:

% cp -a extensions.conf extensions.conf.$(date +%Y%m%d)

then you'd want those files preserved across sysupgrades. I also note the lack of .ael files as being backed up.

The file /etc/init.d/asterisk isn't really modifiable and probably should be updated via sysupgrade (as options are expressed in /etc/config/asterisk instead).

Lastly, cryptographic keys (used by res_crypto) are stored in /var/lib/asterisk/keys/ and definitely should be backed up, along with /var/lib/asterisk/astdb/.

pprindeville commented 1 year ago

Almost forgot, various files like extensions.conf allow for file inclusion, and the names of those additional files can't be known in advance, so another reason to just preserve /etc/asterisk/.

micmac1 commented 1 year ago

Hi Phillip!

Just my two cents. Regarding /etc/asterisk I agree with you, makes sense to me. Regarding init script I think it doesn't hurt to add that to conffiles. It'll only be copied over during sysupgrade if the user did actually make changes to it. My expectation is that users don't rewrite the initi script. But if for whatever reason they do end up changing it I think it's still nice to save the changes during sysupgrade.

Regarding the keys in /var I don't think I'd want that in conffiles because on OWRT /var is volatile by default. So that's not where I'd save any keys. I'd try to change the configuration and set them up in /etc. I think nowadays there's a config switch in OWRT these days to switch /var to be non-volatile, but that's not default. Not really sure about this one.

pprindeville commented 1 year ago

There are two choices. Support persistent /var (which on any box that you want to run Asterisk, will probably be a thing) or else modify the path of astkeydir in /etc/asterisk/asterisk.conf to point to /etc/asterisk/keys/ or some such.

Most initd scripts aren't listed in conffiles, so this would be bending/breaking the paradigm.

But I don't feel that strongly about it.

pprindeville commented 4 months ago

Well, this issue hasn't advanced much in the last year. Should we close it?