add bridge daemon

This commit is contained in:
histausse 2021-08-06 04:55:58 +02:00
parent 673e6c9d04
commit 4557020321
Signed by: histausse
GPG key ID: 67486F107F62E9E9
4 changed files with 35 additions and 3 deletions

View file

@ -3,3 +3,8 @@
shell:
cmd: npm run build
chdir: /srv/matrix-appservice-discord
- name: Restart the discord bridge
systemd:
name: bridge_discord
state: restarted

View file

@ -51,6 +51,7 @@
cmd: npm run build
chdir: /srv/matrix-appservice-discord
creates: /srv/matrix-appservice-discord/build
notify: Restart the discord bridge
- name: Configure the bridge
template:
@ -59,6 +60,7 @@
owner: root
group: root
mode: '0660'
notify: Restart the discord bridge
- name: Generate discord-registration.yaml
shell:
@ -72,3 +74,15 @@
src: /srv/matrix-appservice-discord/discord-registration.yaml
dest: /etc/matrix-synapse/discord-registration.yaml
state: link
- name: Copy the daemon configuration
template:
src: bridge_discord.service
dest: /etc/systemd/system/bridge_discord.service
notify: Restart the discord bridge
- name: Enable the daemon
systemd:
name: bridge_discord
state: started
enabled: yes

View file

@ -0,0 +1,15 @@
{{ ansible_managed | comment }}
[Unit]
Description = Discord Bridge
[Service]
Environment=NODE_PORT=3000
Type=simple
User=root
Restart=on-failure
WorkingDirectory=/srv/matrix-appservice-discord
ExecStart=npm start
[Install]
WantedBy=multi-user.target

View file

@ -1,6 +1,4 @@
# This is a sample of the config file showing all available options.
# Where possible we have documented what they do, and all values are the
# default values.
{{ ansible_managed | comment }}
bridge:
# Domain part of the bridge, e.g. matrix.org