Skip to content

Conversation

@vfreex
Copy link
Contributor

@vfreex vfreex commented Jun 29, 2017

PR #115 breaks the logic that config/apps.config.php get copied
after custom_apps: #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.
@vfreex vfreex changed the title Ensure config/apps.config.php is get copied Ensure config/apps.config.php get copied Jun 29, 2017
@SnowMB
Copy link
Contributor

SnowMB commented Jun 29, 2017

Thanks for the quick fix!

@SnowMB SnowMB merged commit 0061b63 into nextcloud:master Jun 29, 2017
@tilosp
Copy link
Member

tilosp commented Jun 29, 2017

@vfreex @SnowMB this cp is there to upgrade existing setups which were created before #65.
I thought it would be safe to remove it because most of the setups are upgraded by now.
But maybe i am wrong.
If we want to keep it we should use the old check. Because right now the file will be recreated in case the user decides to remove it.

@vfreex vfreex deleted the fix-115 branch June 29, 2017 09:59
@vfreex
Copy link
Contributor Author

vfreex commented Jun 29, 2017

@tilosp
By default custom_apps is empty if the user haven't installed any apps. In that case, the script don't know if the config file has been deleted by the user or it hasn't been copied. So the old check doesn't work.
I would suggest creating an empty file to prevent from copying, but the user should learn about that.

@tilosp
Copy link
Member

tilosp commented Jun 29, 2017

@vfreex
I do not want to check if the custom_apps folder is empty. In old setups there simply is no custom_apps folder.

for dir in config data themes; do
    if [ ! -d /var/www/html/"$dir" ] || directory_empty /var/www/html/"$dir"; then
        cp -arT /usr/src/nextcloud/"$dir" /var/www/html/"$dir"
    fi
done
if [ ! -d /var/www/html/custom_apps ]; then
    cp -a /usr/src/nextcloud/config/apps.config.php /var/www/html/config/apps.config.php
fi
if [ ! -d /var/www/html/custom_apps ] || directory_empty /var/www/html/custom_apps; then
    cp -arT /usr/src/nextcloud/custom_apps /var/www/html/custom_apps
fi

@vfreex
Copy link
Contributor Author

vfreex commented Jun 29, 2017

@tilosp
But if I mount custom_apps from a volume, it will not copy apps.config.php, resulting in a permission error because apps is not writable by default in this image.

@vfreex
Copy link
Contributor Author

vfreex commented Jun 29, 2017

Sorry, my mistake. This situation only happens when upgrading from an old version because in newer version the whole config will be copied.
Your solution looks better than mine.

@tilosp
Copy link
Member

tilosp commented Jun 29, 2017

I implemented this in #119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants