AdaptiveScale / lxdui

LXDUI is a web UI for the native Linux container technology LXD/LXC
Apache License 2.0
719 stars 154 forks source link

LXDUI config gets blown away on upgrade due to being persisted next to the source code #347

Open strugee opened 3 years ago

strugee commented 3 years ago

If you opt to install LXDUI globally (i.e. python3 setup.py install without activating a virtualenv first), configuration files such as auth.conf will be stored in and read from /usr/local/lib/python3.7/dist-packages/LXDUI-<version>-py3.7.egg/conf. This location is not the correct place to store configuration, but even worse, if the administrator runs python3 setup.py install again (e.g. to upgrade LXDUI to a new release), this configuration directory will be silently overwritten with the defaults from upstream.

LXDUI should instead read configuration from /etc - e.g. /etc/lxdui or something like that. auth.conf arguably is state instead of configuration, so maybe it should go in /var/lib (or someplace defined in lxdui.conf) but really almost anywhere is better than where it is now in /usr.

See also the hier(7) and file-hierarchy(7) manpages.

strugee commented 2 years ago

@jetroni closed by accident?

jetroni commented 2 years ago

My bad, this issue was referenced to a PR that was merged and I thought that it was already introduced.