diff --git a/group_vars/chat.yaml b/group_vars/chat.yaml index 8caf096..08a3480 100644 --- a/group_vars/chat.yaml +++ b/group_vars/chat.yaml @@ -1,9 +1,11 @@ --- + root_access: - blackdragon - ak - foobar - polyfloyd + nodejs_version: 22.x thelounge_version: "4.4.3" thelounge_ldap_url: ldaps://ldap.bitlair.nl @@ -31,4 +33,4 @@ nginx_sites: } group_nft_input: - - "tcp dport { http, https } accept # Allow web-traffic from world" \ No newline at end of file + - "tcp dport { http, https } accept # Allow web-traffic from world" diff --git a/roles/chat/defaults/main.yaml b/roles/chat/defaults/main.yaml index e69de29..4e52991 100644 --- a/roles/chat/defaults/main.yaml +++ b/roles/chat/defaults/main.yaml @@ -0,0 +1,5 @@ +--- + +chat_user: thelounge +chat_group: thelounge +chat_configdir: "/etc/thelounge" diff --git a/roles/chat/handlers/main.yaml b/roles/chat/handlers/main.yaml index 82e78eb..e03963e 100644 --- a/roles/chat/handlers/main.yaml +++ b/roles/chat/handlers/main.yaml @@ -1,4 +1,5 @@ --- + - name: Reload systemd ansible.builtin.systemd: daemon_reload: yes diff --git a/roles/chat/tasks/main.yaml b/roles/chat/tasks/main.yaml index 097eb1b..7b74982 100644 --- a/roles/chat/tasks/main.yaml +++ b/roles/chat/tasks/main.yaml @@ -19,12 +19,12 @@ - name: Ensure directories are present ansible.builtin.file: path: "{{ item.path }}" - owner: "thelounge" - group: "thelounge" + owner: "{{ chat_user }}" + group: "{{ chat_group }}" state: "{{ item.state | default('directory') }}" mode: "{{ item.mode | default('0770') }}" with_items: - - { path: "/etc/thelounge" } + - { path: "{{ chat_configdir }}" } - { path: "/var/local/thelounge/users" } - { path: "/var/local/thelounge/storage" } notify: @@ -34,8 +34,8 @@ ansible.builtin.template: src: "{{ item.src }}" dest: "{{ item.dest }}" - owner: "{{ item.owner | default( 'thelounge' ) }}" - group: "{{ item.group | default( 'thelounge' ) }}" + owner: "{{ item.owner | default( chat_user ) }}" + group: "{{ item.group | default( chat_group ) }}" mode: "{{ item.mode | default('0640') }}" with_items: - { src: "nodesource.list", dest: "/etc/apt/sources.list.d/nodesource.list", owner: root, group: root } @@ -101,8 +101,8 @@ ansible.builtin.template: src: "{{ item.src }}" dest: "{{ item.dest }}" - owner: "{{ item.owner | default( 'thelounge' ) }}" - group: "{{ item.group | default( 'thelounge' ) }}" + owner: "{{ item.owner | default( chat_user ) }}" + group: "{{ item.group | default( chat_group ) }}" mode: "{{ item.mode | default('0640') }}" validate: "{{ item.validate | default([]) }}" with_items: diff --git a/roles/chat/templates/config.js.j2 b/roles/chat/templates/config.js.j2 index c1b4a0c..ba12695 100644 --- a/roles/chat/templates/config.js.j2 +++ b/roles/chat/templates/config.js.j2 @@ -3,7 +3,7 @@ module.exports = { public: false, port: 9000, - bind: "0.0.0.0", + bind: "127.0.0.1", reverseProxy: true, lockNetwork: true, maxHistory: 10000, diff --git a/roles/chat/templates/thelounge.service b/roles/chat/templates/thelounge.service index 3fc7396..26a11ea 100644 --- a/roles/chat/templates/thelounge.service +++ b/roles/chat/templates/thelounge.service @@ -4,8 +4,8 @@ After=network-online.target Wants=network-online.target [Service] -User=thelounge -Group=thelounge +User={{ chat_user }} +Group={{ chat_group }} Type=simple Environment=THELOUNGE_HOME=/var/local/thelounge ExecStart=/usr/local/bin/thelounge start