wiki:owncloud-admin

Version 8 (modified by Jamie McClelland, 3 years ago) (diff)

--

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 then psql 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:

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
  • Backup the database with:
    su -c "pg_dump owncloud" www-data > owncloud.sql
    
  • 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
    

Be sure to check /etc/owncloud/config.php to make sure it has the OC_User_mfpl class defined. If not, compare config.php with config.php.bak and update config.php as needed.

When upgrading between major versions you most likely will have to download the corresponding version of the third party apps we are maintaining. Best practice seems to be:

  • Enter maintenance mode (edit to /etc/owncloud/config.php
  • Download all apps in /var/lib/owncloud/apps-local, replacing the existing apps with the new ones.
  • Upgrade the ownCloud core code.
  • su - www-data && cd /var/www/owncloud && php occ upgrade
  • Fix /etc/owncloud/config.php to include our custom class.