Skip to content

Commit

Permalink
move WAF PHP script to config/
Browse files Browse the repository at this point in the history
  • Loading branch information
codepuncher committed Nov 7, 2024
1 parent 491789a commit 688da04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
- name: Template wordfence-waf.php
ansible.builtin.template:
src: "../templates/wordfence-waf.php.j2"
dest: "{{ deploy_helper.new_release_path }}/web/wp/wordfence-waf.php"
dest: "{{ deploy_helper.new_release_path }}/config/wordfence-waf.php"
mode: "0755"
with_dict: "{{ wordpress_sites }}"
vars:
project_plugins_path: "{{ project.plugins_path | default('app/plugins') }}"
9 changes: 5 additions & 4 deletions templates/wordfence-waf.php.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
// Before removing this file, please verify the PHP ini setting `auto_prepend_file` does not point to this.

if (file_exists('{{ deploy_helper.new_release_path }}/web/app/plugins/wordfence/waf/bootstrap.php')) {
define('WFWAF_LOG_PATH', '{{ deploy_helper.new_release_path }}/../../wflogs/');
include_once '{{ deploy_helper.new_release_path }}/web/app/plugins/wordfence/waf/bootstrap.php';
if (file_exists('{{ deploy_helper.new_release_path }}/{{ project_public_path }}/{{ project_plugins_path }}/wordfence/waf/bootstrap.php')) {
if (! defined('WFWAF_LOG_PATH')) {
define('WFWAF_LOG_PATH', '{{ deploy_helper.new_release_path }}/../../wflogs/');
}
include_once '{{ deploy_helper.new_release_path }}/{{ project_public_path }}/{{ project_plugins_path }}/wordfence/waf/bootstrap.php';
}

0 comments on commit 688da04

Please sign in to comment.