Skip to content

Commit ceb2893

Browse files
author
GitHub Workflow
committed
Runs update.sh
1 parent 35e9902 commit ceb2893

39 files changed

Lines changed: 1808 additions & 1 deletion

27/apache/Dockerfile

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
2+
FROM php:8.2-apache-bullseye
3+
4+
# entrypoint.sh and cron.sh dependencies
5+
RUN set -ex; \
6+
\
7+
apt-get update; \
8+
apt-get install -y --no-install-recommends \
9+
busybox-static \
10+
bzip2 \
11+
libldap-common \
12+
libmagickcore-6.q16-6-extra \
13+
rsync \
14+
; \
15+
rm -rf /var/lib/apt/lists/*; \
16+
\
17+
mkdir -p /var/spool/cron/crontabs; \
18+
echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data
19+
20+
# install the PHP extensions we need
21+
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
22+
ENV PHP_MEMORY_LIMIT 512M
23+
ENV PHP_UPLOAD_LIMIT 512M
24+
RUN set -ex; \
25+
\
26+
savedAptMark="$(apt-mark showmanual)"; \
27+
\
28+
apt-get update; \
29+
apt-get install -y --no-install-recommends \
30+
libcurl4-openssl-dev \
31+
libevent-dev \
32+
libfreetype6-dev \
33+
libgmp-dev \
34+
libicu-dev \
35+
libjpeg-dev \
36+
libldap2-dev \
37+
libmagickwand-dev \
38+
libmcrypt-dev \
39+
libmemcached-dev \
40+
libpng-dev \
41+
libpq-dev \
42+
libwebp-dev \
43+
libxml2-dev \
44+
libzip-dev \
45+
; \
46+
\
47+
debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
48+
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \
49+
docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \
50+
docker-php-ext-install -j "$(nproc)" \
51+
bcmath \
52+
exif \
53+
gd \
54+
gmp \
55+
intl \
56+
ldap \
57+
opcache \
58+
pcntl \
59+
pdo_mysql \
60+
pdo_pgsql \
61+
sysvsem \
62+
zip \
63+
; \
64+
\
65+
# pecl will claim success even if one install fails, so we need to perform each install separately
66+
pecl install APCu-5.1.22; \
67+
pecl install imagick-3.7.0; \
68+
pecl install memcached-3.2.0; \
69+
pecl install redis-5.3.7; \
70+
\
71+
docker-php-ext-enable \
72+
apcu \
73+
imagick \
74+
memcached \
75+
redis \
76+
; \
77+
rm -r /tmp/pear; \
78+
\
79+
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
80+
apt-mark auto '.*' > /dev/null; \
81+
apt-mark manual $savedAptMark; \
82+
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
83+
| awk '/=>/ { print $3 }' \
84+
| sort -u \
85+
| xargs -r dpkg-query -S \
86+
| cut -d: -f1 \
87+
| sort -u \
88+
| xargs -rt apt-mark manual; \
89+
\
90+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
91+
rm -rf /var/lib/apt/lists/*
92+
93+
# set recommended PHP.ini settings
94+
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
95+
RUN { \
96+
echo 'opcache.enable=1'; \
97+
echo 'opcache.interned_strings_buffer=32'; \
98+
echo 'opcache.max_accelerated_files=10000'; \
99+
echo 'opcache.memory_consumption=128'; \
100+
echo 'opcache.save_comments=1'; \
101+
echo 'opcache.revalidate_freq=60'; \
102+
echo 'opcache.jit=1255'; \
103+
echo 'opcache.jit_buffer_size=128M'; \
104+
} > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini"; \
105+
\
106+
echo 'apc.enable_cli=1' >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"; \
107+
\
108+
{ \
109+
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
110+
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
111+
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
112+
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
113+
\
114+
mkdir /var/www/data; \
115+
chown -R www-data:root /var/www; \
116+
chmod -R g=u /var/www
117+
118+
VOLUME /var/www/html
119+
120+
RUN a2enmod headers rewrite remoteip ;\
121+
{\
122+
echo RemoteIPHeader X-Real-IP ;\
123+
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
124+
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
125+
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
126+
} > /etc/apache2/conf-available/remoteip.conf;\
127+
a2enconf remoteip
128+
129+
ENV NEXTCLOUD_VERSION 27.0.0
130+
131+
RUN set -ex; \
132+
fetchDeps=" \
133+
gnupg \
134+
dirmngr \
135+
"; \
136+
apt-get update; \
137+
apt-get install -y --no-install-recommends $fetchDeps; \
138+
\
139+
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-27.0.0.tar.bz2"; \
140+
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-27.0.0.tar.bz2.asc"; \
141+
export GNUPGHOME="$(mktemp -d)"; \
142+
# gpg key from https://nextcloud.com/nextcloud.asc
143+
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
144+
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
145+
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
146+
gpgconf --kill all; \
147+
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
148+
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
149+
mkdir -p /usr/src/nextcloud/data; \
150+
mkdir -p /usr/src/nextcloud/custom_apps; \
151+
chmod +x /usr/src/nextcloud/occ; \
152+
\
153+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
154+
rm -rf /var/lib/apt/lists/*
155+
156+
COPY *.sh upgrade.exclude /
157+
COPY config/* /usr/src/nextcloud/config/
158+
159+
ENTRYPOINT ["/entrypoint.sh"]
160+
CMD ["apache2-foreground"]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
$CONFIG = array (
3+
'htaccess.RewriteBase' => '/',
4+
);

27/apache/config/apcu.config.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
$CONFIG = array (
3+
'memcache.local' => '\OC\Memcache\APCu',
4+
);

27/apache/config/apps.config.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
$CONFIG = array (
3+
'apps_paths' => array (
4+
0 => array (
5+
'path' => OC::$SERVERROOT.'/apps',
6+
'url' => '/apps',
7+
'writable' => false,
8+
),
9+
1 => array (
10+
'path' => OC::$SERVERROOT.'/custom_apps',
11+
'url' => '/custom_apps',
12+
'writable' => true,
13+
),
14+
),
15+
);

27/apache/config/autoconfig.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
$autoconfig_enabled = false;
4+
5+
if (getenv('SQLITE_DATABASE')) {
6+
$AUTOCONFIG['dbtype'] = 'sqlite';
7+
$AUTOCONFIG['dbname'] = getenv('SQLITE_DATABASE');
8+
$autoconfig_enabled = true;
9+
} elseif (getenv('MYSQL_DATABASE_FILE') && getenv('MYSQL_USER_FILE') && getenv('MYSQL_PASSWORD_FILE') && getenv('MYSQL_HOST')) {
10+
$AUTOCONFIG['dbtype'] = 'mysql';
11+
$AUTOCONFIG['dbname'] = trim(file_get_contents(getenv('MYSQL_DATABASE_FILE')));
12+
$AUTOCONFIG['dbuser'] = trim(file_get_contents(getenv('MYSQL_USER_FILE')));
13+
$AUTOCONFIG['dbpass'] = trim(file_get_contents(getenv('MYSQL_PASSWORD_FILE')));
14+
$AUTOCONFIG['dbhost'] = getenv('MYSQL_HOST');
15+
$autoconfig_enabled = true;
16+
} elseif (getenv('MYSQL_DATABASE') && getenv('MYSQL_USER') && getenv('MYSQL_PASSWORD') && getenv('MYSQL_HOST')) {
17+
$AUTOCONFIG['dbtype'] = 'mysql';
18+
$AUTOCONFIG['dbname'] = getenv('MYSQL_DATABASE');
19+
$AUTOCONFIG['dbuser'] = getenv('MYSQL_USER');
20+
$AUTOCONFIG['dbpass'] = getenv('MYSQL_PASSWORD');
21+
$AUTOCONFIG['dbhost'] = getenv('MYSQL_HOST');
22+
$autoconfig_enabled = true;
23+
} elseif (getenv('POSTGRES_DB_FILE') && getenv('POSTGRES_USER_FILE') && getenv('POSTGRES_PASSWORD_FILE') && getenv('POSTGRES_HOST')) {
24+
$AUTOCONFIG['dbtype'] = 'pgsql';
25+
$AUTOCONFIG['dbname'] = trim(file_get_contents(getenv('POSTGRES_DB_FILE')));
26+
$AUTOCONFIG['dbuser'] = trim(file_get_contents(getenv('POSTGRES_USER_FILE')));
27+
$AUTOCONFIG['dbpass'] = trim(file_get_contents(getenv('POSTGRES_PASSWORD_FILE')));
28+
$AUTOCONFIG['dbhost'] = getenv('POSTGRES_HOST');
29+
$autoconfig_enabled = true;
30+
} elseif (getenv('POSTGRES_DB') && getenv('POSTGRES_USER') && getenv('POSTGRES_PASSWORD') && getenv('POSTGRES_HOST')) {
31+
$AUTOCONFIG['dbtype'] = 'pgsql';
32+
$AUTOCONFIG['dbname'] = getenv('POSTGRES_DB');
33+
$AUTOCONFIG['dbuser'] = getenv('POSTGRES_USER');
34+
$AUTOCONFIG['dbpass'] = getenv('POSTGRES_PASSWORD');
35+
$AUTOCONFIG['dbhost'] = getenv('POSTGRES_HOST');
36+
$autoconfig_enabled = true;
37+
}
38+
39+
if ($autoconfig_enabled) {
40+
$AUTOCONFIG['directory'] = getenv('NEXTCLOUD_DATA_DIR') ?: '/var/www/html/data';
41+
}

27/apache/config/redis.config.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
if (getenv('REDIS_HOST')) {
3+
$CONFIG = array(
4+
'memcache.distributed' => '\OC\Memcache\Redis',
5+
'memcache.locking' => '\OC\Memcache\Redis',
6+
'redis' => array(
7+
'host' => getenv('REDIS_HOST'),
8+
'password' => (string) getenv('REDIS_HOST_PASSWORD'),
9+
),
10+
);
11+
12+
if (getenv('REDIS_HOST_PORT') !== false) {
13+
$CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT');
14+
} elseif (getenv('REDIS_HOST')[0] != '/') {
15+
$CONFIG['redis']['port'] = 6379;
16+
}
17+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
$overwriteHost = getenv('OVERWRITEHOST');
3+
if ($overwriteHost) {
4+
$CONFIG['overwritehost'] = $overwriteHost;
5+
}
6+
7+
$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
8+
if ($overwriteProtocol) {
9+
$CONFIG['overwriteprotocol'] = $overwriteProtocol;
10+
}
11+
12+
$overwriteCliUrl = getenv('OVERWRITECLIURL');
13+
if ($overwriteCliUrl) {
14+
$CONFIG['overwrite.cli.url'] = $overwriteCliUrl;
15+
}
16+
17+
$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
18+
if ($overwriteWebRoot) {
19+
$CONFIG['overwritewebroot'] = $overwriteWebRoot;
20+
}
21+
22+
$overwriteCondAddr = getenv('OVERWRITECONDADDR');
23+
if ($overwriteCondAddr) {
24+
$CONFIG['overwritecondaddr'] = $overwriteCondAddr;
25+
}
26+
27+
$trustedProxies = getenv('TRUSTED_PROXIES');
28+
if ($trustedProxies) {
29+
$CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
30+
}

27/apache/config/s3.config.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
if (getenv('OBJECTSTORE_S3_BUCKET')) {
3+
$use_ssl = getenv('OBJECTSTORE_S3_SSL');
4+
$use_path = getenv('OBJECTSTORE_S3_USEPATH_STYLE');
5+
$use_legacyauth = getenv('OBJECTSTORE_S3_LEGACYAUTH');
6+
$autocreate = getenv('OBJECTSTORE_S3_AUTOCREATE');
7+
$CONFIG = array(
8+
'objectstore' => array(
9+
'class' => '\OC\Files\ObjectStore\S3',
10+
'arguments' => array(
11+
'bucket' => getenv('OBJECTSTORE_S3_BUCKET'),
12+
'region' => getenv('OBJECTSTORE_S3_REGION') ?: '',
13+
'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '',
14+
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
15+
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
16+
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true,
17+
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true,
18+
// required for some non Amazon S3 implementations
19+
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
20+
// required for older protocol versions
21+
'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false'
22+
)
23+
)
24+
);
25+
26+
if (getenv('OBJECTSTORE_S3_KEY_FILE') && file_exists(getenv('OBJECTSTORE_S3_KEY_FILE'))) {
27+
$CONFIG['objectstore']['arguments']['key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_KEY_FILE')));
28+
} elseif (getenv('OBJECTSTORE_S3_KEY')) {
29+
$CONFIG['objectstore']['arguments']['key'] = getenv('OBJECTSTORE_S3_KEY');
30+
} else {
31+
$CONFIG['objectstore']['arguments']['key'] = '';
32+
}
33+
34+
if (getenv('OBJECTSTORE_S3_SECRET_FILE') && file_exists(getenv('OBJECTSTORE_S3_SECRET_FILE'))) {
35+
$CONFIG['objectstore']['arguments']['secret'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SECRET_FILE')));
36+
} elseif (getenv('OBJECTSTORE_S3_SECRET')) {
37+
$CONFIG['objectstore']['arguments']['secret'] = getenv('OBJECTSTORE_S3_SECRET');
38+
} else {
39+
$CONFIG['objectstore']['arguments']['secret'] = '';
40+
}
41+
}

27/apache/config/smtp.config.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
if (getenv('SMTP_HOST') && getenv('MAIL_FROM_ADDRESS') && getenv('MAIL_DOMAIN')) {
3+
$CONFIG = array (
4+
'mail_smtpmode' => 'smtp',
5+
'mail_smtphost' => getenv('SMTP_HOST'),
6+
'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25),
7+
'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '',
8+
'mail_smtpauth' => getenv('SMTP_NAME') && (getenv('SMTP_PASSWORD') || (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE')))),
9+
'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN',
10+
'mail_smtpname' => getenv('SMTP_NAME') ?: '',
11+
'mail_from_address' => getenv('MAIL_FROM_ADDRESS'),
12+
'mail_domain' => getenv('MAIL_DOMAIN'),
13+
);
14+
15+
if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) {
16+
$CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE')));
17+
} elseif (getenv('SMTP_PASSWORD')) {
18+
$CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD');
19+
} else {
20+
$CONFIG['mail_smtppassword'] = '';
21+
}
22+
}

27/apache/config/swift.config.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
if (getenv('OBJECTSTORE_SWIFT_URL')) {
3+
$autocreate = getenv('OBJECTSTORE_SWIFT_AUTOCREATE');
4+
$CONFIG = array(
5+
'objectstore' => [
6+
'class' => 'OC\\Files\\ObjectStore\\Swift',
7+
'arguments' => [
8+
'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false',
9+
'user' => [
10+
'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'),
11+
'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'),
12+
'domain' => [
13+
'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default',
14+
],
15+
],
16+
'scope' => [
17+
'project' => [
18+
'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'),
19+
'domain' => [
20+
'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default',
21+
],
22+
],
23+
],
24+
'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift',
25+
'region' => getenv('OBJECTSTORE_SWIFT_REGION'),
26+
'url' => getenv('OBJECTSTORE_SWIFT_URL'),
27+
'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'),
28+
]
29+
]
30+
);
31+
}

0 commit comments

Comments
 (0)