Update to php7.0 and add more parameters
This commit is contained in:
parent
58047a81d5
commit
56e9d71a0e
13 changed files with 60 additions and 28 deletions
|
@ -1,6 +1,5 @@
|
|||
upstream php-handler {
|
||||
server 127.0.0.1:9000;
|
||||
#server unix:/var/run/php5-fpm.sock;
|
||||
server unix:/run/php/php7.0-fpm.sock;
|
||||
}
|
||||
|
||||
server {
|
||||
|
|
|
@ -11,25 +11,22 @@ case "$os_version" in
|
|||
8*)
|
||||
:
|
||||
;;
|
||||
9*)
|
||||
:
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported version $os_version of $os." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
nextcloud_version=$(cat "$__object/parameter/version")
|
||||
if [ ! "${nextcloud_version}" ]
|
||||
then
|
||||
echo "Missing nextcloud version (parameter/version)" >&2
|
||||
exit 1
|
||||
fi
|
||||
# TODO check if url parameter is set
|
||||
nextcloud_uri="https://download.nextcloud.com/server/releases/nextcloud-${nextcloud_version}.tar.bz2"
|
||||
|
||||
nextcloud_uri="$(cat "$__object/parameter/uri")-$(cat "$__object/parameter/version").tar.bz2"
|
||||
db_name=$(cat "$__object/parameter/db-name")
|
||||
db_user=$(cat "$__object/parameter/db-user")
|
||||
db_pass=$(cat "$__object/parameter/db-pass")
|
||||
admin_user=$(cat "$__object/parameter/admin-user")
|
||||
admin_pass=$(cat "$__object/parameter/admin-pass")
|
||||
# TODO check shasum of tar ball
|
||||
cat <<eof
|
||||
curl -s -L ${nextcloud_uri} -o /tmp/nextcloud.tar.bz2
|
||||
tar -C /var/www -xvjf /tmp/nextcloud.tar.bz2
|
||||
rm -f /tmp/nextcloud.tar.bz2
|
||||
curl -s -L ${nextcloud_uri} -o /tmp/nextcloud.tar.bz2 &&
|
||||
tar -C /var/www -xvjf /tmp/nextcloud.tar.bz2 &&
|
||||
rm -f /tmp/nextcloud.tar.bz2 &&
|
||||
chown -R www-data:www-data /var/www/nextcloud
|
||||
eof
|
||||
|
|
43
manifest
43
manifest
|
@ -9,11 +9,6 @@ fi
|
|||
os_version=$(cat "$__global/explorer/os_version")
|
||||
case "$os_version" in
|
||||
8*)
|
||||
php=php5
|
||||
:
|
||||
;;
|
||||
9*)
|
||||
php=php
|
||||
:
|
||||
;;
|
||||
*)
|
||||
|
@ -22,17 +17,43 @@ case "$os_version" in
|
|||
;;
|
||||
esac
|
||||
|
||||
# Php 7
|
||||
__apt_key_uri dotdeb --uri https://www.dotdeb.org/dotdeb.gpg
|
||||
require="__apt_key_uri/dotdeb" __apt_source dotdeb --uri http://packages.dotdeb.org \
|
||||
--distribution jessie \
|
||||
--component all
|
||||
|
||||
require="__apt_source/dotdeb" __apt_update_index
|
||||
|
||||
require="__package/php7.0-fpm" __start_on_boot php7.0-fpm
|
||||
|
||||
# Install packages
|
||||
for package in ${php} ${php}-gd ${php}-json ${php}-pgsql ${php}-curl \
|
||||
${php}-intl ${php}-mcrypt ${php}-imagick \
|
||||
postgresql nginx curl
|
||||
do __package $package --state=present
|
||||
for package in php7.0-common php7.0-gd php7.0-json php7.0-pgsql php7.0-curl \
|
||||
php7.0-intl php7.0-mcrypt php7.0-imagick \
|
||||
php7.0-zip php7.0-apcu php7.0-mbstring php7.0-xml php7.0-fpm
|
||||
do require="__apt_update_index" __package $package --state=present
|
||||
done
|
||||
|
||||
|
||||
|
||||
__package postgresql --state=present
|
||||
__package curl --state=present
|
||||
__package nginx --state=present
|
||||
|
||||
# Nginx
|
||||
require="__package/nginx" __file /etc/nginx/sites-enabled/nextcloud --owner www-data \
|
||||
--group www-data --mode 755 --source "$__type/files/nextcloud.nginx"
|
||||
require="__package/nginx" __start_on_boot nginx
|
||||
|
||||
# Postgres
|
||||
require="__package/postgresql" __postgres_database nextcloud --owner nextcloud
|
||||
require="__package/postgresql" __postgres_role nextcloud --login --createdb
|
||||
db_pass=$(cat "$__object/parameter/db-pass")
|
||||
db_user=$(cat "$__object/parameter/db-user")
|
||||
db_name=$(cat "$__object/parameter/db-name")
|
||||
|
||||
|
||||
require="__package/postgresql" __postgres_role "${db_user}" --password "${db_pass}"\
|
||||
--login --createdb
|
||||
|
||||
require="__package/postgresql __postgres_role/${db_user}" __postgres_database "${db_name}"\
|
||||
--owner "${db_user}" --state present
|
||||
require="__package/postgresql" __start_on_boot postgresql
|
||||
|
|
1
parameter/default/admin-pass
Normal file
1
parameter/default/admin-pass
Normal file
|
@ -0,0 +1 @@
|
|||
nextcloud
|
1
parameter/default/admin-user
Normal file
1
parameter/default/admin-user
Normal file
|
@ -0,0 +1 @@
|
|||
nextcloud
|
1
parameter/default/db-name
Normal file
1
parameter/default/db-name
Normal file
|
@ -0,0 +1 @@
|
|||
nextcloud
|
1
parameter/default/db-pass
Normal file
1
parameter/default/db-pass
Normal file
|
@ -0,0 +1 @@
|
|||
nextcloud
|
1
parameter/default/db-user
Normal file
1
parameter/default/db-user
Normal file
|
@ -0,0 +1 @@
|
|||
nextcloud
|
1
parameter/default/hostname
Normal file
1
parameter/default/hostname
Normal file
|
@ -0,0 +1 @@
|
|||
|
1
parameter/default/uri
Normal file
1
parameter/default/uri
Normal file
|
@ -0,0 +1 @@
|
|||
https://download.nextcloud.com/server/releases/nextcloud
|
1
parameter/default/version
Normal file
1
parameter/default/version
Normal file
|
@ -0,0 +1 @@
|
|||
11.0.1
|
8
parameter/optional
Normal file
8
parameter/optional
Normal file
|
@ -0,0 +1,8 @@
|
|||
db-pass
|
||||
db-user
|
||||
db-name
|
||||
admin-user
|
||||
admin-pass
|
||||
uri
|
||||
version
|
||||
hostname
|
|
@ -1 +0,0 @@
|
|||
version
|
Loading…
Reference in a new issue