diff --git a/README.md b/README.md
index 374a416..860ce67 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,9 @@
[](../../../owncloud)
## ownCloud
-The JPS package deploys ownCloud that initially contains 1 application server and 1 database container. The package provides vertical scalling per node and horizontal scaling for each layer out-of-the-box.
+The JPS package deploys ownCloud that initially contains 1 application server and 1 database container.
+
+You also have the choice of using a dedicated storage node or a clustered storage node.
### Highlights
This package is designed to deploy ownCloud environment which represents an open source and free file cloud storage. It can be easily used for data sharing and synchronization, as well as just for storing documents.
@@ -14,16 +16,16 @@ This package is designed to deploy ownCloud environment which represents an open
Layer | Server | Number of CTs
by default | Cloudlets per CT
(reserved/dynamic) | Options
-------------------- | --------------| :----------------------------: | :---------------------------------------: | :-----:
-AS | Apache 2 (MOD_PHP) | 1 | 1 / 16 | -
-DB | MySQL | 1 | 1 / 16 | -
+AS | Apache 2
Litespeed | 1 | 1 / 16 | -
+DB | MariaDB | 1 | 1 / 8 | -
* AS - Application server
* DB - Database
* CT - Container
-**ownCloud Version**: 8.1.1
-**PHP Engine**: PHP 5.5.36
-**MySQL Database**: 5.7.12
+**ownCloud Version**: 10.7
+**PHP Engine**: PHP 7.4.15
+**MariaDB Database**: 10.x
### Deployment
diff --git a/dumps/owncloud.zip b/dumps/owncloud.zip
deleted file mode 100644
index 6eb0e3c..0000000
Binary files a/dumps/owncloud.zip and /dev/null differ
diff --git a/manifest.jps b/manifest.jps
index 44beb4a..b4f2116 100644
--- a/manifest.jps
+++ b/manifest.jps
@@ -2,7 +2,10 @@ type: install
id: owncloud
version: 1.7
name: ownCloud
-baseUrl: https://raw.githubusercontent.com/jelastic-jps/owncloud/master/
+baseUrl: https://raw.githubusercontent.com/jelastic-jps/owncloud/master
+homepage: https://owncloud.org/
+logo: images/ownCloud.png
+description: ownCloud represents an open source and free file cloud storage. It can be easily used for data sharing and synchronization, as well as just for storing documents.
categories:
- apps/file-management
@@ -12,58 +15,144 @@ categories:
mixins:
- configs/vers.yaml
-globals:
- PASSWD: ${fn.password}
-homepage: https://owncloud.org/
-logo: images/ownCloud.png
-description: ownCloud represents an open source and free file cloud storage. It can be easily used for data sharing and synchronization, as well as just for storing documents.
+onBeforeInstall: /scripts/beforeinstall.js?_r=${fn.random}
+
+skipNodeEmails: true
+nodes: definedInOnBeforeInstall
+
+settings:
+ fields:
+ - name: litespeed
+ type: checkbox
+ caption: Install LiteSpeed High-Performance Web Server
+ value: true
+ tooltip: "If this option is disabled, the service will be installed using Apache application server"
+ - pack: ''
+ align: ''
+ defaultPadding: 1
+ defaultFlex: 0
+ caption: Compositefield
+ type: compositefield
+ name: compositefield
+ hideLabel: true
+ hidden: false
+ - name: ded-storage
+ type: checkbox
+ caption: Add a dedicated storage Node
+ value: true
+ tooltip: "If this option is disabled, the storage of the Apache node will be used for all files"
+ showIf:
+ true:
+ - caption: Clustered storage for high availability and more storage
+ type: checkbox
+ name: clustered-storage
+ value: false
+ tooltip: "If this option is activated, the storage node will be made as a clustered version"
+
+ false:
+ - caption: Clustered storage for high availability and more storage
+ type: checkbox
+ name: clustered-storage
+ value: false
+ disabled: true
+ tooltip: "If this option is activated, the storage node will be made as a clustered version"
-nodes:
- - cloudlets: 8
- nodeType: apache2
- engine: php7.4
- - cloudlets: 8
- nodeType: mysql5
onInstall:
- - deploy:
+ - mount
+ - deployApp
+ - set-SQL-settings
+ - set-PHP-settings
+ - apply-settings
+ - optimise-owncloud
+ - restart
+
+actions:
+ mount:
+ - if ('${settings.clustered-storage}' == 'true'):
+ - log: Mount Storage if clustered storage
+ - api:
+ - method: jelastic.environment.file.AddMountPointByGroup
+ params:
+ nodeGroup: cp
+ sourceNodeId: ${nodes.storage.master.id}
+ sourcePath: /data/ROOT
+ path: /var/www/webroot/ROOT
+ sourceAddressType: NODE_GROUP
+ protocol: NFS4
+
+ deployApp:
+ deploy:
archive: https://download.owncloud.org/community/owncloud-${globals.version_owncloud}.zip
name: owncloud-${globals.version_owncloud}.zip
context: ROOT
- - prepareSqlDatabase:
- - nodeType: mysql5
- loginCredentials:
- user: root
- password: ${nodes.mysql5.password}
- newDatabaseName: owncloud
- newDatabaseUser:
- name: owncloud
- password: ${globals.PASSWD}
- - cmd [cp]: printf ' "mysql",\n "dbname" => "owncloud",\n "dbuser" => "owncloud",\n "dbpass" => "${globals.PASSWD}",\n "dbhost" => "${nodes.mysql5.address}",\n "dbtableprefix" => "oc_",\n "adminlogin" => "admin",\n "adminpass" => "${user.appPassword}",\n "directory" => "/var/www/webroot/ROOT/data",\n);' > /var/www/webroot/ROOT/config/autoconfig.php
- - replaceInFile:
- - path: /etc/php.ini
- nodeType: apache2
- replacements:
- - replacement: post_max_size = 256M
- pattern: post_max_size = 8M
- - replacement: upload_max_filesize = 256M
- pattern: upload_max_filesize = 2M
- - replacement: max_execution_time = 300
- pattern: max_execution_time = 30
- - pattern: ";extension=gd.so"
- replacement: extension=gd.so
- - pattern: ";extension=intl.so"
- replacement: extension=intl.so
- - pattern: cgi.fix_pathinfo=0
- replacement: cgi.fix_pathinfo=1
- - restartNode:
- nodeType: apache2
-success: |
- Below you will find your admin panel link, username and password.
-
-
- Admin panel URL: [${env.protocol}://${env.domain}/](${env.protocol}://${env.domain}/)
- Admin name: admin
- Password: ${user.appPassword}
-
- To add custom domain name for your ownCloud installation follow the steps described in our [documentation](http://docs.jelastic.com/custom-domains)
+ set-SQL-settings:
+ - prepareSqlDatabase:
+ - nodeType: sqldb
+ loginCredentials:
+ user: root
+ password: "${nodes.sqldb.password}"
+ newDatabaseName: owncloud
+ newDatabaseUser:
+ name: owncloud
+ password: "${user.appPassword}"
+
+ set-PHP-settings:
+ - cmd [cp]: printf ' "mysql",\n "dbname" => "owncloud",\n "dbuser" => "owncloud",\n "dbpass" => "${user.appPassword}",\n "dbhost" => "${nodes.sqldb.address}",\n "dbtableprefix" => "oc_",\n "adminlogin" => "admin",\n "adminpass" => "${user.appPassword}",\n "directory" => "/var/www/webroot/ROOT/data",\n);' > /var/www/webroot/ROOT/config/autoconfig.php
+ - if ('${settings.litespeed}' == 'true'):
+ replaceInFile:
+ nodeType: cp
+ path: /usr/local/lsws/lsphp/etc/php.ini
+ replacements:
+ - pattern: post_max_size = 8M
+ replacement: post_max_size = 1024M
+ - pattern: upload_max_filesize = 2M
+ replacement: upload_max_filesize = 1024M
+ - pattern: max_execution_time = 30
+ replacement: max_execution_time = 600
+ - else:
+ replaceInFile:
+ nodeType: cp
+ path: /etc/php.ini
+ replacements:
+ - pattern: post_max_size = 100M
+ replacement: post_max_size = 1024M
+ - pattern: upload_max_filesize = 100M
+ replacement: upload_max_filesize = 1024M
+ - pattern: max_execution_time = 300
+ replacement: max_execution_time = 600
+ - pattern: ";extension=gd.so"
+ replacement: extension=gd.so
+ - pattern: ";extension=intl.so"
+ replacement: extension=intl.so
+ - pattern: cgi.fix_pathinfo=0
+ replacement: cgi.fix_pathinfo=1
+ - pattern: ";extension=redis.so"
+ replacement: extension=redis.so
+
+ apply-settings:
+ - restartContainers:
+ nodeGroup: cp
+ - sleep: 20000
+ - cmd[cp]: curl -Lk ${env.domain}
+
+ optimise-owncloud:
+ - cmd[cp]: |-
+ sed -i "36i 'filelocking.enabled' => true," /var/www/webroot/ROOT/config/config.php
+ sed -i "37i 'memcache.locking' => '\\\OC\\\Memcache\\\Redis'," /var/www/webroot/ROOT/config/config.php
+ sed -i "38i 'memcache.local' => '\\\OC\\\Memcache\\\Redis'," /var/www/webroot/ROOT/config/config.php
+ sed -i "39i 'redis' => [" /var/www/webroot/ROOT/config/config.php
+ sed -i "40i 'host' => '/var/run/redis/redis.sock'," /var/www/webroot/ROOT/config/config.php
+ sed -i "41i 'port' => 0," /var/www/webroot/ROOT/config/config.php
+ sed -i "42i ]," /var/www/webroot/ROOT/config/config.php
+ cd /var/www/webroot/ROOT
+ ./occ system:cron
+ crontab -l | { cat; echo "* * * * * /usr/bin/php -f /var/www/webroot/ROOT/occ system:cron"; } | crontab -
+
+ restart:
+ - restartContainers:
+ nodeGroup: cp
+
+success:
+ email: /text/success-text.md
+ text: /text/success-text.md
diff --git a/scripts/beforeinstall.js b/scripts/beforeinstall.js
new file mode 100644
index 0000000..fab8304
--- /dev/null
+++ b/scripts/beforeinstall.js
@@ -0,0 +1,172 @@
+var resp = {
+ result: 0,
+ ssl: true,
+ engine: "php7.4",
+ nodes: []
+}
+
+if (${settings.clustered-storage:false}) {
+ if (${settings.litespeed:false}) {
+ resp.nodes.push({
+ nodeType: "litespeedphp",
+ tag: "6.0-php-7.4.15",
+ engine: "7.4",
+ count: 1,
+ flexibleCloudlets: ${settings.cp_flexibleCloudlets:16},
+ fixedCloudlets: ${settings.cp_fixedCloudlets:1},
+ nodeGroup: "cp",
+ env: {
+ SERVER_WEBROOT: "/var/www/webroot/ROOT",
+ REDIS_ENABLED: "true"
+ }
+ }, {
+ nodeType: "storage",
+ count: 3,
+ cluster: true,
+ flexibleCloudlets: ${settings.st_flexibleCloudlets:8},
+ fixedCloudlets: ${settings.st_fixedCloudlets:1},
+ nodeGroup: "storage",
+ restartDelay: 10,
+ isRedeploySupport: false,
+ validation: {
+ minCount: 3,
+ maxCount: 3
+ }
+ })
+ } else {
+ resp.nodes.push({
+ nodeType: "apache2",
+ count: 1,
+ flexibleCloudlets: ${settings.cp_flexibleCloudlets:16},
+ fixedCloudlets: ${settings.cp_fixedCloudlets:1},
+ nodeGroup: "cp",
+ env: {
+ SERVER_WEBROOT: "/var/www/webroot/ROOT",
+ REDIS_ENABLED: "true"
+ }
+ }, {
+ nodeType: "storage",
+ count: 3,
+ cluster: true,
+ flexibleCloudlets: ${settings.st_flexibleCloudlets:8},
+ fixedCloudlets: ${settings.st_fixedCloudlets:1},
+ nodeGroup: "storage",
+ restartDelay: 10,
+ isRedeploySupport: false,
+ validation: {
+ minCount: 3,
+ maxCount: 3
+ }
+ })
+ }
+} else {
+if (${settings.ded-storage:false}) {
+ if (${settings.litespeed:false}) {
+ resp.nodes.push({
+ nodeType: "litespeedphp",
+ tag: "6.0-php-7.4.15",
+ engine: "7.4",
+ count: 1,
+ flexibleCloudlets: ${settings.cp_flexibleCloudlets:16},
+ fixedCloudlets: ${settings.cp_fixedCloudlets:1},
+ nodeGroup: "cp",
+ env: {
+ SERVER_WEBROOT: "/var/www/webroot/ROOT",
+ REDIS_ENABLED: "true"
+ },
+ volumeMounts: {
+ "/var/www/webroot/ROOT": {
+ readOnly: "false",
+ sourcePath: "/data/ROOT",
+ sourceNodeGroup: "storage"
+ }
+ }
+ }, {
+ nodeType: "storage",
+ count: 1,
+ flexibleCloudlets: ${settings.st_flexibleCloudlets:8},
+ fixedCloudlets: ${settings.st_fixedCloudlets:1},
+ nodeGroup: "storage",
+ isRedeploySupport: false,
+ validation: {
+ minCount: 1,
+ maxCount: 1
+ }
+ })
+ } else {
+ resp.nodes.push({
+ nodeType: "apache2",
+ count: 1,
+ flexibleCloudlets: ${settings.cp_flexibleCloudlets:16},
+ fixedCloudlets: ${settings.cp_fixedCloudlets:1},
+ nodeGroup: "cp",
+ env: {
+ SERVER_WEBROOT: "/var/www/webroot/ROOT",
+ REDIS_ENABLED: "true"
+ },
+ volumeMounts: {
+ "/var/www/webroot/ROOT": {
+ readOnly: "false",
+ sourcePath: "/data/ROOT",
+ sourceNodeGroup: "storage"
+ }
+ }
+ }, {
+ nodeType: "storage",
+ count: 1,
+ flexibleCloudlets: ${settings.st_flexibleCloudlets:8},
+ fixedCloudlets: ${settings.st_fixedCloudlets:1},
+ nodeGroup: "storage",
+ isRedeploySupport: false,
+ validation: {
+ minCount: 1,
+ maxCount: 1
+ }
+ })
+ }
+}}
+
+resp.nodes.push({
+ nodeType: "mariadb-dockerized",
+ flexibleCloudlets: ${settings.db_flexibleCloudlets:16},
+ fixedCloudlets: ${settings.db_fixedCloudlets:1},
+ count: 1,
+ nodeGroup: "sqldb",
+ skipNodeEmails: true,
+ validation: {
+ minCount: 1,
+ maxCount: 1
+ }
+})
+
+
+if (!${settings.ded-storage:false}) {
+ if (${settings.litespeed:false}) {
+ resp.nodes.push({
+ nodeType: "litespeedphp",
+ tag: "6.0-php-7.4.15",
+ engine: "7.4",
+ count: 1,
+ flexibleCloudlets: ${settings.cp_flexibleCloudlets:16},
+ fixedCloudlets: ${settings.cp_fixedCloudlets:1},
+ nodeGroup: "cp",
+ env: {
+ SERVER_WEBROOT: "/var/www/webroot/ROOT",
+ REDIS_ENABLED: "true"
+ }
+ })
+ } else {
+ resp.nodes.push({
+ nodeType: "apache2",
+ count: 1,
+ flexibleCloudlets: ${settings.cp_flexibleCloudlets:16},
+ fixedCloudlets: ${settings.cp_fixedCloudlets:1},
+ nodeGroup: "cp",
+ env: {
+ SERVER_WEBROOT: "/var/www/webroot/ROOT",
+ REDIS_ENABLED: "true"
+ }
+ })
+}}
+
+return resp;
\ No newline at end of file
diff --git a/text/success-email.md b/text/success-email.md
new file mode 100644
index 0000000..50180aa
--- /dev/null
+++ b/text/success-email.md
@@ -0,0 +1,10 @@
+ Below you will find your admin panel link, username and password.
+
+
+ Admin panel URL: [${env.protocol}://${env.domain}/](${env.protocol}://${env.domain}/)
+ Admin name: admin
+ Password: ${user.appPassword}
+
+ To add custom domain name for your ownCloud installation follow the steps described in our [documentation](http://docs.jelastic.com/custom-domains)
+
+ You can find a guide for ownCloud Administration here: https://doc.owncloud.com/server/user_manual/files/webgui/overview.html
diff --git a/text/success-text.md b/text/success-text.md
new file mode 100644
index 0000000..8c33cb9
--- /dev/null
+++ b/text/success-text.md
@@ -0,0 +1,6 @@
+ Below you will find your admin panel link, username and password.
+
+ Admin panel URL: [${env.protocol}://${env.domain}/](${env.protocol}://${env.domain}/)
+ Admin name: admin
+ Password: ${user.appPassword}
+
\ No newline at end of file