From 6531c61c7a865c0867b1a5033bbd931c02534ccf Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 1 Feb 2025 15:34:46 +0900 Subject: [PATCH 1/2] Update files for matrix-coturn: make the reloading schedule configurable with variables This commit adopts the common format which can be seen for BorgBackup. It should be probably helpful, though I am not quite sure how much. Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-turn.md | 12 ++++++++++++ roles/custom/matrix-coturn/defaults/main.yml | 6 ++++++ .../templates/systemd/matrix-coturn-reload.timer.j2 | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/configuring-playbook-turn.md b/docs/configuring-playbook-turn.md index 611037415..56858d886 100644 --- a/docs/configuring-playbook-turn.md +++ b/docs/configuring-playbook-turn.md @@ -64,6 +64,18 @@ jitsi_web_stun_servers: You can put multiple host/port combinations if you'd like to. +### Edit the reloading schedule (optional) + +By default the service is reloaded on 6:30 a.m. every day based on the `matrix_coturn_reload_schedule` variable so that new SSL certificates can kick in. It is defined in the format of systemd timer calendar. + +To edit the schedule, add the following configuration to your `vars.yml` file (adapt to your needs): + +```yaml +matrix_coturn_reload_schedule: "*-*-* 06:30:00" +``` + +**Note**: the actual job may run with a delay. See `matrix_coturn_reload_schedule_randomized_delay_sec` for its default value. + ### Extending the configuration There are some additional things you may wish to configure about the TURN server. diff --git a/roles/custom/matrix-coturn/defaults/main.yml b/roles/custom/matrix-coturn/defaults/main.yml index bda15196a..60641c196 100644 --- a/roles/custom/matrix-coturn/defaults/main.yml +++ b/roles/custom/matrix-coturn/defaults/main.yml @@ -186,3 +186,9 @@ matrix_coturn_tls_key_path: ~ matrix_coturn_tls_v1_enabled: false matrix_coturn_tls_v1_1_enabled: false + +# systemd calendar configuration for the reload job +# the actual job may run with a delay (see matrix_coturn_reload_schedule_randomized_delay_sec) +matrix_coturn_reload_schedule: "*-*-* 06:30:00" +# the delay with which the systemd timer may run in relation to the `matrix_coturn_reload_schedule` schedule +matrix_coturn_reload_schedule_randomized_delay_sec: 1h diff --git a/roles/custom/matrix-coturn/templates/systemd/matrix-coturn-reload.timer.j2 b/roles/custom/matrix-coturn/templates/systemd/matrix-coturn-reload.timer.j2 index 528945412..d4b0b1093 100644 --- a/roles/custom/matrix-coturn/templates/systemd/matrix-coturn-reload.timer.j2 +++ b/roles/custom/matrix-coturn/templates/systemd/matrix-coturn-reload.timer.j2 @@ -3,8 +3,8 @@ Description=Reloads matrix-coturn periodically so that new SSL certificates can [Timer] Unit=matrix-coturn-reload.service -OnCalendar=*-*-* 06:30:00 -RandomizedDelaySec=1h +OnCalendar={{ matrix_coturn_reload_schedule }} +RandomizedDelaySec={{ matrix_coturn_reload_schedule_randomized_delay_sec }} [Install] WantedBy=timers.target From 2e986012c42aef8b375d9438ade3ac4836cd4c44 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Fri, 7 Feb 2025 01:11:57 +0900 Subject: [PATCH 2/2] Update docs/configuring-playbook-synapse-s3-storage-provider.md: add the instruction to edit the schedule Signed-off-by: Suguru Hirahara --- docs/configuring-playbook-synapse-s3-storage-provider.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/configuring-playbook-synapse-s3-storage-provider.md b/docs/configuring-playbook-synapse-s3-storage-provider.md index c564e4c83..efe3a5a82 100644 --- a/docs/configuring-playbook-synapse-s3-storage-provider.md +++ b/docs/configuring-playbook-synapse-s3-storage-provider.md @@ -152,3 +152,9 @@ By default, we periodically ensure that all local files are uploaded to S3 and a - … triggered by the `matrix-synapse-s3-storage-provider-migrate.timer` timer, every day at 05:00 So… you don't need to perform any maintenance yourself. + +The schedule is defined in the format of systemd timer calendar. To edit the schedule, add the following configuration to your `vars.yml` file (adapt to your needs): + +```yaml +matrix_synapse_ext_synapse_s3_storage_provider_periodic_migration_schedule: "*-*-* 05:00:00" +```