mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-04-28 18:30:24 +02:00
Optimized wordpress discourse implementation
This commit is contained in:
parent
965af4fbaa
commit
c26167ce61
@ -1,37 +1,38 @@
|
|||||||
- name: "Revoke old WP Discourse API keys via Rails"
|
---
|
||||||
|
- name: Add /var/www/discourse to Git safe.directory
|
||||||
command: >
|
command: >
|
||||||
docker exec {{ applications.discourse.container }}
|
docker exec {{ applications.discourse.container }} \
|
||||||
rails runner "
|
git config --global --add safe.directory /var/www/discourse
|
||||||
user = User.find_by_username('system')
|
|
||||||
ApiKey
|
|
||||||
.where(
|
|
||||||
user_id: user.id,
|
|
||||||
description: 'WP Discourse Integration',
|
|
||||||
revoked_at: nil
|
|
||||||
)
|
|
||||||
.update_all(revoked_at: Time.current)
|
|
||||||
"
|
|
||||||
args:
|
args:
|
||||||
chdir: "{{ docker_compose.directories.instance }}"
|
chdir: "{{ docker_compose.directories.instance }}"
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Revoke old WP Discourse API keys via Rails
|
||||||
|
command: >
|
||||||
|
docker exec {{ applications.discourse.container }} bash -lc "\
|
||||||
|
cd /var/www/discourse && \
|
||||||
|
script/rails runner \"\
|
||||||
|
ApiKey.where(\
|
||||||
|
user_id: User.find_by_username('system').id,\
|
||||||
|
description: 'WP Discourse Integration',\
|
||||||
|
revoked_at: nil\
|
||||||
|
).update_all(revoked_at: Time.current)\
|
||||||
|
\""
|
||||||
|
args:
|
||||||
|
chdir: "{{ docker_compose.directories.instance }}"
|
||||||
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: "Generate new WP Discourse API key via Rails"
|
- name: Generate new WP Discourse API key via Rake task
|
||||||
command: >
|
command: >
|
||||||
docker exec {{ applications.discourse.container }}
|
docker exec {{ applications.discourse.container }} bash -lc "\
|
||||||
rails runner "
|
cd /var/www/discourse && \
|
||||||
user = User.find_by_username('system')
|
bin/rake api_key:create_master['WP Discourse Integration']\
|
||||||
ak = ApiKey.create!(
|
"
|
||||||
user_id: user.id,
|
|
||||||
token: SecureRandom.hex,
|
|
||||||
description: 'WP Discourse Integration'
|
|
||||||
)
|
|
||||||
puts ak.token
|
|
||||||
"
|
|
||||||
args:
|
args:
|
||||||
chdir: "{{ docker_compose.directories.instance }}"
|
chdir: "{{ docker_compose.directories.instance }}"
|
||||||
register: discourse_generated_api_key
|
register: discourse_generated_api_key
|
||||||
failed_when: false
|
|
||||||
|
|
||||||
- name: "Set fact for new WP Discourse API key"
|
- name: Store the new WP Discourse API key in a fact
|
||||||
set_fact:
|
set_fact:
|
||||||
vault_discourse_api_key: "{{ discourse_generated_api_key.stdout_lines[0] }}"
|
vault_discourse_api_key: "{{ discourse_generated_api_key.stdout | trim }}"
|
||||||
|
@ -272,7 +272,7 @@ defaults_applications:
|
|||||||
users:
|
users:
|
||||||
administrator:
|
administrator:
|
||||||
username: "{{users.administrator.username}}" # Listmonk administrator account username
|
username: "{{users.administrator.username}}" # Listmonk administrator account username
|
||||||
password: "{{users.administrator.password}}" # Password to initialized Listmonk administrator with
|
# password: "{{users.administrator.password}}" # Password to initialized Listmonk administrator with
|
||||||
public_api_activated: False # Security hole. Can be used for spaming
|
public_api_activated: False # Security hole. Can be used for spaming
|
||||||
version: "latest" # Docker Image version
|
version: "latest" # Docker Image version
|
||||||
setup: false # Set true in inventory file to execute the setup and initializing procedures
|
setup: false # Set true in inventory file to execute the setup and initializing procedures
|
||||||
@ -281,7 +281,7 @@ defaults_applications:
|
|||||||
'css': true,
|
'css': true,
|
||||||
'iframe': true,
|
'iframe': true,
|
||||||
'database': true,
|
'database': true,
|
||||||
'oidc': true,
|
'oidc': true
|
||||||
}) }}{% raw %}
|
}) }}{% raw %}
|
||||||
|
|
||||||
mailu:
|
mailu:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user