This commit is contained in:
mwiegand 2022-06-15 04:15:55 +02:00
parent a51d62f5d2
commit 449a3f1ac4
7 changed files with 216 additions and 128 deletions

View file

@ -28,4 +28,14 @@ $CONFIG = array (
"redis" => [
"host" => "/var/run/redis/nextcloud.sock",
],
'trusted_domains' =>
array (
0 => 'localhost',
1 => '127.0.0.1',
2 => 'cloud.sublimity.de',
),
"log_type" => "syslog",
"syslog_tag" => "nextcloud",
"logfile" => "",
"loglevel" => 3,
);

View file

@ -15,6 +15,10 @@ defaults = {
'php-cgi': {},
'php-zip': {},
'php-pgsql': {},
'php-bz2': {}, # face recognition
},
'sources': {
'deb https://repo.delellis.com.ar {release} {release}',
},
},
'archive': {
@ -50,6 +54,11 @@ defaults = {
'env[TMPDIR]': '/tmp',
'env[TEMP]': '/tmp',
},
'php.ini': {
'PHP': {
'memory_limit': '3G', # face recognition requires 2G
},
},
},
'postgresql': {
'roles': {
@ -77,6 +86,11 @@ defaults = {
'when': 'Sun 00:00:00',
'user': 'www-data',
},
'nextcloud-face-recognition': {
'command': '/usr/bin/php -f /opt/nextcloud/occ face:background_job',
'when': 'hourly',
'user': 'www-data',
},
},
'zfs': {
'datasets': {
@ -107,3 +121,16 @@ def vhost(metadata):
},
},
}
@metadata_reactor.provides(
'nginx/vhosts'
)
def pdlib(metadata):
return {
'apt': {
'packages': {
f"php{metadata.get('php/version')}-pdlib": {},
},
},
}

View file

