Skip to content
  • Yuxiang Zhu's avatar
    8e8f33ef
    Copy config, data, custom_apps, and themes to volume when empty · 8e8f33ef
    Yuxiang Zhu authored
    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.
    8e8f33ef
    Copy config, data, custom_apps, and themes to volume when empty
    Yuxiang Zhu authored
    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.
Loading