Joomla: Add upload-size support, introduce php-upload.ini, refactor task numbering, update Docker Compose and override logout client_max_body_size

This commit adds dynamic upload size configuration (upload_max_filesize + post_max_size), introduces a dedicated php-upload.ini template, mounts it through Docker Compose, renumbers all task files consistently, updates main.yml flow, and overrides client_max_body_size inside the logout role.

Improves clarity, consistency, and brings Joomla in line with other IN roles.

See: https://chatgpt.com/share/6927075c-4de0-800f-bcee-b1f5193e4a99
This commit is contained in:
2025-11-26 14:59:51 +01:00
parent da8dc3b53a
commit 62d20fbb71
12 changed files with 34 additions and 10 deletions

View File

@@ -28,5 +28,8 @@ docker:
name: joomla
backup:
no_stop_required: true
upload:
# MB Integer for upload size
size_mb: 100
volumes:
data: "joomla_data"

View File

@@ -0,0 +1,5 @@
- name: "Render php-upload.ini for Joomla"
template:
src: php-upload.ini.j2
dest: "{{ JOOMLA_UPLOAD_CONFIG }}"
mode: "0644"

View File

@@ -12,19 +12,25 @@
include_role:
name: sys-stk-back-stateful
vars:
docker_compose_flush_handlers: true
docker_compose_flush_handlers: false
- name: Include PHP Config tasks
include_tasks: 01_config.yml
- name: flush docker service
meta: flush_handlers
- name: Include install routines
include_tasks: "{{ item }}"
loop:
- 01_install.yml
- 02_debug.yml
- 03_patch.yml
- 02_install.yml
- 03_debug.yml
- 04_patch.yml
- name: Include assert routines
include_tasks: "04_assert.yml"
include_tasks: "05_assert.yml"
when: MODE_ASSERT | bool
- name: Reset Admin Password
include_tasks: 05_reset_admin_password.yml
include_tasks: 06_reset_admin_password.yml

View File

@@ -1,14 +1,12 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %}
application:
build:
context: {{ docker_compose.directories.instance }}
dockerfile: Dockerfile
{{ lookup('template', 'roles/docker-container/templates/build.yml.j2') | indent(4) }}
image: "{{ JOOMLA_CUSTOM_IMAGE }}"
container_name: {{ JOOMLA_CONTAINER }}
pull_policy: never
{% include 'roles/docker-container/templates/base.yml.j2' %}
volumes:
- data:/var/www/html
- {{ JOOMLA_UPLOAD_CONFIG }}:/usr/local/etc/php/conf.d/uploads.ini:ro
ports:
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:{{ container_port }}"
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}

View File

@@ -0,0 +1,2 @@
upload_max_filesize = {{ JOOMLA_UPLOAD_MAX_FILESIZE }}
post_max_size = {{ JOOMLA_POST_MAX_SIZE }}

View File

@@ -2,6 +2,7 @@
application_id: "web-app-joomla"
database_type: "mariadb"
container_port: 80
client_max_body_size: "{{ JOOMLA_POST_MAX_SIZE }}"
# Joomla
JOOMLA_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.joomla.version') }}"
@@ -16,6 +17,12 @@ JOOMLA_CONFIG_FILE: "/var/www/html/configuration.php"
JOOMLA_INSTALLER_CLI_FILE: "/var/www/html/installation/joomla.php"
JOOMLA_CLI_FILE: "/var/www/html/cli/joomla.php"
## Upload
JOOMLA_UPLOAD_CONFIG: "{{ [ docker_compose.directories.instance, 'php-upload.ini' ] | path_join }}"
JOOMLA_UPLOAD_SIZE: "{{ applications | get_app_conf(application_id, 'docker.services.joomla.upload.size_mb') }}"
JOOMLA_UPLOAD_MAX_FILESIZE: "{{ (JOOMLA_UPLOAD_SIZE | int) }}M"
JOOMLA_POST_MAX_SIZE: "{{ ((JOOMLA_UPLOAD_SIZE | int) * 12 // 10) }}M"
# User
JOOMLA_USER_NAME: "{{ users.administrator.username }}"
JOOMLA_USER: "{{ JOOMLA_USER_NAME | capitalize }}"

View File

@@ -21,6 +21,9 @@
- name: "load docker, proxy for '{{ application_id }}'"
include_role:
name: sys-stk-full-stateless
vars:
# Necessary to overwrite parent values
client_max_body_size: "10M"
- name: Create symbolic link from .env file to repository
file: