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

Merge develop 2025-03-07 #277

Merged
merged 76 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4745a41
Allow to specify post language
mkljczk Aug 10, 2023
049045c
Apply lanodan's suggestion
Aug 11, 2023
04c8f6b
Add ObjectValidators.LanguageCode type
mkljczk Aug 11, 2023
366559c
Make status.language == nil for 'und' value
mkljczk Aug 11, 2023
b430b80
Lint
mkljczk Aug 11, 2023
69d53a6
Rename test
mkljczk Aug 11, 2023
47ba7d3
Remove test
mkljczk Aug 11, 2023
edc8689
Move `maybe_add_language` to CommonFixes
mkljczk Aug 19, 2023
62340b5
Move maybe_add_content_map out of Transmogrifier, use code from tusoo…
mkljczk Aug 19, 2023
c160ef7
Remove test
mkljczk Aug 19, 2023
b52d189
Move is_good_locale_code? to object validator
mkljczk Aug 31, 2023
c5ed684
Rename MapOfString to ContentLanguageMap
mkljczk Sep 7, 2023
a3b17da
Rename test
mkljczk Sep 7, 2023
b6bae2d
Merge remote-tracking branch 'origin/develop' into post-languages
mkljczk Dec 22, 2023
51aef6b
Add language from activity context in ObjectValidator
mkljczk Dec 28, 2023
250a487
Merge branch 'develop' into 'post-languages'
mkljczk Jan 19, 2024
e798be9
Merge branch 'develop' into 'post-languages'
mkljczk Feb 2, 2024
05cb931
Merge remote-tracking branch 'origin/develop' into post-languages
mkljczk Feb 22, 2024
a6e066a
Fix adding language to json ld header, add transmogrifier test
mkljczk Mar 7, 2024
03d4e7e
Merge remote-tracking branch 'origin/develop' into post-languages
mkljczk Mar 7, 2024
7620b52
Merge remote-tracking branch 'origin/develop' into post-languages
mkljczk May 18, 2024
ad8c26f
Merge remote-tracking branch 'origin/develop' into post-languages
mkljczk Jul 28, 2024
a40bf5d
Fix good_locale_code?/1 regex
mkljczk Jul 28, 2024
3e5517e
Merge remote-tracking branch 'origin/develop' into post-languages
mkljczk Aug 22, 2024
ad95314
Require HTTP signatures (if enabled) for routes used by both C2S and …
mkljczk Sep 15, 2024
309d22a
Allow disabling C2S ActivityPub API
mkljczk Sep 16, 2024
76cfc61
Merge remote-tracking branch 'origin/develop' into ensure-authorized-…
mkljczk Sep 17, 2024
c94c6ea
Remerge of hashtag following (#341)
FloatingGhost Dec 5, 2022
bdb9f88
Add /api/v1/followed_tags
FloatingGhost Dec 31, 2022
ddf5bfc
Update changelog
mkljczk Dec 30, 2024
f565cf2
update spec
mkljczk Dec 30, 2024
36b7173
fix alias ordering
mkljczk Dec 30, 2024
aa74c87
fix tests
mkljczk Dec 30, 2024
ea01b59
Merge remote-tracking branch 'origin/develop' into post-languages
mkljczk Feb 17, 2025
120fbbc
Include contentMap in outgoing posts
mkljczk Feb 17, 2025
04af8bf
credo
mkljczk Feb 17, 2025
ce4c07c
update test
mkljczk Feb 17, 2025
d905fa0
Allow incoming "Listen" activities
mkljczk Feb 17, 2025
31e3b98
Merge branch 'fix-incoming-scrobbles' into 'develop'
mkljczk Feb 17, 2025
f26509b
Fix missing check for domain presence in rich media ignore_host confi…
feld Feb 22, 2025
ce3a2b4
Merge branch 'feld/emailed-patch' into 'develop'
feld Feb 22, 2025
0d7d6eb
Cheatsheet: Use the correct section
lambadalambda Feb 22, 2025
fe3c72f
Merge branch 'docs-fix' into 'develop'
lambadalambda Feb 22, 2025
801a225
Merge branch 'follow-hashtags' into 'develop'
lambadalambda Feb 22, 2025
6f48ade
Merge branch 'post-languages' into 'develop'
lambadalambda Feb 22, 2025
0f5ac7e
Add SafeZip module
TheOneric Oct 30, 2024
b89070a
SafeZip: Add tests.
lambadalambda Feb 27, 2025
2fcb90f
Emoji, Pack, Backup, Frontend: Use SafeZip
lambadalambda Feb 27, 2025
bf13466
PackTest: Add test for skipping emoji
lambadalambda Feb 28, 2025
ca3c2a4
Verify a local Update sent through AP C2S so users can only update th…
tusooa Oct 16, 2024
7bdeb9a
Fix OpenGraph/TwitterCard meta tag ordering for posts with multiple a…
feld Feb 28, 2025
63663ac
Merge branch 'twittercard-image-order' into 'develop'
feld Feb 28, 2025
cb073a9
Rich Media Parser should use first og:image
feld Feb 28, 2025
2137b68
Fix image URLs in TwitterCard parser test
feld Feb 28, 2025
2c9d071
Retire MRFs DNSRBL, FODirectReply, and QuietReply
feld Mar 1, 2025
b770850
Merge branch 'retire-mrfs' into 'develop'
feld Mar 1, 2025
ac0882e
Filter the parsed OpenGraph/Twittercard tags and only retain the ones…
feld Mar 1, 2025
a8e863e
Merge branch 'rich-media-ordering' into 'develop'
feld Mar 1, 2025
4604f29
Merge branch 'pleroma-ensure-authorized-fetch' into security-2.9
lambadalambda Mar 1, 2025
d6a136f
Config: Deactivate client api by default
lambadalambda Mar 1, 2025
88ee385
Transmogrifier: Strip internal fields
lambadalambda Mar 1, 2025
706bfff
Linting
lambadalambda Mar 1, 2025
13a88bd
Register APNG MIME type
TheOneric Mar 26, 2024
32acdf0
Merge branch 'security-2.9' into release/2.9.0
lambadalambda Mar 1, 2025
e88eb24
Mix: Bump version to 2.9.0
lambadalambda Mar 1, 2025
a24e894
Update changelog
lambadalambda Mar 1, 2025
79cbc74
Linting
lambadalambda Mar 1, 2025
cd5f018
SafeZip Test: Skip failing CI tests for the release (tests work fine …
lambadalambda Mar 1, 2025
af6d547
Merge branch 'release/2.9.0' into 'stable'
lambadalambda Mar 1, 2025
16944eb
Merge branch 'stable' into 'develop'
lambadalambda Mar 1, 2025
bc72262
remove changelog entries from changelog.d
mkljczk Mar 2, 2025
a7b6d3c
Merge branch 'changelog' into 'develop'
lambadalambda Mar 2, 2025
7bfa3bf
Include my frontend in available frontends
mkljczk Mar 2, 2025
b2640f0
Merge branch 'pl-fe' into 'develop'
lambadalambda Mar 2, 2025
a184ecc
Safezip: Fix test (issue was a difference in file ordering between ot…
lambadalambda Mar 2, 2025
906c3ab
Merge branch 'fix-safezip' into 'develop'
lambadalambda Mar 2, 2025
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
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@ 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/).

## 2.9.0

### Security
- Require HTTP signatures (if enabled) for routes used by both C2S and S2S AP API
- Fix several spoofing vectors

### Changed
- Performance: Use 301 (permanent) redirect instead of 302 (temporary) when redirecting small images in media proxy. This allows browsers to cache the redirect response.

### Added
- Include "published" in actor view
- Link to exported outbox/followers/following collections in backup actor.json
- Hashtag following
- Allow to specify post language

### Fixed
- Verify a local Update sent through AP C2S so users can only update their own objects
- Fix Mastodon incoming edits with inlined "likes"
- Allow incoming "Listen" activities
- Fix missing check for domain presence in rich media ignore_host configuration
- Fix Rich Media parsing of TwitterCards/OpenGraph to adhere to the spec and always choose the first image if multiple are provided.
- Fix OpenGraph/TwitterCard meta tag ordering for posts with multiple attachments
- Fix blurhash generation crashes

### Removed
- Retire MRFs DNSRBL, FODirectReply, and QuietReply

## 2.8.0

### Changed
Expand Down
1 change: 0 additions & 1 deletion changelog.d/301-small-image-redirect.change

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/actor-published-date.add

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/backup-links.add

This file was deleted.

Empty file.
Empty file.
1 change: 0 additions & 1 deletion changelog.d/fix-mastodon-edits.fix

This file was deleted.

Empty file.
1 change: 1 addition & 0 deletions changelog.d/pl-fe.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include `pl-fe` in available frontends
1 change: 0 additions & 1 deletion changelog.d/vips-blurhash.fix

This file was deleted.

20 changes: 13 additions & 7 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ config :mime, :types, %{
"application/xrd+xml" => ["xrd+xml"],
"application/jrd+json" => ["jrd+json"],
"application/activity+json" => ["activity+json"],
"application/ld+json" => ["activity+json"]
"application/ld+json" => ["activity+json"],
# Can be removed when bumping MIME past 2.0.5
# see https://akkoma.dev/AkkomaGang/akkoma/issues/657
"image/apng" => ["apng"]
}

config :tesla, adapter: Tesla.Adapter.Hackney
Expand Down Expand Up @@ -359,7 +362,8 @@ config :pleroma, :activitypub,
follow_handshake_timeout: 500,
note_replies_output_limit: 5,
sign_object_fetches: true,
authorized_fetch_mode: false
authorized_fetch_mode: false,
client_api_enabled: false

config :pleroma, :streamer,
workers: 3,
Expand Down Expand Up @@ -413,11 +417,6 @@ config :pleroma, :mrf_vocabulary,
accept: [],
reject: []

config :pleroma, :mrf_dnsrbl,
nameserver: "127.0.0.1",
port: 53,
zone: "bl.pleroma.com"

# threshold of 7 days
config :pleroma, :mrf_object_age,
threshold: 604_800,
Expand Down Expand Up @@ -807,6 +806,13 @@ config :pleroma, :frontends,
"https://lily-is.land/infra/glitch-lily/-/jobs/artifacts/${ref}/download?job=build",
"ref" => "servant",
"build_dir" => "public"
},
"pl-fe" => %{
"name" => "pl-fe",
"git" => "https://github.com/mkljczk/pl-fe",
"build_url" => "https://pl.mkljczk.pl/pl-fe.zip",
"ref" => "develop",
"build_dir" => "."
}
}

