Merge remote-tracking branch 'origin/main'

This commit is contained in:
778a69cd 2023-12-04 16:08:22 +01:00
commit d8ba0bc12c
13 changed files with 59 additions and 36 deletions

View file

@ -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/), 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). 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) ## 4.0.0-beta.2 (2023-12-01)
* test: fix tests using verified routes ([5fcf3d5](https://framagit.org/framasoft/mobilizon/commits/5fcf3d5)) * test: fix tests using verified routes ([5fcf3d5](https://framagit.org/framasoft/mobilizon/commits/5fcf3d5))

View file

@ -165,6 +165,10 @@ defmodule Mobilizon.Federation.ActivityPub.Utils do
"todos" => %{ "todos" => %{
"@id" => "mz:todos", "@id" => "mz:todos",
"@type" => "@id" "@type" => "@id"
},
"status" => %{
"@id" => "ical:status",
"@type" => "ical:status"
} }
} }
] ]

View file

@ -81,7 +81,11 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Event do
external_participation_url: object["externalParticipationUrl"], external_participation_url: object["externalParticipationUrl"],
options: options, options: options,
metadata: metadata, metadata: metadata,
status: object |> Map.get("ical:status", "CONFIRMED") |> String.downcase(), # Remove fallback in MBZ 5.x
status:
object
|> Map.get("status", Map.get(object, "ical:status", "CONFIRMED"))
|> String.downcase(),
online_address: object |> Map.get("attachment", []) |> get_online_address(), online_address: object |> Map.get("attachment", []) |> get_online_address(),
phone_address: object["phoneAddress"], phone_address: object["phoneAddress"],
draft: object["draft"] == true, draft: object["draft"] == true,
@ -142,7 +146,9 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Event do
"anonymousParticipationEnabled" => event.options.anonymous_participation, "anonymousParticipationEnabled" => event.options.anonymous_participation,
"attachment" => Enum.map(event.metadata, &EventMetadataConverter.metadata_to_as/1), "attachment" => Enum.map(event.metadata, &EventMetadataConverter.metadata_to_as/1),
"draft" => event.draft, "draft" => event.draft,
# Remove me in MBZ 5.x
"ical:status" => event.status |> to_string |> String.upcase(), "ical:status" => event.status |> to_string |> String.upcase(),
"status" => event.status |> to_string |> String.upcase(),
"id" => event.url, "id" => event.url,
"url" => event.url, "url" => event.url,
"inLanguage" => event.language, "inLanguage" => event.language,

View file

@ -35,6 +35,8 @@ defmodule Mobilizon.Service.ActorSuspension do
delete_actor_options = Keyword.merge(@delete_actor_default_options, options) delete_actor_options = Keyword.merge(@delete_actor_default_options, options)
Logger.debug(inspect(delete_actor_options)) Logger.debug(inspect(delete_actor_options))
# Only send suspension notifications if we actually are suspending the actor
if Keyword.get(delete_actor_options, :suspension, false) do
send_suspension_notification(actor) send_suspension_notification(actor)
Logger.debug( Logger.debug(
@ -42,6 +44,8 @@ defmodule Mobilizon.Service.ActorSuspension do
) )
notify_event_participants_from_suspension(actor) notify_event_participants_from_suspension(actor)
end
delete_participations(actor) delete_participations(actor)
multi = multi =

View file

@ -20,7 +20,10 @@ defmodule Mobilizon.Service.Workers.Background do
reserve_username when is_boolean(reserve_username) -> reserve_username when is_boolean(reserve_username) ->
case Actors.get_actor(actor_id) do case Actors.get_actor(actor_id) do
%Actor{} = actor -> %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 -> nil ->
{:error, :actor_not_found} {:error, :actor_not_found}

View file

@ -1,7 +1,7 @@
defmodule Mobilizon.Mixfile do defmodule Mobilizon.Mixfile do
use Mix.Project use Mix.Project
@version "4.0.0-beta.2" @version "4.0.0-rc.1"
def project do def project do
[ [

View file

@ -1,6 +1,6 @@
{ {
"name": "mobilizon", "name": "mobilizon",
"version": "4.0.0-beta.2", "version": "4.0.0-rc.1",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View file

@ -7,7 +7,7 @@
:allow-new="false" :allow-new="false"
:open-on-focus="false" :open-on-focus="false"
field="displayName" field="displayName"
placeholder="Add a recipient" :placeholder="t('Add a recipient')"
@typing="getActors" @typing="getActors"
> >
<template #default="props"> <template #default="props">
@ -23,6 +23,7 @@ import { Paginate } from "@/types/paginate";
import { useLazyQuery } from "@vue/apollo-composable"; import { useLazyQuery } from "@vue/apollo-composable";
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import ActorInline from "./ActorInline.vue"; import ActorInline from "./ActorInline.vue";
import { useI18n } from "vue-i18n";
const props = defineProps<{ const props = defineProps<{
modelValue: IActor[]; modelValue: IActor[];
@ -41,6 +42,8 @@ const modelValueWithDisplayName = computed(() =>
})) }))
); );
const { t } = useI18n({ useScope: "global" });
const { const {
load: loadSearchPersonsAndGroupsQuery, load: loadSearchPersonsAndGroupsQuery,
refetch: refetchSearchPersonsAndGroupsQuery, refetch: refetchSearchPersonsAndGroupsQuery,

View file

@ -1636,5 +1636,7 @@
"Either your participation has already been cancelled, either the validation token is incorrect.": "Either your participation has already been cancelled, either the validation token is incorrect.", "Either your participation has already been cancelled, either the validation token is incorrect.": "Either your participation has already been cancelled, either the validation token is incorrect.",
"Your participation has been cancelled": "Your participation has been cancelled", "Your participation has been cancelled": "Your participation has been cancelled",
"Return to the event page": "Return to the event page", "Return to the event page": "Return to the event page",
"Cancel participation": "Cancel participation" "Cancel participation": "Cancel participation",
"Add a recipient": "Add a recipient",
"Announcements for {eventTitle}": "Announcements for {eventTitle}"
} }

