forked from YokaiRick/akkoma
Compare commits
37 commits
Author | SHA1 | Date | |
---|---|---|---|
0af8e93135 | |||
98a64ab145 | |||
94d1af2c4c | |||
43c5fd5db0 | |||
c887dd4f2e | |||
ba1ed37edf | |||
f1de9bd9ba | |||
a4bab7bdfa | |||
a7dbca885f | |||
9d7c877de0 | |||
39a878f530 | |||
dcee1b109b | |||
9a8373a3f5 | |||
ccae7ef824 | |||
8504878187 | |||
fef4bae006 | |||
86dcf273c5 | |||
36cb19dbf2 | |||
71d08991ea | |||
d756607112 | |||
367bc9c818 | |||
81caf77223 | |||
551f92dd50 | |||
d9508474b6 | |||
f676007b18 | |||
63f2d1cbef | |||
f91b896731 | |||
af90a4e51b | |||
5e7be063c7 | |||
a1317bf541 | |||
a0dd670e68 | |||
11d29d27b8 | |||
44da806a77 | |||
d7c805b0bb | |||
c52982e9c5 | |||
2e433e106f | |||
bfbe4e8dce |
6 changed files with 53 additions and 3 deletions
|
@ -65,6 +65,32 @@ pipeline:
|
||||||
- export DEST=scaleway:akkoma-updates/$${CI_COMMIT_TAG:-"$CI_COMMIT_BRANCH"}/akkoma-amd64-ubuntu-jammy.zip
|
- export DEST=scaleway:akkoma-updates/$${CI_COMMIT_TAG:-"$CI_COMMIT_BRANCH"}/akkoma-amd64-ubuntu-jammy.zip
|
||||||
- /bin/sh /entrypoint.sh
|
- /bin/sh /entrypoint.sh
|
||||||
|
|
||||||
|
debian-bullseye:
|
||||||
|
image: hexpm/elixir:1.15.4-erlang-25.3.2.5-debian-bullseye-20230612
|
||||||
|
<<: *on-release
|
||||||
|
environment:
|
||||||
|
MIX_ENV: prod
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
commands:
|
||||||
|
- apt-get update && apt-get install -y cmake libmagic-dev rclone zip imagemagick libmagic-dev git build-essential g++ wget
|
||||||
|
- *clean
|
||||||
|
- echo "import Config" > config/prod.secret.exs
|
||||||
|
- *setup-hex
|
||||||
|
- *tag-build
|
||||||
|
- mix deps.get --only prod
|
||||||
|
- mix release --path release
|
||||||
|
- zip akkoma-amd64-debian-bullseye.zip -r release
|
||||||
|
|
||||||
|
release-debian-bullseye:
|
||||||
|
image: akkoma/releaser
|
||||||
|
<<: *on-release
|
||||||
|
secrets: *scw-secrets
|
||||||
|
commands:
|
||||||
|
- export SOURCE=akkoma-amd64-debian-bullseye.zip
|
||||||
|
# AMD64
|
||||||
|
- export DEST=scaleway:akkoma-updates/$${CI_COMMIT_TAG:-"$CI_COMMIT_BRANCH"}/akkoma-amd64-debian-bullseye.zip
|
||||||
|
- /bin/sh /entrypoint.sh
|
||||||
|
|
||||||
# Canonical amd64-musl
|
# Canonical amd64-musl
|
||||||
musl:
|
musl:
|
||||||
image: hexpm/elixir:1.14.3-erlang-25.2.2-alpine-3.18.0
|
image: hexpm/elixir:1.14.3-erlang-25.2.2-alpine-3.18.0
|
||||||
|
|
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -4,6 +4,11 @@ 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/).
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Issue where a bad inbox URL could break federation
|
||||||
|
|
||||||
## 2023.08
|
## 2023.08
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
@ -233,6 +238,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
## 2022.08
|
## 2022.08
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Non-finch HTTP adapters. `:tesla, :adapter` is now highly recommended to be set to the default.
|
||||||
|
|
||||||
|
## 2022.08
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- extended runtime module support, see config cheatsheet
|
- extended runtime module support, see config cheatsheet
|
||||||
- quote posting; quotes are limited to public posts
|
- quote posting; quotes are limited to public posts
|
||||||
|
|
|
@ -115,13 +115,18 @@ defp allowed_instances do
|
||||||
def should_federate?(url) do
|
def should_federate?(url) do
|
||||||
%{host: host} = URI.parse(url)
|
%{host: host} = URI.parse(url)
|
||||||
|
|
||||||
with allowed <- allowed_instances(),
|
with {nil, false} <- {nil, is_nil(host)},
|
||||||
|
allowed <- allowed_instances(),
|
||||||
false <- Enum.empty?(allowed) do
|
false <- Enum.empty?(allowed) do
|
||||||
allowed
|
allowed
|
||||||
|> Pleroma.Web.ActivityPub.MRF.instance_list_from_tuples()
|
|> Pleroma.Web.ActivityPub.MRF.instance_list_from_tuples()
|
||||||
|> Pleroma.Web.ActivityPub.MRF.subdomains_regex()
|
|> Pleroma.Web.ActivityPub.MRF.subdomains_regex()
|
||||||
|> Pleroma.Web.ActivityPub.MRF.subdomain_match?(host)
|
|> Pleroma.Web.ActivityPub.MRF.subdomain_match?(host)
|
||||||
else
|
else
|
||||||
|
# oi!
|
||||||
|
{nil, true} ->
|
||||||
|
false
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
quarantined_instances =
|
quarantined_instances =
|
||||||
blocked_instances()
|
blocked_instances()
|
||||||
|
|
|
@ -34,7 +34,9 @@ def perform(%Plug.Conn{assigns: assigns} = conn, %{scopes: scopes} = options) do
|
||||||
permissions = Enum.join(missing_scopes, " #{op} ")
|
permissions = Enum.join(missing_scopes, " #{op} ")
|
||||||
|
|
||||||
error_message =
|
error_message =
|
||||||
dgettext("errors", "Insufficient permissions: %{permissions}.", permissions: permissions)
|
dgettext("errors", "Insufficient permissions: %{permissions}.",
|
||||||
|
permissions: permissions
|
||||||
|
)
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> put_resp_content_type("application/json")
|
|> put_resp_content_type("application/json")
|
||||||
|
|
2
mix.exs
2
mix.exs
|
@ -4,7 +4,7 @@ defmodule Pleroma.Mixfile do
|
||||||
def project do
|
def project do
|
||||||
[
|
[
|
||||||
app: :pleroma,
|
app: :pleroma,
|
||||||
version: version("3.10.3"),
|
version: version("3.10.4"),
|
||||||
elixir: "~> 1.14",
|
elixir: "~> 1.14",
|
||||||
elixirc_paths: elixirc_paths(Mix.env()),
|
elixirc_paths: elixirc_paths(Mix.env()),
|
||||||
compilers: [:phoenix] ++ Mix.compilers(),
|
compilers: [:phoenix] ++ Mix.compilers(),
|
||||||
|
|
|
@ -487,4 +487,11 @@ test "publish to url with with different ports" do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "should_federate/1" do
|
||||||
|
test "should not obliterate itself if the inbox URL is bad" do
|
||||||
|
url = "/inbox"
|
||||||
|
refute Pleroma.Web.ActivityPub.Publisher.should_federate?(url)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue