aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roles/nextcloud/defaults/main.yml (renamed from roles/nextcloud/vars/main.yml)4
-rw-r--r--roles/nextcloud/meta/main.yml1
-rw-r--r--roles/nextcloud/tasks/main.yml29
-rw-r--r--roles/nextcloud/templates/etc-php-7.3.ini.j2198
4 files changed, 211 insertions, 21 deletions
diff --git a/roles/nextcloud/vars/main.yml b/roles/nextcloud/defaults/main.yml
index 040338c..983b05b 100644
--- a/roles/nextcloud/vars/main.yml
+++ b/roles/nextcloud/defaults/main.yml
@@ -10,3 +10,7 @@ nextcloud_group: _nextcloud
nextcloud_db: postgres
nextcloud_instance_name: "rgoncalves.se cloud"
+
+nextcloud_php_max_inputtime: 180
+nextcloud_php_memory_limit: -1
+nextcloud_php_upload_maxsize: 100M
diff --git a/roles/nextcloud/meta/main.yml b/roles/nextcloud/meta/main.yml
index 0188b83..9a6c3ec 100644
--- a/roles/nextcloud/meta/main.yml
+++ b/roles/nextcloud/meta/main.yml
@@ -9,3 +9,4 @@ dependencies:
tags: "dependency"
when: ansible_distribution == "OpenBSD"
- { role: postgres, tags: "dependency" }
+ - { role: redis, tags: "dependency" }
diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml
index 3e143a8..ccc35a5 100644
--- a/roles/nextcloud/tasks/main.yml
+++ b/roles/nextcloud/tasks/main.yml
@@ -26,26 +26,13 @@
mode: 0644
when: ansible_distribution == "OpenBSD"
-- name: ensure extensions are enabled in php-fpm
- lineinfile:
- path: /etc/php-7.3.ini
- regexp: "{{ item }}"
- line: "{{ item }}"
- loop:
- - extension=curl
- - extension=pdo_pgsql
- - extension=intl
-
-- name: ensure other config are corrects in php-fpm
- lineinfile:
- path: /etc/php-7.3.ini
- regexp: "^{{ item[0] }}*"
- line: "{{ item[0] }}={{ item[1] }}"
- loop:
- - [ "allow_url_fopen", "On" ]
- - [ "upload_max_filesize", "100M" ]
- - [ "post_max_size", "100M" ]
- - [ "memory_limit", "1024M" ]
+- name: generate nextcloud php config
+ template:
+ src: etc-php-7.3.ini.j2
+ dest: /etc/php-7.3.ini
+ owner: "www"
+ group: "www"
+ mode: "0644"
- name: generate nextcloud custom config
template:
@@ -68,7 +55,7 @@
job: "php -f /var/www/nextcloud/cron.php"
user: www
-- name: ensure directories are chow to www
+- name: ensure directories are chown to www
file:
path: "/var/www/nextcloud/{{ item }}"
owner: "www"
diff --git a/roles/nextcloud/templates/etc-php-7.3.ini.j2 b/roles/nextcloud/templates/etc-php-7.3.ini.j2
new file mode 100644
index 0000000..0e79971
--- /dev/null
+++ b/roles/nextcloud/templates/etc-php-7.3.ini.j2
@@ -0,0 +1,198 @@
+[PHP]
+auto_append_file=
+auto_globals_jit=On
+auto_prepend_file=
+default_charset="UTF-8"
+default_mimetype="text/html"
+disable_classes=
+disable_functions=
+display_errors=Off
+display_startup_errors=Off
+doc_root=
+enable_dl=Off
+engine=On
+error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT
+expose_php=On
+extension_dir="/usr/local/lib/php-7.3/modules"
+html_errors=On
+ignore_repeated_errors=Off
+ignore_repeated_source=Off
+implicit_flush=Off
+include_path=".:/pear/lib:/var/www/pear/lib"
+log_errors=On
+log_errors_max_len=1024
+max_execution_time=30
+output_buffering=4096
+precision=14
+register_argc_argv=Off
+report_memleaks=On
+request_order="GP"
+serialize_precision=-1
+short_open_tag=Off
+unserialize_callback_func=
+user_dir=
+variables_order="GPCS"
+zend.enable_gc=On
+zlib.output_compression=Off
+
+allow_url_fopen=On
+allow_url_include=Off
+default_socket_timeout=60
+file_uploads=On
+max_file_uploads=20
+
+memory_limit={{ nextcloud_php_memory_limit }}
+max_input_time={{ nextcloud_php_max_inputtime }}
+post_max_size={{ nextcloud_php_upload_maxsize }}
+upload_max_filesize={{ nextcloud_php_upload_maxsize }}
+
+pm=dynamic
+pm.maxchildren=120
+pm.start_servers=12
+pm.min_spare_servers=6
+pm.max_spare_servers=18
+
+extension=curl
+extension=gd
+extension=intl
+extension=pdo_pgsql
+extension=zip
+
+[CLI Server]
+cli_server.color=On
+
+[Date]
+date.timezone=UTC
+
+[iconv]
+
+[imap]
+
+[intl]
+
+[sqlite3]
+
+[Pcre]
+
+[Pdo]
+
+[Pdo_mysql]
+pdo_mysql.default_socket=
+
+[Phar]
+
+[mail function]
+SMTP=localhost
+smtp_port=25
+mail.add_x_header=Off
+
+[ODBC]
+odbc.allow_persistent=On
+odbc.check_persistent=On
+odbc.max_persistent=-1
+odbc.max_links=-1
+odbc.defaultlrl=4096
+odbc.defaultbinmode=1
+
+[Interbase]
+ibase.allow_persistent=1
+ibase.max_persistent=-1
+ibase.max_links=-1
+ibase.timestampformat="%Y-%m-%d %H:%M:%S"
+ibase.dateformat="%Y-%m-%d"
+ibase.timeformat="%H:%M:%S"
+
+[MySQLi]
+mysqli.max_persistent=-1
+mysqli.allow_persistent=On
+mysqli.max_links=-1
+mysqli.default_port=3306
+mysqli.default_socket=
+mysqli.default_host=
+mysqli.default_user=
+mysqli.default_pw=
+mysqli.reconnect=Off
+
+[mysqlnd]
+mysqlnd.collect_statistics=On
+mysqlnd.collect_memory_statistics=Off
+
+[OCI8]
+
+[PostgreSQL]
+pgsql.allow_persistent=On
+pgsql.auto_reset_persistent=Off
+pgsql.max_persistent=-1
+pgsql.max_links=-1
+pgsql.ignore_notice=0
+pgsql.log_notice=0
+
+[bcmath]
+bcmath.scale=0
+
+[browscap]
+
+[Session]
+session.save_handler=files
+session.use_strict_mode=0
+session.use_cookies=1
+session.use_only_cookies=1
+session.name=PHPSESSID
+session.auto_start=0
+session.cookie_lifetime=0
+session.cookie_path=/
+session.cookie_domain=
+session.cookie_httponly=
+session.cookie_samesite=
+session.serialize_handler=php
+session.gc_probability=1
+session.gc_divisor=1000
+session.gc_maxlifetime=1440
+session.referer_check=
+session.cache_limiter=nocache
+session.cache_expire=180
+session.use_trans_sid=0
+session.sid_length=26
+session.trans_sid_tags="a=href,area=href,frame=src,form="
+session.sid_bits_per_character=5
+
+[Assertion]
+zend.assertions=-1
+
+[COM]
+
+[mbstring]
+
+[gd]
+
+[exif]
+
+[Tidy]
+
+tidy.clean_output=Off
+
+[soap]
+soap.wsdl_cache_enabled=1
+soap.wsdl_cache_dir="/tmp"
+soap.wsdl_cache_ttl=86400
+soap.wsdl_cache_limit=5
+
+[sysvshm]
+
+[ldap]
+ldap.max_links=-1
+
+[dba]
+
+[opcache]
+opcache.enable=1
+opcache.enable_cli=1
+opcache.memory_consumption=128
+opcache.interned_strings_buffer=8
+opcache.max_accelerated_files=10000
+opcache.revalidate_freq=1
+opcache.save_comments=1
+
+[curl]
+
+[openssl]
remember that computers suck.