mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 15:28:12 +02:00
Remove non-functional Joomla LDAP integration
- Disabled LDAP feature flag (set to false by default, with comment) - Removed ldapautocreate plugin (PHP + XML) - Deleted LDAP helper tasks (01_ldap_files.yml, 05_ldap.yml, 07_diagnose.yml) - Deleted LDAP CLI helper scripts (cli.php, diagnose.php, plugins.php, auth-trace.php) - Removed LDAP configuration variables from vars/main.yml - Removed LDAP environment variables from env.j2 - Removed LDAP-specific mounts from docker-compose.yml.j2 - Dropped php-ldap installation from Dockerfile - Renamed task files for consistent numbering (02->01_install, 03->02_debug, 04->03_patch, 06->04_assert) Reason: LDAP integration was removed because it was not functional. Conversation: https://chatgpt.com/share/68b09373-7aa8-800f-8f2c-11e27123bad1
This commit is contained in:
45
roles/web-app-joomla/tasks/02_debug.yml
Normal file
45
roles/web-app-joomla/tasks/02_debug.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
- name: "Toggle Joomla debug flags safely (configuration.php)"
|
||||
command:
|
||||
argv:
|
||||
- docker
|
||||
- exec
|
||||
- -e
|
||||
- "J_MODE_DEBUG={{ MODE_DEBUG | default(false) | bool | ternary('1','0') }}"
|
||||
- -e
|
||||
- "J_ERR_LEVEL={{ MODE_DEBUG | default(false) | bool | ternary('maximum','default') }}"
|
||||
- "{{ JOOMLA_CONTAINER }}"
|
||||
- php
|
||||
- -r
|
||||
- |
|
||||
$f = '{{ JOOMLA_CONFIG_FILE }}';
|
||||
if (!file_exists($f)) { fwrite(STDERR, "configuration.php missing\n"); exit(1); }
|
||||
$c = file_get_contents($f);
|
||||
$changed = 0;
|
||||
|
||||
$debug = getenv('J_MODE_DEBUG') === '1';
|
||||
$err = getenv('J_ERR_LEVEL') ?: 'default';
|
||||
|
||||
// Clean up previously broken lines
|
||||
$c = preg_replace('/^\s*public\s+1\s*=.*?;$/m', '', $c, -1, $nBad1); $changed += $nBad1;
|
||||
$c = preg_replace('/^\s*public\s*=\s*maximum;$/m', '', $c, -1, $nBad2); $changed += $nBad2;
|
||||
|
||||
// Ensure: public $debug = true|false;
|
||||
$lineDebug = "public \$debug = " . ($debug ? 'true' : 'false') . ";";
|
||||
if (preg_match('/public\s*\$debug\s*=\s*[^;]*;/', $c)) {
|
||||
$c = preg_replace('/public\s*\$debug\s*=\s*[^;]*;/', $lineDebug, $c, 1, $n); $changed += $n;
|
||||
} else {
|
||||
$c = preg_replace("/\n\}\s*$/", "\n\t".$lineDebug."\n}\n", $c, 1, $n); $changed += $n;
|
||||
}
|
||||
|
||||
// Ensure: public $error_reporting = 'maximum'|'default';
|
||||
$lineErr = "public \$error_reporting = '" . str_replace("'", "\\'", $err) . "';";
|
||||
if (preg_match('/public\s*\$error_reporting\s*=\s*[^;]*;/', $c)) {
|
||||
$c = preg_replace('/public\s*\$error_reporting\s*=\s*[^;]*;/', $lineErr, $c, 1, $n); $changed += $n;
|
||||
} else {
|
||||
$c = preg_replace("/\n\}\s*$/", "\n\t".$lineErr."\n}\n", $c, 1, $n); $changed += $n;
|
||||
}
|
||||
|
||||
if ($changed) { file_put_contents($f, $c); echo "changed"; } else { echo "ok"; }
|
||||
register: j_cfg_debug
|
||||
changed_when: (j_cfg_debug.stdout | trim) == "changed"
|
||||
failed_when: j_cfg_debug.rc != 0
|
Reference in New Issue
Block a user