Support out-of-app config directory. #697
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As requested by @oparoz and @jospoortvliet:
The Nextcloud pi drive device is based upon snappy ubuntu core. Snaps are squashfs images which by definition are read-only. This makes the Nextcloud config read-only as well, which greatly limits its usefulness. This PR introduces support for hosting the config out of the main application (in the case of the snap, in a writable area so the rest of the application can remain read-only). It does this by using the environment variable
$NEXTCLOUD_CONFIG_DIR. If it's set, it is used as the config directory. If not set, it uses the default<root>/config/.Note that this is fairly well-tested, but I can't pretend to have hit every code path that uses the config. There may be a better place to put this code. If so, please let me know.