Skip to content

Commit

Permalink
Merge pull request #3 from ItinerisLtd/radicle-support
Browse files Browse the repository at this point in the history
radicle-support
  • Loading branch information
codepuncher authored Nov 8, 2024
2 parents 491789a + 50d3646 commit 7327b40
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ ansible-galaxy install -r galaxy.yml --force
```yaml
# group_vars/all/deploy-hooks.yml
# Learn more on https://roots.io/trellis/docs/deploys/#hooks
deploy_after:
deploy_finalize_after:
- "{{ playbook_dir }}/vendor/roles/itinerisltd.trellis-wordfence-kinsta/tasks/main.yml"
```
## Usage
1. Setup the [role variables](#role-variables)
2. [Deploy](https://roots.io/trellis/docs/deploys/#example)
3. Tell Kinsta to add the `auto_prepend_file` variable that points to `{{ deploy_helper.current_path }}/web/wp/wordfence-waf.php`
3. Tell Kinsta to add the `auto_prepend_file` variable that points to `{{ deploy_helper.current_path }}/config/wordfence-waf.php`
1. `deploy_helper.shared_path` can differ between Trellis setups. Check for final path before asking Kinsta.
2. This is usually where the uploads are stored.
3. E.g. `auto_prepend_file = '/www/kinstauser_123/public/current/web/wp/wordfence-waf.php'`
2. This is the path to the Bedrock/Radicle configs.
3. E.g. `auto_prepend_file = '/www/kinstauser_123/public/current/config/wordfence-waf.php'`

## FAQs

Expand Down
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 7327b40

Please sign in to comment.