Expand Down
5 changes: 5 additions & 0 deletions config/description.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,11 @@ config :pleroma, :config_description, [
type: :integer,
description: "Following handshake timeout",
suggestions: [500]
},
%{
key: :client_api_enabled,
type: :boolean,
description: "Allow client to server ActivityPub interactions"
}
]
},
Expand Down
5 changes: 4 additions & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ config :pleroma, :instance,
external_user_synchronization: false,
static_dir: "test/instance_static/"

config :pleroma, :activitypub, sign_object_fetches: false, follow_handshake_timeout: 0
config :pleroma, :activitypub,
sign_object_fetches: false,
follow_handshake_timeout: 0,
client_api_enabled: true

# Configure your database
config :pleroma, Pleroma.Repo,
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ To add configuration to your config file, you can copy it from the base config.
* `moderator_privileges`: A list of privileges a moderator has (e.g. delete messages, manage reports...)
* Possible values are the same as for `admin_privileges`

## :database
## :features
* `improved_hashtag_timeline`: Setting to force toggle / force disable improved hashtags timeline. `:enabled` forces hashtags to be fetched from `hashtags` table for hashtags timeline. `:disabled` forces object-embedded hashtags to be used (slower). Keep it `:auto` for automatic behaviour (it is auto-set to `:enabled` [unless overridden] when HashtagsTableMigrator completes).