@ -1,110 +0,0 @@
[PHP]
; Only needed for libapache2-mod-php?
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
serialize_precision = -1
ignore_user_abort = Off
zend.enable_gc = On
expose_php = Off
max_execution_time = 300
max_input_time = 600
memory_limit = 1G
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
html_errors = On
error_log = syslog
syslog.ident = php7.4
syslog.filter = ascii
arg_separator.output = "&"
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = ${post_max_size}
default_mimetype = "text/html"
default_charset = "UTF-8"
enable_dl = Off
file_uploads = On
upload_max_filesize = ${post_max_size}
max_file_uploads = 2000
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 10
[CLI Server]
cli_server.color = On
[mail function]
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
[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
[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 = 32
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 6
[Assertion]
zend.assertions = -1
[Date]
date.timezone = Europe/London
[opcache]
opcache.enable = 1
opcache.interned_strings_buffer = 32
opcache.max_accelerated_files = 20000
opcache.memory_consumption = 1024
opcache.save_comments = 1
opcache.validate_timestamps = 1
opcache.revalidate_freq = 60

View file

@ -1,22 +1,21 @@
version = node.metadata.get('php/version')
from os.path import join
import json
php_ini_context = {
'num_cpus': node.metadata.get('vm/cores'),
'post_max_size': node.metadata.get('php/post_max_size'),
}
from bundlewrap.utils.dicts import merge_dict
version = node.metadata.get('php/version')
files = {
f'/etc/php/{version}/cli/php.ini': {
'content_type': 'mako',
'context': php_ini_context,
'content': repo.libs.ini.dumps(node.metadata.get('php/php.ini')),
'needs': {
f'pkg_apt:php{version}',
f'pkg_apt:php{version}-fpm',
},
},
f'/etc/php/{version}/fpm/php.ini': {
'content_type': 'mako',
'context': php_ini_context,
'content': repo.libs.ini.dumps(node.metadata.get('php/php.ini')),
'needs': {
f'pkg_apt:php{version}',
f'pkg_apt:php{version}-fpm',

View file

@ -1,21 +1,143 @@
defaults = {
'php': {
'post_max_size': '32G',
},
}
@metadata_reactor.provides(
'php/php.ini',
)
def php_ini(metadata):
conf = {
'PHP': {
'engine': 'On',
'short_open_tag': 'Off',
'precision': '14',
'output_buffering': '4096',
'zlib.output_compression': 'Off',
'implicit_flush': 'Off',
'serialize_precision': '-1',
'ignore_user_abort': 'Off',
'zend.enable_gc': 'On',
'expose_php': 'Off',
'max_execution_time': '300',
'max_input_time': '600',
'memory_limit': '512M',
'error_reporting': '"E_ALL & ~E_DEPRECATED & ~E_STRICT"',
'display_startup_errors': 'Off',
'log_errors': 'On',
'log_errors_max_len': '1024',
'ignore_repeated_errors': 'Off',
'ignore_repeated_source': 'Off',
'report_memleaks': 'On',
'html_errors': 'On',
'error_log': 'syslog',
'syslog.ident': 'php',
'syslog.filter': 'ascii',
'arg_separator.output': '"&"',
'variables_order': 'GPCS',
'request_order': 'GP',
'register_argc_argv': 'Off',
'auto_globals_jit': 'On',
'post_max_size': '32g',
'default_mimetype': 'text/html',
'default_charset': 'UTF-8',
'enable_dl': 'Off',
'file_uploads': 'On',
'upload_max_filesize': '32g',
'max_file_uploads': '2000',
'allow_url_fopen': 'On',
'allow_url_include': 'Off',
'default_socket_timeout': '10',
},
'CLI Server': {
'cli_server.color': 'On',
},
'mail function': {
'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',
},
'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',
},
'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': '32',
'session.trans_sid_tags': '"a=href,area=href,frame=src,form="',
'session.sid_bits_per_character': '6',
},
'Assertion': {
'zend.assertions': '-1',
},
'Date': {
'date.timezone': 'Europe/London',
},
'opcache': {
'opcache.enable': '1',
'opcache.interned_strings_buffer': '32',
'opcache.max_accelerated_files': '20000',
'opcache.memory_consumption': '1024',
'opcache.save_comments': '1',
'opcache.validate_timestamps': '1',
'opcache.revalidate_freq': '60',
},
}
return {
'php': {
'php.ini': {
section: {
key: value
for key, value in options.items()
if not metadata.get(f'php/php.ini/{section}/{key}', None)
}
for section, options in conf.items()
}
},
}
@metadata_reactor.provides(
'php/www.conf',
)
def www_conf(metadata):
version = metadata.get('php/version')
return {
'php': {
'www.conf': {
'user': 'www-data',
'group': 'www-data',
'listen': f'/run/php/php{version}-fpm.sock',
'listen': f"/run/php/php{metadata.get('php/version')}-fpm.sock",
'listen.owner': 'www-data',
'listen.group': 'www-data',
'pm': 'dynamic',
@ -33,12 +155,11 @@ def www_conf(metadata):
'apt/packages',
)
def apt(metadata):
version = metadata.get('php/version')
return {
'apt': {
'packages': {
f'php{version}': {},
f'php{version}-fpm': {},
f"php{metadata.get('php/version')}": {},
f"php{metadata.get('php/version')}-fpm": {},
},
},
}

View file

@ -0,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6Ju2C2Tq2GijvRcvkQcA37Mx//x
x4ydNydSmu5kxfB6JorgAnK8sLTIHU+RWgmJRly5YY/G6RXm2QsYs+RvObgIablW
k1ZXNcb3qEyn3D91sXUsvp7qMAnQjWp2UkV4KygMc6C4i54JkOTcZiGhynjB6pL9
FgpIgjjhC9B+hToo9uuLC2Ox58TA+7l1sR4JG0XCNW0Z+5swBnWyrlt/ZwWxFqoB
oxYE/j3yxh9TmgHv54/j2ZzU8tiJHW01AGlbbxo=
=cWkh
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -83,7 +83,7 @@
},
'nextcloud': {
'hostname': 'cloud.sublimity.de',
'version': '23.0.3',
'version': '23.0.5',
},
'nextcloud-picsort': {
'ckn': {