View file

@ -1630,5 +1630,7 @@
"Either your participation has already been cancelled, either the validation token is incorrect.": "Soit votre participation a déjà été annulée, soit le jeton de validation est incorrect.", "Either your participation has already been cancelled, either the validation token is incorrect.": "Soit votre participation a déjà été annulée, soit le jeton de validation est incorrect.",
"Your participation has been cancelled": "Votre participation a été annulée", "Your participation has been cancelled": "Votre participation a été annulée",
"Return to the event page": "Retourner à la page de l'événement", "Return to the event page": "Retourner à la page de l'événement",
"Cancel participation": "Annuler la participation" "Cancel participation": "Annuler la participation",
"Add a recipient": "Ajouter un·e destinataire",
"Announcements for {eventTitle}": "Annonces pour {eventTitle}"
} }

View file

@ -66,6 +66,8 @@ server {
location / { location / {
expires off;
add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always;
proxy_pass http://localhost:4000; proxy_pass http://localhost:4000;
} }
@ -75,24 +77,15 @@ server {
default_type "text/plain"; default_type "text/plain";
} }
location ~ ^/img { location ~ ^/(assets|img) {
root /opt/mobilizon/priv/static; root /opt/mobilizon/priv/static;
etag off;
access_log 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 ~ ^/(js|css) {
root /opt/mobilizon/priv/static;
etag off;
access_log off;
add_header Cache-Control "public, max-age=31536000, immutable";
} }
location ~ ^/(media|proxy) { location ~ ^/(media|proxy) {
etag off;
access_log 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; proxy_pass http://localhost:4000;
} }

View file

@ -66,6 +66,8 @@ server {
location / { location / {
expires off;
add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always;
proxy_pass http://localhost:4000; proxy_pass http://localhost:4000;
} }
@ -75,24 +77,15 @@ server {
default_type "text/plain"; default_type "text/plain";
} }
location ~ ^/img { location ~ ^/(assets|img) {
root /opt/mobilizon/priv/static; root /opt/mobilizon/priv/static;
etag off;
access_log 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 ~ ^/(js|css) {
root /home/mobilizon/live/priv/static;
etag off;
access_log off;
add_header Cache-Control "public, max-age=31536000, immutable";
} }
location ~ ^/(media|proxy) { location ~ ^/(media|proxy) {
etag off;
access_log 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; proxy_pass http://localhost:4000;
} }

View file

@ -49,6 +49,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.EventsTest do
"name" => @event_title, "name" => @event_title,
"repliesModerationOption" => nil, "repliesModerationOption" => nil,
"startTime" => @event_begins_on, "startTime" => @event_begins_on,
"status" => "CONFIRMED",
"tag" => [], "tag" => [],
"to" => [@ap_public], "to" => [@ap_public],
"type" => "Event" "type" => "Event"
@ -96,6 +97,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.EventsTest do
"name" => @event_title, "name" => @event_title,
"repliesModerationOption" => nil, "repliesModerationOption" => nil,
"startTime" => @event_begins_on, "startTime" => @event_begins_on,
"status" => "CONFIRMED",
"tag" => [], "tag" => [],
"to" => [^followers_url], "to" => [^followers_url],
"type" => "Event" "type" => "Event"
@ -152,6 +154,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.EventsTest do
"name" => @event_title, "name" => @event_title,
"repliesModerationOption" => nil, "repliesModerationOption" => nil,
"startTime" => @event_begins_on, "startTime" => @event_begins_on,
"status" => "CONFIRMED",
"tag" => [], "tag" => [],
"to" => [@ap_public], "to" => [@ap_public],
"type" => "Event" "type" => "Event"
@ -200,6 +203,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.EventsTest do
"name" => @event_updated_title, "name" => @event_updated_title,
"repliesModerationOption" => nil, "repliesModerationOption" => nil,
"startTime" => @event_begins_on, "startTime" => @event_begins_on,
"status" => "CONFIRMED",
"tag" => [], "tag" => [],
"to" => [@ap_public], "to" => [@ap_public],
"type" => "Event" "type" => "Event"
@ -260,6 +264,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.EventsTest do
"name" => @event_updated_title, "name" => @event_updated_title,
"repliesModerationOption" => nil, "repliesModerationOption" => nil,
"startTime" => @event_begins_on, "startTime" => @event_begins_on,
"status" => "CONFIRMED",
"tag" => [], "tag" => [],
"to" => [@ap_public], "to" => [@ap_public],
"type" => "Event" "type" => "Event"
@ -320,6 +325,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.EventsTest do
"name" => @event_updated_title, "name" => @event_updated_title,
"repliesModerationOption" => nil, "repliesModerationOption" => nil,
"startTime" => @event_begins_on, "startTime" => @event_begins_on,
"status" => "CONFIRMED",
"tag" => [], "tag" => [],
"to" => [@ap_public], "to" => [@ap_public],
"type" => "Event" "type" => "Event"