## Background migrations
Expand Down
15 changes: 3 additions & 12 deletions lib/mix/tasks/pleroma/emoji.ex
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ defmodule Mix.Tasks.Pleroma.Emoji do
)

files = fetch_and_decode!(files_loc)
files_to_unzip = for({_, f} <- files, do: f)

IO.puts(IO.ANSI.format(["Unpacking ", :bright, pack_name]))

Expand All @@ -103,17 +104,7 @@ defmodule Mix.Tasks.Pleroma.Emoji do
pack_name
])

files_to_unzip =
Enum.map(
files,
fn {_, f} -> to_charlist(f) end
)

{:ok, _} =
:zip.unzip(binary_archive,
cwd: String.to_charlist(pack_path),
file_list: files_to_unzip
)
{:ok, _} = Pleroma.SafeZip.unzip_data(binary_archive, pack_path, files_to_unzip)

IO.puts(IO.ANSI.format(["Writing pack.json for ", :bright, pack_name]))

Expand Down Expand Up @@ -201,7 +192,7 @@ defmodule Mix.Tasks.Pleroma.Emoji do

tmp_pack_dir = Path.join(System.tmp_dir!(), "emoji-pack-#{name}")

{:ok, _} = :zip.unzip(binary_archive, cwd: String.to_charlist(tmp_pack_dir))
{:ok, _} = Pleroma.SafeZip.unzip_data(binary_archive, tmp_pack_dir)

