Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ Send a test HTTP request to the webserver backend service:

a vhost can be created by the api-cli command

We use a container with nginx and another container for the php-fpm configuration (actually availlable PHP 7.4,8.0,8.1,8.2,8.3,8.4)
We use a container with nginx and another container for the php-fpm configuration (actually availlable PHP 7.4,8.0,8.1,8.2,8.3,8.4,8.5)

Launch `create-vhost`, by setting the following parameters:
- `PhpVersion`: Set the version of php needed, can be `''(no php), 7.4,8.0,8.1,8.2,8.3,8.4`
- `PhpVersion`: Set the version of php needed, can be `''(no php), 7.4,8.0,8.1,8.2,8.3,8.4,8.5`
- `ServerNames`: set the domain name of the vhost, it must be an array
- `MemoryLimit`: This sets the maximum amount of memory that a script is allowed to allocate. use `MB`
- `AllowUrlfOpen` : This option enables the URL-aware fopen wrappers that enable accessing URL object like files. use `enabled|disabled`
Expand Down Expand Up @@ -225,7 +225,7 @@ The TCP port of the php-fpm port is unique, each virtualhost gets a nex tcp port

Launch `update-vhost`, by setting the following parameters:
- `port`: The tcp port of php-fpm, it is used as an ID for the virtualhost
- `PhpVersion`: Set the version of php needed, can be `''(no php), 7.4,8.0,8.1,8.2,8.3,8.4`
- `PhpVersion`: Set the version of php needed, can be `''(no php), 7.4,8.0,8.1,8.2,8.3,8.4,8.5`
- `ServerNames`: set the domain name of the vhost, it must be an array
- `MemoryLimit`: This sets the maximum amount of memory that a script is allowed to allocate. use `MB`
- `AllowUrlfOpen` : This option enables the URL-aware fopen wrappers that enable accessing URL object like files. use `enabled|disabled`
Expand Down
9 changes: 9 additions & 0 deletions build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ repobase="${REPOBASE:-ghcr.io/nethserver}"
# Configure the image name
reponame="webserver"

podman build \
--force-rm \
--layers \
--tag "${repobase}/php8.5-fpm" \
--build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.5.1-fpm-bookworm" \
container

images+=("${repobase}/php8.5-fpm")

podman build \
--force-rm \
--layers \
Expand Down
7 changes: 5 additions & 2 deletions container/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ ARG PHP_EXTENSIONS="\
intl \
ldap \
mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
Expand Down Expand Up @@ -106,6 +105,11 @@ RUN set -eux \
\
&& docker-php-ext-install -j"$(nproc)" $PHP_EXTENSIONS \
\
# --- Handle opcache depending on PHP version (skip for 8.5.x) ---
&& if php -r 'exit(version_compare(PHP_VERSION,"8.5.0","<")?0:1);'; then \
docker-php-ext-install -j"$(nproc)" opcache; \
fi \
\
# --- Handle IMAP depending on PHP version ---
&& if php -r 'exit(version_compare(PHP_VERSION,"8.4.0","<")?0:1);'; then \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
Expand Down Expand Up @@ -151,7 +155,6 @@ RUN set -eux \
exit 40; \
fi; \
done

# --- Custom PHP configs ---
COPY docker-php-ext-opcache.ini /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
COPY docker-php-ext-imap.ini /usr/local/etc/php/conf.d/docker-php-ext-imap.ini
2 changes: 1 addition & 1 deletion imageroot/actions/create-vhost/validate-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"format": "regex",
"pattern":"(^[0-9][.][0-9]$|^$)",
"title": "PhpVersion",
"description": "Could be 7.4 or 8.0 or 8.1 or 8.2 or 8.3 or 8.4 or ''"
"description": "Could be 7.4 or 8.0 or 8.1 or 8.2 or 8.3 or 8.4 or 8.5 or ''"
},
"MemoryLimit": {
"type": "integer",
Expand Down
2 changes: 1 addition & 1 deletion imageroot/actions/get-configuration/validate-output.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"format": "regex",
"pattern": "(^[0-9][.][0-9]$|^$)",
"title": "PhpVersion",
"description": "Could be 7.4 or 8.0 or 8.1 or 8.2 or 8.3 or 8.4 or ''"
"description": "Could be 7.4 or 8.0 or 8.1 or 8.2 or 8.3 or 8.4 or 8.5 or ''"
},
"MemoryLimit": {
"type": "integer",
Expand Down
2 changes: 1 addition & 1 deletion imageroot/actions/update-vhost/validate-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"format": "regex",
"pattern": "(^[0-9][.][0-9]$|^$)",
"title": "PhpVersion",
"description": "Could be 7.4 or 8.0 or 8.1 or 8.2 or 8.3 or 8.4 or ''"
"description": "Could be 7.4 or 8.0 or 8.1 or 8.2 or 8.3 or 8.4 or 8.5 or ''"
},
"MemoryLimit": {
"type": "integer",
Expand Down
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
"matchCurrentVersion": "/^8\\.4\\./",
"allowedVersions": "/^8\\.4\\./"
},
{
"matchDatasources": ["docker"],
"matchPackageNames": ["php"],
"matchCurrentVersion": "/^8\\.5\\./",
"allowedVersions": "/^8\\.5\\./"
},
{
"matchDatasources": ["docker"],
"matchPackageNames": ["nginx"],
Expand Down
18 changes: 18 additions & 0 deletions tests/webserver.robot
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,24 @@ Check if phpinfo.php uses PHP 8.4 with the custom settings
Should Contain ${output} <tr><td class="e">max_execution_time</td><td class="v">3600</td><td class="v">3600</td></tr>
Should Contain ${output} <tr><td class="e">max_file_uploads</td><td class="v">20000</td><td class="v">20000</td></tr>

Check if vhost 9001 can use PHP85
${rc} = Execute Command api-cli run module/${module_id}/update-vhost --data '{"PhpVersion":"8.5","ServerNames":["foo.com","john.com"],"Port":9001,"MemoryLimit":2000,"AllowUrlfOpen":"enabled","UploadMaxFilesize":2000,"PostMaxSize":2000,"MaxExecutionTime":3600,"MaxFileUploads":20000,"lets_encrypt":true,"http2https":true,"Indexes":"enabled","status":"enabled"}'
... return_rc=True return_stdout=False
Should Be Equal As Integers ${rc} 0

Check if virtualhost john.com works as expected after PHP85 update
Retry test VirtualHost john.com URL is reachable

Check if phpinfo.php uses PHP 8.5 with the custom settings
${output} = Execute Command curl -H "Host: john.com" ${backend_url}/phpinfo.php
Should Contain ${output} PHP 8.5
Should Contain ${output} <tr><td class="e">memory_limit</td><td class="v">2000M</td><td class="v">2000M</td></tr>
Should Contain ${output} <tr><td class="e">allow_url_fopen</td><td class="v">On</td><td class="v">On</td></tr>
Should Contain ${output} <tr><td class="e">upload_max_filesize</td><td class="v">2000M</td><td class="v">2000M</td></tr>
Should Contain ${output} <tr><td class="e">post_max_size</td><td class="v">2000M</td><td class="v">2000M</td></tr>
Should Contain ${output} <tr><td class="e">max_execution_time</td><td class="v">3600</td><td class="v">3600</td></tr>
Should Contain ${output} <tr><td class="e">max_file_uploads</td><td class="v">20000</td><td class="v">20000</td></tr>

Login to sftpgo as user 9001 password 9001
Put File ${CURDIR}/test-sftpgo-login.sh /tmp/test-sftpgo-login.sh
${user} = Set Variable u3@domain.test
Expand Down
1 change: 1 addition & 0 deletions ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"PHP_82":"PHP 8.2",
"PHP_83":"PHP 8.3",
"PHP_84":"PHP 8.4",
"PHP_85":"PHP 8.5",
"container_version_will_be_installed":"Changing PHP version will install a new PHP container: configuration might take a while",
"select_php_version":"Version of PHP",
"AllowUrlfOpen":"URL-aware fopen wrappers",
Expand Down
3 changes: 3 additions & 0 deletions ui/src/views/VirtualHosts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@
<cv-dropdown-item value="8.4">{{
$t("virtualhosts.PHP_84")
}}</cv-dropdown-item>
<cv-dropdown-item value="8.5">{{
$t("virtualhosts.PHP_85")
}}</cv-dropdown-item>
</cv-dropdown>
<!-- advanced options -->
<cv-accordion ref="accordion">
Expand Down
Loading