Files
computer-playbook/roles/web-app-wordpress/vars/main.yml
kevinveenbirkenbachandClaude Opus 5.5 b56b0551aa fix(web-app-wordpress): size PHP's memory_limit from the container, not the upload
upload.ini set memory_limit to WORDPRESS_MAX_UPLOAD_SIZE, the same 256M
as upload_max_filesize and post_max_size, so the memory a request may
use depended on how large an upload may be. It is now a quarter of the
service's mem_limit through lookup('service_memory_mb'), which renders
384M beside the 1.5g container. The upload sizes keep their variable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 01:40:20 +02:00

47 lines
3.3 KiB
YAML

---
application_id: "web-app-wordpress"
entity_name: "{{ application_id | get_entity_name }}"
WORDPRESS_URL: "{{ lookup('tls', application_id, 'url.base') }}"
WORDPRESS_TITLE: "{{ lookup('config', application_id, 'services.' ~ entity_name ~ '.title') }}"
WORDPRESS_MAX_UPLOAD_SIZE: "{{ lookup('config', application_id, 'services.' ~ entity_name ~ '.max_upload_size') }}"
WORDPRESS_PHP_MEMORY_LIMIT: "{{ lookup('service_memory_mb', application_id, entity_name, 0.25) }}M"
WORDPRESS_DOCKER_HTML_PATH: "{{ lookup('volume', 'web-app-wordpress', 'data').target }}"
WORDPRESS_DOCKER_CONF_PATH: "{{ WORDPRESS_CONFIG_PATH }}"
WORDPRESS_VERSION: "{{ lookup('config', application_id, 'services.' ~ entity_name ~ '.version') }}"
WORDPRESS_IMAGE: "{{ lookup('config', application_id, 'services.' ~ entity_name ~ '.image') }}"
WORDPRESS_CONTAINER: "{{ lookup('config', application_id, 'services.' ~ entity_name ~ '.name') }}"
WORDPRESS_CONTAINER_ADDRESS: "{{ lookup('container_address', application_id, entity_name) }}"
WORDPRESS_DISCOURSE_CONTAINER_ADDRESS: "{{ lookup('config', 'web-app-discourse', 'services.discourse.name') }}"
WORDPRESS_DOMAINS: "{{ lookup('domains', application_id) }}"
WORDPRESS_PLUGINS: "{{ lookup('config', application_id, 'addons') | dict2items | selectattr('value.mechanism', 'equalto', 'plugin') | list }}"
WORDPRESS_MU_PLUGINS: "{{ lookup('config', application_id, 'addons') | dict2items | selectattr('value.mechanism', 'equalto', 'mu_plugin') | list }}"
WORDPRESS_ADDONS_INSTALLED: "{{ (WORDPRESS_PLUGINS + WORDPRESS_MU_PLUGINS) | map(attribute='key') | list }}"
WORDPRESS_ADDONS_REQUIRED: "{{ lookup('config', application_id, 'addons') | dict2items | selectattr('value.required', 'defined') | selectattr('value.required') |
map(attribute='key') | list }}"
WORDPRESS_USER: "www-data"
WORDPRESS_LITELLM_ENV_ID: "{{ lookup('config', application_id, 'addons.ai-engine.config.environment.id') }}"
WORDPRESS_MCP_ENABLED: "{{ lookup('config', application_id, 'mcp.enabled') }}"
WORDPRESS_MCP_SERVICE_KEY: "{{ lookup('config', application_id, 'mcp.endpoint.service_key') }}"
WORDPRESS_MCP_ACCOUNT: "{{ lookup('users', 'mcp-web-app-wordpress') }}"
WORDPRESS_MCP_USERNAME: "{{ WORDPRESS_MCP_ACCOUNT.username }}"
WORDPRESS_MCP_EMAIL: "{{ WORDPRESS_MCP_ACCOUNT.email }}"
WORDPRESS_MCP_ROLE: "subscriber"
WORDPRESS_MCP_APP_PASSWORD_NAME: "mcp"
WORDPRESS_MCP_USER_PASSWORD: "{{ WORDPRESS_MCP_ACCOUNT.password }}"
WORDPRESS_MSMTP_SRC: "{{ lookup('path_absolute', 'roles/sys-svc-mail-msmtp/templates/msmtprc.conf.j2') }}"
WORDPRESS_MSMTP_ABS: "{{ [ lookup('container', application_id, 'directories.config'), 'msmtprc.conf'] | path_join }}"
WORDPRESS_CONFIG_FILE: "wp-config.php"
WORDPRESS_CONFIG_PATH: "{{ [WORDPRESS_DOCKER_HTML_PATH, WORDPRESS_CONFIG_FILE] | path_join }}"
WORDPRESS_CONFIG_UPLD_REL: "config/upload.ini"
WORDPRESS_CONFIG_UPLD_ABS: "{{ [lookup('container', application_id, 'directories.instance'), WORDPRESS_CONFIG_UPLD_REL ] | path_join }}"
WORDPRESS_MU_PLUGINS_DIR: "{{ [WORDPRESS_DOCKER_HTML_PATH, 'wp-content/mu-plugins'] | path_join }}"
WORDPRESS_PERMALINK_STRUCTURE: "/%postname%/"
WORDPRESS_ADMIN_EMAIL: "{{ lookup('config', application_id, 'users.administrator.email') }}"
WORDPRESS_ADMIN_USER: "{{ lookup('config', application_id, 'users.administrator.username') }}"
WORDPRESS_ADMIN_PASSWORD: "{{ lookup('config', application_id, 'secrets.credentials.administrator_password') }}"