2017-04-21 04:57:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
os=$(cat "$__global/explorer/os")
|
|
|
|
if [ ! "$os" = "debian" ]
|
|
|
|
then
|
|
|
|
echo "OS $os is currently not supported." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
os_version=$(cat "$__global/explorer/os_version")
|
|
|
|
case "$os_version" in
|
|
|
|
8*)
|
2017-04-22 08:23:06 +00:00
|
|
|
:
|
|
|
|
;;
|
2017-04-21 04:57:03 +00:00
|
|
|
*)
|
|
|
|
echo "Unsupported version $os_version of $os." >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2017-04-29 12:57:20 +00:00
|
|
|
# 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
|
|
|
|
|
2017-04-23 06:16:43 +00:00
|
|
|
# Install packages
|
2017-04-29 12:57:20 +00:00
|
|
|
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
|
2017-04-23 06:16:43 +00:00
|
|
|
done
|
2017-04-21 04:57:03 +00:00
|
|
|
|
2017-04-29 12:57:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
__package postgresql --state=present
|
|
|
|
__package curl --state=present
|
|
|
|
__package nginx --state=present
|
|
|
|
|
2017-04-23 06:16:43 +00:00
|
|
|
# Nginx
|
2017-04-23 06:22:31 +00:00
|
|
|
require="__package/nginx" __file /etc/nginx/sites-enabled/nextcloud --owner www-data \
|
2017-04-24 09:20:03 +00:00
|
|
|
--group www-data --mode 755 --source "$__type/files/nextcloud.nginx"
|
2017-04-29 12:57:20 +00:00
|
|
|
require="__package/nginx" __start_on_boot nginx
|
2017-04-21 04:57:03 +00:00
|
|
|
|
2017-04-23 06:16:43 +00:00
|
|
|
# Postgres
|
2017-04-29 12:57:20 +00:00
|
|
|
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
|