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: >
|
||||
docker exec {{ applications.discourse.container }}
|
||||
rails runner "
|
||||
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)
|
||||
"
|
||||
docker exec {{ applications.discourse.container }} \
|
||||
git config --global --add safe.directory /var/www/discourse
|
||||
args:
|
||||
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
|
||||
|
||||
- name: "Generate new WP Discourse API key via Rails"
|
||||
- name: Generate new WP Discourse API key via Rake task
|
||||
command: >
|
||||
docker exec {{ applications.discourse.container }}
|
||||
rails runner "
|
||||
user = User.find_by_username('system')
|
||||
ak = ApiKey.create!(
|
||||
user_id: user.id,
|
||||
token: SecureRandom.hex,
|
||||
description: 'WP Discourse Integration'
|
||||
)
|
||||
puts ak.token
|
||||
"
|
||||
docker exec {{ applications.discourse.container }} bash -lc "\
|
||||
cd /var/www/discourse && \
|
||||
bin/rake api_key:create_master['WP Discourse Integration']\
|
||||
"
|
||||
args:
|
||||
chdir: "{{ docker_compose.directories.instance }}"
|
||||
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:
|
||||
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:
|
||||
administrator:
|
||||
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
|
||||
version: "latest" # Docker Image version
|
||||
setup: false # Set true in inventory file to execute the setup and initializing procedures
|
||||
@ -281,7 +281,7 @@ defaults_applications:
|
||||
'css': true,
|
||||
'iframe': true,
|
||||
'database': true,
|
||||
'oidc': true,
|
||||
'oidc': true
|
||||
}) }}{% raw %}
|
||||
|
||||
mailu:
|
||||
|
Loading…
x
Reference in New Issue
Block a user