====== Nextcloud ======
===== Links =====
* [[https://nextcloud.com/changelog/|Changelog]]
* [[https://docs.nextcloud.com/server/17/admin_manual/installation/server_tuning.html|Server tuning]]
* [[https://docs.nextcloud.com/server/28/admin_manual/configuration_server/config_sample_php_parameters.html#remember-login-cookie-lifetime|Cookie lifetime]]
===== Commands =====
==== Update apps ====
* sudo -u www-data php /var/www/nextcloud/occ update:check
* sudo -u www-data php /var/www/nextcloud/occ app:update --all
==== Update Nextcloud ====
* sudo -u www-data php /var/www/nextcloud/updater/updater.phar
===== Customization =====
==== Default page ====
* occ config:app:set core defaultpage --value "/apps/files/files?dir=/Hamster"
===== Nextcloud Worries =====
==== Incomplete downloads from SMB shares ====
**Problem:** Nextcloud 20.0.9 introduced a bug causing incomplete downloads from external storages using SMB. The issue lies in the Icewind component.
**Solution:** Download an older version of Nextcloud (20.0.8) and replace the Icewind directory (''nextcloud/apps/files_external/3rdparty/icewind'')
==== Desktop client refuses to sync due to earlier errors ====
**Problem:** Nextcloud Desktop (temporarily) blacklists files that failed earlier. It's located in a hidden sqlite database within each synced folder, e.g. ''._sync_abcde1234ef56.db''
**Solution:** Remove the blacklist:
- Quit the desktop client
- ''sqlite3 SyncedFolder/._sync_f84e9c996af0.db''
- ''delete from 'blacklist';''
- [Ctrl+D] to exit
==== Downloads from SMB external storage larger than 512 MB fails ====
**Problem:** While Nextcloud can work with the smbclient package, it seems to need ''php-smbclient'' for larger transfers. This package is currently not available as a Debian package in bookworm.
**Solution**
- ''apt install libsmbclient-dev php-dev''
- ''pecl install smbclient''
- ''%%echo "extension=smbclient.so" >> /etc/php/8.2/fpm/php.ini%%''
- ''systemctl reload php8.2-fpm''
[[https://www.server-world.info/en/note?os=Debian_12&p=nextcloud&f=11|NextCloud : Use External Storage]]
==== Set longer cookie lifetime ====
- ''vim nextcloud/config/config.php''
- 'remember_login_cookie_lifetime' => 60*60*24*180, \\ //(for 180 days)//