From 6ee3c8a51faac10a72087849a0ae45c011ba3b25 Mon Sep 17 00:00:00 2001 From: Andre Mohr Date: Wed, 13 Jan 2016 23:46:09 +0100 Subject: [PATCH 1/3] Add additional apps directory to the $OWNCLOUD_DATA_DIR and to the owncloud config. --- assets/runtime/env-defaults | 1 + assets/runtime/functions | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index a7f3f12..2076ce6 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -7,6 +7,7 @@ DEBUG=${DEBUG:-false} OWNCLOUD_CONFIG_DIR=${OWNCLOUD_CONFIG_DIR:-$OWNCLOUD_DATA_DIR/config} OWNCLOUD_OCDATA_DIR=${OWNCLOUD_OCDATA_DIR:-$OWNCLOUD_DATA_DIR/ocdata} OWNCLOUD_BACKUPS_DIR=${OWNCLOUD_BACKUPS_DIR:-$OWNCLOUD_DATA_DIR/backups} +OWNCLOUD_APPS_DIR=${OWNCLOUD_APPS_DIR:-$OWNCLOUD_DATA_DIR/apps} OWNCLOUD_ADMIN_USER=${OWNCLOUD_ADMIN_USER:-admin} OWNCLOUD_ADMIN_PASSWORD=${OWNCLOUD_ADMIN_PASSWORD:-password} diff --git a/assets/runtime/functions b/assets/runtime/functions index 1e596d0..8bb387e 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -310,6 +310,25 @@ owncloud_configure_domain() { sed -i "s|0 => '.*',|0 => '${OWNCLOUD_FQDN}',|" ${OWNCLOUD_APP_CONFIG} } +owncloud_configure_apps_paths() { + echo "Configuring ownCloud::apps_paths..." + read -r -d '' apps_paths << EOF +array ( + 0 => array ( + "path" => OC::$SERVERROOT."/apps", + "url" => "/apps", + "writable" => false, + ), + 1 => array ( + "path" => OC::$SERVERROOT."/apps2", + "url" => "/apps2", + "writable" => true, + ), +) +EOM + owncloud_set_param apps_paths "$apps_paths" +} + owncloud_configure_max_upload_size() { echo "Configuring ownCloud::max_upload_size..." ( @@ -505,8 +524,16 @@ initialize_datadir() { chmod -R 0755 ${OWNCLOUD_BACKUPS_DIR} chown -R ${OWNCLOUD_USER}: ${OWNCLOUD_BACKUPS_DIR} + # create apps directory + mkdir -p ${OWNCLOUD_APPS_DIR} + chown -R ${OWNCLOUD_USER}: ${OWNCLOUD_APPS_DIR} + chmod -R 0750 ${OWNCLOUD_APPS_DIR} + # symlink to config/config.php -> ${OWNCLOUD_CONFIG_DIR}/config.php ln -sf ${OWNCLOUD_CONFIG_DIR}/config.php ${OWNCLOUD_INSTALL_DIR}/config/config.php + + # symlink to apps2 -> ${OWNCLOUD_APPS_DIR} + ln -sf ${OWNCLOUD_APPS_DIR} ${OWNCLOUD_INSTALL_DIR}/apps2 } initialize_system() { @@ -519,6 +546,7 @@ configure_owncloud() { owncloud_configure_database owncloud_upgrade owncloud_configure_domain + owncloud_configure_apps_paths owncloud_configure_max_upload_size owncloud_configure_max_file_uploads @@ -541,6 +569,7 @@ backup_create() { backup_dump_database backup_dump_directory ${OWNCLOUD_CONFIG_DIR} .tar.gz backup_dump_directory ${OWNCLOUD_OCDATA_DIR} .tar + backup_dump_directory ${OWNCLOUD_APPS_DIR} .tar.gz backup_dump_information backup_create_archive backup_information.yml database.sql.gz config.tar.gz ocdata.tar backup_purge_expired @@ -596,4 +625,5 @@ backup_restore() { backup_restore_database backup_restore_directory ${OWNCLOUD_CONFIG_DIR} .tar.gz backup_restore_directory ${OWNCLOUD_OCDATA_DIR} .tar + backup_restore_directory ${OWNCLOUD_APPS_DIR} .tar.gz } From 764c15cb26752d088e0b2337771f706457d31d07 Mon Sep 17 00:00:00 2001 From: Andre Mohr Date: Thu, 14 Jan 2016 00:21:43 +0100 Subject: [PATCH 2/3] Fixed typo in configuration of owncloud apps_paths --- assets/runtime/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/runtime/functions b/assets/runtime/functions index 8bb387e..5d5ec84 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -312,7 +312,7 @@ owncloud_configure_domain() { owncloud_configure_apps_paths() { echo "Configuring ownCloud::apps_paths..." - read -r -d '' apps_paths << EOF + read -r -d '' apps_paths << EOM array ( 0 => array ( "path" => OC::$SERVERROOT."/apps", From 4b3831e7297e5b7746f6fd19b5df21350491bef0 Mon Sep 17 00:00:00 2001 From: Andre Mohr Date: Thu, 14 Jan 2016 01:35:49 +0100 Subject: [PATCH 3/3] Change the apps_paths to single line, otherwise sed outputs an error --- assets/runtime/functions | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/assets/runtime/functions b/assets/runtime/functions index 5d5ec84..a9b081e 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -312,20 +312,7 @@ owncloud_configure_domain() { owncloud_configure_apps_paths() { echo "Configuring ownCloud::apps_paths..." - read -r -d '' apps_paths << EOM -array ( - 0 => array ( - "path" => OC::$SERVERROOT."/apps", - "url" => "/apps", - "writable" => false, - ), - 1 => array ( - "path" => OC::$SERVERROOT."/apps2", - "url" => "/apps2", - "writable" => true, - ), -) -EOM + apps_paths="array ( 0 => array ( 'path' => OC::\$SERVERROOT.'/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ( 'path' => OC::\$SERVERROOT.'/apps2', 'url' => '/apps2', 'writable' => true, ),)" owncloud_set_param apps_paths "$apps_paths" }