Skip to content

Commit 5814f93

Browse files
infra: Update to 32.0.1 and sync with other changes.
1 parent f373f28 commit 5814f93

10 files changed

Lines changed: 336 additions & 128 deletions

Dockerfile

Lines changed: 71 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
2-
FROM php:8.0-apache-bullseye
2+
FROM php:8.4-apache-trixie
33

44
# entrypoint.sh and cron.sh dependencies
55
RUN set -ex; \
@@ -9,9 +9,12 @@ RUN set -ex; \
99
rsync \
1010
bzip2 \
1111
busybox-static \
12+
ghostscript \
13+
imagemagick \
1214
libldap-common \
15+
libmagickcore-7.q16-10-extra \
1316
; \
14-
rm -rf /var/lib/apt/lists/*; \
17+
apt-get dist-clean; \
1518
\
1619
mkdir -p /var/spool/cron/crontabs; \
1720
echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data
@@ -24,6 +27,8 @@ RUN chmod +x /usr/local/bin/install-php-extensions && sync
2427

2528
ENV PHP_MEMORY_LIMIT 512M
2629
ENV PHP_UPLOAD_LIMIT 512M
30+
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
31+
ENV IPE_GD_WITHOUTAVIF 1
2732
RUN set -ex; \
2833
\
2934
install-php-extensions \
@@ -32,6 +37,7 @@ RUN set -ex; \
3237
exif \
3338
gd \
3439
gmp \
40+
igbinary \
3541
imagick \
3642
intl \
3743
ldap \
@@ -41,41 +47,88 @@ RUN set -ex; \
4147
pdo_mysql \
4248
pdo_pgsql \
4349
redis \
50+
sysvsem \
4451
zip \
4552
;
4653

54+
# trust all ldap certificates
55+
RUN { \
56+
echo 'TLS_REQCERT allow'; \
57+
} >> /etc/ldap/ldap.conf
58+
4759
# set recommended PHP.ini settings
4860
# see https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
4961
RUN { \
50-
echo 'opcache.interned_strings_buffer=16'; \
51-
echo 'opcache.revalidate_freq=5'; \
52-
echo 'opcache.jit_buffer_size=100M'; \
53-
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
62+
echo 'opcache.enable=1'; \
63+
echo 'opcache.interned_strings_buffer=32'; \
64+
echo 'opcache.jit=1255'; \
65+
echo 'opcache.jit_buffer_size=128M'; \
66+
echo 'opcache.max_accelerated_files=10000'; \
67+
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
68+
echo 'opcache.revalidate_freq=60'; \
69+
echo 'opcache.save_comments=1'; \
70+
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
5471
\
55-
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
72+
{ \
73+
echo 'apc.enable_cli=1'; \
74+
echo 'apc.shm_size=128M'; \
75+
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
5676
\
5777
{ \
78+
echo 'always_populate_raw_post_data=-1'; \
79+
echo 'default_socket_timeout=600'; \
80+
echo 'max_execution_time=300'; \
81+
echo 'max_input_time=300'; \
5882
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
59-
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
83+
echo 'output_buffering=0'; \
6084
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
61-
} > /usr/local/etc/php/conf.d/nextcloud.ini; \
85+
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
86+
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
87+
\
88+
{ \
89+
echo 'apc.serializer=igbinary'; \
90+
echo 'session.serialize_handler=igbinary'; \
91+
} >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini"; \
92+
\
93+
{ \
94+
echo 'redis.session.locking_enabled = 1'; \
95+
echo 'redis.session.lock_retries = -1'; \
96+
echo 'redis.session.lock_wait_time = 10000'; \
97+
echo 'session.gc_maxlifetime = 86400'; \
98+
} > "${PHP_INI_DIR}/conf.d/redis-session.ini"; \
6299
\
63100
mkdir /var/www/data; \
101+
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
102+
/docker-entrypoint-hooks.d/post-installation \
103+
/docker-entrypoint-hooks.d/pre-upgrade \
104+
/docker-entrypoint-hooks.d/post-upgrade \
105+
/docker-entrypoint-hooks.d/before-starting; \
64106
chown -R www-data:root /var/www; \
65107
chmod -R g=u /var/www
66108

109+
# set ImageMagick policy
110+
RUN sed -i'' 's|.*<policy domain="coder".*"PDF".*| <policy domain="coder" rights="read \| write" pattern="PDF" />|g' \
111+
/etc/ImageMagick-7/policy.xml
112+
67113
VOLUME /var/www/html
68114

69-
RUN a2enmod headers rewrite remoteip ;\
70-
{\
71-
echo RemoteIPHeader X-Real-IP ;\
72-
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
73-
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
74-
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
75-
} > /etc/apache2/conf-available/remoteip.conf;\
115+
RUN a2enmod headers rewrite remoteip ; \
116+
{ \
117+
echo 'RemoteIPHeader X-Real-IP'; \
118+
echo 'RemoteIPInternalProxy 10.0.0.0/8'; \
119+
echo 'RemoteIPInternalProxy 172.16.0.0/12'; \
120+
echo 'RemoteIPInternalProxy 192.168.0.0/16'; \
121+
} > /etc/apache2/conf-available/remoteip.conf; \
76122
a2enconf remoteip
77123

78-
ENV NEXTCLOUD_VERSION 23.0.3
124+
# set apache config LimitRequestBody
125+
ENV APACHE_BODY_LIMIT 1073741824
126+
RUN { \
127+
echo 'LimitRequestBody ${APACHE_BODY_LIMIT}'; \
128+
} > /etc/apache2/conf-available/apache-limits.conf; \
129+
a2enconf apache-limits
130+
131+
ENV NEXTCLOUD_VERSION 32.0.1
79132

80133
RUN set -ex; \
81134
fetchDeps=" \
@@ -112,8 +165,7 @@ CMD ["apache2-foreground"]
112165

113166
RUN apt-get update && apt-get install -y \
114167
supervisor \
115-
&& rm -rf /var/lib/apt/lists/* \
116-
&& mkdir /var/log/supervisord /var/run/supervisord
168+
&& rm -rf /var/lib/apt/lists/*
117169

118170
COPY supervisord.conf /
119171

config/redis.config.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'memcache.locking' => '\OC\Memcache\Redis',
66
'redis' => array(
77
'host' => getenv('REDIS_HOST'),
8-
'password' => (string) getenv('REDIS_HOST_PASSWORD'),
8+
'password' => getenv('REDIS_HOST_PASSWORD_FILE') ? trim(file_get_contents(getenv('REDIS_HOST_PASSWORD_FILE'))) : (string) getenv('REDIS_HOST_PASSWORD'),
99
),
1010
);
1111

@@ -14,4 +14,8 @@
1414
} elseif (getenv('REDIS_HOST')[0] != '/') {
1515
$CONFIG['redis']['port'] = 6379;
1616
}
17+
18+
if (getenv('REDIS_HOST_USER') !== false) {
19+
$CONFIG['redis']['user'] = (string) getenv('REDIS_HOST_USER');
20+
}
1721
}

config/reverse-proxy.config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
$CONFIG['overwriteprotocol'] = $overwriteProtocol;
1010
}
1111

12+
$overwriteCliUrl = getenv('OVERWRITECLIURL');
13+
if ($overwriteCliUrl) {
14+
$CONFIG['overwrite.cli.url'] = $overwriteCliUrl;
15+
}
16+
1217
$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
1318
if ($overwriteWebRoot) {
1419
$CONFIG['overwritewebroot'] = $overwriteWebRoot;
@@ -23,3 +28,8 @@
2328
if ($trustedProxies) {
2429
$CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
2530
}
31+
32+
$forwardedForHeaders = getenv('FORWARDED_FOR_HEADERS');
33+
if ($forwardedForHeaders) {
34+
$CONFIG['forwarded_for_headers'] = array_filter(array_map('trim', explode(' ', $forwardedForHeaders)));
35+
}

config/s3.config.php

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,40 @@
99
'class' => '\OC\Files\ObjectStore\S3',
1010
'arguments' => array(
1111
'bucket' => getenv('OBJECTSTORE_S3_BUCKET'),
12-
'key' => getenv('OBJECTSTORE_S3_KEY') ?: '',
13-
'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '',
1412
'region' => getenv('OBJECTSTORE_S3_REGION') ?: '',
1513
'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '',
1614
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
15+
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
1716
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
18-
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true,
19-
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true,
17+
'autocreate' => strtolower($autocreate) !== 'false',
18+
'use_ssl' => strtolower($use_ssl) !== 'false',
2019
// required for some non Amazon S3 implementations
2120
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
2221
// required for older protocol versions
2322
'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false'
2423
)
2524
)
2625
);
27-
}
26+
27+
if (getenv('OBJECTSTORE_S3_KEY_FILE')) {
28+
$CONFIG['objectstore']['arguments']['key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_KEY_FILE')));
29+
} elseif (getenv('OBJECTSTORE_S3_KEY')) {
30+
$CONFIG['objectstore']['arguments']['key'] = getenv('OBJECTSTORE_S3_KEY');
31+
} else {
32+
$CONFIG['objectstore']['arguments']['key'] = '';
33+
}
34+
35+
if (getenv('OBJECTSTORE_S3_SECRET_FILE')) {
36+
$CONFIG['objectstore']['arguments']['secret'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SECRET_FILE')));
37+
} elseif (getenv('OBJECTSTORE_S3_SECRET')) {
38+
$CONFIG['objectstore']['arguments']['secret'] = getenv('OBJECTSTORE_S3_SECRET');
39+
} else {
40+
$CONFIG['objectstore']['arguments']['secret'] = '';
41+
}
42+
43+
if (getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')) {
44+
$CONFIG['objectstore']['arguments']['sse_c_key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')));
45+
} elseif (getenv('OBJECTSTORE_S3_SSE_C_KEY')) {
46+
$CONFIG['objectstore']['arguments']['sse_c_key'] = getenv('OBJECTSTORE_S3_SSE_C_KEY');
47+
}
48+
}

config/smtp.config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
'mail_smtphost' => getenv('SMTP_HOST'),
66
'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25),
77
'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '',
8-
'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'),
8+
'mail_smtpauth' => getenv('SMTP_NAME') && (getenv('SMTP_PASSWORD') || getenv('SMTP_PASSWORD_FILE')),
99
'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN',
1010
'mail_smtpname' => getenv('SMTP_NAME') ?: '',
1111
'mail_from_address' => getenv('MAIL_FROM_ADDRESS'),
1212
'mail_domain' => getenv('MAIL_DOMAIN'),
1313
);
1414

15-
if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) {
15+
if (getenv('SMTP_PASSWORD_FILE')) {
1616
$CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE')));
1717
} elseif (getenv('SMTP_PASSWORD')) {
1818
$CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD');
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
$CONFIG = array (
3+
'upgrade.disable-web' => true,
4+
);

cron.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
set -eu
33

4-
exec busybox crond -f -l 0 -L /dev/stdout
4+
exec busybox crond -f -L /dev/stdout

0 commit comments

Comments
 (0)