forked from AkkomaGang/akkoma
Compare commits
33 commits
309d574ff9
...
c3418694b9
Author | SHA1 | Date | |
---|---|---|---|
c3418694b9 | |||
1946834e07 | |||
a846e60d71 | |||
1be18a9f4c | |||
2d9358c432 | |||
55fc410f80 | |||
e934cd4ca5 | |||
ae40ccb8ca | |||
7ed52838f4 | |||
fe23660a2d | |||
177d420ae7 | |||
b0f2ed6eaa | |||
39cef8b8d2 | |||
3ba743d635 | |||
bd02c3d7de | |||
8de373fa24 | |||
d32c4e89bc | |||
7c095a6b70 | |||
e0428a8f14 | |||
e5619c0895 | |||
833d7661d6 | |||
|
d8c7ed70d0 | ||
e8bf4422ff | |||
bcfbfbcff5 | |||
f2e45d4d4b | |||
7615a11a1e | |||
f19d5d1380 | |||
f048e0cf1b | |||
6ed5be61ff | |||
88a8086ad3 | |||
40da4e88ea | |||
a2e397a79d | |||
97037c0b53 |
16 changed files with 198 additions and 67 deletions
|
@ -6,9 +6,12 @@ depends_on:
|
|||
|
||||
variables:
|
||||
- &scw-secrets
|
||||
- SCW_ACCESS_KEY
|
||||
- SCW_SECRET_KEY
|
||||
- SCW_DEFAULT_ORGANIZATION_ID
|
||||
SCW_ACCESS_KEY:
|
||||
from_secret: SCW_ACCESS_KEY
|
||||
SCW_SECRET_KEY:
|
||||
from_secret: SCW_SECRET_KEY
|
||||
SCW_DEFAULT_ORGANIZATION_ID:
|
||||
from_secret: SCW_DEFAULT_ORGANIZATION_ID
|
||||
- &setup-hex "mix local.hex --force && mix local.rebar --force"
|
||||
- &on-release
|
||||
when:
|
||||
|
@ -56,7 +59,7 @@ steps:
|
|||
release-debian-bookworm:
|
||||
image: akkoma/releaser
|
||||
<<: *on-release
|
||||
secrets: *scw-secrets
|
||||
environment: *scw-secrets
|
||||
commands:
|
||||
- export SOURCE=akkoma-amd64.zip
|
||||
# AMD64
|
||||
|
@ -85,7 +88,7 @@ steps:
|
|||
release-debian-bullseye:
|
||||
image: akkoma/releaser
|
||||
<<: *on-release
|
||||
secrets: *scw-secrets
|
||||
environment: *scw-secrets
|
||||
commands:
|
||||
- export SOURCE=akkoma-amd64-debian-bullseye.zip
|
||||
# AMD64
|
||||
|
@ -111,7 +114,7 @@ steps:
|
|||
release-musl:
|
||||
image: akkoma/releaser
|
||||
<<: *on-stable
|
||||
secrets: *scw-secrets
|
||||
environment: *scw-secrets
|
||||
commands:
|
||||
- export SOURCE=akkoma-amd64-musl.zip
|
||||
- export DEST=scaleway:akkoma-updates/$${CI_COMMIT_TAG:-"$CI_COMMIT_BRANCH"}/akkoma-amd64-musl.zip
|
||||
|
|
|
@ -6,9 +6,12 @@ depends_on:
|
|||
|
||||
variables:
|
||||
- &scw-secrets
|
||||
- SCW_ACCESS_KEY
|
||||
- SCW_SECRET_KEY
|
||||
- SCW_DEFAULT_ORGANIZATION_ID
|
||||
SCW_ACCESS_KEY:
|
||||
from_secret: SCW_ACCESS_KEY
|
||||
SCW_SECRET_KEY:
|
||||
from_secret: SCW_SECRET_KEY
|
||||
SCW_DEFAULT_ORGANIZATION_ID:
|
||||
from_secret: SCW_DEFAULT_ORGANIZATION_ID
|
||||
- &setup-hex "mix local.hex --force && mix local.rebar --force"
|
||||
- &on-release
|
||||
when:
|
||||
|
@ -56,7 +59,7 @@ steps:
|
|||
release-debian-bookworm:
|
||||
image: akkoma/releaser:arm64
|
||||
<<: *on-release
|
||||
secrets: *scw-secrets
|
||||
environment: *scw-secrets
|
||||
commands:
|
||||
- export SOURCE=akkoma-arm64.zip
|
||||
- export DEST=scaleway:akkoma-updates/$${CI_COMMIT_TAG:-"$CI_COMMIT_BRANCH"}/akkoma-arm64-ubuntu-jammy.zip
|
||||
|
@ -83,7 +86,7 @@ steps:
|
|||
release-musl:
|
||||
image: akkoma/releaser:arm64
|
||||
<<: *on-stable
|
||||
secrets: *scw-secrets
|
||||
environment: *scw-secrets
|
||||
commands:
|
||||
- export SOURCE=akkoma-arm64-musl.zip
|
||||
- export DEST=scaleway:akkoma-updates/$${CI_COMMIT_TAG:-"$CI_COMMIT_BRANCH"}/akkoma-arm64-musl.zip
|
||||
|
|
|
@ -6,10 +6,6 @@ depends_on:
|
|||
- build-amd64
|
||||
|
||||
variables:
|
||||
- &scw-secrets
|
||||
- SCW_ACCESS_KEY
|
||||
- SCW_SECRET_KEY
|
||||
- SCW_DEFAULT_ORGANIZATION_ID
|
||||
- &setup-hex "mix local.hex --force && mix local.rebar --force"
|
||||
- &on-release
|
||||
when:
|
||||
|
@ -49,12 +45,14 @@ variables:
|
|||
steps:
|
||||
docs:
|
||||
<<: *on-point-release
|
||||
secrets:
|
||||
- SCW_ACCESS_KEY
|
||||
- SCW_SECRET_KEY
|
||||
- SCW_DEFAULT_ORGANIZATION_ID
|
||||
environment:
|
||||
CI: "true"
|
||||
SCW_ACCESS_KEY:
|
||||
from_secret: SCW_ACCESS_KEY
|
||||
SCW_SECRET_KEY:
|
||||
from_secret: SCW_SECRET_KEY
|
||||
SCW_DEFAULT_ORGANIZATION_ID:
|
||||
from_secret: SCW_DEFAULT_ORGANIZATION_ID
|
||||
image: python:3.10-slim
|
||||
commands:
|
||||
- apt-get update && apt-get install -y rclone wget git zip
|
||||
|
|
|
@ -2,10 +2,6 @@ labels:
|
|||
platform: linux/amd64
|
||||
|
||||
variables:
|
||||
- &scw-secrets
|
||||
- SCW_ACCESS_KEY
|
||||
- SCW_SECRET_KEY
|
||||
- SCW_DEFAULT_ORGANIZATION_ID
|
||||
- &setup-hex "mix local.hex --force && mix local.rebar --force"
|
||||
- &on-release
|
||||
when:
|
||||
|
|
|
@ -17,10 +17,6 @@ matrix:
|
|||
OTP_VERSION: 26
|
||||
|
||||
variables:
|
||||
- &scw-secrets
|
||||
- SCW_ACCESS_KEY
|
||||
- SCW_SECRET_KEY
|
||||
- SCW_DEFAULT_ORGANIZATION_ID
|
||||
- &setup-hex "mix local.hex --force && mix local.rebar --force"
|
||||
- &on-release
|
||||
when:
|
||||
|
|
22
CHANGELOG.md
22
CHANGELOG.md
|
@ -4,10 +4,26 @@ 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/).
|
||||
|
||||
## UNRELEASED
|
||||
## 2025.01
|
||||
|
||||
## Added
|
||||
- New config option `:instance, :cleanup_attachments_delay`
|
||||
- It is now possible to display custom source URLs in akkoma-fe;
|
||||
the settings are part of the frontend configuration
|
||||
|
||||
## Fixed
|
||||
- Media proxy no longer attempts to proxy embedded images
|
||||
- Fix significant uneccessary overhead of attachment cleanup;
|
||||
it no longer attempts to cleanup attachments of deleted remote posts
|
||||
- Fix “Delete & Redraft” often losing attachments if attachment cleanup was enabled
|
||||
- ObjectAge policy no longer lets unlisted posts slip through
|
||||
- ObjectAge policy no longer leaks belated DMs and follower-only posts
|
||||
- the NodeINfo endpoint now uses the correct content type
|
||||
|
||||
## Changed
|
||||
- Anonymous objects now federate completely without an id
|
||||
adopting a proposed AP spec errata and restoring federation
|
||||
with e.g. IceShrimp.NET and fedify-based implementations
|
||||
|
||||
## 3.13.3
|
||||
|
||||
|
@ -20,7 +36,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
- Meilisearch: it is now possible to use separate keys for search and admin actions
|
||||
- New standalone `prune_orphaned_activities` mix task with configurable batch limit
|
||||
- The `prune_objects` mix task now accepts a `--limit` parameter for initial object pruning
|
||||
- New config option `:instance, :cleanup_attachments_delay`
|
||||
|
||||
## Fixed
|
||||
- Meilisearch: order of results returned from our REST API now actually matches how Meilisearch ranks results
|
||||
|
@ -29,9 +44,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
- AP objects with additional JSON-LD profiles beyond ActivityStreams can now be fetched
|
||||
- Single-selection polls no longer expose the voter_count; MastoAPI demands it be null
|
||||
and this confused some clients leading to vote distributions >100%
|
||||
- Fix “Delete & Redraft” often losing attachments if attachment cleanup was enabled
|
||||
- ObjectAge policy no longer lets unlisted posts slip through
|
||||
- ObjectAge policy no longer leaks belated DMs and follower-only posts
|
||||
|
||||
## Changed
|
||||
- Refactored Rich Media to cache the content in the database. Fetching operations that could block status rendering have been eliminated.
|
||||
|
|
|
@ -303,6 +303,7 @@
|
|||
allow_headings: false,
|
||||
allow_tables: false,
|
||||
allow_fonts: false,
|
||||
allow_math: true,
|
||||
scrub_policy: [
|
||||
Pleroma.HTML.Scrubber.Default,
|
||||
Pleroma.HTML.Transform.MediaProxy
|
||||
|
|
|
@ -35,32 +35,24 @@ sudo useradd -r -s /bin/false -m -d /var/lib/akkoma -U akkoma
|
|||
|
||||
### Install Elixir and Erlang
|
||||
|
||||
#### Using `apt`
|
||||
If your distribution packages a recent enough version of Elixir, you can install it directly from the distro repositories and skip to the next section of the guide:
|
||||
|
||||
```shell
|
||||
sudo apt install elixir erlang-dev erlang-nox
|
||||
```
|
||||
|
||||
Otherwise use [asdf](https://github.com/asdf-vm/asdf) to install the latest versions of Elixir and Erlang.
|
||||
#### Using `asdf`
|
||||
If your distribution does not have a recent version of Elxir in their repositories, you can use [asdf](https://asdf-vm.com/) to install a newer version of Elixir and Erlang.
|
||||
|
||||
First, install some dependencies needed to build Elixir and Erlang:
|
||||
```shell
|
||||
sudo apt install curl unzip build-essential autoconf m4 libncurses5-dev libssh-dev unixodbc-dev xsltproc libxml2-utils libncurses-dev
|
||||
```
|
||||
|
||||
Then login to the `akkoma` user and install asdf:
|
||||
```shell
|
||||
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3
|
||||
```
|
||||
Then login to the `akkoma` user.
|
||||
|
||||
Add the following lines to `~/.bashrc`:
|
||||
```shell
|
||||
. "$HOME/.asdf/asdf.sh"
|
||||
# asdf completions
|
||||
. "$HOME/.asdf/completions/asdf.bash"
|
||||
```
|
||||
|
||||
Restart the shell:
|
||||
Install asdf by following steps 1 to 3 on [their website](https://asdf-vm.com/guide/getting-started.html), then restart the shell to load asdf:
|
||||
```shell
|
||||
exec $SHELL
|
||||
```
|
||||
|
@ -69,15 +61,15 @@ Next install Erlang:
|
|||
```shell
|
||||
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
|
||||
export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"
|
||||
asdf install erlang 25.3.2.5
|
||||
asdf global erlang 25.3.2.5
|
||||
asdf install erlang 26.2.5.4
|
||||
asdf global erlang 26.2.5.4
|
||||
```
|
||||
|
||||
Now install Elixir:
|
||||
```shell
|
||||
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
|
||||
asdf install elixir 1.15.4-otp-25
|
||||
asdf global elixir 1.15.4-otp-25
|
||||
asdf install elixir 1.17.3-otp-26
|
||||
asdf global elixir 1.17.3-otp-26
|
||||
```
|
||||
|
||||
Confirm that Elixir is installed correctly by checking the version:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Required dependencies
|
||||
|
||||
* PostgreSQL 12+
|
||||
* Elixir 1.14+ (currently tested up to 1.16)
|
||||
* Elixir 1.14+ (currently tested up to 1.17)
|
||||
* Erlang OTP 25+ (currently tested up to OTP27)
|
||||
* git
|
||||
* file / libmagic
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
#
|
||||
|
||||
daemon="/usr/local/bin/elixir"
|
||||
daemon_flags="--detached -S /usr/local/bin/mix phx.server"
|
||||
daemon_flags="-S /usr/local/bin/mix phx.server"
|
||||
daemon_user="_akkoma"
|
||||
daemon_execdir="/home/_akkoma/akkoma"
|
||||
|
||||
. /etc/rc.d/rc.subr
|
||||
|
||||
rc_bg="YES"
|
||||
rc_reload=NO
|
||||
pexp="phx.server"
|
||||
|
||||
|
@ -24,7 +26,7 @@ rc_check() {
|
|||
}
|
||||
|
||||
rc_start() {
|
||||
${rcexec} "cd akkoma; ${daemon} ${daemon_flags}"
|
||||
rc_exec "${daemon} ${daemon_flags}"
|
||||
}
|
||||
|
||||
rc_stop() {
|
||||
|
|
|
@ -343,13 +343,16 @@ def run(["prune_objects" | args]) do
|
|||
|
||||
%{:num_rows => del_hashtags} =
|
||||
"""
|
||||
DELETE FROM hashtags AS ht
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM hashtags_objects hto
|
||||
WHERE ht.id = hto.hashtag_id
|
||||
UNION
|
||||
SELECT 1 FROM user_follows_hashtag ufht
|
||||
WHERE ht.id = ufht.hashtag_id)
|
||||
DELETE FROM hashtags
|
||||
USING hashtags AS ht
|
||||
LEFT JOIN hashtags_objects hto
|
||||
ON ht.id = hto.hashtag_id
|
||||
LEFT JOIN user_follows_hashtag ufht
|
||||
ON ht.id = ufht.hashtag_id
|
||||
WHERE
|
||||
hashtags.id = ht.id
|
||||
AND hto.hashtag_id is NULL
|
||||
AND ufht.hashtag_id is NULL
|
||||
"""
|
||||
|> Repo.query!()
|
||||
|
||||
|
|
|
@ -84,8 +84,11 @@ defp default_config(Swoosh.Adapters.SMTP, conf, _) do
|
|||
cacerts: os_cacerts,
|
||||
versions: [:"tlsv1.2", :"tlsv1.3"],
|
||||
verify: :verify_peer,
|
||||
# some versions have supposedly issues verifying wildcard certs without this
|
||||
server_name_indication: relay,
|
||||
# This allows wildcard ceritifcates to be verified properly.
|
||||
# The :https parameter simply means to use the HTTPS wildcard format
|
||||
# (as opposed to say LDAP). SMTP servers tend to use the same type of
|
||||
# certs as HTTPS ones so this should work for most.
|
||||
customize_hostname_check: [
|
||||
match_fun: :public_key.pkix_verify_hostname_match_fun(:https)
|
||||
],
|
||||
|
|
|
@ -95,21 +95,29 @@ defp query_with(q, :rum, search_query) do
|
|||
)
|
||||
end
|
||||
|
||||
def maybe_restrict_local(q, user) do
|
||||
def should_restrict_local(user) do
|
||||
limit = Pleroma.Config.get([:instance, :limit_to_local_content], :unauthenticated)
|
||||
|
||||
case {limit, user} do
|
||||
{:all, _} -> restrict_local(q)
|
||||
{:unauthenticated, %User{}} -> q
|
||||
{:unauthenticated, _} -> restrict_local(q)
|
||||
{false, _} -> q
|
||||
{:all, _} -> true
|
||||
{:unauthenticated, %User{}} -> false
|
||||
{:unauthenticated, _} -> true
|
||||
{false, _} -> false
|
||||
end
|
||||
end
|
||||
|
||||
def maybe_restrict_local(q, user) do
|
||||
case should_restrict_local(user) do
|
||||
true -> restrict_local(q)
|
||||
false -> q
|
||||
end
|
||||
end
|
||||
|
||||
defp restrict_local(q), do: where(q, local: true)
|
||||
|
||||
def maybe_fetch(activities, user, search_query) do
|
||||
with true <- Regex.match?(~r/https?:/, search_query),
|
||||
with false <- should_restrict_local(user),
|
||||
true <- Regex.match?(~r/https?:/, search_query),
|
||||
{:ok, object} <- Fetcher.fetch_object_from_id(search_query),
|
||||
%Activity{} = activity <- Activity.get_create_by_object_ap_id(object.data["id"]),
|
||||
true <- Visibility.visible_for_user?(activity, user) do
|
||||
|
|
2
mix.exs
2
mix.exs
|
@ -4,7 +4,7 @@ defmodule Pleroma.Mixfile do
|
|||
def project do
|
||||
[
|
||||
app: :pleroma,
|
||||
version: version("3.13.3"),
|
||||
version: version("3.14.0"),
|
||||
elixir: "~> 1.14",
|
||||
elixirc_paths: elixirc_paths(Mix.env()),
|
||||
compilers: Mix.compilers(),
|
||||
|
|
|
@ -124,6 +124,119 @@ defmodule Pleroma.HTML.Scrubber.Default do
|
|||
Meta.allow_tag_with_these_attributes(:font, ["face"])
|
||||
end
|
||||
|
||||
if Pleroma.Config.get!([:markup, :allow_math]) do
|
||||
Meta.allow_tag_with_these_attributes("annotation", ["encoding"])
|
||||
Meta.allow_tag_with_these_attributes(:"annotation-xml", ["encoding"])
|
||||
|
||||
Meta.allow_tag_with_these_attributes(:math, [
|
||||
"display",
|
||||
"displaystyle",
|
||||
"mathvariant",
|
||||
"scriptlevel"
|
||||
])
|
||||
|
||||
basic_math_tags = [
|
||||
"maction",
|
||||
"merror",
|
||||
:mi,
|
||||
"mmultiscripts",
|
||||
:mn,
|
||||
"mphantom",
|
||||
"mprescripts",
|
||||
"mroot",
|
||||
"mrow",
|
||||
"ms",
|
||||
"msqrt",
|
||||
"mstyle",
|
||||
"msub",
|
||||
"msubsup",
|
||||
"msup",
|
||||
"mtable",
|
||||
"mtext",
|
||||
"mtr",
|
||||
"semantics"
|
||||
]
|
||||
|
||||
for tag <- basic_math_tags do
|
||||
Meta.allow_tag_with_these_attributes(unquote(tag), [
|
||||
"mathvariant",
|
||||
"displaystyle",
|
||||
"scriptlevel"
|
||||
])
|
||||
end
|
||||
|
||||
Meta.allow_tag_with_these_attributes("mfrac", [
|
||||
"displaystyle",
|
||||
"linethickness",
|
||||
"mathvariant",
|
||||
"scriptlevel"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes(:mo, [
|
||||
"displaystyle",
|
||||
"form",
|
||||
"largeop",
|
||||
"lspace",
|
||||
"mathvariant",
|
||||
"minsize",
|
||||
"movablelimits",
|
||||
"rspace",
|
||||
"scriptlevel",
|
||||
"stretchy",
|
||||
"symmetric"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes("mover", [
|
||||
"accent",
|
||||
"displaystyle",
|
||||
"mathvariant",
|
||||
"scriptlevel"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes("mpadded", [
|
||||
"depth",
|
||||
"displaystyle",
|
||||
"height",
|
||||
"lspace",
|
||||
"mathvariant",
|
||||
"scriptlevel",
|
||||
"voffset",
|
||||
"width"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes("mspace", [
|
||||
"depth",
|
||||
"displaystyle",
|
||||
"height",
|
||||
"mathvariant",
|
||||
"scriptlevel",
|
||||
"width"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes("mtd", [
|
||||
"columnspan",
|
||||
"displaystyle",
|
||||
"mathvariant",
|
||||
"rowspan",
|
||||
"scriptlevel"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes("munder", [
|
||||
"accentunder",
|
||||
"displaystyle",
|
||||
"mathvariant",
|
||||
"scriptlevel"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes("munderover", [
|
||||
"accent",
|
||||
"accentunder",
|
||||
"displaystyle",
|
||||
"mathvariant",
|
||||
"scriptlevel"
|
||||
])
|
||||
end
|
||||
|
||||
Meta.allow_tag_with_these_attributes(:center, [])
|
||||
Meta.allow_tag_with_these_attributes(:small, [])
|
||||
|
||||
|
|
|
@ -588,6 +588,7 @@ test "attachments" do
|
|||
end
|
||||
|
||||
test "put the url advertised in the Activity in to the url attribute" do
|
||||
Pleroma.Config.put([:instance, :limit_to_local_content], false)
|
||||
id = "https://wedistribute.org/wp-json/pterotype/v1/object/85810"
|
||||
[activity] = Activity.search(nil, id)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue