forked from AkkomaGang/akkoma
Compare commits
38 commits
Author | SHA1 | Date | |
---|---|---|---|
ebfb617b26 | |||
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 |
110 changed files with 454 additions and 943 deletions
|
@ -1,14 +1,3 @@
|
|||
[
|
||||
import_deps: [:ecto, :ecto_sql, :phoenix],
|
||||
subdirectories: ["priv/*/migrations"],
|
||||
plugins: [Phoenix.LiveView.HTMLFormatter],
|
||||
inputs: [
|
||||
"mix.exs",
|
||||
"*.{heex,ex,exs}",
|
||||
"{config,lib,test}/**/*.{heex,ex,exs}",
|
||||
"priv/*/seeds.exs",
|
||||
"priv/repo/migrations/*.exs",
|
||||
"priv/repo/optional_migrations/**/*.exs",
|
||||
"priv/scrubbers/*.ex"
|
||||
]
|
||||
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}", "priv/repo/migrations/*.exs", "priv/repo/optional_migrations/**/*.exs", "priv/scrubbers/*.ex"]
|
||||
]
|
||||
|
|
|
@ -37,7 +37,7 @@ variables:
|
|||
pipeline:
|
||||
# Canonical amd64
|
||||
debian-bookworm:
|
||||
image: hexpm/elixir:1.15.4-erlang-26.0.2-debian-bookworm-20230612
|
||||
image: hexpm/elixir:1.15.4-erlang-25.3.2.5-debian-bookworm-20230612
|
||||
<<: *on-release
|
||||
environment:
|
||||
MIX_ENV: prod
|
||||
|
@ -66,7 +66,7 @@ pipeline:
|
|||
- /bin/sh /entrypoint.sh
|
||||
|
||||
debian-bullseye:
|
||||
image: hexpm/elixir:1.15.4-erlang-26.0.2-debian-bullseye-20230612
|
||||
image: hexpm/elixir:1.15.4-erlang-25.3.2.5-debian-bullseye-20230612
|
||||
<<: *on-release
|
||||
environment:
|
||||
MIX_ENV: prod
|
||||
|
@ -76,6 +76,7 @@ pipeline:
|
|||
- *clean
|
||||
- echo "import Config" > config/prod.secret.exs
|
||||
- *setup-hex
|
||||
- *mix-clean
|
||||
- *tag-build
|
||||
- mix deps.get --only prod
|
||||
- mix release --path release
|
||||
|
@ -93,7 +94,7 @@ pipeline:
|
|||
|
||||
# Canonical amd64-musl
|
||||
musl:
|
||||
image: hexpm/elixir:1.15.4-erlang-26.0.2-alpine-3.18.2
|
||||
image: hexpm/elixir:1.14.3-erlang-25.2.2-alpine-3.18.0
|
||||
<<: *on-stable
|
||||
environment:
|
||||
MIX_ENV: prod
|
||||
|
|
|
@ -37,7 +37,7 @@ variables:
|
|||
pipeline:
|
||||
# Canonical arm64
|
||||
debian-bookworm:
|
||||
image: hexpm/elixir:1.15.4-erlang-26.0.2-debian-bookworm-20230612
|
||||
image: hexpm/elixir:1.15.4-erlang-25.3.2.5-debian-bookworm-20230612
|
||||
<<: *on-release
|
||||
environment:
|
||||
MIX_ENV: prod
|
||||
|
@ -65,7 +65,7 @@ pipeline:
|
|||
|
||||
# Canonical arm64-musl
|
||||
musl:
|
||||
image: hexpm/elixir:1.15.4-erlang-26.0.2-alpine-3.18.2
|
||||
image: hexpm/elixir:1.15.4-erlang-25.3.2.5-alpine-3.18.2
|
||||
<<: *on-stable
|
||||
environment:
|
||||
MIX_ENV: prod
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
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:
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
branch:
|
||||
- develop
|
||||
- stable
|
||||
- refs/tags/v*
|
||||
- refs/tags/stable-*
|
||||
- &on-stable
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
branch:
|
||||
- stable
|
||||
- refs/tags/stable-*
|
||||
- &on-point-release
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- develop
|
||||
- stable
|
||||
- &on-pr-open
|
||||
when:
|
||||
event:
|
||||
- pull_request
|
||||
|
||||
- &tag-build "export BUILD_TAG=$${CI_COMMIT_TAG:-\"$CI_COMMIT_BRANCH\"} && export PLEROMA_BUILD_BRANCH=$BUILD_TAG"
|
||||
|
||||
- &clean "(rm -rf release || true) && (rm -rf _build || true) && (rm -rf /root/.mix)"
|
||||
- &mix-clean "mix deps.clean --all && mix clean"
|
||||
|
||||
pipeline:
|
||||
lint:
|
||||
image: akkoma/ci-base:1.15-otp26
|
||||
<<: *on-pr-open
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
commands:
|
||||
- mix local.hex --force
|
||||
- mix local.rebar --force
|
||||
- mix deps.get
|
||||
- mix compile
|
||||
- mix format --check-formatted
|
|
@ -1,8 +1,5 @@
|
|||
platform: linux/amd64
|
||||
|
||||
depends_on:
|
||||
- lint
|
||||
|
||||
matrix:
|
||||
ELIXIR_VERSION:
|
||||
- 1.14
|
||||
|
@ -15,8 +12,9 @@ matrix:
|
|||
OTP_VERSION: 25
|
||||
- ELIXIR_VERSION: 1.15
|
||||
OTP_VERSION: 25
|
||||
- ELIXIR_VERSION: 1.15
|
||||
OTP_VERSION: 26
|
||||
# Soon
|
||||
#- ELIXIR_VERSION: 1.15
|
||||
# OTP_VERSION: 26
|
||||
|
||||
variables:
|
||||
- &scw-secrets
|
||||
|
@ -71,7 +69,15 @@ services:
|
|||
POSTGRES_PASSWORD: postgres
|
||||
|
||||
pipeline:
|
||||
test:
|
||||
lint:
|
||||
<<: *on-pr-open
|
||||
image: akkoma/ci-base:1.15
|
||||
commands:
|
||||
- mix local.hex --force
|
||||
- mix local.rebar --force
|
||||
- mix format --check-formatted
|
||||
|
||||
build:
|
||||
image: akkoma/ci-base:${ELIXIR_VERSION}-otp${OTP_VERSION}
|
||||
<<: *on-pr-open
|
||||
environment:
|
||||
|
@ -85,9 +91,24 @@ pipeline:
|
|||
- mix local.rebar --force
|
||||
- mix deps.get
|
||||
- mix compile
|
||||
- mix ecto.drop -f -q
|
||||
- mix ecto.create
|
||||
- mix ecto.migrate
|
||||
- mkdir -p test/tmp
|
||||
- mix test --preload-modules --exclude erratic --exclude federated --exclude mocked
|
||||
- mix test --preload-modules --only mocked
|
||||
|
||||
test:
|
||||
image: akkoma/ci-base:${ELIXIR_VERSION}-otp${OTP_VERSION}
|
||||
<<: *on-pr-open
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
POSTGRES_DB: pleroma_test_${ELIXIR_VERSION}_${OTP_VERSION}
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
DB_HOST: postgres
|
||||
commands:
|
||||
- mix local.hex --force
|
||||
- mix local.rebar --force
|
||||
- mix deps.get
|
||||
- mix compile
|
||||
- mix ecto.drop -f -q
|
||||
- mix ecto.create
|
||||
- mix ecto.migrate
|
||||
- mkdir -p test/tmp
|
||||
- mix test --preload-modules --exclude erratic --exclude federated --exclude mocked
|
||||
- mix test --preload-modules --only mocked
|
||||
|
|
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -6,18 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
## Unreleased
|
||||
|
||||
## Added
|
||||
- Full compatibility with Erlang OTP26
|
||||
- handling of GET /api/v1/preferences
|
||||
|
||||
## Changed
|
||||
- OTP builds are now built on erlang OTP26
|
||||
- The base Phoenix framework is now updated to 1.7
|
||||
|
||||
## Fixed
|
||||
- Documentation issue in which a non-existing nginx file was referenced
|
||||
- Issue where a bad inbox URL could break federation
|
||||
- Issue where hashtag rel values would be scrubbed
|
||||
|
||||
## 2023.08
|
||||
|
||||
|
@ -248,6 +238,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
## 2022.08
|
||||
|
||||
### Removed
|
||||
- Non-finch HTTP adapters. `:tesla, :adapter` is now highly recommended to be set to the default.
|
||||
|
||||
## 2022.08
|
||||
|
||||
### Added
|
||||
- extended runtime module support, see config cheatsheet
|
||||
- quote posting; quotes are limited to public posts
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM hexpm/elixir:1.15.4-erlang-26.0.2-alpine-3.18.2
|
||||
FROM hexpm/elixir:1.15.4-erlang-25.3.2.5-alpine-3.18.2
|
||||
|
||||
ENV MIX_ENV=prod
|
||||
ENV ERL_EPMD_ADDRESS=127.0.0.1
|
||||
|
|
|
@ -110,6 +110,17 @@
|
|||
"xmpp"
|
||||
]
|
||||
|
||||
websocket_config = [
|
||||
path: "/websocket",
|
||||
serializer: [
|
||||
{Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
|
||||
{Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
|
||||
],
|
||||
timeout: 60_000,
|
||||
transport_log: false,
|
||||
compress: false
|
||||
]
|
||||
|
||||
# Configures the endpoint
|
||||
config :pleroma, Pleroma.Web.Endpoint,
|
||||
url: [host: "localhost"],
|
||||
|
@ -119,7 +130,10 @@
|
|||
{:_,
|
||||
[
|
||||
{"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
|
||||
{:_, Plug.Cowboy.Handler, {Pleroma.Web.Endpoint, []}}
|
||||
{"/websocket", Phoenix.Endpoint.CowboyWebSocket,
|
||||
{Phoenix.Transports.WebSocket,
|
||||
{Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
|
||||
{:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
|
||||
]}
|
||||
]
|
||||
],
|
||||
|
@ -156,10 +170,6 @@
|
|||
"application/ld+json" => ["activity+json"]
|
||||
}
|
||||
|
||||
config :mime, :extensions, %{
|
||||
"activity+json" => "application/activity+json"
|
||||
}
|
||||
|
||||
config :tesla, :adapter, {Tesla.Adapter.Finch, name: MyFinch}
|
||||
|
||||
# Configures http settings, upstream proxy etc.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
* PostgreSQL 9.6+
|
||||
* Elixir 1.14+
|
||||
* Erlang OTP 25+
|
||||
* Erlang OTP 24+
|
||||
* git
|
||||
* file / libmagic
|
||||
* gcc (clang might also work)
|
||||
|
|
|
@ -40,7 +40,7 @@ If you are on pleroma develop, and have updated since 2022-08, you may have issu
|
|||
Please roll back the given migrations:
|
||||
|
||||
```bash
|
||||
MIX_ENV=prod mix ecto.rollback --migrations-path priv/repo/optional_migrations/pleroma_develop_rollbacks -n5
|
||||
MIX_ENV=prod mix ecto.rollback --migrations-path priv/repo/optional_migrations/pleroma_develop_rollbacks -n3
|
||||
```
|
||||
|
||||
Then compile, migrate and restart as usual.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
This guide covers a installation using an OTP release. To install Akkoma from source, please check out the corresponding guide for your distro.
|
||||
|
||||
## Pre-requisites
|
||||
* A machine running Linux with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and an `x86_64` or `arm64` CPU you have root access to. If you are not sure if it's compatible see [Detecting flavour section](#detecting-flavour) below
|
||||
* A machine running Linux with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and an `x86_64` CPU you have root access to. If you are not sure if it's compatible see [Detecting flavour section](#detecting-flavour) below
|
||||
* For installing OTP releases on RedHat-based distros like Fedora and Centos Stream, please follow [this guide](./otp_redhat_en.md) instead.
|
||||
* A (sub)domain pointed to the machine
|
||||
|
||||
|
@ -187,18 +187,18 @@ The location of nginx configs is dependent on the distro
|
|||
|
||||
=== "Alpine"
|
||||
```
|
||||
cp /opt/akkoma/installation/akkoma.nginx /etc/nginx/conf.d/akkoma.conf
|
||||
cp /opt/akkoma/installation/nginx/akkoma.nginx /etc/nginx/conf.d/akkoma.conf
|
||||
```
|
||||
|
||||
=== "Debian/Ubuntu"
|
||||
```
|
||||
cp /opt/akkoma/installation/akkoma.nginx /etc/nginx/sites-available/akkoma.conf
|
||||
cp /opt/akkoma/installation/nginx/akkoma.nginx /etc/nginx/sites-available/akkoma.conf
|
||||
ln -s /etc/nginx/sites-available/akkoma.conf /etc/nginx/sites-enabled/akkoma.conf
|
||||
```
|
||||
|
||||
If your distro does not have either of those you can append `include /etc/nginx/akkoma.conf` to the end of the http section in /etc/nginx/nginx.conf and
|
||||
```sh
|
||||
cp /opt/akkoma/installation/akkoma.nginx /etc/nginx/akkoma.conf
|
||||
cp /opt/akkoma/installation/nginx/akkoma.nginx /etc/nginx/akkoma.conf
|
||||
```
|
||||
|
||||
#### Edit the nginx config
|
||||
|
|
|
@ -178,7 +178,7 @@ certbot certonly --standalone --preferred-challenges http -d yourinstance.tld
|
|||
#### Copy Akkoma nginx configuration to the nginx folder
|
||||
|
||||
```shell
|
||||
cp /opt/akkoma/installation/akkoma.nginx /etc/nginx/conf.d/akkoma.conf
|
||||
cp /opt/akkoma/installation/nginx/akkoma.nginx /etc/nginx/conf.d/akkoma.conf
|
||||
```
|
||||
|
||||
#### Edit the nginx config
|
||||
|
|
|
@ -130,7 +130,6 @@ def run(["get-packs" | args]) do
|
|||
}
|
||||
|
||||
File.write!(Path.join(pack_path, "pack.json"), Jason.encode!(pack_json, pretty: true))
|
||||
Pleroma.Emoji.reload()
|
||||
else
|
||||
IO.puts(IO.ANSI.format([:bright, :red, "No pack named \"#{pack_name}\" found"]))
|
||||
end
|
||||
|
@ -236,8 +235,6 @@ def run(["gen-pack" | args]) do
|
|||
|
||||
IO.puts("#{pack_file} has been created with the #{name} pack")
|
||||
end
|
||||
|
||||
Pleroma.Emoji.reload()
|
||||
end
|
||||
|
||||
def run(["reload"]) do
|
||||
|
|
|
@ -30,12 +30,12 @@ def run(["index"]) do
|
|||
meili_put(
|
||||
"/indexes/objects/settings/ranking-rules",
|
||||
[
|
||||
"published:desc",
|
||||
"words",
|
||||
"exactness",
|
||||
"proximity",
|
||||
"typo",
|
||||
"exactness",
|
||||
"attribute",
|
||||
"published:desc",
|
||||
"sort"
|
||||
]
|
||||
)
|
||||
|
|
|
@ -11,7 +11,6 @@ defmodule Mix.Tasks.Pleroma.User do
|
|||
alias Pleroma.UserInviteToken
|
||||
alias Pleroma.Web.ActivityPub.Builder
|
||||
alias Pleroma.Web.ActivityPub.Pipeline
|
||||
use Pleroma.Web, :verified_routes
|
||||
|
||||
@shortdoc "Manages Pleroma users"
|
||||
@moduledoc File.read!("docs/docs/administration/CLI_tasks/user.md")
|
||||
|
@ -114,7 +113,11 @@ def run(["reset_password", nickname]) do
|
|||
{:ok, token} <- Pleroma.PasswordResetToken.create_token(user) do
|
||||
shell_info("Generated password reset token for #{user.nickname}")
|
||||
|
||||
IO.puts("URL: #{~p[/api/v1/pleroma/password_reset/#{token.token}]}")
|
||||
IO.puts(
|
||||
"URL: #{Pleroma.Web.Router.Helpers.reset_password_url(Pleroma.Web.Endpoint,
|
||||
:reset,
|
||||
token.token)}"
|
||||
)
|
||||
else
|
||||
_ ->
|
||||
shell_error("No local user #{nickname}")
|
||||
|
@ -300,7 +303,13 @@ def run(["invite" | rest]) do
|
|||
{:ok, invite} <- UserInviteToken.create_invite(options) do
|
||||
shell_info("Generated user invite token " <> String.replace(invite.invite_type, "_", " "))
|
||||
|
||||
url = url(~p[/registration/#{invite.token}])
|
||||
url =
|
||||
Pleroma.Web.Router.Helpers.redirect_url(
|
||||
Pleroma.Web.Endpoint,
|
||||
:registration_page,
|
||||
invite.token
|
||||
)
|
||||
|
||||
IO.puts(url)
|
||||
else
|
||||
error ->
|
||||
|
|
|
@ -26,6 +26,7 @@ def init(%Plug.Conn{method: "GET"} = conn, {endpoint, handler, transport}) do
|
|||
conn
|
||||
|> fetch_query_params
|
||||
|> Transport.transport_log(opts[:transport_log])
|
||||
|> Transport.force_ssl(handler, endpoint, opts)
|
||||
|> Transport.check_origin(handler, endpoint, opts)
|
||||
|
||||
case conn do
|
||||
|
|
|
@ -6,13 +6,10 @@ defmodule Pleroma.Emails.AdminEmail do
|
|||
@moduledoc "Admin emails"
|
||||
|
||||
import Swoosh.Email
|
||||
use Pleroma.Web, :mailer
|
||||
|
||||
alias Pleroma.Config
|
||||
alias Pleroma.HTML
|
||||
|
||||
use Phoenix.VerifiedRoutes,
|
||||
endpoint: Pleroma.Web.Endpoint,
|
||||
router: Pleroma.Web.Router
|
||||
alias Pleroma.Web.Router.Helpers
|
||||
|
||||
defp instance_config, do: Config.get(:instance)
|
||||
defp instance_name, do: instance_config()[:name]
|
||||
|
@ -48,7 +45,7 @@ def report(to, reporter, account, statuses, comment) do
|
|||
statuses
|
||||
|> Enum.map(fn
|
||||
%{id: id} ->
|
||||
status_url = url(~p[/notice/#{id}])
|
||||
status_url = Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, id)
|
||||
"<li><a href=\"#{status_url}\">#{status_url}</li>"
|
||||
|
||||
%{"id" => id} when is_binary(id) ->
|
||||
|
|
|
@ -6,11 +6,12 @@ defmodule Pleroma.Emails.UserEmail do
|
|||
@moduledoc "User emails"
|
||||
|
||||
require Pleroma.Web.Gettext
|
||||
use Pleroma.Web, :mailer
|
||||
|
||||
alias Pleroma.Config
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.Endpoint
|
||||
alias Pleroma.Web.Gettext
|
||||
alias Pleroma.Web.Router
|
||||
|
||||
import Swoosh.Email
|
||||
import Phoenix.Swoosh, except: [render_body: 3]
|
||||
|
@ -74,7 +75,7 @@ def welcome(user, opts \\ %{}) do
|
|||
|
||||
def password_reset_email(user, token) when is_binary(token) do
|
||||
Gettext.with_locale_or_default user.language do
|
||||
password_reset_url = ~p[/api/v1/pleroma/password_reset/#{token}]
|
||||
password_reset_url = Router.Helpers.reset_password_url(Endpoint, :reset, token)
|
||||
|
||||
html_body =
|
||||
Gettext.dpgettext(
|
||||
|
@ -107,7 +108,12 @@ def user_invitation_email(
|
|||
to_name \\ nil
|
||||
) do
|
||||
Gettext.with_locale_or_default user.language do
|
||||
registration_url = ~p[/registration/#{user_invite_token.token}]
|
||||
registration_url =
|
||||
Router.Helpers.redirect_url(
|
||||
Endpoint,
|
||||
:registration_page,
|
||||
user_invite_token.token
|
||||
)
|
||||
|
||||
html_body =
|
||||
Gettext.dpgettext(
|
||||
|
@ -140,7 +146,13 @@ def user_invitation_email(
|
|||
|
||||
def account_confirmation_email(user) do
|
||||
Gettext.with_locale_or_default user.language do
|
||||
confirmation_url = ~p[/api/account/confirm_email/#{user.id}/#{user.confirmation_token}]
|
||||
confirmation_url =
|
||||
Router.Helpers.confirm_email_url(
|
||||
Endpoint,
|
||||
:confirm_email,
|
||||
user.id,
|
||||
to_string(user.confirmation_token)
|
||||
)
|
||||
|
||||
html_body =
|
||||
Gettext.dpgettext(
|
||||
|
@ -330,7 +342,7 @@ def unsubscribe_url(user, notifications_type) do
|
|||
|> Pleroma.JWT.generate_and_sign!()
|
||||
|> Base.encode64()
|
||||
|
||||
~p[/mailer/unsubscribe/#{token}]
|
||||
Router.Helpers.subscription_url(Endpoint, :unsubscribe, token)
|
||||
end
|
||||
|
||||
def backup_is_ready_email(backup, admin_user_id \\ nil) do
|
||||
|
|
|
@ -76,6 +76,6 @@ def sign(%User{keys: keys} = user, headers) do
|
|||
def signed_date, do: signed_date(NaiveDateTime.utc_now())
|
||||
|
||||
def signed_date(%NaiveDateTime{} = date) do
|
||||
Timex.lformat!(date, "{WDshort}, {0D} {Mshort} {YYYY} {h24}:{m}:{s} GMT", "en")
|
||||
Timex.format!(date, "{WDshort}, {0D} {Mshort} {YYYY} {h24}:{m}:{s} GMT")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -44,8 +44,6 @@ defmodule Pleroma.User do
|
|||
alias Pleroma.Web.RelMe
|
||||
alias Pleroma.Workers.BackgroundWorker
|
||||
|
||||
use Pleroma.Web, :verified_routes
|
||||
|
||||
require Logger
|
||||
|
||||
@type t :: %__MODULE__{}
|
||||
|
@ -1605,13 +1603,9 @@ def blocks_user?(%User{} = user, %User{} = target) do
|
|||
def blocks_user?(_, _), do: false
|
||||
|
||||
def blocks_domain?(%User{} = user, %User{} = target) do
|
||||
domain_blocks = Pleroma.Web.ActivityPub.MRF.subdomains_regex(user.domain_blocks)
|
||||
%{host: host} = URI.parse(target.ap_id)
|
||||
Enum.member?(user.domain_blocks, host)
|
||||
# TODO: functionality should probably be changed such that subdomains block as well,
|
||||
# but as it stands, this just hecks up the relationships endpoint
|
||||
# domain_blocks = Pleroma.Web.ActivityPub.MRF.subdomains_regex(user.domain_blocks)
|
||||
# %{host: host} = URI.parse(target.ap_id)
|
||||
# Pleroma.Web.ActivityPub.MRF.subdomain_match?(domain_blocks, host)
|
||||
Pleroma.Web.ActivityPub.MRF.subdomain_match?(domain_blocks, host)
|
||||
end
|
||||
|
||||
def blocks_domain?(_, _), do: false
|
||||
|
@ -2453,7 +2447,12 @@ defp validate_rel_me_field(changeset, fields, raw_fields, %User{
|
|||
end
|
||||
|
||||
if is_url(raw_value) do
|
||||
frontend_url = url(~p[/#{nickname}])
|
||||
frontend_url =
|
||||
Pleroma.Web.Router.Helpers.redirect_url(
|
||||
Pleroma.Web.Endpoint,
|
||||
:redirector_with_meta,
|
||||
nickname
|
||||
)
|
||||
|
||||
possible_urls = [ap_id, frontend_url]
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ defmodule Pleroma.Web do
|
|||
alias Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug
|
||||
alias Pleroma.Web.Plugs.OAuthScopesPlug
|
||||
alias Pleroma.Web.Plugs.PlugHelper
|
||||
require Pleroma.Constants
|
||||
|
||||
def controller do
|
||||
quote do
|
||||
|
@ -38,7 +37,7 @@ def controller do
|
|||
import Pleroma.Web.Gettext
|
||||
import Pleroma.Web.TranslationHelpers
|
||||
|
||||
unquote(verified_routes())
|
||||
alias Pleroma.Web.Router.Helpers, as: Routes
|
||||
|
||||
plug(:set_put_layout)
|
||||
|
||||
|
@ -185,10 +184,7 @@ def view do
|
|||
|
||||
# Import convenience functions from controllers
|
||||
import Phoenix.Controller,
|
||||
only: [view_module: 1, view_template: 1]
|
||||
|
||||
import Phoenix.Flash
|
||||
alias Phoenix.Flash
|
||||
only: [get_flash: 1, get_flash: 2, view_module: 1, view_template: 1]
|
||||
|
||||
# Include shared imports and aliases for views
|
||||
unquote(view_helpers())
|
||||
|
@ -222,7 +218,7 @@ def component do
|
|||
|
||||
def router do
|
||||
quote do
|
||||
use Phoenix.Router, helpers: false
|
||||
use Phoenix.Router
|
||||
|
||||
import Plug.Conn
|
||||
import Phoenix.Controller
|
||||
|
@ -250,24 +246,7 @@ defp view_helpers do
|
|||
|
||||
import Pleroma.Web.ErrorHelpers
|
||||
import Pleroma.Web.Gettext
|
||||
unquote(verified_routes())
|
||||
end
|
||||
end
|
||||
|
||||
def static_paths, do: Pleroma.Constants.static_only_files()
|
||||
|
||||
def verified_routes do
|
||||
quote do
|
||||
use Phoenix.VerifiedRoutes,
|
||||
endpoint: Pleroma.Web.Endpoint,
|
||||
router: Pleroma.Web.Router,
|
||||
statics: Pleroma.Web.static_paths()
|
||||
end
|
||||
end
|
||||
|
||||
def mailer do
|
||||
quote do
|
||||
unquote(verified_routes())
|
||||
alias Pleroma.Web.Router.Helpers, as: Routes
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1792,11 +1792,6 @@ def pin_data_from_featured_collection(
|
|||
end)
|
||||
end
|
||||
|
||||
def pin_data_from_featured_collection(obj) do
|
||||
Logger.error("Could not parse featured collection #{inspect(obj)}")
|
||||
%{}
|
||||
end
|
||||
|
||||
def fetch_and_prepare_featured_from_ap_id(nil) do
|
||||
{:ok, %{}}
|
||||
end
|
||||
|
|
|
@ -18,8 +18,6 @@ defmodule Pleroma.Web.ActivityPub.Builder do
|
|||
alias Pleroma.Web.CommonAPI.ActivityDraft
|
||||
alias Pleroma.Web.Endpoint
|
||||
|
||||
use Pleroma.Web, :verified_routes
|
||||
|
||||
require Pleroma.Constants
|
||||
|
||||
def accept_or_reject(actor, activity, type) do
|
||||
|
@ -404,6 +402,6 @@ def unpin(%User{} = user, object) do
|
|||
end
|
||||
|
||||
defp pinned_url(nickname) when is_binary(nickname) do
|
||||
url(~p[/users/#{nickname}/collections/featured])
|
||||
Pleroma.Web.Router.Helpers.activity_pub_url(Pleroma.Web.Endpoint, :pinned, nickname)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,11 +16,10 @@ defmodule Pleroma.Web.ActivityPub.Utils do
|
|||
alias Pleroma.Web.ActivityPub.Visibility
|
||||
alias Pleroma.Web.AdminAPI.AccountView
|
||||
alias Pleroma.Web.Endpoint
|
||||
alias Pleroma.Web.Router.Helpers
|
||||
|
||||
import Ecto.Query
|
||||
|
||||
use Pleroma.Web, :verified_routes
|
||||
|
||||
require Logger
|
||||
require Pleroma.Constants
|
||||
|
||||
|
@ -125,15 +124,19 @@ def make_date do
|
|||
end
|
||||
|
||||
def generate_activity_id do
|
||||
url(~p[/activities/#{UUID.generate()}])
|
||||
generate_id("activities")
|
||||
end
|
||||
|
||||
def generate_context_id do
|
||||
url(~p[/contexts/#{UUID.generate()}])
|
||||
generate_id("contexts")
|
||||
end
|
||||
|
||||
def generate_object_id do
|
||||
url(~p[/objects/#{UUID.generate()}])
|
||||
Helpers.o_status_url(Endpoint, :object, UUID.generate())
|
||||
end
|
||||
|
||||
def generate_id(type) do
|
||||
"#{Endpoint.url()}/#{type}/#{UUID.generate()}"
|
||||
end
|
||||
|
||||
def get_notified_from_object(%{"type" => type} = object) when type in @supported_object_types do
|
||||
|
@ -151,7 +154,7 @@ def get_notified_from_object(object) do
|
|||
Notification.get_notified_from_activity(%Activity{data: object}, false)
|
||||
end
|
||||
|
||||
def maybe_create_context(context), do: context || generate_context_id()
|
||||
def maybe_create_context(context), do: context || generate_id("contexts")
|
||||
|
||||
@doc """
|
||||
Enqueues an activity for federation if it's local
|
||||
|
|
|
@ -12,22 +12,24 @@ defmodule Pleroma.Web.ActivityPub.UserView do
|
|||
alias Pleroma.Web.ActivityPub.ObjectView
|
||||
alias Pleroma.Web.ActivityPub.Transmogrifier
|
||||
alias Pleroma.Web.ActivityPub.Utils
|
||||
alias Pleroma.Web.Endpoint
|
||||
alias Pleroma.Web.Router.Helpers
|
||||
|
||||
require Pleroma.Web.ActivityPub.Transmogrifier
|
||||
|
||||
import Ecto.Query
|
||||
|
||||
def render("endpoints.json", %{user: %User{nickname: nil, local: true} = _user}) do
|
||||
%{"sharedInbox" => url(~p"/inbox")}
|
||||
%{"sharedInbox" => Helpers.activity_pub_url(Endpoint, :inbox)}
|
||||
end
|
||||
|
||||
def render("endpoints.json", %{user: %User{local: true} = _user}) do
|
||||
%{
|
||||
"oauthAuthorizationEndpoint" => url(~p"/oauth/authorize"),
|
||||
"oauthRegistrationEndpoint" => url(~p"/api/v1/apps"),
|
||||
"oauthTokenEndpoint" => url(~p"/oauth/token"),
|
||||
"sharedInbox" => url(~p"/inbox"),
|
||||
"uploadMedia" => url(~p"/api/ap/upload_media")
|
||||
"oauthAuthorizationEndpoint" => Helpers.o_auth_url(Endpoint, :authorize),
|
||||
"oauthRegistrationEndpoint" => Helpers.app_url(Endpoint, :create),
|
||||
"oauthTokenEndpoint" => Helpers.o_auth_url(Endpoint, :token_exchange),
|
||||
"sharedInbox" => Helpers.activity_pub_url(Endpoint, :inbox),
|
||||
"uploadMedia" => Helpers.activity_pub_url(Endpoint, :upload_media)
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -17,7 +17,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
|
|||
alias Pleroma.Web.AdminAPI
|
||||
alias Pleroma.Web.AdminAPI.AccountView
|
||||
alias Pleroma.Web.AdminAPI.ModerationLogView
|
||||
alias Pleroma.Web.Endpoint
|
||||
alias Pleroma.Web.Plugs.OAuthScopesPlug
|
||||
alias Pleroma.Web.Router
|
||||
|
||||
@users_page_size 50
|
||||
|
||||
|
@ -254,7 +256,7 @@ def get_password_reset(conn, %{"nickname" => nickname}) do
|
|||
conn
|
||||
|> json(%{
|
||||
token: token.token,
|
||||
link: url(~p[/api/v1/pleroma/password_reset/#{token.token}])
|
||||
link: Router.Helpers.reset_password_url(Endpoint, :reset, token.token)
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -451,20 +451,6 @@ def endorsements_operation do
|
|||
}
|
||||
end
|
||||
|
||||
def preferences_operation do
|
||||
%Operation{
|
||||
tags: ["Account Preferences"],
|
||||
description: "Preferences defined by the user in their account settings.",
|
||||
summary: "Preferred common behaviors to be shared across clients.",
|
||||
operationId: "AccountController.preferences",
|
||||
security: [%{"oAuth" => ["read:accounts"]}],
|
||||
responses: %{
|
||||
200 => Operation.response("Preferences", "application/json", Account),
|
||||
401 => Operation.response("Error", "application/json", ApiError)
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def identity_proofs_operation do
|
||||
%Operation{
|
||||
tags: ["Retrieve account information"],
|
||||
|
|
|
@ -97,7 +97,7 @@ defmodule Pleroma.Web.Endpoint do
|
|||
Plug.Static,
|
||||
at: "/",
|
||||
from: :pleroma,
|
||||
only: Pleroma.Web.static_paths(),
|
||||
only: Pleroma.Constants.static_only_files(),
|
||||
# credo:disable-for-previous-line Credo.Check.Readability.MaxLineLength
|
||||
gzip: true,
|
||||
cache_control_for_etags: @static_cache_control,
|
||||
|
|
|
@ -30,7 +30,7 @@ def feed_redirect(%{assigns: %{format: format}} = conn, _params)
|
|||
|
||||
def feed_redirect(conn, %{"nickname" => nickname}) do
|
||||
with {_, %User{} = user} <- {:fetch_user, User.get_cached_by_nickname(nickname)} do
|
||||
redirect(conn, external: "#{url(~p"/users/#{user.nickname}/feed")}.atom")
|
||||
redirect(conn, external: "#{Routes.user_feed_url(conn, :feed, user.nickname)}.atom")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@ def index(conn, _params) do
|
|||
|
||||
index =
|
||||
if flavour == "fedibird-fe" do
|
||||
"fedibird.html"
|
||||
"fedibird.index.html"
|
||||
else
|
||||
"glitchsoc.html"
|
||||
"glitchsoc.index.html"
|
||||
end
|
||||
|
||||
conn
|
||||
|
|
|
@ -51,7 +51,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
|
|||
plug(
|
||||
OAuthScopesPlug,
|
||||
%{scopes: ["read:accounts"]}
|
||||
when action in [:verify_credentials, :endorsements, :identity_proofs, :preferences]
|
||||
when action in [:verify_credentials, :endorsements, :identity_proofs]
|
||||
)
|
||||
|
||||
plug(
|
||||
|
@ -544,9 +544,4 @@ def endorsements(conn, params), do: MastodonAPIController.empty_array(conn, para
|
|||
|
||||
@doc "GET /api/v1/identity_proofs"
|
||||
def identity_proofs(conn, params), do: MastodonAPIController.empty_array(conn, params)
|
||||
|
||||
@doc "GET /api/v1/preferences"
|
||||
def preferences(%{assigns: %{user: user}} = conn, _params) do
|
||||
render(conn, "preferences.json", user: user)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,7 +54,12 @@ def login(conn, params) do
|
|||
defp redirect_to_oauth_form(conn, _params) do
|
||||
with {:ok, app} <- local_mastofe_app() do
|
||||
path =
|
||||
~p[/oauth/authorize?#{[response_type: "code", client_id: app.client_id, redirect_uri: ".", scope: Enum.join(app.scopes, " ")]}]
|
||||
Routes.o_auth_path(conn, :authorize,
|
||||
response_type: "code",
|
||||
client_id: app.client_id,
|
||||
redirect_uri: ".",
|
||||
scope: Enum.join(app.scopes, " ")
|
||||
)
|
||||
|
||||
redirect(conn, to: path)
|
||||
end
|
||||
|
@ -86,7 +91,7 @@ def password_reset(conn, params) do
|
|||
defp local_mastodon_post_login_path(conn) do
|
||||
case get_session(conn, :return_to) do
|
||||
nil ->
|
||||
~p"/web/getting-started"
|
||||
Routes.masto_fe_path(conn, :index, ["getting-started"])
|
||||
|
||||
return_to ->
|
||||
delete_session(conn, :return_to)
|
||||
|
|
|
@ -190,17 +190,6 @@ def render("instance.json", %{instance: %Pleroma.Instances.Instance{} = instance
|
|||
|
||||
def render("instance.json", _), do: nil
|
||||
|
||||
def render("preferences.json", %{user: user} = _opts) do
|
||||
# TODO: Do we expose more settings that make sense to plug in here?
|
||||
%{
|
||||
"posting:default:visibility": user.default_scope,
|
||||
"posting:default:sensitive": false,
|
||||
"posting:default:language": nil,
|
||||
"reading:expand:media": "default",
|
||||
"reading:expand:spoilers": false
|
||||
}
|
||||
end
|
||||
|
||||
defp do_render("show.json", %{user: user} = opts) do
|
||||
user = User.sanitize_html(user, User.html_filter_policy(opts[:for]))
|
||||
display_name = user.name || user.nickname
|
||||
|
|
|
@ -322,7 +322,7 @@ def render("show.json", %{activity: %{id: id, data: %{"object" => _object}} = ac
|
|||
|
||||
url =
|
||||
if user.local do
|
||||
url(~p[/notice/#{activity}])
|
||||
Pleroma.Web.Router.Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, activity)
|
||||
else
|
||||
object.data["url"] || object.data["external_url"] || object.data["id"]
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
defmodule Pleroma.Web.MastodonAPI.TagView do
|
||||
use Pleroma.Web, :view
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.Router.Helpers
|
||||
|
||||
def render("index.json", %{tags: tags, for_user: user}) do
|
||||
render_many(tags, __MODULE__, "show.json", %{for_user: user})
|
||||
|
@ -16,7 +17,7 @@ def render("show.json", %{tag: tag, for_user: user}) do
|
|||
|
||||
%{
|
||||
name: tag.name,
|
||||
url: url(~p[/tags/#{tag.name}]),
|
||||
url: Helpers.tag_feed_url(Pleroma.Web.Endpoint, :feed, tag.name),
|
||||
history: [],
|
||||
following: following
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Web.Metadata.Providers.Feed do
|
||||
alias Pleroma.Web.Endpoint
|
||||
alias Pleroma.Web.Metadata.Providers.Provider
|
||||
|
||||
use Pleroma.Web, :verified_routes
|
||||
alias Pleroma.Web.Router.Helpers
|
||||
|
||||
@behaviour Provider
|
||||
|
||||
|
@ -16,7 +16,7 @@ def build_tags(%{user: user}) do
|
|||
[
|
||||
rel: "alternate",
|
||||
type: "application/atom+xml",
|
||||
href: ~p[/users/#{user.nickname}/feed.atom]
|
||||
href: Helpers.user_feed_path(Endpoint, :feed, user.nickname) <> ".atom"
|
||||
], []}
|
||||
]
|
||||
end
|
||||
|
|
|
@ -10,8 +10,6 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCard do
|
|||
alias Pleroma.Web.Metadata.Providers.Provider
|
||||
alias Pleroma.Web.Metadata.Utils
|
||||
|
||||
use Pleroma.Web, :verified_routes
|
||||
|
||||
@behaviour Provider
|
||||
@media_types ["image", "audio", "video"]
|
||||
|
||||
|
@ -114,7 +112,7 @@ defp build_attachments(id, %{data: %{"attachment" => attachments}}) do
|
|||
defp build_attachments(_id, _object), do: []
|
||||
|
||||
defp player_url(id) do
|
||||
url(~p[/notice/#{id}/embed_player])
|
||||
Pleroma.Web.Router.Helpers.o_status_url(Pleroma.Web.Endpoint, :notice_player, id)
|
||||
end
|
||||
|
||||
# Videos have problems without dimensions, but we used to not provide WxH for images.
|
||||
|
|
|
@ -449,7 +449,7 @@ def prepare_request(%Plug.Conn{} = conn, %{
|
|||
|> Map.put("state", state)
|
||||
|
||||
# Handing the request to Ueberauth
|
||||
redirect(conn, to: ~p"/oauth/#{provider}?#{params}")
|
||||
redirect(conn, to: Routes.o_auth_path(conn, :request, provider, params))
|
||||
end
|
||||
|
||||
def request(%Plug.Conn{} = conn, params) do
|
||||
|
@ -623,7 +623,7 @@ def login(%User{} = user, %App{} = app, requested_scopes) when is_list(requested
|
|||
end
|
||||
|
||||
# Special case: Local MastodonFE
|
||||
defp redirect_uri(_, "."), do: url(~p"/web/login")
|
||||
defp redirect_uri(%Plug.Conn{} = conn, "."), do: Routes.auth_url(conn, :login)
|
||||
|
||||
defp redirect_uri(%Plug.Conn{}, redirect_uri), do: redirect_uri
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
|
|||
alias Pleroma.Web.Fallback.RedirectController
|
||||
alias Pleroma.Web.Metadata.PlayerView
|
||||
alias Pleroma.Web.Plugs.RateLimiter
|
||||
alias Pleroma.Web.Router
|
||||
|
||||
plug(
|
||||
RateLimiter,
|
||||
|
@ -86,7 +87,7 @@ def notice(%{assigns: %{format: format}} = conn, %{"id" => id}) do
|
|||
%{
|
||||
activity_id: activity.id,
|
||||
object: object,
|
||||
url: url(~p[/notice/#{activity.id}]),
|
||||
url: Router.Helpers.o_status_url(Endpoint, :notice, activity.id),
|
||||
user: user
|
||||
}
|
||||
)
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
defmodule Pleroma.Web.Plugs.HTTPSignaturePlug do
|
||||
import Plug.Conn
|
||||
import Phoenix.Controller, only: [get_format: 1]
|
||||
|
||||
use Pleroma.Web, :verified_routes
|
||||
alias Pleroma.Activity
|
||||
alias Pleroma.Web.Router
|
||||
alias Pleroma.Signature
|
||||
alias Pleroma.Instances
|
||||
require Logger
|
||||
|
@ -33,10 +32,10 @@ def call(conn, _opts) do
|
|||
end
|
||||
|
||||
def route_aliases(%{path_info: ["objects", id], query_string: query_string}) do
|
||||
ap_id = url(~p[/objects/#{id}])
|
||||
ap_id = Router.Helpers.o_status_url(Pleroma.Web.Endpoint, :object, id)
|
||||
|
||||
with %Activity{} = activity <- Activity.get_by_object_ap_id_with_object(ap_id) do
|
||||
[~p"/notice/#{activity.id}", "/notice/#{activity.id}?#{query_string}"]
|
||||
["/notice/#{activity.id}", "/notice/#{activity.id}?#{query_string}"]
|
||||
else
|
||||
_ -> []
|
||||
end
|
||||
|
|
|
@ -629,8 +629,6 @@ defmodule Pleroma.Web.Router do
|
|||
post("/tags/:id/follow", TagController, :follow)
|
||||
post("/tags/:id/unfollow", TagController, :unfollow)
|
||||
get("/followed_tags", TagController, :show_followed)
|
||||
|
||||
get("/preferences", AccountController, :preferences)
|
||||
end
|
||||
|
||||
scope "/api/web", Pleroma.Web do
|
||||
|
|
|
@ -11,6 +11,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
|
|||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
alias Pleroma.Web.ActivityPub.Visibility
|
||||
alias Pleroma.Web.Metadata
|
||||
alias Pleroma.Web.Router.Helpers
|
||||
|
||||
plug(:put_layout, :static_fe)
|
||||
plug(:assign_id)
|
||||
|
@ -110,11 +111,11 @@ def show(%{assigns: %{username_or_id: username_or_id, tab: tab}} = conn, params)
|
|||
end
|
||||
|
||||
def show(%{assigns: %{object_id: _}} = conn, _params) do
|
||||
url = unverified_url(conn, conn.request_path)
|
||||
url = Helpers.url(conn) <> conn.request_path
|
||||
|
||||
case Activity.get_create_by_object_ap_id_with_object(url) do
|
||||
%Activity{} = activity ->
|
||||
to = ~p[/notice/#{activity}]
|
||||
to = Helpers.o_status_path(Pleroma.Web.Endpoint, :notice, activity)
|
||||
redirect(conn, to: to)
|
||||
|
||||
_ ->
|
||||
|
@ -123,11 +124,11 @@ def show(%{assigns: %{object_id: _}} = conn, _params) do
|
|||
end
|
||||
|
||||
def show(%{assigns: %{activity_id: _}} = conn, _params) do
|
||||
url = unverified_url(conn, conn.request_path)
|
||||
url = Helpers.url(conn) <> conn.request_path
|
||||
|
||||
case Activity.get_by_ap_id(url) do
|
||||
%Activity{} = activity ->
|
||||
to = ~p[/notice/#{activity}]
|
||||
to = Helpers.o_status_path(Pleroma.Web.Endpoint, :notice, activity)
|
||||
redirect(conn, to: to)
|
||||
|
||||
_ ->
|
||||
|
@ -166,7 +167,7 @@ defp represent(%Activity{object: %Object{data: data}} = activity, selected) do
|
|||
|
||||
link =
|
||||
case user.local do
|
||||
true -> ~p[/notice/#{activity}]
|
||||
true -> Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, activity)
|
||||
_ -> data["url"] || data["external_url"] || data["id"]
|
||||
end
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEView do
|
|||
alias Pleroma.Web.Gettext
|
||||
alias Pleroma.Web.MediaProxy
|
||||
alias Pleroma.Web.Metadata.Utils
|
||||
alias Pleroma.Web.Router.Helpers
|
||||
|
||||
use Phoenix.HTML
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<h3>After you submit, you will need to refresh manually to get your new frontend!</h3>
|
||||
|
||||
<%= form_for @conn, ~p"/akkoma/frontend", fn f -> %>
|
||||
<%= form_for @conn, Routes.frontend_switcher_path(@conn, :do_switch), fn f -> %>
|
||||
<%= select(f, :frontend, @choices) %>
|
||||
|
||||
<%= submit do: "submit" %>
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
xmlns:ostatus="http://ostatus.org/schema/1.0"
|
||||
xmlns:statusnet="http://status.net/schema/api/1/">
|
||||
|
||||
<id><%= '#{url(~p"/tags/#{@tag}")}.rss' %></id>
|
||||
<id><%= '#{Routes.tag_feed_url(@conn, :feed, @tag)}.rss' %></id>
|
||||
<title>#<%= @tag %></title>
|
||||
|
||||
<subtitle><%= Gettext.dpgettext("static_pages", "tag feed description", "These are public toots tagged with #%{tag}. You can interact with them if you have an account anywhere in the fediverse.", tag: @tag) %></subtitle>
|
||||
<logo><%= feed_logo() %></logo>
|
||||
<updated><%= most_recent_update(@activities) %></updated>
|
||||
<link rel="self" href="<%= '#{url(~p"/tags/#{@tag}")}.atom' %>" type="application/atom+xml"/>
|
||||
<link rel="self" href="<%= '#{Routes.tag_feed_url(@conn, :feed, @tag)}.atom' %>" type="application/atom+xml"/>
|
||||
<%= for activity <- @activities do %>
|
||||
<%= render @view_module, "_tag_activity.atom", Map.merge(assigns, prepare_activity(activity, actor: true)) %>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<title>#<%= @tag %></title>
|
||||
<description><%= Gettext.dpgettext("static_pages", "tag feed description", "These are public toots tagged with #%{tag}. You can interact with them if you have an account anywhere in the fediverse.", tag: @tag) %></description>
|
||||
<link><%= '#{url(~p"/tags/#{@tag}")}.rss' %></link>
|
||||
<link><%= '#{Routes.tag_feed_url(@conn, :feed, @tag)}.rss' %></link>
|
||||
<webfeeds:logo><%= feed_logo() %></webfeeds:logo>
|
||||
<webfeeds:accentColor>2b90d9</webfeeds:accentColor>
|
||||
<%= for activity <- @activities do %>
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
xmlns:poco="http://portablecontacts.net/spec/1.0"
|
||||
xmlns:ostatus="http://ostatus.org/schema/1.0">
|
||||
|
||||
<id><%= url(~p"/users/#{@user.nickname}/feed") <> ".atom" %></id>
|
||||
<id><%= Routes.user_feed_url(@conn, :feed, @user.nickname) <> ".atom" %></id>
|
||||
<title><%= @user.nickname <> "'s timeline" %></title>
|
||||
<updated><%= most_recent_update(@activities, @user) %></updated>
|
||||
<logo><%= logo(@user) %></logo>
|
||||
<link rel="self" href="<%= '#{url(~p"/users/#{@user.nickname}/feed")}.atom' %>" type="application/atom+xml"/>
|
||||
<link rel="self" href="<%= '#{Routes.user_feed_url(@conn, :feed, @user.nickname)}.atom' %>" type="application/atom+xml"/>
|
||||
|
||||
<%= render @view_module, "_author.atom", assigns %>
|
||||
|
||||
<%= if last_activity(@activities) do %>
|
||||
<link rel="next" href="<%= '#{url(~p"/users/#{@user.nickname}/feed")}.atom?max_id=#{last_activity(@activities).id}' %>" type="application/atom+xml"/>
|
||||
<link rel="next" href="<%= '#{Routes.user_feed_url(@conn, :feed, @user.nickname)}.atom?max_id=#{last_activity(@activities).id}' %>" type="application/atom+xml"/>
|
||||
<% end %>
|
||||
|
||||
<%= for activity <- @activities do %>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<guid><%= url(~p"/users/#{@user.nickname}/feed") <> ".rss" %></guid>
|
||||
<guid><%= Routes.user_feed_url(@conn, :feed, @user.nickname) <> ".rss" %></guid>
|
||||
<title><%= @user.nickname <> "'s timeline" %></title>
|
||||
<updated><%= most_recent_update(@activities, @user) %></updated>
|
||||
<image><%= logo(@user) %></image>
|
||||
<link><%= '#{url(~p"/users/#{@user.nickname}/feed")}.rss' %></link>
|
||||
<link><%= '#{Routes.user_feed_url(@conn, :feed, @user.nickname)}.rss' %></link>
|
||||
|
||||
<%= render @view_module, "_author.rss", assigns %>
|
||||
|
||||
<%= if last_activity(@activities) do %>
|
||||
<link rel="next"><%= '#{url(~p"/users/#{@user.nickname}/feed")}.rss?max_id=#{last_activity(@activities).id}' %></link>
|
||||
<link rel="next"><%= '#{Routes.user_feed_url(@conn, :feed, @user.nickname)}.rss?max_id=#{last_activity(@activities).id}' %></link>
|
||||
<% end %>
|
||||
|
||||
<%= for activity <- @activities do %>
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- FEDIBIRD -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport" />
|
||||
<title>
|
||||
<%= Config.get([:instance, :name]) %>
|
||||
</title>
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<link rel="manifest" type="applicaton/manifest+json" {%{href: ~p"/web/manifest.json"}} />
|
||||
|
||||
<meta name="theme-color" {%{content: Config.get([:manifest, :theme_color])}} />
|
||||
|
||||
<script id="initial-state" type="application/json">
|
||||
<%= initial_state(@token, @user, @custom_emojis) %>
|
||||
</script>
|
||||
|
||||
<script crossorigin="anonymous" src="/packs/js/common.js">
|
||||
</script>
|
||||
<script crossorigin="anonymous" src="/packs/js/locale_en.js">
|
||||
</script>
|
||||
|
||||
<link
|
||||
rel="preload"
|
||||
as="script"
|
||||
crossorigin="anonymous"
|
||||
href="/packs/js/features/getting_started.js"
|
||||
/>
|
||||
<link rel="preload" as="script" crossorigin="anonymous" href="/packs/js/features/compose.js" />
|
||||
<link
|
||||
rel="preload"
|
||||
as="script"
|
||||
crossorigin="anonymous"
|
||||
href="/packs/js/features/home_timeline.js"
|
||||
/>
|
||||
<link
|
||||
rel="preload"
|
||||
as="script"
|
||||
crossorigin="anonymous"
|
||||
href="/packs/js/features/public_timeline.js"
|
||||
/>
|
||||
<link
|
||||
rel="preload"
|
||||
as="script"
|
||||
crossorigin="anonymous"
|
||||
href="/packs/js/features/notifications.js"
|
||||
/>
|
||||
<script crossorigin="anonymous" src="/packs/js/application.js">
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" media="all" href="/packs/css/common.css" />
|
||||
<link rel="stylesheet" media="all" href="/packs/css/default.css" />
|
||||
</head>
|
||||
<body class="app-body no-reduce-motion system-font">
|
||||
<div class="app-holder" data-props="{"locale":"en"}" id="mastodon"></div>
|
||||
</body>
|
||||
</html>
|
35
lib/pleroma/web/templates/masto_fe/fedibird.index.html.eex
Normal file
35
lib/pleroma/web/templates/masto_fe/fedibird.index.html.eex
Normal file
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta content='width=device-width, initial-scale=1' name='viewport'>
|
||||
<title>
|
||||
<%= Config.get([:instance, :name]) %>
|
||||
</title>
|
||||
<link rel="icon" type="image/png" href="/favicon.png"/>
|
||||
<link rel="manifest" type="applicaton/manifest+json" href="<%= Routes.masto_fe_path(Pleroma.Web.Endpoint, :manifest) %>" />
|
||||
|
||||
<meta name="theme-color" content="<%= Config.get([:manifest, :theme_color]) %>" />
|
||||
|
||||
<script id='initial-state' type='application/json'><%= initial_state(@token, @user, @custom_emojis) %></script>
|
||||
|
||||
<script crossorigin='anonymous' src="/packs/js/common.js"></script>
|
||||
<script crossorigin='anonymous' src="/packs/js/locale_en.js"></script>
|
||||
|
||||
<link rel='preload' as='script' crossorigin='anonymous' href='/packs/js/features/getting_started.js'>
|
||||
<link rel='preload' as='script' crossorigin='anonymous' href='/packs/js/features/compose.js'>
|
||||
<link rel='preload' as='script' crossorigin='anonymous' href='/packs/js/features/home_timeline.js'>
|
||||
<link rel='preload' as='script' crossorigin='anonymous' href='/packs/js/features/public_timeline.js'>
|
||||
<link rel='preload' as='script' crossorigin='anonymous' href='/packs/js/features/notifications.js'>
|
||||
<script crossorigin='anonymous' src="/packs/js/application.js"></script>
|
||||
|
||||
|
||||
<link rel="stylesheet" media="all" href="/packs/css/common.css" />
|
||||
<link rel="stylesheet" media="all" href="/packs/css/default.css" />
|
||||
|
||||
</head>
|
||||
<body class='app-body no-reduce-motion system-font'>
|
||||
<div class='app-holder' data-props='{"locale":"en"}' id='mastodon'>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,57 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- GLITCHSOC -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport" />
|
||||
<title>
|
||||
<%= Config.get([:instance, :name]) %>
|
||||
</title>
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<link rel="manifest" type="applicaton/manifest+json" {%{href: ~p"/web/manifest.json"}} />
|
||||
|
||||
<meta name="theme-color" {%{content: Config.get([:manifest, :theme_color])}} />
|
||||
|
||||
<script crossorigin="anonymous" src="/packs/js/locales.js">
|
||||
</script>
|
||||
<script crossorigin="anonymous" src="/packs/js/locales/glitch/en.js">
|
||||
</script>
|
||||
|
||||
<link
|
||||
rel="preload"
|
||||
as="script"
|
||||
crossorigin="anonymous"
|
||||
href="/packs/js/features/getting_started.js"
|
||||
/>
|
||||
<link rel="preload" as="script" crossorigin="anonymous" href="/packs/js/features/compose.js" />
|
||||
<link
|
||||
rel="preload"
|
||||
as="script"
|
||||
crossorigin="anonymous"
|
||||
href="/packs/js/features/home_timeline.js"
|
||||
/>
|
||||
<link
|
||||
rel="preload"
|
||||
as="script"
|
||||
crossorigin="anonymous"
|
||||
href="/packs/js/features/notifications.js"
|
||||
/>
|
||||
<script id="initial-state" type="application/json">
|
||||
<%= initial_state(@token, @user, @custom_emojis) %>
|
||||
</script>
|
||||
|
||||
<script src="/packs/js/core/common.js">
|
||||
</script>
|
||||
<link rel="stylesheet" media="all" href="/packs/css/core/common.css" />
|
||||
|
||||
<script src="/packs/js/flavours/glitch/common.js">
|
||||
</script>
|
||||
<link rel="stylesheet" media="all" href="/packs/css/flavours/glitch/common.css" />
|
||||
|
||||
<script src="/packs/js/flavours/glitch/home.js">
|
||||
</script>
|
||||
</head>
|
||||
<body class="app-body no-reduce-motion system-font">
|
||||
<div class="app-holder" data-props="{"locale":"en"}" id="mastodon"></div>
|
||||
</body>
|
||||
</html>
|
35
lib/pleroma/web/templates/masto_fe/glitchsoc.index.html.eex
Normal file
35
lib/pleroma/web/templates/masto_fe/glitchsoc.index.html.eex
Normal file
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta content='width=device-width, initial-scale=1' name='viewport'>
|
||||
<title>
|
||||
<%= Config.get([:instance, :name]) %>
|
||||
</title>
|
||||
<link rel="icon" type="image/png" href="/favicon.png"/>
|
||||
<link rel="manifest" type="applicaton/manifest+json" href="<%= Routes.masto_fe_path(Pleroma.Web.Endpoint, :manifest) %>" />
|
||||
|
||||
<meta name="theme-color" content="<%= Config.get([:manifest, :theme_color]) %>" />
|
||||
|
||||
<script crossorigin='anonymous' src="/packs/js/locales.js"></script>
|
||||
<script crossorigin='anonymous' src="/packs/js/locales/glitch/en.js"></script>
|
||||
|
||||
<link rel='preload' as='script' crossorigin='anonymous' href='/packs/js/features/getting_started.js'>
|
||||
<link rel='preload' as='script' crossorigin='anonymous' href='/packs/js/features/compose.js'>
|
||||
<link rel='preload' as='script' crossorigin='anonymous' href='/packs/js/features/home_timeline.js'>
|
||||
<link rel='preload' as='script' crossorigin='anonymous' href='/packs/js/features/notifications.js'>
|
||||
<script id='initial-state' type='application/json'><%= initial_state(@token, @user, @custom_emojis) %></script>
|
||||
|
||||
<script src="/packs/js/core/common.js"></script>
|
||||
<link rel="stylesheet" media="all" href="/packs/css/core/common.css" />
|
||||
|
||||
<script src="/packs/js/flavours/glitch/common.js"></script>
|
||||
<link rel="stylesheet" media="all" href="/packs/css/flavours/glitch/common.css" />
|
||||
|
||||
<script src="/packs/js/flavours/glitch/home.js"></script>
|
||||
</head>
|
||||
<body class='app-body no-reduce-motion system-font'>
|
||||
<div class='app-holder' data-props='{"locale":"en"}' id='mastodon'>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,15 +1,15 @@
|
|||
<div>
|
||||
<%= if Flash.get(@flash, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= Flash.get(@flash, :info) %></p>
|
||||
<%= if get_flash(@conn, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
|
||||
<% end %>
|
||||
<%= if Flash.get(@flash, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= Flash.get(@flash, :error) %></p>
|
||||
<%= if get_flash(@conn, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
|
||||
<% end %>
|
||||
<div class="panel-heading">
|
||||
<%= Gettext.dpgettext("static_pages", "mfa recover page title", "Two-factor recovery") %>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<%= form_for @conn, ~p"/oauth/mfa/verify", [as: "mfa"], fn f -> %>
|
||||
<%= form_for @conn, Routes.mfa_verify_path(@conn, :verify), [as: "mfa"], fn f -> %>
|
||||
<div class="input">
|
||||
<%= label f, :code, Gettext.dpgettext("static_pages", "mfa recover recovery code prompt", "Recovery code") %>
|
||||
<%= text_input f, :code, [autocomplete: false, autocorrect: "off", autocapitalize: "off", autofocus: true, spellcheck: false] %>
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
<%= submit Gettext.dpgettext("static_pages", "mfa recover verify recovery code button", "Verify") %>
|
||||
<% end %>
|
||||
<a href="<%= ~p"/oauth/mfa?#{[challenge_type: "totp", mfa_token: @mfa_token, state: @state, redirect_uri: @redirect_uri]}" %>">
|
||||
<a href="<%= Routes.mfa_path(@conn, :show, %{challenge_type: "totp", mfa_token: @mfa_token, state: @state, redirect_uri: @redirect_uri}) %>">
|
||||
<%= Gettext.dpgettext("static_pages", "mfa recover use 2fa code link", "Enter a two-factor code") %>
|
||||
</a>
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
<div>
|
||||
<%= if Flash.get(@flash, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= Flash.get(@flash, :info) %></p>
|
||||
<%= if get_flash(@conn, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
|
||||
<% end %>
|
||||
<%= if Flash.get(@flash, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= Flash.get(@flash, :error) %></p>
|
||||
<%= if get_flash(@conn, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
|
||||
<% end %>
|
||||
<div class="panel-heading">
|
||||
<%= Gettext.dpgettext("static_pages", "mfa auth page title", "Two-factor authentication") %>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<%= form_for @conn, ~p"/oauth/mfa/verify", [as: "mfa"], fn f -> %>
|
||||
<%= form_for @conn, Routes.mfa_verify_path(@conn, :verify), [as: "mfa"], fn f -> %>
|
||||
<div class="input">
|
||||
<%= label f, :code, Gettext.dpgettext("static_pages", "mfa auth code prompt", "Authentication code") %>
|
||||
<%= text_input f, :code, [autocomplete: "one-time-code", autocorrect: "off", autocapitalize: "off", autofocus: true, pattern: "[0-9]*", spellcheck: false] %>
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
<%= submit Gettext.dpgettext("static_pages", "mfa auth verify code button", "Verify") %>
|
||||
<% end %>
|
||||
<a href="<%= ~p"/oauth/mfa?#{[challenge_type: "recovery", mfa_token: @mfa_token, state: @state, redirect_uri: @redirect_uri]}" %>">
|
||||
<a href="<%= Routes.mfa_path(@conn, :show, %{challenge_type: "recovery", mfa_token: @mfa_token, state: @state, redirect_uri: @redirect_uri}) %>">
|
||||
<%= Gettext.dpgettext("static_pages", "mfa auth page use recovery code link", "Enter a two-factor recovery code") %>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<h2><%= Gettext.dpgettext("static_pages", "oauth external provider page title", "Sign in with external provider") %></h2>
|
||||
|
||||
<%= form_for @conn, ~p"/oauth/prepare_request", [as: "authorization", method: "get"], fn f -> %>
|
||||
<%= form_for @conn, Routes.o_auth_path(@conn, :prepare_request), [as: "authorization", method: "get"], fn f -> %>
|
||||
<div style="display: none">
|
||||
<%= render @view_module, "_scopes.html", Map.merge(assigns, %{form: f}) %>
|
||||
</div>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<%= if Flash.get(@flash, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= Flash.get(@flash, :info) %></p>
|
||||
<%= if get_flash(@conn, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
|
||||
<% end %>
|
||||
<%= if Flash.get(@flash, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= Flash.get(@flash, :error) %></p>
|
||||
<%= if get_flash(@conn, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
|
||||
<% end %>
|
||||
|
||||
<h2><%= Gettext.dpgettext("static_pages", "oauth register page title", "Registration Details") %></h2>
|
||||
|
||||
<p><%= Gettext.dpgettext("static_pages", "oauth register page fill form prompt", "If you'd like to register a new account, please provide the details below.") %></p>
|
||||
<%= form_for @conn, ~p"/oauth/register", [as: "authorization"], fn f -> %>
|
||||
<%= form_for @conn, Routes.o_auth_path(@conn, :register), [as: "authorization"], fn f -> %>
|
||||
|
||||
<div class="input">
|
||||
<%= label f, :nickname, Gettext.dpgettext("static_pages", "oauth register page nickname prompt", "Nickname") %>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<%= if Flash.get(@flash, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= Flash.get(@flash, :info) %></p>
|
||||
<%= if get_flash(@conn, :info) do %>
|
||||
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
|
||||
<% end %>
|
||||
<%= if Flash.get(@flash, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= Flash.get(@flash, :error) %></p>
|
||||
<%= if get_flash(@conn, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @conn, ~p"/oauth/authorize", [as: "authorization"], fn f -> %>
|
||||
<%= form_for @conn, Routes.o_auth_path(@conn, :authorize), [as: "authorization"], fn f -> %>
|
||||
|
||||
<%= if @user do %>
|
||||
<div class="account-header">
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="remote-follow">
|
||||
<form method="POST" action="<%= ~p"/main/ostatus" %>">
|
||||
<form method="POST" action="<%= Helpers.util_path(@conn, :remote_subscribe) %>">
|
||||
<input type="hidden" name="nickname" value="<%= @user.nickname %>">
|
||||
<input type="hidden" name="profile" value="">
|
||||
<button type="submit" class="button-default"><%= Gettext.dpgettext("static_pages", "static fe profile page remote follow button", "Remote follow") %></button>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<h2>Password Reset for <%= @user.nickname %></h2>
|
||||
<%= form_for @conn, ~p"/api/v1/pleroma/password_reset", [as: "data"], fn f -> %>
|
||||
<%= form_for @conn, Routes.reset_password_path(@conn, :do_reset), [as: "data"], fn f -> %>
|
||||
<div class="form-row">
|
||||
<%= label f, :password, Gettext.dpgettext("static_pages", "password reset form password prompt", "Password") %>
|
||||
<%= password_input f, :password %>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<h2><%= Gettext.dpgettext("static_pages", "remote follow header", "Remote follow") %></h2>
|
||||
<img height="128" width="128" src="<%= avatar_url(@followee) %>">
|
||||
<p><%= @followee.nickname %></p>
|
||||
<%= form_for @conn, ~p"/ostatus_subscribe", [as: "user"], fn f -> %>
|
||||
<%= form_for @conn, Routes.remote_follow_path(@conn, :do_follow), [as: "user"], fn f -> %>
|
||||
<%= hidden_input f, :id, value: @followee.id %>
|
||||
<%= submit Gettext.dpgettext("static_pages", "remote follow authorization button", "Authorize") %>
|
||||
<% end %>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<h2><%= Gettext.dpgettext("static_pages", "remote follow header, need login", "Log in to follow") %></h2>
|
||||
<p><%= @followee.nickname %></p>
|
||||
<img height="128" width="128" src="<%= avatar_url(@followee) %>">
|
||||
<%= form_for @conn, ~p"/ostatus_subscribe", [as: "authorization"], fn f -> %>
|
||||
<%= form_for @conn, Routes.remote_follow_path(@conn, :do_follow), [as: "authorization"], fn f -> %>
|
||||
<%= text_input f, :name, placeholder: Gettext.dpgettext("static_pages", "placeholder text for username entry", "Username"), required: true, autocomplete: "username" %>
|
||||
<br>
|
||||
<%= password_input f, :password, placeholder: Gettext.dpgettext("static_pages", "placeholder text for password entry", "Password"), required: true, autocomplete: "password" %>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<h2><%= Gettext.dpgettext("static_pages", "remote follow mfa header", "Two-factor authentication") %></h2>
|
||||
<p><%= @followee.nickname %></p>
|
||||
<img height="128" width="128" src="<%= avatar_url(@followee) %>">
|
||||
<%= form_for @conn, ~p"/ostatus_subscribe", [as: "mfa"], fn f -> %>
|
||||
<%= form_for @conn, Routes.remote_follow_path(@conn, :do_follow), [as: "mfa"], fn f -> %>
|
||||
<%= text_input f, :code, placeholder: Gettext.dpgettext("static_pages", "placeholder text for auth code entry", "Authentication code"), required: true %>
|
||||
<br>
|
||||
<%= hidden_input f, :id, value: @followee.id %>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<h2><%= Gettext.dpgettext("static_pages", "status interact error", "Error: %{error}", error: @error) %></h2>
|
||||
<% else %>
|
||||
<h2><%= raw Gettext.dpgettext("static_pages", "status interact header", "Interacting with %{nickname}'s %{status_link}", nickname: safe_to_string(html_escape(@nickname)), status_link: safe_to_string(link(Gettext.dpgettext("static_pages", "status interact header - status link text", "status"), to: @status_link))) %></h2>
|
||||
<%= form_for @conn, ~p"/main/ostatus", [as: "status"], fn f -> %>
|
||||
<%= form_for @conn, Routes.util_path(@conn, :remote_subscribe), [as: "status"], fn f -> %>
|
||||
<%= hidden_input f, :status_id, value: @status_id %>
|
||||
<%= text_input f, :profile, placeholder: Gettext.dpgettext("static_pages", "placeholder text for account id", "Your account ID, e.g. lain@quitter.se") %>
|
||||
<%= submit Gettext.dpgettext("static_pages", "status interact authorization button", "Interact") %>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<h2><%= Gettext.dpgettext("static_pages", "remote follow error", "Error: %{error}", error: @error) %></h2>
|
||||
<% else %>
|
||||
<h2><%= Gettext.dpgettext("static_pages", "remote follow header", "Remotely follow %{nickname}", nickname: @nickname) %></h2>
|
||||
<%= form_for @conn, ~p"/main/ostatus", [as: "user"], fn f -> %>
|
||||
<%= form_for @conn, Routes.util_path(@conn, :remote_subscribe), [as: "user"], fn f -> %>
|
||||
<%= hidden_input f, :nickname, value: @nickname %>
|
||||
<%= text_input f, :profile, placeholder: Gettext.dpgettext("static_pages", "placeholder text for account id", "Your account ID, e.g. lain@quitter.se") %>
|
||||
<%= submit Gettext.dpgettext("static_pages", "remote follow authorization button for following with a remote account", "Follow") %>
|
||||
|
|
|
@ -38,7 +38,7 @@ def follow(%{assigns: %{user: user}} = conn, %{"acct" => acct}) do
|
|||
defp follow_status(conn, _user, acct) do
|
||||
with {:ok, object} <- Fetcher.fetch_object_from_id(acct),
|
||||
%Activity{id: activity_id} <- Activity.get_create_by_object_ap_id(object.data["id"]) do
|
||||
redirect(conn, to: ~p"/notice/#{activity_id}")
|
||||
redirect(conn, to: Routes.o_status_path(conn, :notice, activity_id))
|
||||
else
|
||||
error ->
|
||||
handle_follow_error(conn, error)
|
||||
|
|
|
@ -13,6 +13,7 @@ defmodule Pleroma.Web.EmbedView do
|
|||
alias Pleroma.Web.Gettext
|
||||
alias Pleroma.Web.MediaProxy
|
||||
alias Pleroma.Web.Metadata.Utils
|
||||
alias Pleroma.Web.Router.Helpers
|
||||
|
||||
import Phoenix.HTML
|
||||
|
||||
|
@ -47,7 +48,7 @@ defp activity_content(%Activity{object: %Object{data: %{"content" => content}}})
|
|||
defp activity_content(_), do: nil
|
||||
|
||||
defp activity_url(%User{local: true}, activity) do
|
||||
~p[/notice/#{activity}]
|
||||
Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, activity)
|
||||
end
|
||||
|
||||
defp activity_url(%User{local: false}, %Activity{object: %Object{data: data}}) do
|
||||
|
|
|
@ -85,7 +85,7 @@ def render("manifest.json", _params) do
|
|||
background_color: Config.get([:manifest, :background_color]),
|
||||
display: "standalone",
|
||||
scope: Pleroma.Web.Endpoint.url(),
|
||||
start_url: ~p"/web/getting-started",
|
||||
start_url: Routes.masto_fe_path(Pleroma.Web.Endpoint, :index, ["getting-started"]),
|
||||
categories: [
|
||||
"social"
|
||||
],
|
||||
|
|
|
@ -26,7 +26,13 @@ def string_from_xpath(xpath, doc) do
|
|||
|
||||
def parse_document(text) do
|
||||
try do
|
||||
doc = SweetXml.parse(text, dtd: :none)
|
||||
{doc, _rest} =
|
||||
text
|
||||
|> :binary.bin_to_list()
|
||||
|> :xmerl_scan.string(
|
||||
quiet: true,
|
||||
allow_entities: false
|
||||
)
|
||||
|
||||
{:ok, doc}
|
||||
rescue
|
||||
|
|
23
mix.exs
23
mix.exs
|
@ -4,10 +4,10 @@ defmodule Pleroma.Mixfile do
|
|||
def project do
|
||||
[
|
||||
app: :pleroma,
|
||||
version: version("3.10.3"),
|
||||
version: version("3.10.4"),
|
||||
elixir: "~> 1.14",
|
||||
elixirc_paths: elixirc_paths(Mix.env()),
|
||||
compilers: Mix.compilers(),
|
||||
compilers: [:phoenix] ++ Mix.compilers(),
|
||||
elixirc_options: [warnings_as_errors: warnings_as_errors()],
|
||||
xref: [exclude: [:eldap]],
|
||||
start_permanent: Mix.env() == :prod,
|
||||
|
@ -114,9 +114,7 @@ defp oauth_deps do
|
|||
# Type `mix help deps` for examples and options.
|
||||
defp deps do
|
||||
[
|
||||
{:phoenix, "~> 1.7.0"},
|
||||
{:phoenix_view, "~> 2.0"},
|
||||
{:phoenix_live_dashboard, "~> 0.7.2"},
|
||||
{:phoenix, "~> 1.6.15"},
|
||||
{:tzdata, "~> 1.1.1"},
|
||||
{:plug_cowboy, "~> 2.6"},
|
||||
{:phoenix_pubsub, "~> 2.1"},
|
||||
|
@ -158,9 +156,7 @@ defp deps do
|
|||
{:timex, "~> 3.7"},
|
||||
{:ueberauth, "~> 0.10"},
|
||||
{:linkify, git: "https://akkoma.dev/AkkomaGang/linkify.git"},
|
||||
{:http_signatures,
|
||||
git: "https://akkoma.dev/AkkomaGang/http_signatures.git",
|
||||
ref: "6640ce7d24c783ac2ef56e27d00d12e8dc85f396"},
|
||||
{:http_signatures, "~> 0.1.1"},
|
||||
{:telemetry, "~> 1.2"},
|
||||
{:telemetry_poller, "~> 1.0"},
|
||||
{:telemetry_metrics, "~> 0.6"},
|
||||
|
@ -181,21 +177,20 @@ defp deps do
|
|||
git: "https://git.pleroma.social/pleroma/elixir-libraries/elixir-captcha.git",
|
||||
ref: "3bbfa8b5ea13accc1b1c40579a380d8e5cfd6ad2"},
|
||||
{:restarter, path: "./restarter"},
|
||||
{:majic,
|
||||
git: "https://akkoma.dev/AkkomaGang/majic.git",
|
||||
ref: "80540b36939ec83f48e76c61e5000e0fd67706f0"},
|
||||
{:majic, "~> 1.0"},
|
||||
{:eblurhash, "~> 1.2.2"},
|
||||
{:open_api_spex, "~> 3.17"},
|
||||
{:search_parser,
|
||||
git: "https://github.com/FloatingGhost/pleroma-contrib-search-parser.git",
|
||||
ref: "08971a81e68686f9ac465cfb6661d51c5e4e1e7f"},
|
||||
{:nimble_parsec, "~> 1.3", override: true},
|
||||
{:phoenix_live_dashboard, "~> 0.7.2"},
|
||||
{:ecto_psql_extras, "~> 0.7"},
|
||||
{:elasticsearch,
|
||||
git: "https://akkoma.dev/AkkomaGang/elasticsearch-elixir.git", ref: "main"},
|
||||
{:mfm_parser,
|
||||
git: "https://akkoma.dev/AkkomaGang/mfm-parser.git",
|
||||
ref: "b21ab7754024af096f2d14247574f55f0063295b"},
|
||||
ref: "912fba81152d4d572e457fd5427f9875b2bc3dbe"},
|
||||
|
||||
## dev & test
|
||||
{:ex_doc, "~> 0.30", only: :dev, runtime: false},
|
||||
|
@ -206,9 +201,7 @@ defp deps do
|
|||
{:mox, "~> 1.0", only: :test},
|
||||
{:websockex, "~> 0.4.3", only: :test},
|
||||
{:dialyxir, "~> 1.3", only: [:dev], runtime: false},
|
||||
{:elixir_xml_to_map, "~> 3.0", only: :test},
|
||||
{:mint, "~> 1.5.1", override: true},
|
||||
{:nimble_pool, "~> 1.0", override: true}
|
||||
{:mint, "~> 1.5.1", override: true}
|
||||
] ++ oauth_deps()
|
||||
end
|
||||
|
||||
|
|
29
mix.lock
29
mix.lock
|
@ -32,22 +32,19 @@
|
|||
"ecto_psql_extras": {:hex, :ecto_psql_extras, "0.7.12", "e3bd8318702b069263d0118e7cdb6c66c5ff0a034f540f4c0158bd769e7dff6a", [:mix], [{:ecto_sql, "~> 3.7", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0", [hex: :postgrex, repo: "hexpm", optional: false]}, {:table_rex, "~> 3.1.1", [hex: :table_rex, repo: "hexpm", optional: false]}], "hexpm", "4a1d1d10b74ce033a428a99272038c90e444a0a1912a074e38a71ee9f667714c"},
|
||||
"ecto_sql": {:hex, :ecto_sql, "3.10.1", "6ea6b3036a0b0ca94c2a02613fd9f742614b5cfe494c41af2e6571bb034dd94c", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.10.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f6a25bdbbd695f12c8171eaff0851fa4c8e72eec1e98c7364402dda9ce11c56b"},
|
||||
"elasticsearch": {:git, "https://akkoma.dev/AkkomaGang/elasticsearch-elixir.git", "6cd946f75f6ab9042521a009d1d32d29a90113ca", [ref: "main"]},
|
||||
"elixir_make": {:hex, :elixir_make, "0.7.7", "7128c60c2476019ed978210c245badf08b03dbec4f24d05790ef791da11aa17c", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "5bc19fff950fad52bbe5f211b12db9ec82c6b34a9647da0c2224b8b8464c7e6c"},
|
||||
"elixir_xml_to_map": {:hex, :elixir_xml_to_map, "3.0.0", "67dcff30ecf72aed37ab08525133e4420717a749436e22bfece431e7dddeea7e", [:mix], [{:erlsom, "~> 1.4", [hex: :erlsom, repo: "hexpm", optional: false]}], "hexpm", "11222dd7f029f8db7a6662b41c992dbdb0e1c6e4fdea6a42056f9d27c847efbb"},
|
||||
"elixir_make": {:hex, :elixir_make, "0.6.3", "bc07d53221216838d79e03a8019d0839786703129599e9619f4ab74c8c096eac", [:mix], [], "hexpm", "f5cbd651c5678bcaabdbb7857658ee106b12509cd976c2c2fca99688e1daf716"},
|
||||
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
|
||||
"erlsom": {:hex, :erlsom, "1.5.1", "c8fe2babd33ff0846403f6522328b8ab676f896b793634cfe7ef181c05316c03", [:rebar3], [], "hexpm", "7965485494c5844dd127656ac40f141aadfa174839ec1be1074e7edf5b4239eb"},
|
||||
"eternal": {:hex, :eternal, "1.2.2", "d1641c86368de99375b98d183042dd6c2b234262b8d08dfd72b9eeaafc2a1abd", [:mix], [], "hexpm", "2c9fe32b9c3726703ba5e1d43a1d255a4f3f2d8f8f9bc19f094c7cb1a7a9e782"},
|
||||
"ex_aws": {:hex, :ex_aws, "2.4.4", "d7886eaca7e10f7bd3d9e9d2d5414cb336737b3ab2fddd4fa30358b725293fe0", [:mix], [{:configparser_ex, "~> 4.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8 or ~> 3.0", [hex: :jsx, repo: "hexpm", optional: true]}, {:mime, "~> 1.2 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:sweet_xml, "~> 0.7", [hex: :sweet_xml, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a7d63e485ca2b16fb804f3f20097827aa69885eea6e69fa75c98f353c9c91dc7"},
|
||||
"ex_aws_s3": {:hex, :ex_aws_s3, "2.4.0", "ce8decb6b523381812798396bc0e3aaa62282e1b40520125d1f4eff4abdff0f4", [:mix], [{:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:sweet_xml, ">= 0.0.0", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "85dda6e27754d94582869d39cba3241d9ea60b6aa4167f9c88e309dc687e56bb"},
|
||||
"ex_const": {:hex, :ex_const, "0.2.4", "d06e540c9d834865b012a17407761455efa71d0ce91e5831e86881b9c9d82448", [:mix], [], "hexpm", "96fd346610cc992b8f896ed26a98be82ac4efb065a0578f334a32d60a3ba9767"},
|
||||
"ex_doc": {:hex, :ex_doc, "0.30.5", "aa6da96a5c23389d7dc7c381eba862710e108cee9cfdc629b7ec021313900e9e", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "88a1e115dcb91cefeef7e22df4a6ebbe4634fbf98b38adcbc25c9607d6d9d8e6"},
|
||||
"ex_doc": {:hex, :ex_doc, "0.30.3", "bfca4d340e3b95f2eb26e72e4890da83e2b3a5c5b0e52607333bf5017284b063", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "fbc8702046c1d25edf79de376297e608ac78cdc3a29f075484773ad1718918b6"},
|
||||
"ex_machina": {:hex, :ex_machina, "2.7.0", "b792cc3127fd0680fecdb6299235b4727a4944a09ff0fa904cc639272cd92dc7", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "419aa7a39bde11894c87a615c4ecaa52d8f107bbdd81d810465186f783245bf8"},
|
||||
"ex_syslogger": {:hex, :ex_syslogger, "2.0.0", "de6de5c5472a9c4fdafb28fa6610e381ae79ebc17da6490b81d785d68bd124c9", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}, {:syslog, "~> 1.1.0", [hex: :syslog, repo: "hexpm", optional: false]}], "hexpm", "a52b2fe71764e9e6ecd149ab66635812f68e39279cbeee27c52c0e35e8b8019e"},
|
||||
"excoveralls": {:hex, :excoveralls, "0.16.1", "0bd42ed05c7d2f4d180331a20113ec537be509da31fed5c8f7047ce59ee5a7c5", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "dae763468e2008cf7075a64cb1249c97cb4bc71e236c5c2b5e5cdf1cfa2bf138"},
|
||||
"expo": {:hex, :expo, "0.4.1", "1c61d18a5df197dfda38861673d392e642649a9cef7694d2f97a587b2cfb319b", [:mix], [], "hexpm", "2ff7ba7a798c8c543c12550fa0e2cbc81b95d4974c65855d8d15ba7b37a1ce47"},
|
||||
"fast_html": {:hex, :fast_html, "2.2.0", "6c5ef1be087a4ed613b0379c13f815c4d11742b36b67bb52cee7859847c84520", [:make, :mix], [{:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.0", [hex: :nimble_pool, repo: "hexpm", optional: false]}], "hexpm", "064c4f23b4a6168f9187dac8984b056f2c531bb0787f559fd6a8b34b38aefbae"},
|
||||
"fast_sanitize": {:hex, :fast_sanitize, "0.2.3", "67b93dfb34e302bef49fec3aaab74951e0f0602fd9fa99085987af05bd91c7a5", [:mix], [{:fast_html, "~> 2.0", [hex: :fast_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "e8ad286d10d0386e15d67d0ee125245ebcfbc7d7290b08712ba9013c8c5e56e2"},
|
||||
"file_ex": {:git, "https://akkoma.dev/AkkomaGang/file_ex.git", "cc7067c7d446c2526e9ecf91d40896b088851569", [ref: "cc7067c7d446c2526e9ecf91d40896b088851569"]},
|
||||
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
|
||||
"finch": {:hex, :finch, "0.16.0", "40733f02c89f94a112518071c0a91fe86069560f5dbdb39f9150042f44dcfb1a", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6 or ~> 1.0", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f660174c4d519e5fec629016054d60edd822cdfe2b7270836739ac2f97735ec5"},
|
||||
"flake_id": {:hex, :flake_id, "0.1.0", "7716b086d2e405d09b647121a166498a0d93d1a623bead243e1f74216079ccb3", [:mix], [{:base62, "~> 1.2", [hex: :base62, repo: "hexpm", optional: false]}, {:ecto, ">= 2.0.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm", "31fc8090fde1acd267c07c36ea7365b8604055f897d3a53dd967658c691bd827"},
|
||||
|
@ -57,7 +54,7 @@
|
|||
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~> 2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
|
||||
"hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
|
||||
"html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"},
|
||||
"http_signatures": {:git, "https://akkoma.dev/AkkomaGang/http_signatures.git", "6640ce7d24c783ac2ef56e27d00d12e8dc85f396", [ref: "6640ce7d24c783ac2ef56e27d00d12e8dc85f396"]},
|
||||
"http_signatures": {:hex, :http_signatures, "0.1.1", "ca7ebc1b61542b163644c8c3b1f0e0f41037d35f2395940d3c6c7deceab41fd8", [:mix], [], "hexpm", "cc3b8a007322cc7b624c0c15eec49ee58ac977254ff529a3c482f681465942a3"},
|
||||
"httpoison": {:hex, :httpoison, "1.8.2", "9eb9c63ae289296a544842ef816a85d881d4a31f518a0fec089aaa744beae290", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "2bb350d26972e30c96e2ca74a1aaf8293d61d0742ff17f01e0279fef11599921"},
|
||||
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
|
||||
"inet_cidr": {:hex, :inet_cidr, "1.0.4", "a05744ab7c221ca8e395c926c3919a821eb512e8f36547c062f62c4ca0cf3d6e", [:mix], [], "hexpm", "64a2d30189704ae41ca7dbdd587f5291db5d1dda1414e0774c29ffc81088c1bc"},
|
||||
|
@ -66,15 +63,15 @@
|
|||
"jose": {:hex, :jose, "1.11.6", "613fda82552128aa6fb804682e3a616f4bc15565a048dabd05b1ebd5827ed965", [:mix, :rebar3], [], "hexpm", "6275cb75504f9c1e60eeacb771adfeee4905a9e182103aa59b53fed651ff9738"},
|
||||
"jumper": {:hex, :jumper, "1.0.1", "3c00542ef1a83532b72269fab9f0f0c82bf23a35e27d278bfd9ed0865cecabff", [:mix], [], "hexpm", "318c59078ac220e966d27af3646026db9b5a5e6703cb2aa3e26bcfaba65b7433"},
|
||||
"linkify": {:git, "https://akkoma.dev/AkkomaGang/linkify.git", "2567e2c1073fa371fd26fd66dfa5bc77b6919c16", []},
|
||||
"mail": {:hex, :mail, "0.3.1", "cb0a14e4ed8904e4e5a08214e686ccf6f9099346885db17d8c309381f865cc5c", [:mix], [], "hexpm", "1db701e89865c1d5fa296b2b57b1cd587587cca8d8a1a22892b35ef5a8e352a6"},
|
||||
"majic": {:git, "https://akkoma.dev/AkkomaGang/majic.git", "80540b36939ec83f48e76c61e5000e0fd67706f0", [ref: "80540b36939ec83f48e76c61e5000e0fd67706f0"]},
|
||||
"mail": {:hex, :mail, "0.3.0", "f353ef5f41d9f2e483ba7c5df92cdfe27b990b2d8c8c41d84c7b2b40ec33989f", [:mix], [], "hexpm", "523d700b2231d887dc4ee41d3bb13f48358f6f118e55a67cef6d630d7907116c"},
|
||||
"majic": {:hex, :majic, "1.0.0", "37e50648db5f5c2ff0c9fb46454d034d11596c03683807b9fb3850676ffdaab3", [:make, :mix], [{:elixir_make, "~> 0.6.1", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "7905858f76650d49695f14ea55cd9aaaee0c6654fa391671d4cf305c275a0a9e"},
|
||||
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
|
||||
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
|
||||
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
|
||||
"meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"},
|
||||
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
|
||||
"mfm_parser": {:git, "https://akkoma.dev/AkkomaGang/mfm-parser.git", "b21ab7754024af096f2d14247574f55f0063295b", [ref: "b21ab7754024af096f2d14247574f55f0063295b"]},
|
||||
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
|
||||
"mfm_parser": {:git, "https://akkoma.dev/AkkomaGang/mfm-parser.git", "912fba81152d4d572e457fd5427f9875b2bc3dbe", [ref: "912fba81152d4d572e457fd5427f9875b2bc3dbe"]},
|
||||
"mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"},
|
||||
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
|
||||
"mint": {:hex, :mint, "1.5.1", "8db5239e56738552d85af398798c80648db0e90f343c8469f6c6d8898944fb6f", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "4a63e1e76a7c3956abd2c72f370a0d0aecddc3976dea5c27eccbecfa5e7d5b1e"},
|
||||
"mock": {:hex, :mock, "0.3.8", "7046a306b71db2488ef54395eeb74df0a7f335a7caca4a3d3875d1fc81c884dd", [:mix], [{:meck, "~> 0.9.2", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "7fa82364c97617d79bb7d15571193fc0c4fe5afd0c932cef09426b3ee6fe2022"},
|
||||
|
@ -82,13 +79,13 @@
|
|||
"mox": {:hex, :mox, "1.0.2", "dc2057289ac478b35760ba74165b4b3f402f68803dd5aecd3bfd19c183815d64", [:mix], [], "hexpm", "f9864921b3aaf763c8741b5b8e6f908f44566f1e427b2630e89e9a73b981fef2"},
|
||||
"nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"},
|
||||
"nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"},
|
||||
"nimble_pool": {:hex, :nimble_pool, "1.0.0", "5eb82705d138f4dd4423f69ceb19ac667b3b492ae570c9f5c900bb3d2f50a847", [:mix], [], "hexpm", "80be3b882d2d351882256087078e1b1952a28bf98d0a287be87e4a24a710b67a"},
|
||||
"oban": {:hex, :oban, "2.15.4", "d49ab4ffb7153010e32f80fe9e56f592706238149ec579eb50f8a4e41d218856", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5fce611fdfffb13e9148df883116e5201adf1e731eb302cc88cde0588510079c"},
|
||||
"nimble_pool": {:hex, :nimble_pool, "0.2.6", "91f2f4c357da4c4a0a548286c84a3a28004f68f05609b4534526871a22053cde", [:mix], [], "hexpm", "1c715055095d3f2705c4e236c18b618420a35490da94149ff8b580a2144f653f"},
|
||||
"oban": {:hex, :oban, "2.15.2", "8f934a49db39163633965139c8846d8e24c2beb4180f34a005c2c7c3f69a6aa2", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0f4a579ea48fc7489e0d84facf8b01566e142bdc6542d7dabce32c10e664f1e9"},
|
||||
"open_api_spex": {:hex, :open_api_spex, "3.17.3", "ada8e352eb786050dd639db2439d3316e92f3798eb2abd051f55bb9af825b37e", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, "~> 3.0 or ~> 4.0 or ~> 5.0", [hex: :poison, repo: "hexpm", optional: true]}, {:ymlr, "~> 2.0 or ~> 3.0", [hex: :ymlr, repo: "hexpm", optional: true]}], "hexpm", "165db21a85ca83cffc8e7c8890f35b354eddda8255de7404a2848ed652b9f0fe"},
|
||||
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
|
||||
"phoenix": {:hex, :phoenix, "1.7.7", "4cc501d4d823015007ba3cdd9c41ecaaf2ffb619d6fb283199fa8ddba89191e0", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "8966e15c395e5e37591b6ed0bd2ae7f48e961f0f60ac4c733f9566b519453085"},
|
||||
"phoenix": {:hex, :phoenix, "1.6.16", "e5bdd18c7a06da5852a25c7befb72246de4ddc289182285f8685a40b7b5f5451", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e15989ff34f670a96b95ef6d1d25bad0d9c50df5df40b671d8f4a669e050ac39"},
|
||||
"phoenix_ecto": {:hex, :phoenix_ecto, "4.4.2", "b21bd01fdeffcfe2fab49e4942aa938b6d3e89e93a480d4aee58085560a0bc0d", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "70242edd4601d50b69273b057ecf7b684644c19ee750989fd555625ae4ce8f5d"},
|
||||
"phoenix_html": {:hex, :phoenix_html, "3.3.2", "d6ce982c6d8247d2fc0defe625255c721fb8d5f1942c5ac051f6177bffa5973f", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "44adaf8e667c1c20fb9d284b6b0fa8dc7946ce29e81ce621860aa7e96de9a11d"},
|
||||
"phoenix_html": {:hex, :phoenix_html, "3.3.1", "4788757e804a30baac6b3fc9695bf5562465dd3f1da8eb8460ad5b404d9a2178", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "bed1906edd4906a15fd7b412b85b05e521e1f67c9a85418c55999277e553d0d3"},
|
||||
"phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.7.2", "97cc4ff2dba1ebe504db72cb45098cb8e91f11160528b980bd282cc45c73b29c", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.5", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.18.3", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "0e5fdf063c7a3b620c566a30fcf68b7ee02e5e46fe48ee46a6ec3ba382dc05b7"},
|
||||
"phoenix_live_view": {:hex, :phoenix_live_view, "0.18.18", "1f38fbd7c363723f19aad1a04b5490ff3a178e37daaf6999594d5f34796c47fc", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a5810d0472f3189ede6d2a95bda7f31c6113156b91784a3426cb0ab6a6d85214"},
|
||||
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"},
|
||||
|
@ -111,7 +108,7 @@
|
|||
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
|
||||
"statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"},
|
||||
"sweet_xml": {:hex, :sweet_xml, "0.7.3", "debb256781c75ff6a8c5cbf7981146312b66f044a2898f453709a53e5031b45b", [:mix], [], "hexpm", "e110c867a1b3fe74bfc7dd9893aa851f0eed5518d0d7cad76d7baafd30e4f5ba"},
|
||||
"swoosh": {:hex, :swoosh, "1.11.5", "429dccde78e2f60c6339e96917efecebca9d1f254d2878a150f580d2f782260b", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "21ee57dcd68d2f56d3bbe11e76d56d142b221bb12b6018c551cc68442b800040"},
|
||||
"swoosh": {:hex, :swoosh, "1.11.4", "9b353f998cba3c5e101a0669559c2fb2757b5d9eb7db058bf08687d82e93e416", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d3390914022a456ae1604bfcb3431bd12509b2afe8c70296bae6c9dca4903d0f"},
|
||||
"syslog": {:hex, :syslog, "1.1.0", "6419a232bea84f07b56dc575225007ffe34d9fdc91abe6f1b2f254fd71d8efc2", [:rebar3], [], "hexpm", "4c6a41373c7e20587be33ef841d3de6f3beba08519809329ecc4d27b15b659e1"},
|
||||
"table_rex": {:hex, :table_rex, "3.1.1", "0c67164d1714b5e806d5067c1e96ff098ba7ae79413cc075973e17c38a587caa", [:mix], [], "hexpm", "678a23aba4d670419c23c17790f9dcd635a4a89022040df7d5d772cb21012490"},
|
||||
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
|
||||
|
@ -129,7 +126,5 @@
|
|||
"unsafe": {:hex, :unsafe, "1.0.1", "a27e1874f72ee49312e0a9ec2e0b27924214a05e3ddac90e91727bc76f8613d8", [:mix], [], "hexpm", "6c7729a2d214806450d29766abc2afaa7a2cbecf415be64f36a6691afebb50e5"},
|
||||
"vex": {:hex, :vex, "0.9.0", "613ea5eb3055662e7178b83e25b2df0975f68c3d8bb67c1645f0573e1a78d606", [:mix], [], "hexpm", "c69fff44d5c8aa3f1faee71bba1dcab05dd36364c5a629df8bb11751240c857f"},
|
||||
"web_push_encryption": {:hex, :web_push_encryption, "0.3.1", "76d0e7375142dfee67391e7690e89f92578889cbcf2879377900b5620ee4708d", [:mix], [{:httpoison, "~> 1.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jose, "~> 1.11.1", [hex: :jose, repo: "hexpm", optional: false]}], "hexpm", "4f82b2e57622fb9337559058e8797cb0df7e7c9790793bdc4e40bc895f70e2a2"},
|
||||
"websock": {:hex, :websock, "0.5.2", "b3c08511d8d79ed2c2f589ff430bd1fe799bb389686dafce86d28801783d8351", [:mix], [], "hexpm", "925f5de22fca6813dfa980fb62fd542ec43a2d1a1f83d2caec907483fe66ff05"},
|
||||
"websock_adapter": {:hex, :websock_adapter, "0.5.3", "4908718e42e4a548fc20e00e70848620a92f11f7a6add8cf0886c4232267498d", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "cbe5b814c1f86b6ea002b52dd99f345aeecf1a1a6964e209d208fb404d930d3d"},
|
||||
"websockex": {:hex, :websockex, "0.4.3", "92b7905769c79c6480c02daacaca2ddd49de936d912976a4d3c923723b647bf0", [:mix], [], "hexpm", "95f2e7072b85a3a4cc385602d42115b73ce0b74a9121d0d6dbbf557645ac53e4"},
|
||||
}
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
defmodule Pleroma.Repo.Migrations.DropUnusedIndexes do
|
||||
use Ecto.Migration
|
||||
|
||||
@disable_ddl_transaction true
|
||||
|
||||
@disable_migration_lock true
|
||||
|
||||
def up do
|
||||
drop_if_exists(
|
||||
index(:activities, ["(data->>'actor')", "inserted_at desc"], name: :activities_actor_index)
|
||||
)
|
||||
|
||||
drop_if_exists(index(:activities, ["(data->'to')"], name: :activities_to_index))
|
||||
|
||||
drop_if_exists(index(:activities, ["(data->'cc')"], name: :activities_cc_index))
|
||||
|
||||
drop_if_exists(index(:activities, ["(split_part(actor, '/', 3))"], name: :activities_hosts))
|
||||
|
||||
drop_if_exists(
|
||||
index(:activities, ["(data->'object'->>'inReplyTo')"], name: :activities_in_reply_to)
|
||||
)
|
||||
|
||||
drop_if_exists(
|
||||
index(:activities, ["((data #> '{\"object\",\"likes\"}'))"], name: :activities_likes)
|
||||
)
|
||||
end
|
||||
|
||||
def down do
|
||||
create_if_not_exists(
|
||||
index(:activities, ["(data->>'actor')", "inserted_at desc"],
|
||||
name: :activities_actor_index,
|
||||
concurrently: true
|
||||
)
|
||||
)
|
||||
|
||||
create_if_not_exists(
|
||||
index(:activities, ["(data->'to')"],
|
||||
name: :activities_to_index,
|
||||
using: :gin,
|
||||
concurrently: true
|
||||
)
|
||||
)
|
||||
|
||||
create_if_not_exists(
|
||||
index(:activities, ["(data->'cc')"],
|
||||
name: :activities_cc_index,
|
||||
using: :gin,
|
||||
concurrently: true
|
||||
)
|
||||
)
|
||||
|
||||
create_if_not_exists(
|
||||
index(:activities, ["(split_part(actor, '/', 3))"],
|
||||
name: :activities_hosts,
|
||||
concurrently: true
|
||||
)
|
||||
)
|
||||
|
||||
create_if_not_exists(
|
||||
index(:activities, ["(data->'object'->>'inReplyTo')"],
|
||||
name: :activities_in_reply_to,
|
||||
concurrently: true
|
||||
)
|
||||
)
|
||||
|
||||
create_if_not_exists(
|
||||
index(:activities, ["((data #> '{\"object\",\"likes\"}'))"],
|
||||
name: :activities_likes,
|
||||
using: :gin,
|
||||
concurrently: true
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
|
@ -1,15 +0,0 @@
|
|||
defmodule Pleroma.Repo.Migrations.InstancesAddMetadata do
|
||||
use Ecto.Migration
|
||||
|
||||
def down do
|
||||
alter table(:instances) do
|
||||
remove_if_exists(:metadata, :map)
|
||||
end
|
||||
end
|
||||
|
||||
def up do
|
||||
alter table(:instances) do
|
||||
add_if_not_exists(:metadata, :map)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,15 +0,0 @@
|
|||
defmodule Pleroma.Repo.Migrations.RemoveUserApEnabled do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
alter table(:users) do
|
||||
remove_if_exists(:ap_enabled, :boolean)
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
alter table(:users) do
|
||||
add_if_not_exists(:ap_enabled, :boolean, default: true, null: false)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -26,9 +26,7 @@ defmodule Pleroma.HTML.Scrubber.Default do
|
|||
"nofollow",
|
||||
"noopener",
|
||||
"noreferrer",
|
||||
"ugc",
|
||||
"tag ugc",
|
||||
"ugc tag"
|
||||
"ugc"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
|
||||
|
|
|
@ -19,9 +19,7 @@ defmodule Pleroma.HTML.Scrubber.LinksOnly do
|
|||
"noopener",
|
||||
"noreferrer",
|
||||
"me",
|
||||
"ugc",
|
||||
"tag ugc",
|
||||
"ugc tag"
|
||||
"ugc"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
|
||||
|
|
|
@ -26,9 +26,7 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do
|
|||
"tag",
|
||||
"nofollow",
|
||||
"noopener",
|
||||
"noreferrer",
|
||||
"tag ugc",
|
||||
"ugc tag"
|
||||
"noreferrer"
|
||||
])
|
||||
|
||||
Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
|
||||
|
|
44
test/fixtures/xml_normal.xml
vendored
44
test/fixtures/xml_normal.xml
vendored
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.05" encoding="UTF-8"?>
|
||||
<game>
|
||||
<matchups>
|
||||
<matchup winner-id="1">
|
||||
<name>Match One</name>
|
||||
<teams>
|
||||
<team>
|
||||
<id>1</id>
|
||||
<name>Team One</name>
|
||||
</team>
|
||||
<team>
|
||||
<id>2</id>
|
||||
<name>Team Two</name>
|
||||
</team>
|
||||
</teams>
|
||||
</matchup>
|
||||
<matchup winner-id="2">
|
||||
<name>Match Two</name>
|
||||
<teams>
|
||||
<team>
|
||||
<id>2</id>
|
||||
<name>Team Two</name>
|
||||
</team>
|
||||
<team>
|
||||
<id>3</id>
|
||||
<name>Team Three</name>
|
||||
</team>
|
||||
</teams>
|
||||
</matchup>
|
||||
<matchup winner-id="1">
|
||||
<name>Match Three</name>
|
||||
<teams>
|
||||
<team>
|
||||
<id>1</id>
|
||||
<name>Team One</name>
|
||||
</team>
|
||||
<team>
|
||||
<id>3</id>
|
||||
<name>Team Three</name>
|
||||
</team>
|
||||
</teams>
|
||||
</matchup>
|
||||
</matchups>
|
||||
</game>
|
|
@ -182,81 +182,8 @@ test "load a settings with large values and pass to file", %{temp_file: temp_fil
|
|||
assert File.exists?(temp_file)
|
||||
{:ok, file} = File.read(temp_file)
|
||||
|
||||
{:ok, file_quote} = Code.string_to_quoted(file)
|
||||
|
||||
{:__block__, [],
|
||||
[
|
||||
_,
|
||||
{:config, _, config_quote}
|
||||
]} = file_quote
|
||||
|
||||
assert [
|
||||
:pleroma,
|
||||
:instance,
|
||||
[
|
||||
name: "Pleroma",
|
||||
email: "example@example.com",
|
||||
notify_email: "noreply@example.com",
|
||||
description: "A Pleroma instance, an alternative fediverse server",
|
||||
limit: 5000,
|
||||
remote_limit: 100_000,
|
||||
upload_limit: 16_000_000,
|
||||
avatar_upload_limit: 2_000_000,
|
||||
background_upload_limit: 4_000_000,
|
||||
banner_upload_limit: 4_000_000,
|
||||
poll_limits: {_, _, poll_limits},
|
||||
registrations_open: true,
|
||||
federating: true,
|
||||
federation_incoming_replies_max_depth: 100,
|
||||
federation_reachability_timeout_days: 7,
|
||||
federation_publisher_modules: [
|
||||
{_, _, [:Pleroma, :Web, :ActivityPub, :Publisher]}
|
||||
],
|
||||
allow_relay: true,
|
||||
public: true,
|
||||
quarantined_instances: [],
|
||||
managed_config: true,
|
||||
static_dir: "instance/static/",
|
||||
allowed_post_formats: ["text/plain", "text/html", "text/markdown", "text/bbcode"],
|
||||
autofollowed_nicknames: [],
|
||||
max_pinned_statuses: 1,
|
||||
attachment_links: false,
|
||||
max_report_comment_size: 1000,
|
||||
safe_dm_mentions: false,
|
||||
healthcheck: false,
|
||||
remote_post_retention_days: 90,
|
||||
skip_thread_containment: true,
|
||||
limit_to_local_content: :unauthenticated,
|
||||
user_bio_length: 5000,
|
||||
user_name_length: 100,
|
||||
max_account_fields: 10,
|
||||
max_remote_account_fields: 20,
|
||||
account_field_name_length: 512,
|
||||
account_field_value_length: 2048,
|
||||
external_user_synchronization: true,
|
||||
extended_nickname_format: true,
|
||||
multi_factor_authentication: [
|
||||
{:totp,
|
||||
[
|
||||
digits: 6,
|
||||
period: 30
|
||||
]},
|
||||
{:backup_codes,
|
||||
[
|
||||
number: 2,
|
||||
length: 6
|
||||
]}
|
||||
]
|
||||
]
|
||||
] = config_quote
|
||||
|
||||
assert Keyword.equal?(
|
||||
poll_limits,
|
||||
max_options: 20,
|
||||
max_option_chars: 200,
|
||||
min_expiration: 0,
|
||||
max_expiration: 31_536_000
|
||||
)
|
||||
assert file ==
|
||||
"import Config\n\nconfig :pleroma, :instance,\n name: \"Pleroma\",\n email: \"example@example.com\",\n notify_email: \"noreply@example.com\",\n description: \"A Pleroma instance, an alternative fediverse server\",\n limit: 5000,\n remote_limit: 100_000,\n upload_limit: 16_000_000,\n avatar_upload_limit: 2_000_000,\n background_upload_limit: 4_000_000,\n banner_upload_limit: 4_000_000,\n poll_limits: %{\n max_expiration: 31_536_000,\n max_option_chars: 200,\n max_options: 20,\n min_expiration: 0\n },\n registrations_open: true,\n federating: true,\n federation_incoming_replies_max_depth: 100,\n federation_reachability_timeout_days: 7,\n federation_publisher_modules: [Pleroma.Web.ActivityPub.Publisher],\n allow_relay: true,\n public: true,\n quarantined_instances: [],\n managed_config: true,\n static_dir: \"instance/static/\",\n allowed_post_formats: [\"text/plain\", \"text/html\", \"text/markdown\", \"text/bbcode\"],\n autofollowed_nicknames: [],\n max_pinned_statuses: 1,\n attachment_links: false,\n max_report_comment_size: 1000,\n safe_dm_mentions: false,\n healthcheck: false,\n remote_post_retention_days: 90,\n skip_thread_containment: true,\n limit_to_local_content: :unauthenticated,\n user_bio_length: 5000,\n user_name_length: 100,\n max_account_fields: 10,\n max_remote_account_fields: 20,\n account_field_name_length: 512,\n account_field_value_length: 2048,\n external_user_synchronization: true,\n extended_nickname_format: true,\n multi_factor_authentication: [\n totp: [digits: 6, period: 30],\n backup_codes: [number: 2, length: 6]\n ]\n"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ defmodule Pleroma.Emails.AdminEmailTest do
|
|||
import Pleroma.Factory
|
||||
|
||||
alias Pleroma.Emails.AdminEmail
|
||||
alias Pleroma.Web.Router.Helpers
|
||||
|
||||
test "build report email" do
|
||||
config = Pleroma.Config.get(:instance)
|
||||
|
@ -17,7 +18,7 @@ test "build report email" do
|
|||
res =
|
||||
AdminEmail.report(to_user, reporter, account, [%{name: "Test", id: "12"}], "Test comment")
|
||||
|
||||
status_url = url(~p[/notice/12])
|
||||
status_url = Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, "12")
|
||||
reporter_url = reporter.ap_id
|
||||
account_url = account.ap_id
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ defmodule Pleroma.Emails.UserEmailTest do
|
|||
use Pleroma.DataCase, async: true
|
||||
|
||||
alias Pleroma.Emails.UserEmail
|
||||
alias Pleroma.Web.Endpoint
|
||||
alias Pleroma.Web.Router
|
||||
|
||||
import Pleroma.Factory
|
||||
|
||||
|
@ -16,7 +18,7 @@ test "build password reset email" do
|
|||
assert email.from == {config[:name], config[:notify_email]}
|
||||
assert email.to == [{user.name, user.email}]
|
||||
assert email.subject == "Password reset"
|
||||
assert email.html_body =~ ~p"/api/v1/pleroma/password_reset/test_token"
|
||||
assert email.html_body =~ Router.Helpers.reset_password_url(Endpoint, :reset, "test_token")
|
||||
end
|
||||
|
||||
test "build user invitation email" do
|
||||
|
@ -28,7 +30,8 @@ test "build user invitation email" do
|
|||
assert email.subject == "Invitation to Akkoma"
|
||||
assert email.to == [{"Jonh", "test@test.com"}]
|
||||
|
||||
assert email.html_body =~ ~p[/registration/#{token.token}]
|
||||
assert email.html_body =~
|
||||
Router.Helpers.redirect_url(Endpoint, :registration_page, token.token)
|
||||
end
|
||||
|
||||
test "build account confirmation email" do
|
||||
|
@ -39,7 +42,8 @@ test "build account confirmation email" do
|
|||
assert email.to == [{user.name, user.email}]
|
||||
assert email.subject == "#{config[:name]} account confirmation"
|
||||
|
||||
assert email.html_body =~ ~p[/account/confirm_email/#{user.id}/conf-token]
|
||||
assert email.html_body =~
|
||||
Router.Helpers.confirm_email_url(Endpoint, :confirm_email, user.id, "conf-token")
|
||||
end
|
||||
|
||||
test "build approval pending email" do
|
||||
|
|
|
@ -6,19 +6,17 @@ defmodule Pleroma.HealthcheckTest do
|
|||
use Pleroma.DataCase, async: true
|
||||
alias Pleroma.Healthcheck
|
||||
|
||||
import Pleroma.Test.Matchers.List
|
||||
|
||||
test "system_info/0" do
|
||||
result = Healthcheck.system_info() |> Map.from_struct()
|
||||
|
||||
assert_unordered_list_equal(Map.keys(result), [
|
||||
:active,
|
||||
:healthy,
|
||||
:idle,
|
||||
:job_queue_stats,
|
||||
:memory_used,
|
||||
:pool_size
|
||||
])
|
||||
assert Map.keys(result) == [
|
||||
:active,
|
||||
:healthy,
|
||||
:idle,
|
||||
:job_queue_stats,
|
||||
:memory_used,
|
||||
:pool_size
|
||||
]
|
||||
end
|
||||
|
||||
describe "check_health/1" do
|
||||
|
|
|
@ -31,9 +31,10 @@ test "within/2 captures local bindings and executes block on remote node" do
|
|||
test "runs webserver on customized port" do
|
||||
{nickname, url, url_404} =
|
||||
within @federated1 do
|
||||
import Pleroma.Web.Router.Helpers
|
||||
user = Pleroma.Factory.insert(:user)
|
||||
user_url = ~p[/api/v1/accounts/#{user}]
|
||||
url_404 = ~p"/api/v1/accounts/not-exists"
|
||||
user_url = account_url(Pleroma.Web.Endpoint, :show, user)
|
||||
url_404 = account_url(Pleroma.Web.Endpoint, :show, "not-exists")
|
||||
|
||||
{user.nickname, user_url, url_404}
|
||||
end
|
||||
|
|
|
@ -6,19 +6,16 @@ defmodule Pleroma.MFA.TOTPTest do
|
|||
use Pleroma.DataCase, async: true
|
||||
|
||||
alias Pleroma.MFA.TOTP
|
||||
import Pleroma.Test.Matchers.URI
|
||||
|
||||
test "create provisioning_uri to generate qrcode" do
|
||||
uri =
|
||||
TOTP.provisioning_uri("test-secret", "test@example.com",
|
||||
TOTP.provisioning_uri("test-secrcet", "test@example.com",
|
||||
issuer: "Plerome-42",
|
||||
digits: 8,
|
||||
period: 60
|
||||
)
|
||||
|
||||
assert_uri_equals(
|
||||
uri,
|
||||
"otpauth://totp/test@example.com?digits=8&issuer=Plerome-42&period=60&secret=test-secret"
|
||||
)
|
||||
assert uri ==
|
||||
"otpauth://totp/test@example.com?digits=8&issuer=Plerome-42&period=60&secret=test-secrcet"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,13 +29,13 @@ test "change/0 converts auto_linker opts for Pleroma.Formatter", %{migration: mi
|
|||
|
||||
%{value: new_opts} = ConfigDB.get_by_params(%{group: :pleroma, key: Pleroma.Formatter})
|
||||
|
||||
assert Keyword.equal?(new_opts,
|
||||
assert new_opts == [
|
||||
class: false,
|
||||
extra: true,
|
||||
new_window: false,
|
||||
rel: "testing",
|
||||
strip_prefix: false
|
||||
)
|
||||
]
|
||||
|
||||
clear_config(Pleroma.Formatter, new_opts)
|
||||
assert new_opts == Pleroma.Config.get(Pleroma.Formatter)
|
||||
|
@ -67,6 +67,6 @@ test "transform_opts/1 returns a list of compatible opts", %{migration: migratio
|
|||
strip_prefix: false
|
||||
]
|
||||
|
||||
assert Keyword.equal?(migration.transform_opts(old_opts), expected_opts)
|
||||
assert migration.transform_opts(old_opts) == expected_opts
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,16 +26,16 @@ test "change/0 converts a map into a list", %{migration: migration} do
|
|||
|
||||
%{value: new_opts} = ConfigDB.get_by_params(%{group: :pleroma, key: Pleroma.Formatter})
|
||||
|
||||
assert Keyword.equal?(new_opts,
|
||||
assert new_opts == [
|
||||
class: false,
|
||||
extra: true,
|
||||
new_window: false,
|
||||
rel: "F",
|
||||
strip_prefix: false
|
||||
)
|
||||
]
|
||||
|
||||
clear_config(Pleroma.Formatter, new_opts)
|
||||
assert Keyword.equal?(new_opts, Pleroma.Config.get(Pleroma.Formatter))
|
||||
assert new_opts == Pleroma.Config.get(Pleroma.Formatter)
|
||||
|
||||
{text, _mentions, []} =
|
||||
Pleroma.Formatter.linkify(
|
||||
|
@ -61,7 +61,7 @@ test "change/0 skips if Pleroma.Formatter config is already a list", %{migration
|
|||
|
||||
%{value: new_opts} = ConfigDB.get_by_params(%{group: :pleroma, key: Pleroma.Formatter})
|
||||
|
||||
assert Keyword.equal?(new_opts, opts)
|
||||
assert new_opts == opts
|
||||
end
|
||||
|
||||
test "change/0 skips if Pleroma.Formatter is empty", %{migration: migration} do
|
||||
|
|
|
@ -71,35 +71,6 @@ test "it returns error when not found user" do
|
|||
end
|
||||
end
|
||||
|
||||
defp split_signature(sig) do
|
||||
sig
|
||||
|> String.split(",")
|
||||
|> Enum.map(fn part ->
|
||||
[key, value] = String.split(part, "=", parts: 2)
|
||||
[key, String.trim(value, ~s|"|)]
|
||||
end)
|
||||
|> Enum.sort_by(fn [k, _] -> k end)
|
||||
end
|
||||
|
||||
# Break up a signature and check by parts
|
||||
defp assert_signature_equal(sig_a, sig_b) when is_binary(sig_a) and is_binary(sig_b) do
|
||||
parts_a = split_signature(sig_a)
|
||||
parts_b = split_signature(sig_b)
|
||||
|
||||
parts_a
|
||||
|> Enum.with_index()
|
||||
|> Enum.each(fn {part_a, index} ->
|
||||
part_b = Enum.at(parts_b, index)
|
||||
assert_part_equal(part_a, part_b)
|
||||
end)
|
||||
end
|
||||
|
||||
defp assert_part_equal(part_a, part_b) do
|
||||
if part_a != part_b do
|
||||
flunk("Signature check failed - expected #{part_a} to equal #{part_b}")
|
||||
end
|
||||
end
|
||||
|
||||
describe "sign/2" do
|
||||
test "it returns signature headers" do
|
||||
user =
|
||||
|
@ -108,18 +79,14 @@ test "it returns signature headers" do
|
|||
keys: @private_key
|
||||
})
|
||||
|
||||
headers = %{
|
||||
host: "test.test",
|
||||
"content-length": 100
|
||||
}
|
||||
|
||||
assert_signature_equal(
|
||||
Signature.sign(
|
||||
user,
|
||||
headers
|
||||
),
|
||||
"keyId=\"https://mastodon.social/users/lambadalambda#main-key\",algorithm=\"rsa-sha256\",headers=\"content-length host\",signature=\"sibUOoqsFfTDerquAkyprxzDjmJm6erYc42W5w1IyyxusWngSinq5ILTjaBxFvfarvc7ci1xAi+5gkBwtshRMWm7S+Uqix24Yg5EYafXRun9P25XVnYBEIH4XQ+wlnnzNIXQkU3PU9e6D8aajDZVp3hPJNeYt1gIPOA81bROI8/glzb1SAwQVGRbqUHHHKcwR8keiR/W2h7BwG3pVRy4JgnIZRSW7fQogKedDg02gzRXwUDFDk0pr2p3q6bUWHUXNV8cZIzlMK+v9NlyFbVYBTHctAR26GIAN6Hz0eV0mAQAePHDY1mXppbA8Gpp6hqaMuYfwifcXmcc+QFm4e+n3A==\""
|
||||
)
|
||||
assert Signature.sign(
|
||||
user,
|
||||
%{
|
||||
host: "test.test",
|
||||
"content-length": 100
|
||||
}
|
||||
) ==
|
||||
"keyId=\"https://mastodon.social/users/lambadalambda#main-key\",algorithm=\"rsa-sha256\",headers=\"content-length host\",signature=\"sibUOoqsFfTDerquAkyprxzDjmJm6erYc42W5w1IyyxusWngSinq5ILTjaBxFvfarvc7ci1xAi+5gkBwtshRMWm7S+Uqix24Yg5EYafXRun9P25XVnYBEIH4XQ+wlnnzNIXQkU3PU9e6D8aajDZVp3hPJNeYt1gIPOA81bROI8/glzb1SAwQVGRbqUHHHKcwR8keiR/W2h7BwG3pVRy4JgnIZRSW7fQogKedDg02gzRXwUDFDk0pr2p3q6bUWHUXNV8cZIzlMK+v9NlyFbVYBTHctAR26GIAN6Hz0eV0mAQAePHDY1mXppbA8Gpp6hqaMuYfwifcXmcc+QFm4e+n3A==\""
|
||||
end
|
||||
|
||||
test "it returns error" do
|
||||
|
|
|
@ -1004,13 +1004,23 @@ test "it doesn't fail on invalid alsoKnownAs entries" do
|
|||
test "returns an ap_id for a user" do
|
||||
user = insert(:user)
|
||||
|
||||
assert User.ap_id(user) == url(@endpoint, ~p[/users/#{user.nickname}])
|
||||
assert User.ap_id(user) ==
|
||||
Pleroma.Web.Router.Helpers.user_feed_url(
|
||||
Pleroma.Web.Endpoint,
|
||||
:feed_redirect,
|
||||
user.nickname
|
||||
)
|
||||
end
|
||||
|
||||
test "returns an ap_followers link for a user" do
|
||||
user = insert(:user)
|
||||
|
||||
assert User.ap_followers(user) == url(@endpoint, ~p[/users/#{user.nickname}/followers])
|
||||
assert User.ap_followers(user) ==
|
||||
Pleroma.Web.Router.Helpers.user_feed_url(
|
||||
Pleroma.Web.Endpoint,
|
||||
:feed_redirect,
|
||||
user.nickname
|
||||
) <> "/followers"
|
||||
end
|
||||
|
||||
describe "remote user changeset" do
|
||||
|
@ -1353,27 +1363,25 @@ test "does not block domain with same end if wildcard added" do
|
|||
refute User.blocks?(user, collateral_user)
|
||||
end
|
||||
|
||||
# This behaviour is not honoured by the timeline query
|
||||
# re-add at a later date when UX is established
|
||||
# test "blocks domain with wildcard for subdomain" do
|
||||
# user = insert(:user)
|
||||
#
|
||||
# user_from_subdomain =
|
||||
# insert(:user, %{ap_id: "https://subdomain.awful-and-rude-instance.com/user/bully"})
|
||||
#
|
||||
# user_with_two_subdomains =
|
||||
# insert(:user, %{
|
||||
# ap_id: "https://subdomain.second_subdomain.awful-and-rude-instance.com/user/bully"
|
||||
# })
|
||||
#
|
||||
# user_domain = insert(:user, %{ap_id: "https://awful-and-rude-instance.com/user/bully"})
|
||||
#
|
||||
# {:ok, user} = User.block_domain(user, "awful-and-rude-instance.com")
|
||||
#
|
||||
# assert User.blocks?(user, user_from_subdomain)
|
||||
# assert User.blocks?(user, user_with_two_subdomains)
|
||||
# assert User.blocks?(user, user_domain)
|
||||
# end
|
||||
test "blocks domain with wildcard for subdomain" do
|
||||
user = insert(:user)
|
||||
|
||||
user_from_subdomain =
|
||||
insert(:user, %{ap_id: "https://subdomain.awful-and-rude-instance.com/user/bully"})
|
||||
|
||||
user_with_two_subdomains =
|
||||
insert(:user, %{
|
||||
ap_id: "https://subdomain.second_subdomain.awful-and-rude-instance.com/user/bully"
|
||||
})
|
||||
|
||||
user_domain = insert(:user, %{ap_id: "https://awful-and-rude-instance.com/user/bully"})
|
||||
|
||||
{:ok, user} = User.block_domain(user, "awful-and-rude-instance.com")
|
||||
|
||||
assert User.blocks?(user, user_from_subdomain)
|
||||
assert User.blocks?(user, user_with_two_subdomains)
|
||||
assert User.blocks?(user, user_domain)
|
||||
end
|
||||
|
||||
test "unblocks domains" do
|
||||
user = insert(:user)
|
||||
|
|
|
@ -39,7 +39,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
|
|||
test "with the relay active, it returns the relay user", %{conn: conn} do
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/relay")
|
||||
|> get(activity_pub_path(conn, :relay))
|
||||
|> json_response(200)
|
||||
|
||||
assert res["id"] =~ "/relay"
|
||||
|
@ -49,7 +49,7 @@ test "with the relay disabled, it returns 404", %{conn: conn} do
|
|||
clear_config([:instance, :allow_relay], false)
|
||||
|
||||
conn
|
||||
|> get(~p"/relay")
|
||||
|> get(activity_pub_path(conn, :relay))
|
||||
|> json_response(404)
|
||||
end
|
||||
|
||||
|
@ -59,7 +59,7 @@ test "on non-federating instance, it returns 404", %{conn: conn} do
|
|||
|
||||
conn
|
||||
|> assign(:user, user)
|
||||
|> get(~p"/relay")
|
||||
|> get(activity_pub_path(conn, :relay))
|
||||
|> json_response(404)
|
||||
end
|
||||
end
|
||||
|
@ -68,7 +68,7 @@ test "on non-federating instance, it returns 404", %{conn: conn} do
|
|||
test "it returns the internal fetch user", %{conn: conn} do
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/internal/fetch")
|
||||
|> get(activity_pub_path(conn, :internal_fetch))
|
||||
|> json_response(200)
|
||||
|
||||
assert res["id"] =~ "/fetch"
|
||||
|
@ -80,7 +80,7 @@ test "on non-federating instance, it returns 404", %{conn: conn} do
|
|||
|
||||
conn
|
||||
|> assign(:user, user)
|
||||
|> get(~p"/internal/fetch")
|
||||
|> get(activity_pub_path(conn, :internal_fetch))
|
||||
|> json_response(404)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2629,14 +2629,6 @@ test "allow fetching of accounts with an empty string name field" do
|
|||
assert user.name == " "
|
||||
end
|
||||
|
||||
test "pin_data_from_featured_collection will ignore unsupported values" do
|
||||
assert %{} ==
|
||||
ActivityPub.pin_data_from_featured_collection(%{
|
||||
"type" => "CollectionThatIsNotRealAndCannotHurtMe",
|
||||
"first" => "https://social.example/users/alice/collections/featured?page=true"
|
||||
})
|
||||
end
|
||||
|
||||
describe "persist/1" do
|
||||
test "should not persist remote delete activities" do
|
||||
poster = insert(:user, local: false)
|
||||
|
|
|
@ -783,8 +783,7 @@ test "it confirms emails of two users", %{conn: conn, admin: admin} do
|
|||
|
||||
describe "PATCH /resend_confirmation_email" do
|
||||
test "it resend emails for two users", %{conn: conn, admin: admin} do
|
||||
[first_user, second_user] =
|
||||
insert_pair(:user, is_confirmed: false, confirmation_token: "something")
|
||||
[first_user, second_user] = insert_pair(:user, is_confirmed: false)
|
||||
|
||||
ret_conn =
|
||||
patch(conn, "/api/v1/pleroma/admin/users/resend_confirmation_email", %{
|
||||
|
|
|
@ -212,7 +212,7 @@ test "updates state of multiple reports", %{
|
|||
test "returns empty response when no reports created", %{conn: conn} do
|
||||
response =
|
||||
conn
|
||||
|> get(~p"/api/v1/pleroma/admin/reports")
|
||||
|> get(report_path(conn, :index))
|
||||
|> json_response_and_validate_schema(:ok)
|
||||
|
||||
assert Enum.empty?(response["reports"])
|
||||
|
@ -232,7 +232,7 @@ test "returns reports", %{conn: conn} do
|
|||
|
||||
response =
|
||||
conn
|
||||
|> get(~p"/api/v1/pleroma/admin/reports")
|
||||
|> get(report_path(conn, :index))
|
||||
|> json_response_and_validate_schema(:ok)
|
||||
|
||||
[report] = response["reports"]
|
||||
|
@ -264,7 +264,7 @@ test "returns reports with specified state", %{conn: conn} do
|
|||
|
||||
response =
|
||||
conn
|
||||
|> get(~p[/api/v1/pleroma/admin/reports?#{[state: "open"]}])
|
||||
|> get(report_path(conn, :index, %{state: "open"}))
|
||||
|> json_response_and_validate_schema(:ok)
|
||||
|
||||
assert [open_report] = response["reports"]
|
||||
|
@ -276,7 +276,7 @@ test "returns reports with specified state", %{conn: conn} do
|
|||
|
||||
response =
|
||||
conn
|
||||
|> get(~p[/api/v1/pleroma/admin/reports?#{[state: "closed"]}])
|
||||
|> get(report_path(conn, :index, %{state: "closed"}))
|
||||
|> json_response_and_validate_schema(:ok)
|
||||
|
||||
assert [closed_report] = response["reports"]
|
||||
|
@ -288,7 +288,7 @@ test "returns reports with specified state", %{conn: conn} do
|
|||
|
||||
assert %{"total" => 0, "reports" => []} ==
|
||||
conn
|
||||
|> get(~p[/api/v1/pleroma/admin/reports?#{[state: "resolved"]}])
|
||||
|> get(report_path(conn, :index, %{state: "resolved"}))
|
||||
|> json_response_and_validate_schema(:ok)
|
||||
end
|
||||
|
||||
|
|
|
@ -685,7 +685,7 @@ test "load users with actor_type is Person", %{admin: admin, conn: conn} do
|
|||
|
||||
response =
|
||||
conn
|
||||
|> get(~p"/api/v1/pleroma/admin/users", %{actor_types: ["Person"]})
|
||||
|> get(user_path(conn, :index), %{actor_types: ["Person"]})
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
users = [
|
||||
|
@ -706,7 +706,7 @@ test "load users with actor_type is Person and Service", %{admin: admin, conn: c
|
|||
|
||||
response =
|
||||
conn
|
||||
|> get(~p"/api/v1/pleroma/admin/users", %{actor_types: ["Person", "Service"]})
|
||||
|> get(user_path(conn, :index), %{actor_types: ["Person", "Service"]})
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
users = [
|
||||
|
@ -727,7 +727,7 @@ test "load users with actor_type is Service", %{conn: conn} do
|
|||
|
||||
response =
|
||||
conn
|
||||
|> get(~p"/api/v1/pleroma/admin/users", %{actor_types: ["Service"]})
|
||||
|> get(user_path(conn, :index), %{actor_types: ["Service"]})
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
users = [user_response(user_service, %{"actor_type" => "Service"})]
|
||||
|
|
|
@ -50,7 +50,7 @@ test "gets a feed (ATOM)", %{conn: conn} do
|
|||
response =
|
||||
conn
|
||||
|> put_req_header("accept", "application/atom+xml")
|
||||
|> get(~p"/tags/pleromaart.atom")
|
||||
|> get(tag_feed_path(conn, :feed, "pleromaart.atom"))
|
||||
|> response(200)
|
||||
|
||||
xml = parse(response)
|
||||
|
@ -117,7 +117,7 @@ test "gets a feed (RSS)", %{conn: conn} do
|
|||
response =
|
||||
conn
|
||||
|> put_req_header("accept", "application/rss+xml")
|
||||
|> get(~p"/tags/pleromaart.rss")
|
||||
|> get(tag_feed_path(conn, :feed, "pleromaart.rss"))
|
||||
|> response(200)
|
||||
|
||||
xml = parse(response)
|
||||
|
@ -157,7 +157,7 @@ test "gets a feed (RSS)", %{conn: conn} do
|
|||
response =
|
||||
conn
|
||||
|> put_req_header("accept", "application/rss+xml")
|
||||
|> get(~p"/tags/pleromaart.rss")
|
||||
|> get(tag_feed_path(conn, :feed, "pleromaart.rss"))
|
||||
|> response(200)
|
||||
|
||||
xml = parse(response)
|
||||
|
@ -188,7 +188,7 @@ test "gets a feed (RSS)", %{conn: conn} do
|
|||
test "returns 404 for tags feed", %{conn: conn} do
|
||||
conn
|
||||
|> put_req_header("accept", "application/rss+xml")
|
||||
|> get(~p"/tags/pleromaart.rss")
|
||||
|> get(tag_feed_path(conn, :feed, "pleromaart.rss"))
|
||||
|> response(404)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -66,7 +66,7 @@ test "gets an atom feed", %{conn: conn, user: user, object: object, max_id: max_
|
|||
resp =
|
||||
conn
|
||||
|> put_req_header("accept", "application/atom+xml")
|
||||
|> get(~p[/users/#{user.nickname}/feed])
|
||||
|> get(user_feed_path(conn, :feed, user.nickname))
|
||||
|> response(200)
|
||||
|
||||
activity_titles =
|
||||
|
@ -128,7 +128,7 @@ test "returns 404 for a missing feed", %{conn: conn} do
|
|||
conn =
|
||||
conn
|
||||
|> put_req_header("accept", "application/atom+xml")
|
||||
|> get(~p"/users/nonexisting/feed")
|
||||
|> get(user_feed_path(conn, :feed, "nonexisting"))
|
||||
|
||||
assert response(conn, 404)
|
||||
end
|
||||
|
@ -144,7 +144,7 @@ test "returns feed with public and unlisted activities", %{conn: conn} do
|
|||
resp =
|
||||
conn
|
||||
|> put_req_header("accept", "application/atom+xml")
|
||||
|> get(~p[/users/#{user.nickname}/feed])
|
||||
|> get(user_feed_path(conn, :feed, user.nickname))
|
||||
|> response(200)
|
||||
|
||||
activity_titles =
|
||||
|
@ -163,7 +163,7 @@ test "returns 404 when the user is remote", %{conn: conn} do
|
|||
|
||||
assert conn
|
||||
|> put_req_header("accept", "application/atom+xml")
|
||||
|> get(~p[/users/#{user.nickname}/feed])
|
||||
|> get(user_feed_path(conn, :feed, user.nickname))
|
||||
|> response(404)
|
||||
end
|
||||
|
||||
|
@ -240,7 +240,7 @@ test "with non-html / non-json format, it returns error when user is not found",
|
|||
response =
|
||||
conn
|
||||
|> put_req_header("accept", "application/xml")
|
||||
|> get(~p"/users/jimm/feed")
|
||||
|> get(user_feed_path(conn, :feed, "jimm"))
|
||||
|> response(404)
|
||||
|
||||
assert response == ~S({"error":"Not found"})
|
||||
|
@ -258,7 +258,7 @@ test "returns 404 for user feed", %{conn: conn} do
|
|||
|
||||
assert conn
|
||||
|> put_req_header("accept", "application/atom+xml")
|
||||
|> get(~p[/users/#{user.nickname}/feed])
|
||||
|> get(user_feed_path(conn, :feed, user.nickname))
|
||||
|> response(404)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2060,32 +2060,4 @@ test "removing user from followers errors", %{user: user, conn: conn} do
|
|||
assert %{"error" => "Record not found"} = json_response_and_validate_schema(conn_res, 404)
|
||||
end
|
||||
end
|
||||
|
||||
describe "preferences" do
|
||||
test "get account preferences" do
|
||||
user = insert(:user, default_scope: "public")
|
||||
%{conn: conn} = oauth_access(["read:accounts"], user: user)
|
||||
|
||||
conn = get(conn, "/api/v1/preferences")
|
||||
response = json_response_and_validate_schema(conn, 200)
|
||||
|
||||
assert %{
|
||||
"posting:default:language" => nil,
|
||||
"posting:default:sensitive" => false,
|
||||
"posting:default:visibility" => "public",
|
||||
"reading:expand:media" => "default",
|
||||
"reading:expand:spoilers" => false
|
||||
} = response
|
||||
end
|
||||
|
||||
test "test changing account preferences" do
|
||||
user = insert(:user, default_scope: "unlisted")
|
||||
%{conn: conn} = oauth_access(["read:accounts"], user: user)
|
||||
|
||||
conn = get(conn, "/api/v1/preferences")
|
||||
response = json_response_and_validate_schema(conn, 200)
|
||||
|
||||
assert response["posting:default:visibility"] == "unlisted"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1883,7 +1883,7 @@ test "favorites paginate correctly" do
|
|||
|
||||
# Using the header for pagination works correctly
|
||||
[next, _] = get_resp_header(result, "link") |> hd() |> String.split(", ")
|
||||
[_, max_id] = Regex.run(~r/max_id=([^&>]+)/, next)
|
||||
[_, max_id] = Regex.run(~r/max_id=([^&]+)/, next)
|
||||
|
||||
assert max_id == third_favorite.id
|
||||
|
||||
|
|
|
@ -529,7 +529,7 @@ test "update fields with a link to content with rel=me, with frontend path", %{
|
|||
user: user,
|
||||
conn: conn
|
||||
} do
|
||||
fe_url = url(~p[/#{user.nickname}])
|
||||
fe_url = "#{Pleroma.Web.Endpoint.url()}/#{user.nickname}"
|
||||
|
||||
Tesla.Mock.mock(fn
|
||||
%{url: "http://example.com/rel_me/fe_path"} ->
|
||||
|
|
|
@ -258,7 +258,7 @@ test "a note activity" do
|
|||
expected = %{
|
||||
id: to_string(note.id),
|
||||
uri: object_data["id"],
|
||||
url: url(~p[/notice/#{note}]),
|
||||
url: Pleroma.Web.Router.Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, note),
|
||||
account: AccountView.render("show.json", %{user: user, skip_visibility_check: true}),
|
||||
in_reply_to_id: nil,
|
||||
in_reply_to_account_id: nil,
|
||||
|
|
|
@ -12,6 +12,7 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
|
|||
alias Pleroma.Web.MediaProxy
|
||||
alias Pleroma.Web.Metadata.Providers.TwitterCard
|
||||
alias Pleroma.Web.Metadata.Utils
|
||||
alias Pleroma.Web.Router
|
||||
|
||||
setup do: clear_config([Pleroma.Web.Metadata, :unfurl_nsfw])
|
||||
|
||||
|
@ -188,7 +189,7 @@ test "it renders supported types of attachments and skips unknown types" do
|
|||
{:meta,
|
||||
[
|
||||
name: "twitter:player",
|
||||
content: url(Endpoint, ~p[/notice/#{activity.id}/embed_player])
|
||||
content: Router.Helpers.o_status_url(Endpoint, :notice_player, activity.id)
|
||||
], []},
|
||||
{:meta, [name: "twitter:player:width", content: "800"], []},
|
||||
{:meta, [name: "twitter:player:height", content: "600"], []},
|
||||
|
|
|
@ -13,28 +13,28 @@ test "/user_exists", %{conn: conn} do
|
|||
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/user_exists", user: "lain")
|
||||
|> get(mongoose_im_path(conn, :user_exists), user: "lain")
|
||||
|> json_response(200)
|
||||
|
||||
assert res == true
|
||||
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/user_exists", user: "alice")
|
||||
|> get(mongoose_im_path(conn, :user_exists), user: "alice")
|
||||
|> json_response(404)
|
||||
|
||||
assert res == false
|
||||
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/user_exists", user: "bob")
|
||||
|> get(mongoose_im_path(conn, :user_exists), user: "bob")
|
||||
|> json_response(404)
|
||||
|
||||
assert res == false
|
||||
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/user_exists", user: "konata")
|
||||
|> get(mongoose_im_path(conn, :user_exists), user: "konata")
|
||||
|> json_response(404)
|
||||
|
||||
assert res == false
|
||||
|
@ -52,28 +52,28 @@ test "/check_password", %{conn: conn} do
|
|||
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/check_password", user: user.nickname, pass: "cool")
|
||||
|> get(mongoose_im_path(conn, :check_password), user: user.nickname, pass: "cool")
|
||||
|> json_response(200)
|
||||
|
||||
assert res == true
|
||||
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/check_password", user: user.nickname, pass: "uncool")
|
||||
|> get(mongoose_im_path(conn, :check_password), user: user.nickname, pass: "uncool")
|
||||
|> json_response(403)
|
||||
|
||||
assert res == false
|
||||
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/check_password", user: "konata", pass: "cool")
|
||||
|> get(mongoose_im_path(conn, :check_password), user: "konata", pass: "cool")
|
||||
|> json_response(404)
|
||||
|
||||
assert res == false
|
||||
|
||||
res =
|
||||
conn
|
||||
|> get(~p"/check_password", user: "nobody", pass: "cool")
|
||||
|> get(mongoose_im_path(conn, :check_password), user: "nobody", pass: "cool")
|
||||
|> json_response(404)
|
||||
|
||||
assert res == false
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue