[Feature Request] auto searh for nzbget.conf at startup

Discuss newly added features or request new features.
Post Reply
MrVideo
Posts: 38
Joined: 20 Mar 2019, 05:44

[Feature Request] auto searh for nzbget.conf at startup

Post by MrVideo » 20 Mar 2019, 15:29

Various files mention ~/nzbget.conf, /etc/nzbget.conf and the default one in the installdir.

But, I discovered that when I copied the file from the installdir to my home and modified it, it was not opened when I started nzbget, it opened the installdir file.

It would be nice if nzbget searched for the config file in the following order (so that -c isn't needed):
~ ($HOME)
/etc
<install-dir>

Just an idea.

hugbug
Developer & Admin
Posts: 7418
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Feature Request] auto searh for nzbget.conf at startup

Post by hugbug » 20 Mar 2019, 15:37

It already searches in various places. InstallDir is the most important one and therefore is searched first.

MrVideo
Posts: 38
Joined: 20 Mar 2019, 05:44

Re: [Feature Request] auto searh for nzbget.conf at startup

Post by MrVideo » 20 Mar 2019, 15:42

That makes searching the home location impossible, as it will always find the installdir location, unless one deletes the installdir copy and that will only last until the next install.

So, how can it search various locations if it never gets past the installdir location?

hugbug
Developer & Admin
Posts: 7418
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Feature Request] auto searh for nzbget.conf at startup

Post by hugbug » 20 Mar 2019, 15:55

Searching in install dir first is very important. That makes a new installation with installer into a new directory a clean and always working installlation, an important thing for troubleshooting.

If you use installer I recommend to keep the config file in install dir. That however isn't the only possible way to install nzbget. If you like the Unix way of installing software (files spread all over the file system) then you can compile nzbget and install it with "make install". Then you wouldn't have config-file near binary file and the config file in home dir will be found first. That's where the search in various places is originated from.

MrVideo
Posts: 38
Joined: 20 Mar 2019, 05:44

Re: [Feature Request] auto searh for nzbget.conf at startup

Post by MrVideo » 20 Mar 2019, 19:40

hugbug wrote:
20 Mar 2019, 15:55
Searching in install dir first is very important. That makes a new installation with installer into a new directory a clean and always working installlation, an important thing for troubleshooting.
On a M$ system, I agree with using the config file in the installdir as the first choice. But, on a Linux/Unix system, the concept of searching the user's home first goes way back. For me, that is over 35 years. If the program is started by root, or at startup, then a home config file won't necessarily be found/created. Then a /etc location would be searched next. In this case usually a place like /etc/nzbget/nzbget.conf. Lastly the installdir location.

I really hate how M$ tends to do configurations, i.e., via the registry. Way back when, the .ini file was used (and still is in some cases) and that was always in the installdir. While the concept of a home kinda exists in the "Documents and Settings" folder, I've never liked it. Being Unix born and bred, I like having my home searched first for the config file for programs I run. If I set up a program that is started by the system, then I expect a config file in /etc. In this case, I start nzbget in a terminal.

Now I see why the backup and restore of the config file exists. When an update of the program is installed, the config file will get overwritten. If the user forgets to back up the config fille, all is lost. By having the config file in $HOME, or .etc, one doesn't have to worry about losing the conifguration.

Consider me an old-timer. Obviously you have no plans to add this feature request. So, I'll just have an alias that starts nzbget with the -c option.

I don't mean to be a pain. I really do like this program. Once I get extracting the nzb file from a rar file working, I'll be really happy as this program makes downloading usenet files a breeze. Thanks.

hugbug
Developer & Admin
Posts: 7418
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Feature Request] auto searh for nzbget.conf at startup

Post by hugbug » 20 Mar 2019, 20:28

Config isn't overwritten on update.

Search in install dir is to make installation via installer self-contained. Everything is installed into one directory and configured to save everything (config, state, downloaded files) into that directory. After installation the program works. Always, even if you had a corrupted older installation somewhere else or an old (and bad) config-file somewhere. The program works because all needed files are in installation directory. That's like a container. Easy installation (works 100%), super easy deinstallation (just delete the directory and no files remain anywhere).

If you don't like this concept you can install it Unix way (into multiple directories) either by compiling yourself and dong "make install" or by installing from system repository. Nzbget supports the spreaded installations too but if you use installer you'll have a containerized installation.

I can't change the search order because that would go against the concept of installer.

I think I have an (alternative) solution for you: instead of creating a launch script you can symlink the config-file from home dir into installation dir. That prevents creating of new config file on update.

MrVideo
Posts: 38
Joined: 20 Mar 2019, 05:44

Re: [Feature Request] auto searh for nzbget.conf at startup

Post by MrVideo » 21 Mar 2019, 00:27

hugbug wrote:
20 Mar 2019, 20:28
Config isn't overwritten on update.
So, what happens if something is changed in the config file?
I think I have an (alternative) solution for you: instead of creating a launch script you can symlink the config-file from home dir into installation dir. That prevents creating of new config file on update.
Well, it isn't a launch script specifically. It is an alias. The nzbget program isn't in my path, so I need a way to point to it anyway. Having an alias is a quick and dirty way to do it. But, I'll keep the symlink idea in mind.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest