Follow Freedesktop's XDG base directory specification
On linux systems, using your application automatically results in the creation of ~/.stremio-server directory. This directory is placed directly into the user's $HOME, which is unnecessary and only results in cluttering this directory.
Freedesktop's XDG Base Directory spec has been there for a long time , and there is no reason to disregard this well-established and known standard. It is here precisely to avoid this clutter in the home directory and rather use a specifically defined path depending on the type of data that your application is storing.
The linked specification should explain everything pretty clearly, but this is a simple and quick listing of which environmental variables should be used for which type of content:
$XDG_DATA_HOME: Data that persists between application restarts and is needed for the app to work properly (things like databases)$XDG_CONFIG_HOME: Configuration data that remains mostly static and is usually only read by the application, writes should only occur when the user edits these files directly or if something is changed by the user within the application.$XDG_CACHE_HOME: Non-essential data that is expected to be removed by the user regularly.$XDG_RUNTIME_DIR: Runtime file objects, such as sockets or named pipes. This directory will be removed once the user logs off.$XDG_STATE_HOME: Data that should persist between application restarts, but it wouldn't be a huge issue if it got removed.
Suggested locations for your application
In your case, from my quick observations, I've only seen server-settings.json and stremio-cache present in that directory.
- For the
server-settings.json, you should use the$XDG_CONFIG_HOME/stremio/server-settings.jsonor simply as$XDG_CONFIG_HOME/stremio.json. If this environmental variable isn't defined by the user, fall back to~/.config. - For the
stremio-cachedirectory, it should use$XDG_CACHE_HOME/stremio. If it isn't define, fall back to~/.cache.
Note that you may want to keep ~/.stremio-server as the first directory in a lookup order, and only use the XDG paths if it isn't present. This should be done purely as a way to respect the old configurations already present in there after the update is released.