Files
CoM-ghost_protocol/phantom/playbooks/matrix/main.yml
T
n0mad1k 7484a0e034 Phantom v2: dual-mode architecture, security hardening, deployment management
- Dual-mode operation: standalone + c2itall integrated (env var detection)
- SSH keys moved to ~/.ssh/c2deploy_ph-{id} with per-deployment known_hosts
- Ansible output streaming with filtered console + full log capture
- Deployment management menu: discover, SSH, teardown existing deployments
- Cert setup script (setup-cert.sh) deployed to servers for post-DNS LE certs
- Matrix hardening: unique secrets, SSRF protection, rate limits, nginx security headers
- Base hardening: fail2ban systemd backend (Debian 12), SSH limits, nginx jails
- Add-matrix-user helper script deployed to all Matrix servers
- .env support for standalone credential storage
- Config key rename: deploy_id → deployment_id (with backward compat)
- Provider cleanup playbooks for teardown
- Test suite with 50 tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:45:24 -04:00

51 lines
1.4 KiB
YAML

---
# Matrix (Synapse) + Element Web deployment
# Installs Synapse homeserver with optional Element Web frontend
- name: Deploy Matrix Homeserver
hosts: all
become: true
vars:
matrix_domain: "{{ domain }}"
matrix_server_name: "{{ matrix_server_name | default(domain) }}"
matrix_admin: "{{ matrix_admin_user | default('admin') }}"
matrix_admin_pass: "{{ matrix_admin_password }}"
matrix_registration_enabled: "{{ matrix_registration | default(false) }}"
element_enabled: "{{ matrix_element_web | default(true) }}"
matrix_signing_key: "{{ matrix_signing_key }}"
target_host: "{{ target_host | default('localhost') }}"
tasks:
- name: Include Synapse installation tasks
include_tasks: tasks/synapse.yml
- name: Include Element Web tasks
include_tasks: tasks/element.yml
when: element_enabled | bool
- name: Include nginx reverse proxy tasks
include_tasks: tasks/nginx.yml
- name: Create Tools directory
file:
path: /root/Tools
state: directory
mode: "0755"
- name: Deploy Matrix user creation script
template:
src: ../common/templates/add-matrix-user.sh.j2
dest: /root/Tools/add-matrix-user.sh
mode: "0700"
handlers:
- name: restart synapse
service:
name: matrix-synapse
state: restarted
- name: reload nginx
service:
name: nginx
state: reloaded