-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Copy config, data, custom_apps, and themes to volume when empty #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
tilosp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks a lot for your work! |
|
|
||
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. I'll fix that.
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.
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.
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.
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.