Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable mod_mam for Message Archive Management #30

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions roles/ejabberd/files/ejabberd-delete-old-mam-messages.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Unit]
Description=Deletion of MAM messages stored by ejabberd

[Service]
Type=oneshot
ExecStart=/usr/sbin/ejabberdctl delete_old_mam_messages all 31

User=ejabberd
Group=ejabberd

NoNewPrivileges=true
PrivateDevices=true
PrivateMounts=true
PrivateTmp=true
PrivateUsers=false
ProtectClock=true
ProtectControlGroups=true
ProtectHome=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=true
10 changes: 10 additions & 0 deletions roles/ejabberd/files/ejabberd-delete-old-mam-messages.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Run monthly deletion of MAM messages stored by ejabberd

[Timer]
OnCalendar=monthly
RandomizedDelaySec=1h
FixedRandomDelay=true

[Install]
WantedBy=timers.target
23 changes: 23 additions & 0 deletions roles/ejabberd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,29 @@
state: started
daemon_reload: true

- name: Systemd service unit deleting old MAM messages
ansible.builtin.copy:
src: ejabberd-delete-old-mam-messages.service
dest: /etc/systemd/system/ejabberd-delete-old-mam-messages.service
owner: root
group: root
mode: 0644

- name: Systemd timer for deleting old MAM messages
ansible.builtin.copy:
src: ejabberd-delete-old-mam-messages.timer
dest: /etc/systemd/system/ejabberd-delete-old-mam-messages.timer
owner: root
group: root
mode: 0644

- name: Enable systemd timer for deleting old MAM messages
ansible.builtin.systemd:
name: ejabberd-delete-old-mam-messages.timer
enabled: true
state: started
daemon_reload: true

- name: Create /etc/default/ejabberd
ansible.builtin.template:
src: ejabberd-default.j2
Expand Down
5 changes: 4 additions & 1 deletion roles/ejabberd/templates/ejabberd.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ access_rules:
## Expected by the ipstamp module for XpartaMuPP
ipbots:
- allow: ipbots
mam_modify:
- deny
muc_admin:
- allow: admin
- allow: muc_admins
Expand Down Expand Up @@ -283,7 +285,8 @@ modules:
## ipstamp module used by XpartaMuPP to insert IP addresses into the gamelist
mod_ipstamp: {}
mod_last: {}
## mod_mam:
mod_mam:
access_preferences: mam_modify
## ## Mnesia is limited to 2GB, better to use an SQL backend
## ## For small servers SQLite is a good fit and is very easy
## ## to configure. Uncomment this when you have SQL configured:
Expand Down
Loading