Copy config, data, custom_apps, and themes to volume when empty#115
Merged
tilosp merged 1 commit intonextcloud:masterfrom Jun 28, 2017
Merged
Copy config, data, custom_apps, and themes to volume when empty#115tilosp merged 1 commit intonextcloud:masterfrom
tilosp merged 1 commit intonextcloud:masterfrom
Conversation
When Nextcloud performs an upgrade or clean installation,
it will check whether /var/www/html/{config,data,custom_apps,themes} exist.
If not, it will copy
/usr/src/nextcloud/{config,data,custom_apps,themes} to /var/www/html.
This leads to a problem: If those subdirectories are existent but
empty, it will not do the copy. This situation is common when you mount
volumes to those subdirectories, like:
```
version: "2.1"
services:
app:
image: nextcloud:12-apache
volumes:
- nextcloud:/var/www/html:Z
- nextcloud-custom_apps:/var/www/html/custom_apps:Z
- nextcloud-config:/var/www/html/config:Z
- nextcloud-data:/var/www/html/data:Z
- nextcloud-themes:/var/www/html/themes:Z
ports:
- 8080:80/tcp
db:
image: mariadb
volumes:
- db:/var/lib/mysql:Z
environment:
MYSQL_USER: nextcloud
MYSQL_DATABASE: nextcloud
MYSQL_PASSWORD: nextcloud
MYSQL_ROOT_PASSWORD: nextcloud
volumes:
nextcloud:
nextcloud-custom_apps:
nextcloud-config:
nextcloud-data:
nextcloud-themes:
db:
```
This patch will fix this issue by copying to those subdirectories when they
are empty.
Member
|
Thanks a lot for your work! |
menghan
reviewed
Jun 29, 2017
|
|
||
| if [ ! -d /var/www/html/custom_apps ]; then | ||
| cp -arT /usr/src/nextcloud/custom_apps /var/www/html/custom_apps | ||
| cp -a /usr/src/nextcloud/config/apps.config.php /var/www/html/config/apps.config.php |
There was a problem hiding this comment.
This pull request breaks this line: if /var/www/html/config exists but /var/www/html/custom_apps doesn't, config/apps.config.php don't get copied
Contributor
Author
There was a problem hiding this comment.
Thanks for the review. I'll fix that.
vfreex
added a commit
to vfreex/nextcloud-docker
that referenced
this pull request
Jun 29, 2017
PR nextcloud#115 breaks the logic that config/apps.config.php is get copied after custom_apps: nextcloud#115 (comment). This patch is going to copy that file if it doesn't exist.
vfreex
added a commit
to vfreex/nextcloud-docker
that referenced
this pull request
Jun 29, 2017
PR nextcloud#115 breaks the logic that config/apps.config.php get copied after custom_apps: nextcloud#115 (comment). This patch is going to copy that file if it doesn't exist.
Craeckie
pushed a commit
to Craeckie/nextcloud-docker-full
that referenced
this pull request
Mar 30, 2022
PR #115 breaks the logic that config/apps.config.php get copied after custom_apps: nextcloud/docker#115 (comment). This patch is going to copy that file if it doesn't exist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When Nextcloud performs an upgrade or clean installation,
it will check whether /var/www/html/{config,data,custom_apps,themes} exist.
If not, it will copy
/usr/src/nextcloud/{config,data,custom_apps,themes} to /var/www/html.
This leads to a problem: If those subdirectories are existent but
empty, it will not do the copy. This situation is common when you mount
volumes to those subdirectories, like:
This patch will fix this issue by checking whether those subdirectories
are empty.