From 6c992cade5f03b4b6c3602ded2d186cf55d73728 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 4 Dec 2023 08:18:45 +0100 Subject: [PATCH 1/5] docs(nginx): improve nginx configuration Remove etag off and improve Cache-Control Signed-off-by: Thomas Citharel --- support/nginx/mobilizon-release.conf | 17 +++++------------ support/nginx/mobilizon-source.conf | 17 +++++------------ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/support/nginx/mobilizon-release.conf b/support/nginx/mobilizon-release.conf index f074c3544..11c661b08 100644 --- a/support/nginx/mobilizon-release.conf +++ b/support/nginx/mobilizon-release.conf @@ -66,6 +66,8 @@ server { location / { + expires off; + add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always; proxy_pass http://localhost:4000; } @@ -75,24 +77,15 @@ server { default_type "text/plain"; } - location ~ ^/img { + location ~ ^/(assets|img) { root /opt/mobilizon/priv/static; - etag off; access_log off; - add_header Cache-Control "public, max-age=31536000, immutable"; - } - - location ~ ^/(js|css) { - root /opt/mobilizon/priv/static; - etag off; - access_log off; - add_header Cache-Control "public, max-age=31536000, immutable"; + add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable"; } location ~ ^/(media|proxy) { - etag off; access_log off; - add_header Cache-Control "public, max-age=31536000, immutable"; + add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable"; proxy_pass http://localhost:4000; } diff --git a/support/nginx/mobilizon-source.conf b/support/nginx/mobilizon-source.conf index ff626e197..03ed6979f 100644 --- a/support/nginx/mobilizon-source.conf +++ b/support/nginx/mobilizon-source.conf @@ -66,6 +66,8 @@ server { location / { + expires off; + add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always; proxy_pass http://localhost:4000; } @@ -75,24 +77,15 @@ server { default_type "text/plain"; } - location ~ ^/img { + location ~ ^/(assets|img) { root /opt/mobilizon/priv/static; - etag off; access_log off; - add_header Cache-Control "public, max-age=31536000, immutable"; - } - - location ~ ^/(js|css) { - root /home/mobilizon/live/priv/static; - etag off; - access_log off; - add_header Cache-Control "public, max-age=31536000, immutable"; + add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable"; } location ~ ^/(media|proxy) { - etag off; access_log off; - add_header Cache-Control "public, max-age=31536000, immutable"; + add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable"; proxy_pass http://localhost:4000; } From 9e41bc1ad633a82da8b8d318991c0df34425f205 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 4 Dec 2023 09:02:38 +0100 Subject: [PATCH 2/5] fix(backend): only send suspension notification emails when actor's suspended and not just deleted Signed-off-by: Thomas Citharel --- lib/service/actor_suspension.ex | 14 +++++++++----- lib/service/workers/background.ex | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/service/actor_suspension.ex b/lib/service/actor_suspension.ex index 00062563e..6c548772a 100644 --- a/lib/service/actor_suspension.ex +++ b/lib/service/actor_suspension.ex @@ -35,13 +35,17 @@ defmodule Mobilizon.Service.ActorSuspension do delete_actor_options = Keyword.merge(@delete_actor_default_options, options) Logger.debug(inspect(delete_actor_options)) - send_suspension_notification(actor) + # Only send suspension notifications if we actually are suspending the actor + if Keyword.get(delete_actor_options, :suspension, false) do + send_suspension_notification(actor) - Logger.debug( - "Sending suspension notifications to participants from events created by this actor" - ) + Logger.debug( + "Sending suspension notifications to participants from events created by this actor" + ) + + notify_event_participants_from_suspension(actor) + end - notify_event_participants_from_suspension(actor) delete_participations(actor) multi = diff --git a/lib/service/workers/background.ex b/lib/service/workers/background.ex index 6f5175b9d..d7d62a0bc 100644 --- a/lib/service/workers/background.ex +++ b/lib/service/workers/background.ex @@ -20,7 +20,10 @@ defmodule Mobilizon.Service.Workers.Background do reserve_username when is_boolean(reserve_username) -> case Actors.get_actor(actor_id) do %Actor{} = actor -> - ActorSuspension.suspend_actor(actor, reserve_username: reserve_username) + ActorSuspension.suspend_actor(actor, + reserve_username: reserve_username, + suspension: Map.get(args, "suspension", false) + ) nil -> {:error, :actor_not_found} From 24d92f60f7e3a25bb162687e2b29484b4dec0d5c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 4 Dec 2023 09:33:02 +0100 Subject: [PATCH 3/5] chore(release): 4.0.0-rc.1 Signed-off-by: Thomas Citharel --- CHANGELOG.md | 7 +++++++ mix.exs | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c80a0c03a..4c412ee44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 4.0.0-rc.1 (2023-12-04) + +* fix: prevent sending group physical address if it's empty and allow empty text for timezone ([32caebb](https://framagit.org/framasoft/mobilizon/commits/32caebb)), closes [#1357](https://framagit.org/framasoft/mobilizon/issues/1357) +* fix(activitypub): add missing externalParticipationUrl context ([8795576](https://framagit.org/framasoft/mobilizon/commits/8795576)), closes [#1376](https://framagit.org/framasoft/mobilizon/issues/1376) +* fix(backend): only send suspension notification emails when actor's suspended and not just deleted ([9e41bc1](https://framagit.org/framasoft/mobilizon/commits/9e41bc1)) +* docs(nginx): improve nginx configuration ([6c992ca](https://framagit.org/framasoft/mobilizon/commits/6c992ca)) + ## 4.0.0-beta.2 (2023-12-01) * test: fix tests using verified routes ([5fcf3d5](https://framagit.org/framasoft/mobilizon/commits/5fcf3d5)) diff --git a/mix.exs b/mix.exs index 1ee250566..aebe02bd2 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Mobilizon.Mixfile do use Mix.Project - @version "4.0.0-beta.2" + @version "4.0.0-rc.1" def project do [ diff --git a/package.json b/package.json index d07a76645..b12db9a7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mobilizon", - "version": "4.0.0-beta.2", + "version": "4.0.0-rc.1", "private": true, "scripts": { "dev": "vite", From 10ce812660aea30687d92c2153edee0d26ec1851 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 4 Dec 2023 11:03:34 +0100 Subject: [PATCH 4/5] fix(front): make recipient field placeholder translatable Signed-off-by: Thomas Citharel --- src/components/Account/ActorAutoComplete.vue | 5 ++++- src/i18n/en_US.json | 4 +++- src/i18n/fr_FR.json | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/Account/ActorAutoComplete.vue b/src/components/Account/ActorAutoComplete.vue index 47da387aa..6e561d5a0 100644 --- a/src/components/Account/ActorAutoComplete.vue +++ b/src/components/Account/ActorAutoComplete.vue @@ -7,7 +7,7 @@ :allow-new="false" :open-on-focus="false" field="displayName" - placeholder="Add a recipient" + :placeholder="t('Add a recipient')" @typing="getActors" >