Merge remote-tracking branch 'upstream/develop' into bnakkoma

This commit is contained in:
itepechi 2023-11-08 03:52:31 +09:00
commit c76ebd4e3c
9 changed files with 46 additions and 23 deletions

View File

@ -45,3 +45,16 @@
8. Remove the dependencies that you don't need anymore (see installation guide). Make sure you don't remove packages that are still needed for other software that you have running!
[¹]: We assume the database name and user are both "akkoma". If not, you can find the correct name in your config files.
## Docker installations
If running behind Docker, it is required to run the above commands inside of a running database container.
### Example
Running `docker compose run --rm db pg_dump <...>` will fail and return:
```
pg_dump: error: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?"
```
However, first starting just the database container with `docker compose up db -d`, and then running `docker compose exec db pg_dump -d akkoma --format=custom -f </your/backup/dir/akkoma.pgdump>` will successfully generate a database dump.
Then to make the file accessible on the host system you can run `docker compose cp db:</your/backup/dir/akkoma.pgdump> </your/target/location>` to copy if from the container.

View File

@ -60,7 +60,7 @@ Example of `my-awesome-theme.json` where we add the name "My Awesome Theme"
### Set as default theme
Now we can set the new theme as default in the [Pleroma FE configuration](https://docs-fe.akkoma.dev/stable/CONFIGURATION).
Now we can set the new theme as default in the [Pleroma FE configuration](https://docs-fe.akkoma.dev/stable/CONFIGURATION/).
Example of adding the new theme in the back-end config files
```elixir

View File

@ -74,7 +74,7 @@ defmodule Pleroma.Emails.UserEmail 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 = url(~p[/api/v1/pleroma/password_reset/#{token}])
html_body =
Gettext.dpgettext(
@ -107,7 +107,7 @@ defmodule Pleroma.Emails.UserEmail do
to_name \\ nil
) do
Gettext.with_locale_or_default user.language do
registration_url = ~p[/registration/#{user_invite_token.token}]
registration_url = url(~p[/registration/#{user_invite_token.token}])
html_body =
Gettext.dpgettext(
@ -140,7 +140,7 @@ defmodule Pleroma.Emails.UserEmail do
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 = url(~p[/api/account/confirm_email/#{user.id}/#{user.confirmation_token}])
html_body =
Gettext.dpgettext(
@ -330,7 +330,7 @@ defmodule Pleroma.Emails.UserEmail do
|> Pleroma.JWT.generate_and_sign!()
|> Base.encode64()
~p[/mailer/unsubscribe/#{token}]
url(~p[/mailer/unsubscribe/#{token}])
end
def backup_is_ready_email(backup, admin_user_id \\ nil) do

View File

@ -61,11 +61,14 @@ defmodule Pleroma.ReverseProxy do
"""
@inline_content_types [
"image/avif",
"image/gif",
"image/jpeg",
"image/jpg",
"image/jxl",
"image/png",
"image/svg+xml",
"image/webp",
"audio/mpeg",
"audio/mp3",
"video/webm",

View File

@ -180,7 +180,7 @@ defmodule Pleroma.Mixfile do
{:remote_ip, "~> 1.1.0"},
{:captcha,
git: "https://git.pleroma.social/pleroma/elixir-libraries/elixir-captcha.git",
ref: "3bbfa8b5ea13accc1b1c40579a380d8e5cfd6ad2"},
ref: "90f6ce7672f70f56708792a98d98bd05176c9176"},
{:restarter, path: "./restarter"},
{:majic,
git: "https://akkoma.dev/AkkomaGang/majic.git",

View File

@ -7,7 +7,7 @@
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"cachex": {:hex, :cachex, "3.6.0", "14a1bfbeee060dd9bec25a5b6f4e4691e3670ebda28c8ba2884b12fe30b36bf8", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:jumper, "~> 1.0", [hex: :jumper, repo: "hexpm", optional: false]}, {:sleeplocks, "~> 1.1", [hex: :sleeplocks, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm", "ebf24e373883bc8e0c8d894a63bbe102ae13d918f790121f5cfe6e485cc8e2e2"},
"calendar": {:hex, :calendar, "1.0.0", "f52073a708528482ec33d0a171954ca610fe2bd28f1e871f247dc7f1565fa807", [:mix], [{:tzdata, "~> 0.1.201603 or ~> 0.5.20 or ~> 1.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "990e9581920c82912a5ee50e62ff5ef96da6b15949a2ee4734f935fdef0f0a6f"},
"captcha": {:git, "https://git.pleroma.social/pleroma/elixir-libraries/elixir-captcha.git", "3bbfa8b5ea13accc1b1c40579a380d8e5cfd6ad2", [ref: "3bbfa8b5ea13accc1b1c40579a380d8e5cfd6ad2"]},
"captcha": {:git, "https://git.pleroma.social/pleroma/elixir-libraries/elixir-captcha.git", "90f6ce7672f70f56708792a98d98bd05176c9176", [ref: "90f6ce7672f70f56708792a98d98bd05176c9176"]},
"castore": {:hex, :castore, "1.0.3", "7130ba6d24c8424014194676d608cb989f62ef8039efd50ff4b3f33286d06db8", [:mix], [], "hexpm", "680ab01ef5d15b161ed6a95449fac5c6b8f60055677a8e79acf01b27baa4390b"},
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"},

View File

@ -2,21 +2,28 @@
# XXX: This should be removed when elixir's releases get custom command support
detect_flavour() {
arch="amd64"
if getconf GNU_LIBC_VERSION >/dev/null; then
libc_postfix=""
elif [ "$(ldd 2>&1 | head -c 9)" = "musl libc" ]; then
libc_postfix="-musl"
elif [ "$(find /lib/libc.musl* | wc -l)" ]; then
libc_postfix="-musl"
else
echo "Unsupported libc" >&2
exit 1
machine_type=$(uname -m)
if [ ${machine_type} = 'aarch64' ] ; then
arch='arm64'
elif [ ${machine_type} = 'x86_64' ] ; then
arch='amd64'
if getconf GNU_LIBC_VERSION >/dev/null; then
libc_postfix=""
elif [ "$(ldd 2>&1 | head -c 9)" = "musl libc" ]; then
libc_postfix="-musl"
elif [ "$(find /lib/libc.musl* | wc -l)" ]; then
libc_postfix="-musl"
else
echo "Unsupported libc" >&2
exit 1
fi
else
echo "Could not detect your architecture please pass them via --flavour"
exit 1
fi
echo "$arch$libc_postfix"
echo "$arch$libc_postfix"
}
detect_branch() {
version="$(cut -d' ' -f2 <"$RELEASE_ROOT"/releases/start_erl.data)"
# Expected format: major.minor.patch_version(-number_of_commits_ahead_of_tag-gcommit_hash).branch

View File

@ -16,7 +16,7 @@ defmodule Pleroma.Emails.UserEmailTest 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 =~ url(~p"/api/v1/pleroma/password_reset/test_token")
end
test "build user invitation email" do
@ -28,7 +28,7 @@ defmodule Pleroma.Emails.UserEmailTest 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 =~ url(~p[/registration/#{token.token}])
end
test "build account confirmation email" do
@ -39,7 +39,7 @@ defmodule Pleroma.Emails.UserEmailTest 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 =~ url(~p[/api/account/confirm_email/#{user.id}/conf-token])
end
test "build approval pending email" do

View File

@ -91,7 +91,7 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
assert user_data = json_response_and_validate_schema(conn, 200)
assert user_data["note"] ==
~s(I drink <a class="hashtag" data-tag="cofe" href="http://localhost:4001/tag/cofe">#cofe</a> with <span class="h-card"><a class="u-url mention" data-user="#{user2.id}" href="#{user2.ap_id}" rel="ugc">@<span>#{user2.nickname}</span></a></span><br/><br/>suya..)
~s(I drink <a class="hashtag" data-tag="cofe" href="http://localhost:4001/tag/cofe" rel=\"tag ugc\">#cofe</a> with <span class="h-card"><a class="u-url mention" data-user="#{user2.id}" href="#{user2.ap_id}" rel="ugc">@<span>#{user2.nickname}</span></a></span><br/><br/>suya..)
assert user_data["source"]["note"] == raw_bio