nextcloud-instance.cfg.in 6.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

#############
#   Redis   #
#############
[nc-directory]
recipe  = slapos.cookbook:mkdirectory
redis     = ${directory:srv}/redis
redis-log = ${directory:log}/redis
data      = ${directory:srv}/data
backup   = ${directory:backup}/nextcloud

[service-redis]
recipe  = slapos.cookbook:redis.server
wrapper = ${directory:services}/redis
promise_wrapper = ${directory:promises}/redis
server_dir  = ${nc-directory:redis}
config_file = ${directory:etc}/redis.conf
log_file    = ${nc-directory:redis-log}/redis.log
pid_file    = ${directory:run}/redis.pid
use_passwd  = false
unixsocket  = ${:server_dir}/redis.socket
# port = 0 means "don't listen on TCP at all" - listen only on unix socket
ipv6    = ::1
port    = 0
server_bin  = {{ redis_bin }}
depend  =
    ${logrotate-entry-redis:recipe}

[logrotate-entry-redis]
<= logrotate-entry-base
name = redis
log     = ${nc-directory:redis-log}/*.log
frequency = daily
rotate-num = 30

[instance-parameter]
nextcloud = ${:document-root}
admin-user = admin
admin-password = admin
trusted-domain-list = 
  [${apache-php-configuration:ip}]:${apache-php-configuration:port}
  ${slap-parameter:instance.trusted-domain-1}
  ${slap-parameter:instance.trusted-domain-2}
44 45
  ${slap-parameter:instance.trusted-domain-3}

46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
trusted-proxy-list = ${slap-parameter:instance.trusted-proxy-list}
cli-url = ${slap-parameter:instance.cli-url}
data-dir = ${nc-directory:data}
redis-socket = ${service-redis:unixsocket}

#php.ini parameters
php.memory_limit = 512M
php.date.timezone = Europe/Paris
php.upload_max_filesize = 10240M
php.post_max_size = 10240M
php.session.cookie_secure = True
php.max_execution_time = 1800
php.max_input_time = 3600
php.output_buffering = 'Off'
php.max_file_uploads = 100

#SMTP settings
mail.from = ${slap-parameter:instance.mail-from}
mail.domain = ${slap-parameter:instance.mail-domain}
mail.smtpauthtype = ${slap-parameter:instance.mail-smtpauthtype}
mail.smtpauth = ${slap-parameter:instance.mail-smtpauth}
mail.smtpport = ${slap-parameter:instance.mail-smtpport}
mail.smtphost = ${slap-parameter:instance.mail-smtphost}
mail.smtpname = ${slap-parameter:instance.mail-smtpname}
mail.smtppassword = ${slap-parameter:instance.mail-smtppassword}
# Instance configuration
collabora-url = ${slap-parameter:instance.collabora-url}
stun-server = ${slap-parameter:instance.stun-server}
turn-server = ${slap-parameter:instance.turn-server}
turn-secret = ${slap-parameter:instance.turn-secret}

[nextcloud-install.sh]
recipe = slapos.recipe.template:jinja2
template = {{ nextcloud_install_sh }}
rendered = ${directory:scripts}/nextcloud-install
context =
  section parameter_dict   instance-parameter
mode = 744
depends =
  ${service-redis:recipe}
  ${nextcloud-cron:recipe}
  ${nextcloud-optimize:recipe}
  ${nextcloud-apache-httpd:recipe}
  ${nextcloud-backup-cron:recipe}
  ${nextcloud-news-updater:recipe}
91
  ${nextcloud-config-update:recipe}
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153

[nextcloud-apache-httpd]
recipe = slapos.recipe.template:jinja2
template = {{ nextcloud_apache_httpd }}
rendered = ${directory:apache.d}/nextcloud.conf
context =
  section parameter_dict apache-php-configuration
mode = 744

[nextcloud-cron]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = nextcloud
frequency = */5 * * * *
command = ${php-bin:wrapper-path} -f ${instance-parameter:nextcloud}/cron.php

[nextcloud-optimize-bin]
recipe = collective.recipe.template
input = inline:#!/bin/bash
  {{ redis_cli }} -s ${instance-parameter:redis-socket} <<EOF
  FLUSHALL
  quit
  EOF
  ${php-bin:wrapper-path} ${instance-parameter:nextcloud}/occ files:scan --all
  ${php-bin:wrapper-path} ${instance-parameter:nextcloud}/occ files:scan-app-data
  exit 0
output = ${directory:bin}/nextcloud-optimize
mode = 744

[nextcloud-backup]
recipe = collective.recipe.template
input = inline:#!/bin/bash
  ${php-bin:wrapper-path} ${instance-parameter:nextcloud}/occ app:list --output json > ${nc-directory:backup}/app-list.json
  cp -r ${instance-parameter:nextcloud}/config ${nc-directory:backup}
  exit 0
output = ${directory:bin}/nextcloud-backup
mode = 744

[nextcloud-backup-cron]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = nextcloud-backup
frequency = 0 0 * * * *
command = ${nextcloud-backup:output}

[nextcloud-optimize]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = nextcloud-optimize
frequency = 5 1 * * *
command = ${nextcloud-optimize-bin:output}

[nextcloud-news-updater]
recipe = collective.recipe.template
input = inline:#!/bin/sh
  cd {{ news_updater_location }}
  export PATH={{ php_location }}/bin:$PATH
  {{ python3_location}}/bin/python3 -m nextcloud_news_updater --phpini ${php.ini-conf:rendered} \
    --interval 300 --mode endless --loglevel info ${instance-parameter:nextcloud}
output = ${directory:scripts}/nextcloud-news-updater
mode = 744

154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
[nextcloud-config.json]
recipe = slapos.recipe.template:jinja2
template = {{ nextcloud_parameter_json }}
rendered = ${directory:etc}/nextcloud-config.json
extensions = jinja2.ext.do
context =
  section parameter_dict   instance-parameter
mode = 600

[nextcloud-config-update]
output = ${directory:scripts}/nextcloud-update
recipe = collective.recipe.template
input = inline:#!/bin/sh
  if [ -f "${instance-parameter:nextcloud}/config/CAN_INSTALL" ]; then
    # do not run this script if nextcloud is not installed yet.
    exit 1;
  fi
  ${php-bin:wrapper-path} ${instance-parameter:nextcloud}/occ config:import ${nextcloud-config.json:rendered}
mode = 744

174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
[php-bin]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/php
command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:rendered}

[publish-connection-information]
admin-user = ${instance-parameter:admin-user}
admin-password = ${instance-parameter:admin-password}

[slap-parameter]
instance.mail-from = Nextcloud
instance.mail-domain = nextcloud@example.com
instance.mail-smtpauthtype = LOGIN
instance.mail-smtpauth = 1
instance.mail-smtpport = 587
instance.mail-smtphost =
instance.mail-smtpname =
instance.mail-smtppassword =
instance.collabora-url = https://collabora.host.vifib.net/
instance.stun-server = turn.vifib.com:5349
instance.turn-server =
instance.turn-secret =

instance.cli-url = ${apache-php-configuration:url}
198
instance.trusted-domain-1 =
199
instance.trusted-domain-2 =
200
instance.trusted-domain-3 =
201
instance.trusted-proxy-list =