Owncloud
Our owncloud installation is running on lucius, which is currently running Debian jessie. The owncloud package, however, comes from the ownCloud repo (see #11039).
Important details
- As per the Debian packaging, it is run as the www-data user
- Directories:
- The code is in /var/www/owncloud.
- The data (files) are in /var/lib/owncloud/data.
- Our theme is in /var/lib/owncloud/themes (symlinked from /var/www/owncloud/themes)
- Our configuratio is in /etc/owncloud (symlinked from /var/www/owncloud/config)
- We're using the postgres package not the mysql package. If you want to muck around in the database:
su - www-data
and thenpsql owncloud
- We're authenticating using the login-service (web api).
- User accounts are created on the fly.
- This code is in the /etc/owncloud/config.php file (and must be re-copied when admin config changes are applied).
- The code has to stay in config.php or it won't work in all cases (I tried to make a third party app with this code - but the third party app is not invoked withn you download the ics version of the calendar).
- This is a real pain.
- The admin username and password are in keyringer. However, try to avoid logging in as the admin, and if you change any configuration options, /etc/owncloud/config.php may get overwritten (which contains our custom user backend). A copy should be available at /etc/owncloud/config.php.bak
- A 5GB per user quota is set. This is configured by logging in as admin and then clicking to administer users. Quotas can be changed on a per user basis.
- To fix #8125, we've added our own custom theme called "mayfirst", which is in lucius.mayfirst.org:/var/lib/owncloud/themes and it is activated via the theme => "mayfirst" line in lucius.mayfirst.org:/etc/owncloud/config.php. Currently, it only adds a style sheet that simply hides the password change form.
- We have committed to maintaining four extra apps, which are installed in /var/lib/owncloud/apps-local:
- Documents
- Calendar
- Contacts
- Grauphel (see #10305)
- Bookmarks (see #10696)
Upgrading
The current version is from the owncloud Debian repositories (see /etc/apt/sources.list.d/owncloud.list, which points to http://download.owncloud.org/download/repositories/stable/Debian_8.0/). The server is pined to ownCloud 8 to prevent an upgrade to 9 (see /etc/apt/preferences.d/owncloud.pref).
However, version 8, while still supported by ownCloud, is no longer in the Debian repository. So, to do a minor upgrade, we will have to switch from the debian ownCloud package to ownCloud source package.
Steps to upgrade from source:
- Visit https://owncloud.org/changelog/ and download the appropriate version to /root using wget and unpack
- Create symlinks that mirror the symlinks in /var/www/owncloud
- If upgrading a major version, backup /var/lib/owncloud/apps-local and download new versions of all apps in /var/lib/owncloud/apps-local, replacing the existing apps with the new ones.
- Copy /etc/owncloud/config.php to /etc/owncloud/config.php.bak
- Enter maintenance mode (edit to /etc/owncloud/config.php)
- Backup the database with:
su -c "pg_dump owncloud" www-data | gzip - > owncloud.pre.$(date +%Y.%m.%d).backup.sql.gz
- Ensure the dump completed successfully:
tail owncloud.sql
- Make a backup of the current owncloud installation:
mv /var/www/owncloud /var/www/owncloud.version.n.n.n
- Move the new copy in:
mv /root/owncloud /var/www/
- Ensure all database udpates have been run, su to the www-data user and then:
su - www-data cd /var/www/owncloud php occ upgrade
- Fix /etc/owncloud/config.php to include our custom class (reference /etc/owncloud/config.php.bak).
- Login as mfpl-admin (password in key ringer) and ensure all the experimental apps are enabled.