emoji_map = Pleroma.Emoji.Loader.make_shortcode_to_file_map(tmp_pack_dir, exts)

Expand Down
10 changes: 7 additions & 3 deletions lib/pleroma/constants.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ defmodule Pleroma.Constants do
"deleted_activity_id",
"pleroma_internal",
"generator",
"rules"
"rules",
"language"
]
)

Expand All @@ -36,10 +37,12 @@ defmodule Pleroma.Constants do
"updated",
"emoji",
"content",
"contentMap",
"summary",
"sensitive",
"attachment",
"generator"
"generator",
"language"
]
)

Expand Down Expand Up @@ -100,7 +103,8 @@ defmodule Pleroma.Constants do
"Announce",
"Undo",
"Flag",
"EmojiReact"
"EmojiReact",
"Listen"
]
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only

defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.ContentLanguageMap do
use Ecto.Type

import Pleroma.EctoType.ActivityPub.ObjectValidators.LanguageCode,
only: [good_locale_code?: 1]

def type, do: :map

def cast(%{} = object) do
with {status, %{} = data} when status in [:modified, :ok] <- validate_map(object) do
{:ok, data}
else
{_, nil} -> {:ok, nil}
{:error, _} -> :error
end
end

def cast(_), do: :error

def dump(data), do: {:ok, data}

def load(data), do: {:ok, data}

defp validate_map(%{} = object) do
{status, data} =
object
|> Enum.reduce({:ok, %{}}, fn
{lang, value}, {status, acc} when is_binary(lang) and is_binary(value) ->
if good_locale_code?(lang) do
{status, Map.put(acc, lang, value)}
else
{:modified, acc}
end

_, {_status, acc} ->
{:modified, acc}
end)

if data == %{} do
{status, nil}
else
{status, data}
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only

defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.LanguageCode do
use Ecto.Type

def type, do: :string

def cast(language) when is_binary(language) do
if good_locale_code?(language) do
{:ok, language}
else
{:error, :invalid_language}
end
end

def cast(_), do: :error

def dump(data), do: {:ok, data}

def load(data), do: {:ok, data}

def good_locale_code?(code) when is_binary(code), do: code =~ ~r<^[a-zA-Z0-9\-]+\z$>

def good_locale_code?(_code), do: false
end
Loading
Loading