Hello Tobias,
Matej Marusak [2021-02-04 17:59 +0100]:
I assume this "list of remote hosts" is not the same list
of hosts on which
you use cockpit. When you need to store some database on the server just
pick a well defined location and use that. (like
/usr/share/myapp/database.db)
Please don't use /usr for these -- this is read-only package manager territory.
For a system-wide database, use /var/lib/myapp, for a per-user database use
~/.config/myapp or ~/.local/share/myapp
> Has the cockpit API maybe an easy way to retrieve the directory
where an
> extension lives in?
>
I am not aware of it, but it would not be hard to write a simple function
to find from where the extension is being served. But I would argue for not
using that for storing any arbitrary data mainly as users may
remove/reinstall your extension and the data would go with it.
That not, but again, the installation directory of a cockpit page is a really
bad place for data.
Martin