minor fixes, add a redlight install section for rapid testing
This commit is contained in:
parent
bb10c3a4b9
commit
a707d8a746
@ -3,3 +3,9 @@ server_name: "penholder.xyz"
|
||||
postgresql_password: "strong-redacted-password"
|
||||
matrix_admin_email: "perthchat@protonmail.com"
|
||||
registration_shared_secret: "strong-redacted-password"
|
||||
|
||||
testing_user: {
|
||||
"username": "newuser2657",
|
||||
"password": "strong-redacted-password",
|
||||
"admin": True
|
||||
}
|
@ -3,3 +3,9 @@ server_name: "snowsupport.top"
|
||||
postgresql_password: "strong-redacted-password"
|
||||
matrix_admin_email: "perthchat@protonmail.com"
|
||||
registration_shared_secret: "strong-redacted-password"
|
||||
|
||||
testing_user: {
|
||||
"username": "newuser2657",
|
||||
"password": "strong-redacted-password",
|
||||
"admin": True
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
|
||||
[matrix_servers]
|
||||
matrix.penholder.xyz ansible_host=matrix.penholder.xyz ansible_ssh_user=root
|
||||
#matrix.snowsupport.top ansible_host=matrix.snowsupport.top ansible_ssh_user=root
|
||||
#matrix.penholder.xyz ansible_host=matrix.penholder.xyz ansible_ssh_user=root
|
||||
matrix.snowsupport.top ansible_host=matrix.snowsupport.top ansible_ssh_user=root
|
6
roles/handlers/main.yml
Normal file
6
roles/handlers/main.yml
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
---
|
||||
- name: Restart Synapse
|
||||
service:
|
||||
name: matrix-synapse
|
||||
state: restarted
|
3
roles/setup-redlight/tasks/main.yml
Normal file
3
roles/setup-redlight/tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_redlight.yml"
|
||||
tags: ['never', 'setup-redlight']
|
63
roles/setup-redlight/tasks/setup_redlight.yml
Normal file
63
roles/setup-redlight/tasks/setup_redlight.yml
Normal file
@ -0,0 +1,63 @@
|
||||
|
||||
- name: Ensure /opt/synapse_modules directory exists
|
||||
file:
|
||||
path: /opt/synapse_modules
|
||||
state: directory
|
||||
owner: matrix-synapse
|
||||
group: matrix-synapse
|
||||
mode: '0755'
|
||||
|
||||
- name: Add PYTHONPATH to /lib/systemd/system/matrix-synapse.service file
|
||||
lineinfile:
|
||||
path: /lib/systemd/system/matrix-synapse.service
|
||||
insertafter: "^[Service]"
|
||||
regexp: '^Environment="PYTHONPATH=.*'
|
||||
line: 'Environment="PYTHONPATH=$PYTHONPATH:/opt/synapse_modules"'
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Reload systemd daemon
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
|
||||
- name: Ensure rsync is installed
|
||||
apt:
|
||||
name: rsync
|
||||
state: present
|
||||
|
||||
- name: Clone redlight module to /tmp
|
||||
git:
|
||||
repo: https://code.glowers.club/PC-Admin/redlight.git
|
||||
dest: /tmp/redlight
|
||||
version: main
|
||||
force: yes
|
||||
|
||||
- name: Synchronize /tmp/redlight content to /opt/synapse_modules/
|
||||
synchronize:
|
||||
src: /tmp/redlight/
|
||||
dest: /opt/synapse_modules/
|
||||
delete: yes
|
||||
|
||||
- name: Change ownership of /opt/synapse_modules/
|
||||
file:
|
||||
path: /opt/synapse_modules/
|
||||
owner: matrix-synapse
|
||||
group: matrix-synapse
|
||||
recurse: yes
|
||||
state: directory
|
||||
|
||||
- name: Add modules to homeserver.yaml
|
||||
blockinfile:
|
||||
path: /etc/matrix-synapse/homeserver.yaml
|
||||
block: |
|
||||
modules:
|
||||
- module: hello_world_module.HelloWorldModule
|
||||
config: {} # No specific configuration for this module
|
||||
- module: abuse_lookup_module.AbuseLookupModule
|
||||
config: {}
|
||||
state: present
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: Restart Synapse
|
@ -1,4 +1,4 @@
|
||||
|
||||
---
|
||||
- name: Install Certbot
|
||||
apt:
|
||||
name: certbot
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
---
|
||||
- name: Install NGINX
|
||||
apt:
|
||||
name: nginx
|
||||
@ -16,3 +16,15 @@
|
||||
src: "/etc/nginx/sites-available/{{ server_name }}"
|
||||
dest: "/etc/nginx/sites-enabled/{{ server_name }}"
|
||||
state: link
|
||||
|
||||
- name: Remove default Nginx Config
|
||||
file:
|
||||
path: /etc/nginx/sites-enabled/default
|
||||
state: absent
|
||||
notify: Restart Nginx
|
||||
|
||||
- name: Remove 'matrix' Nginx Config
|
||||
file:
|
||||
path: /etc/nginx/sites-enabled/matrix
|
||||
state: absent
|
||||
notify: Restart Nginx
|
||||
|
@ -27,11 +27,11 @@
|
||||
state: absent
|
||||
notify: Restart Nginx
|
||||
|
||||
- name: Set Synapse Cache Factor
|
||||
lineinfile:
|
||||
path: /etc/default/matrix-synapse
|
||||
regexp: '^SYNAPSE_CACHE_FACTOR='
|
||||
line: 'SYNAPSE_CACHE_FACTOR=2.0'
|
||||
state: present
|
||||
create: yes
|
||||
notify: Restart Synapse
|
||||
# - name: Set Synapse Cache Factor
|
||||
# lineinfile:
|
||||
# path: /etc/default/matrix-synapse
|
||||
# regexp: '^SYNAPSE_CACHE_FACTOR='
|
||||
# line: 'SYNAPSE_CACHE_FACTOR=2.0'
|
||||
# state: present
|
||||
# create: yes
|
||||
# notify: Restart Synapse
|
||||
|
4
roles/setup-synapse/tasks/create_admin_user.yml
Normal file
4
roles/setup-synapse/tasks/create_admin_user.yml
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
- name: Create Testing User
|
||||
shell: |
|
||||
sudo -u matrix-synapse python3 /opt/venvs/matrix-synapse/lib/python3.11/site-packages/synapse/_scripts/register_new_matrix_user.py -c /etc/matrix-synapse/homeserver.yaml http://localhost:8008 --user {{ testing_user.username }} --password {{ testing_user.password }}
|
@ -3,7 +3,7 @@
|
||||
become: yes
|
||||
template:
|
||||
src: "{{ role_path }}/templates/nginx-element.conf.j2"
|
||||
dest: "/etc/nginx/sites-available/element.{{ server_name}}.conf"
|
||||
dest: "/etc/nginx/sites-available/element"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
@ -12,8 +12,8 @@
|
||||
- name: Create symbolic link for NGINX config
|
||||
become: yes
|
||||
file:
|
||||
src: /etc/nginx/sites-available/element.{{ server_name}}.conf
|
||||
dest: /etc/nginx/sites-enabled/element.{{ server_name}}.conf
|
||||
src: /etc/nginx/sites-available/element
|
||||
dest: /etc/nginx/sites-enabled/element
|
||||
state: link
|
||||
force: yes
|
||||
|
||||
|
@ -17,3 +17,7 @@
|
||||
# Install Element Web
|
||||
- import_tasks: "{{ role_path }}/tasks/element_setup.yml"
|
||||
tags: install-element
|
||||
|
||||
# Create Admin User
|
||||
- import_tasks: "{{ role_path }}/tasks/create_admin_user.yml"
|
||||
tags: create-admin-user
|
||||
|
@ -29,3 +29,5 @@ allow_public_rooms_over_federation: true
|
||||
enable_registration: false
|
||||
admin_contact: "mailto:{{ matrix_admin_email }}"
|
||||
registration_shared_secret: "{{ registration_shared_secret }}"
|
||||
caches:
|
||||
global_factor: 1.0
|
Loading…
Reference in New Issue
Block a user