forked from AkkomaGang/akkoma
Compare commits
31 commits
962847fdc3
...
87feb78960
Author | SHA1 | Date | |
---|---|---|---|
87feb78960 | |||
3ff0f46b9f | |||
4f0cb61782 | |||
5fdb5d69d2 | |||
f66135ed08 | |||
dc34328f15 | |||
13e2a811ec | |||
1a4238bf98 | |||
c3069b9478 | |||
51f09531c4 | |||
83aab0859a | |||
|
eb2b0d26e4 | ||
|
91870590ec | ||
|
c442877c25 | ||
|
16af0bad55 | ||
|
16ee6ed500 | ||
|
babf5df0e7 | ||
|
5767f59294 | ||
|
72ce0b7759 | ||
|
0cf9b44179 | ||
|
3cf335c4d0 | ||
|
1556e2be8e | ||
|
629077dce4 | ||
|
50256af6f6 | ||
|
c5d36d9679 | ||
|
fb4c5b97c7 | ||
|
a715cf4b3c | ||
|
693a6486da | ||
|
4e353f0335 | ||
|
3947012691 | ||
|
d61b7d4b49 |
49 changed files with 31446 additions and 20611 deletions
|
@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
## Added
|
## Added
|
||||||
- Implement [FEP-67ff](https://codeberg.org/fediverse/fep/src/branch/main/fep/67ff/fep-67ff.md) (federation documentation)
|
- Implement [FEP-67ff](https://codeberg.org/fediverse/fep/src/branch/main/fep/67ff/fep-67ff.md) (federation documentation)
|
||||||
- Meilisearch: it is now possible to use separate keys for search and admin actions
|
- Meilisearch: it is now possible to use separate keys for search and admin actions
|
||||||
|
- New standalone `prune_orphaned_activities` mix task with configurable batch limit
|
||||||
|
- The `prune_objects` mix task now accepts a `--limit` parameter for initial object pruning
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
- Meilisearch: order of results returned from our REST API now actually matches how Meilisearch ranks results
|
- Meilisearch: order of results returned from our REST API now actually matches how Meilisearch ranks results
|
||||||
|
@ -112,8 +114,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
- Akkoma API is now documented
|
- Akkoma API is now documented
|
||||||
- ability to auto-approve follow requests from users you are already following
|
- ability to auto-approve follow requests from users you are already following
|
||||||
- The SimplePolicy MRF can now strip user backgrounds from selected remote hosts
|
- The SimplePolicy MRF can now strip user backgrounds from selected remote hosts
|
||||||
- New standalone `prune_orphaned_activities` mix task with configurable batch limit
|
|
||||||
- The `prune_objects` mix task now accepts a `--limit` parameter for initial object pruning
|
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
- OTP builds are now built on erlang OTP26
|
- OTP builds are now built on erlang OTP26
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
1. Stop the Akkoma service.
|
1. Stop the Akkoma service.
|
||||||
2. Go to the working directory of Akkoma (default is `/opt/akkoma`)
|
2. Go to the working directory of Akkoma (default is `/opt/akkoma`)
|
||||||
3. Run[¹] `sudo -Hu postgres pg_dump -d akkoma --format=custom -f </path/to/backup_location/akkoma.pgdump>` (make sure the postgres user has write access to the destination file)
|
3. Run `sudo -Hu postgres pg_dump -d akkoma --format=custom -f </path/to/backup_location/akkoma.pgdump>`[¹] (make sure the postgres user has write access to the destination file)
|
||||||
4. Copy `akkoma.pgdump`, `config/prod.secret.exs`[²], `config/setup_db.psql` (if still available) and the `uploads` folder to your backup destination. If you have other modifications, copy those changes too.
|
4. Copy `akkoma.pgdump`, `config/config.exs`[²], `uploads` folder, and [static directory](../configuration/static_dir.md) to your backup destination. If you have other modifications, copy those changes too.
|
||||||
5. Restart the Akkoma service.
|
5. Restart the Akkoma service.
|
||||||
|
|
||||||
[¹]: We assume the database name is "akkoma". If not, you can find the correct name in your config files.
|
[¹]: We assume the database name is "akkoma". If not, you can find the correct name in your configuration files.
|
||||||
[²]: If you've installed using OTP, you need `config/config.exs` instead of `config/prod.secret.exs`.
|
[²]: If you have a from source installation, you need `config/prod.secret.exs` instead of `config/config.exs`. The `config/config.exs` file also exists, but in case of from source installations, it only contains the default values and it is tracked by Git, so you don't need to back it up.
|
||||||
|
|
||||||
## Restore/Move
|
## Restore/Move
|
||||||
|
|
||||||
|
@ -17,19 +17,16 @@
|
||||||
2. Stop the Akkoma service.
|
2. Stop the Akkoma service.
|
||||||
3. Go to the working directory of Akkoma (default is `/opt/akkoma`)
|
3. Go to the working directory of Akkoma (default is `/opt/akkoma`)
|
||||||
4. Copy the above mentioned files back to their original position.
|
4. Copy the above mentioned files back to their original position.
|
||||||
5. Drop the existing database and user if restoring in-place[¹]. `sudo -Hu postgres psql -c 'DROP DATABASE akkoma;';` `sudo -Hu postgres psql -c 'DROP USER akkoma;'`
|
5. Drop the existing database and user[¹]. `sudo -Hu postgres psql -c 'DROP DATABASE akkoma;';` `sudo -Hu postgres psql -c 'DROP USER akkoma;'`
|
||||||
6. Restore the database schema and akkoma role using either of the following options
|
6. Restore the database schema and akkoma role[¹] (replace the password with the one you find in the configuration file), `sudo -Hu postgres psql -c "CREATE USER akkoma WITH ENCRYPTED PASSWORD '<database-password-wich-you-can-find-in-your-configuration-file>';"` `sudo -Hu postgres psql -c "CREATE DATABASE akkoma OWNER akkoma;"`.
|
||||||
* You can use the original `setup_db.psql` if you have it[²]: `sudo -Hu postgres psql -f config/setup_db.psql`.
|
|
||||||
* Or recreate the database and user yourself (replace the password with the one you find in the config file) `sudo -Hu postgres psql -c "CREATE USER akkoma WITH ENCRYPTED PASSWORD '<database-password-wich-you-can-find-in-your-config-file>'; CREATE DATABASE akkoma OWNER akkoma;"`.
|
|
||||||
7. Now restore the Akkoma instance's data into the empty database schema[¹]: `sudo -Hu postgres pg_restore -d akkoma -v -1 </path/to/backup_location/akkoma.pgdump>`
|
7. Now restore the Akkoma instance's data into the empty database schema[¹]: `sudo -Hu postgres pg_restore -d akkoma -v -1 </path/to/backup_location/akkoma.pgdump>`
|
||||||
8. If you installed a newer Akkoma version, you should run `MIX_ENV=prod mix ecto.migrate`[³]. This task performs database migrations, if there were any.
|
8. If you installed a newer Akkoma version, you should run the database migrations `./bin/pleroma_ctl migrate`[²].
|
||||||
9. Restart the Akkoma service.
|
9. Restart the Akkoma service.
|
||||||
10. Run `sudo -Hu postgres vacuumdb --all --analyze-in-stages`. This will quickly generate the statistics so that postgres can properly plan queries.
|
10. Run `sudo -Hu postgres vacuumdb --all --analyze-in-stages`. This will quickly generate the statistics so that postgres can properly plan queries.
|
||||||
11. If setting up on a new server configure Nginx by using the `installation/akkoma.nginx` config sample or reference the Akkoma installation guide for your OS which contains the Nginx configuration instructions.
|
11. If setting up on a new server, configure Nginx by using the `installation/nginx/akkoma.nginx` configuration sample or reference the Akkoma installation guide which contains the Nginx configuration instructions.
|
||||||
|
|
||||||
[¹]: We assume the database name and user are both "akkoma". If not, you can find the correct name in your config files.
|
[¹]: We assume the database name and user are both "akkoma". If not, you can find the correct name in your configuration files.
|
||||||
[²]: You can recreate the `config/setup_db.psql` by running the `mix pleroma.instance gen` task again. You can ignore most of the questions, but make the database user, name, and password the same as found in your backed up config file. This will also create a new `config/generated_config.exs` file which you may delete as it is not needed.
|
[²]: If you have a from source installation, the command is `MIX_ENV=prod mix ecto.migrate`. Note that we prefix with `MIX_ENV=prod` to use the `config/prod.secret.exs` configuration file.
|
||||||
[³]: Prefix with `MIX_ENV=prod` to run it using the production config file.
|
|
||||||
|
|
||||||
## Remove
|
## Remove
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ as soon as the post is received by your instance.
|
||||||
|
|
||||||
## Nginx
|
## Nginx
|
||||||
|
|
||||||
The following are excerpts from the [suggested nginx config](../../../installation/nginx/akkoma.nginx) that demonstrates the necessary config for the media proxy to work.
|
The following are excerpts from the [suggested nginx config](https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop/installation/nginx/akkoma.nginx) that demonstrates the necessary config for the media proxy to work.
|
||||||
|
|
||||||
A `proxy_cache_path` must be defined, for example:
|
A `proxy_cache_path` must be defined, for example:
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,6 @@ example.tld {
|
||||||
output file /var/log/caddy/akkoma.log
|
output file /var/log/caddy/akkoma.log
|
||||||
}
|
}
|
||||||
|
|
||||||
encode gzip
|
|
||||||
|
|
||||||
# this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
|
# this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
|
||||||
# and `localhost.` resolves to [::0] on some systems: see issue #930
|
# and `localhost.` resolves to [::0] on some systems: see issue #930
|
||||||
reverse_proxy 127.0.0.1:4000
|
reverse_proxy 127.0.0.1:4000
|
||||||
|
|
|
@ -233,7 +233,7 @@ def config_descriptions(policies) do
|
||||||
if function_exported?(policy, :config_description, 0) do
|
if function_exported?(policy, :config_description, 0) do
|
||||||
description =
|
description =
|
||||||
@default_description
|
@default_description
|
||||||
|> Map.merge(policy.config_description)
|
|> Map.merge(policy.config_description())
|
||||||
|> Map.put(:group, :pleroma)
|
|> Map.put(:group, :pleroma)
|
||||||
|> Map.put(:tab, :mrf)
|
|> Map.put(:tab, :mrf)
|
||||||
|> Map.put(:type, :group)
|
|> Map.put(:type, :group)
|
||||||
|
|
|
@ -17,6 +17,7 @@ def render("show.json", _) do
|
||||||
uri: Pleroma.Web.Endpoint.url(),
|
uri: Pleroma.Web.Endpoint.url(),
|
||||||
title: Keyword.get(instance, :name),
|
title: Keyword.get(instance, :name),
|
||||||
description: Keyword.get(instance, :description),
|
description: Keyword.get(instance, :description),
|
||||||
|
short_description: Keyword.get(instance, :description),
|
||||||
version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})",
|
version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})",
|
||||||
email: Keyword.get(instance, :email),
|
email: Keyword.get(instance, :email),
|
||||||
urls: %{
|
urls: %{
|
||||||
|
|
|
@ -18,6 +18,8 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
|
||||||
@timeout :timer.seconds(60)
|
@timeout :timer.seconds(60)
|
||||||
# Hibernate every X messages
|
# Hibernate every X messages
|
||||||
@hibernate_every 100
|
@hibernate_every 100
|
||||||
|
# Tune garabge collect for long-lived websocket process
|
||||||
|
@fullsweep_after 20
|
||||||
|
|
||||||
def init(%{qs: qs} = req, state) do
|
def init(%{qs: qs} = req, state) do
|
||||||
with params <- Enum.into(:cow_qs.parse_qs(qs), %{}),
|
with params <- Enum.into(:cow_qs.parse_qs(qs), %{}),
|
||||||
|
@ -59,6 +61,10 @@ def websocket_init(state) do
|
||||||
"#{__MODULE__} accepted websocket connection for user #{(state.user || %{id: "anonymous"}).id}, topic #{state.topic}"
|
"#{__MODULE__} accepted websocket connection for user #{(state.user || %{id: "anonymous"}).id}, topic #{state.topic}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# process is long-lived and can sometimes accumulate stale data in such a way it's
|
||||||
|
# not freed by young garbage cycles, thus make full collection sweeps more frequent
|
||||||
|
:erlang.process_flag(:fullsweep_after, @fullsweep_after)
|
||||||
|
|
||||||
Streamer.add_socket(state.topic, state.oauth_token)
|
Streamer.add_socket(state.topic, state.oauth_token)
|
||||||
{:ok, %{state | timer: timer()}}
|
{:ok, %{state | timer: timer()}}
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
xmlns:ostatus="http://ostatus.org/schema/1.0"
|
xmlns:ostatus="http://ostatus.org/schema/1.0"
|
||||||
xmlns:statusnet="http://status.net/schema/api/1/">
|
xmlns:statusnet="http://status.net/schema/api/1/">
|
||||||
|
|
||||||
<id><%= '#{url(~p"/tags/#{@tag}")}.rss' %></id>
|
<id><%= "#{url(~p"/tags/#{@tag}")}.rss" %></id>
|
||||||
<title>#<%= @tag %></title>
|
<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>
|
<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>
|
<logo><%= feed_logo() %></logo>
|
||||||
<updated><%= most_recent_update(@activities) %></updated>
|
<updated><%= most_recent_update(@activities) %></updated>
|
||||||
<link rel="self" href="<%= '#{url(~p"/tags/#{@tag}")}.atom' %>" type="application/atom+xml"/>
|
<link rel="self" href="<%= "#{url(~p"/tags/#{@tag}")}.atom" %>" type="application/atom+xml"/>
|
||||||
<%= for activity <- @activities do %>
|
<%= for activity <- @activities do %>
|
||||||
<%= render @view_module, "_tag_activity.atom", Map.merge(assigns, prepare_activity(activity, actor: true)) %>
|
<%= render @view_module, "_tag_activity.atom", Map.merge(assigns, prepare_activity(activity, actor: true)) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
<title>#<%= @tag %></title>
|
<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>
|
<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><%= "#{url(~p"/tags/#{@tag}")}.rss" %></link>
|
||||||
<webfeeds:logo><%= feed_logo() %></webfeeds:logo>
|
<webfeeds:logo><%= feed_logo() %></webfeeds:logo>
|
||||||
<webfeeds:accentColor>2b90d9</webfeeds:accentColor>
|
<webfeeds:accentColor>2b90d9</webfeeds:accentColor>
|
||||||
<%= for activity <- @activities do %>
|
<%= for activity <- @activities do %>
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
<title><%= @user.nickname <> "'s timeline" %></title>
|
<title><%= @user.nickname <> "'s timeline" %></title>
|
||||||
<updated><%= most_recent_update(@activities, @user) %></updated>
|
<updated><%= most_recent_update(@activities, @user) %></updated>
|
||||||
<logo><%= logo(@user) %></logo>
|
<logo><%= logo(@user) %></logo>
|
||||||
<link rel="self" href="<%= '#{url(~p"/users/#{@user.nickname}/feed")}.atom' %>" type="application/atom+xml"/>
|
<link rel="self" href="<%= "#{url(~p"/users/#{@user.nickname}/feed")}.atom" %>" type="application/atom+xml"/>
|
||||||
|
|
||||||
<%= render @view_module, "_author.atom", assigns %>
|
<%= render @view_module, "_author.atom", assigns %>
|
||||||
|
|
||||||
<%= if last_activity(@activities) do %>
|
<%= 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="<%= "#{url(~p"/users/#{@user.nickname}/feed")}.atom?max_id=#{last_activity(@activities).id}" %>" type="application/atom+xml"/>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= for activity <- @activities do %>
|
<%= for activity <- @activities do %>
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
<title><%= @user.nickname <> "'s timeline" %></title>
|
<title><%= @user.nickname <> "'s timeline" %></title>
|
||||||
<updated><%= most_recent_update(@activities, @user) %></updated>
|
<updated><%= most_recent_update(@activities, @user) %></updated>
|
||||||
<image><%= logo(@user) %></image>
|
<image><%= logo(@user) %></image>
|
||||||
<link><%= '#{url(~p"/users/#{@user.nickname}/feed")}.rss' %></link>
|
<link><%= "#{url(~p"/users/#{@user.nickname}/feed")}.rss" %></link>
|
||||||
|
|
||||||
<%= render @view_module, "_author.rss", assigns %>
|
<%= render @view_module, "_author.rss", assigns %>
|
||||||
|
|
||||||
<%= if last_activity(@activities) do %>
|
<%= 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"><%= "#{url(~p"/users/#{@user.nickname}/feed")}.rss?max_id=#{last_activity(@activities).id}" %></link>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= for activity <- @activities do %>
|
<%= for activity <- @activities do %>
|
||||||
|
|
|
@ -5,8 +5,8 @@ msgstr ""
|
||||||
"POT-Creation-Date: 2022-07-28 09:35+0000\n"
|
"POT-Creation-Date: 2022-07-28 09:35+0000\n"
|
||||||
"PO-Revision-Date: 2023-08-04 14:19+0000\n"
|
"PO-Revision-Date: 2023-08-04 14:19+0000\n"
|
||||||
"Last-Translator: Anonymous <noreply@weblate.org>\n"
|
"Last-Translator: Anonymous <noreply@weblate.org>\n"
|
||||||
"Language-Team: Catalan <http://translate.akkoma.dev/projects/akkoma/"
|
"Language-Team: Catalan <http://translate.akkoma.dev/projects/akkoma/akkoma-"
|
||||||
"akkoma-backend-config-descriptions/ca/>\n"
|
"backend-config-descriptions/ca/>\n"
|
||||||
"Language: ca\n"
|
"Language: ca\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,8 +5,8 @@ msgstr ""
|
||||||
"POT-Creation-Date: 2022-08-06 22:23+0000\n"
|
"POT-Creation-Date: 2022-08-06 22:23+0000\n"
|
||||||
"PO-Revision-Date: 2023-08-04 14:19+0000\n"
|
"PO-Revision-Date: 2023-08-04 14:19+0000\n"
|
||||||
"Last-Translator: Anonymous <noreply@weblate.org>\n"
|
"Last-Translator: Anonymous <noreply@weblate.org>\n"
|
||||||
"Language-Team: Spanish <http://translate.akkoma.dev/projects/akkoma/"
|
"Language-Team: Spanish <http://translate.akkoma.dev/projects/akkoma/akkoma-"
|
||||||
"akkoma-backend-config-descriptions/es/>\n"
|
"backend-config-descriptions/es/>\n"
|
||||||
"Language: es\n"
|
"Language: es\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -5,8 +5,8 @@ msgstr ""
|
||||||
"POT-Creation-Date: 2022-08-06 21:54+0000\n"
|
"POT-Creation-Date: 2022-08-06 21:54+0000\n"
|
||||||
"PO-Revision-Date: 2023-08-04 14:26+0000\n"
|
"PO-Revision-Date: 2023-08-04 14:26+0000\n"
|
||||||
"Last-Translator: Anonymous <noreply@weblate.org>\n"
|
"Last-Translator: Anonymous <noreply@weblate.org>\n"
|
||||||
"Language-Team: Dutch <http://translate.akkoma.dev/projects/akkoma/"
|
"Language-Team: Dutch <http://translate.akkoma.dev/projects/akkoma/akkoma-"
|
||||||
"akkoma-backend-config-descriptions/nl/>\n"
|
"backend-config-descriptions/nl/>\n"
|
||||||
"Language: nl\n"
|
"Language: nl\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -5,8 +5,8 @@ msgstr ""
|
||||||
"POT-Creation-Date: 2023-07-07 18:47+0000\n"
|
"POT-Creation-Date: 2023-07-07 18:47+0000\n"
|
||||||
"PO-Revision-Date: 2023-08-04 14:19+0000\n"
|
"PO-Revision-Date: 2023-08-04 14:19+0000\n"
|
||||||
"Last-Translator: Anonymous <noreply@weblate.org>\n"
|
"Last-Translator: Anonymous <noreply@weblate.org>\n"
|
||||||
"Language-Team: Thai <http://translate.akkoma.dev/projects/akkoma/"
|
"Language-Team: Thai <http://translate.akkoma.dev/projects/akkoma/akkoma-"
|
||||||
"akkoma-backend-config-descriptions/th/>\n"
|
"backend-config-descriptions/th/>\n"
|
||||||
"Language: th\n"
|
"Language: th\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,12 +1,10 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddContextIndex do
|
defmodule Pleroma.Repo.Migrations.AddContextIndex do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
create(
|
create(
|
||||||
index(:activities, ["(data->>'type')", "(data->>'context')"],
|
index(:activities, ["(data->>'type')", "(data->>'context')"],
|
||||||
name: :activities_context_index,
|
name: :activities_context_index
|
||||||
concurrently: true
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddFTSIndexToActivities do
|
defmodule Pleroma.Repo.Migrations.AddFTSIndexToActivities do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
create(
|
create(
|
||||||
index(:activities, ["(to_tsvector('english', data->'object'->>'content'))"],
|
index(:activities, ["(to_tsvector('english', data->'object'->>'content'))"],
|
||||||
concurrently: true,
|
|
||||||
using: :gin,
|
using: :gin,
|
||||||
name: :activities_fts
|
name: :activities_fts
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddTagIndex do
|
defmodule Pleroma.Repo.Migrations.AddTagIndex do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
create(
|
create(
|
||||||
index(:activities, ["(data #> '{\"object\",\"tag\"}')"],
|
index(:activities, ["(data #> '{\"object\",\"tag\"}')"],
|
||||||
concurrently: true,
|
|
||||||
using: :gin,
|
using: :gin,
|
||||||
name: :activities_tags
|
name: :activities_tags
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddSecondObjectIndexToActivty do
|
defmodule Pleroma.Repo.Migrations.AddSecondObjectIndexToActivty do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
drop_if_exists(
|
drop_if_exists(
|
||||||
index(:activities, ["(data->'object'->>'id')", "(data->>'type')"],
|
index(:activities, ["(data->'object'->>'id')", "(data->>'type')"],
|
||||||
|
@ -12,8 +10,7 @@ def change do
|
||||||
|
|
||||||
create(
|
create(
|
||||||
index(:activities, ["(coalesce(data->'object'->>'id', data->>'object'))"],
|
index(:activities, ["(coalesce(data->'object'->>'id', data->>'object'))"],
|
||||||
name: :activities_create_objects_index,
|
name: :activities_create_objects_index
|
||||||
concurrently: true
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddObjectActorIndex do
|
defmodule Pleroma.Repo.Migrations.AddObjectActorIndex do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
create(
|
create(index(:objects, ["(data->>'actor')", "(data->>'type')"], name: :objects_actor_type))
|
||||||
index(:objects, ["(data->>'actor')", "(data->>'type')"],
|
|
||||||
concurrently: true,
|
|
||||||
name: :objects_actor_type
|
|
||||||
)
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddActorToActivity do
|
defmodule Pleroma.Repo.Migrations.AddActorToActivity do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def up do
|
def up do
|
||||||
alter table(:activities) do
|
alter table(:activities) do
|
||||||
add(:actor, :string)
|
add(:actor, :string)
|
||||||
end
|
end
|
||||||
|
|
||||||
create(index(:activities, [:actor, "id DESC NULLS LAST"], concurrently: true))
|
create(index(:activities, [:actor, "id DESC NULLS LAST"]))
|
||||||
end
|
end
|
||||||
|
|
||||||
def down do
|
def down do
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddSortIndexToActivities do
|
defmodule Pleroma.Repo.Migrations.AddSortIndexToActivities do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
create(index(:activities, ["id desc nulls last"], concurrently: true))
|
create(index(:activities, ["id desc nulls last"]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddFollowerAddressIndexToUsers do
|
defmodule Pleroma.Repo.Migrations.AddFollowerAddressIndexToUsers do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
@disable_ddl_transaction true
|
|
||||||
def change do
|
def change do
|
||||||
create(index(:users, [:follower_address], concurrently: true))
|
create(index(:users, [:follower_address]))
|
||||||
create(index(:users, [:following], concurrently: true, using: :gin))
|
create(index(:users, [:following], using: :gin))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
defmodule Pleroma.Repo.Migrations.ModifyActivityIndex do
|
defmodule Pleroma.Repo.Migrations.ModifyActivityIndex do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
create(index(:activities, ["id desc nulls last", "local"], concurrently: true))
|
create(index(:activities, ["id desc nulls last", "local"]))
|
||||||
drop_if_exists(index(:activities, ["id desc nulls last"]))
|
drop_if_exists(index(:activities, ["id desc nulls last"]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
defmodule Pleroma.Repo.Migrations.CreateApidHostExtractionIndex do
|
defmodule Pleroma.Repo.Migrations.CreateApidHostExtractionIndex do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
create(
|
create(index(:activities, ["(split_part(actor, '/', 3))"], name: :activities_hosts))
|
||||||
index(:activities, ["(split_part(actor, '/', 3))"],
|
|
||||||
concurrently: true,
|
|
||||||
name: :activities_hosts
|
|
||||||
)
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
defmodule Pleroma.Repo.Migrations.CreateActivitiesInReplyToIndex do
|
defmodule Pleroma.Repo.Migrations.CreateActivitiesInReplyToIndex do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
create(
|
create(index(:activities, ["(data->'object'->>'inReplyTo')"], name: :activities_in_reply_to))
|
||||||
index(:activities, ["(data->'object'->>'inReplyTo')"],
|
|
||||||
concurrently: true,
|
|
||||||
name: :activities_in_reply_to
|
|
||||||
)
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddVisibilityFunction do
|
defmodule Pleroma.Repo.Migrations.AddVisibilityFunction do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def up do
|
def up do
|
||||||
definition = """
|
definition = """
|
||||||
|
@ -30,8 +29,7 @@ def up do
|
||||||
|
|
||||||
create(
|
create(
|
||||||
index(:activities, ["activity_visibility(actor, recipients, data)"],
|
index(:activities, ["activity_visibility(actor, recipients, data)"],
|
||||||
name: :activities_visibility_index,
|
name: :activities_visibility_index
|
||||||
concurrently: true
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddActivitiesLikesIndex do
|
defmodule Pleroma.Repo.Migrations.AddActivitiesLikesIndex do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
create(
|
create(
|
||||||
index(:activities, ["((data #> '{\"object\",\"likes\"}'))"],
|
index(:activities, ["((data #> '{\"object\",\"likes\"}'))"],
|
||||||
concurrently: true,
|
|
||||||
name: :activities_likes,
|
name: :activities_likes,
|
||||||
using: :gin
|
using: :gin
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddCorrectDMIndex do
|
defmodule Pleroma.Repo.Migrations.AddCorrectDMIndex do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
@disable_ddl_transaction true
|
|
||||||
|
|
||||||
def up do
|
def up do
|
||||||
drop_if_exists(
|
drop_if_exists(
|
||||||
|
@ -12,7 +11,6 @@ def up do
|
||||||
create(
|
create(
|
||||||
index(:activities, ["activity_visibility(actor, recipients, data)", "id DESC NULLS LAST"],
|
index(:activities, ["activity_visibility(actor, recipients, data)", "id DESC NULLS LAST"],
|
||||||
name: :activities_visibility_index,
|
name: :activities_visibility_index,
|
||||||
concurrently: true,
|
|
||||||
where: "data->>'type' = 'Create'"
|
where: "data->>'type' = 'Create'"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -22,7 +20,6 @@ def down do
|
||||||
drop_if_exists(
|
drop_if_exists(
|
||||||
index(:activities, ["activity_visibility(actor, recipients, data)", "id DESC"],
|
index(:activities, ["activity_visibility(actor, recipients, data)", "id DESC"],
|
||||||
name: :activities_visibility_index,
|
name: :activities_visibility_index,
|
||||||
concurrently: true,
|
|
||||||
where: "data->>'type' = 'Create'"
|
where: "data->>'type' = 'Create'"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddIndexOnSubscribers do
|
defmodule Pleroma.Repo.Migrations.AddIndexOnSubscribers do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
@disable_ddl_transaction true
|
|
||||||
def change do
|
def change do
|
||||||
create(
|
create(
|
||||||
index(:users, ["(info->'subscribers')"],
|
index(:users, ["(info->'subscribers')"],
|
||||||
name: :users_subscribers_index,
|
name: :users_subscribers_index,
|
||||||
using: :gin,
|
using: :gin
|
||||||
concurrently: true
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
defmodule Pleroma.Repo.Migrations.AddFollowingAddressIndexToUser do
|
defmodule Pleroma.Repo.Migrations.AddFollowingAddressIndexToUser do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
@disable_ddl_transaction true
|
|
||||||
def change do
|
def change do
|
||||||
create(index(:users, [:following_address], concurrently: true))
|
create(index(:users, [:following_address]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -100,7 +100,7 @@ def update_follower_count(%{id: user_id} = user) do
|
||||||
|
|
||||||
"users"
|
"users"
|
||||||
|> where(id: ^user_id)
|
|> where(id: ^user_id)
|
||||||
|> join(:inner, [u], s in subquery(follower_count_query))
|
|> join(:inner, [u], s in subquery(follower_count_query), on: true)
|
||||||
|> update([u, s],
|
|> update([u, s],
|
||||||
set: [follower_count: s.count]
|
set: [follower_count: s.count]
|
||||||
)
|
)
|
||||||
|
|
|
@ -23,6 +23,7 @@ test "get instance information", %{conn: conn} do
|
||||||
"uri" => _,
|
"uri" => _,
|
||||||
"title" => _,
|
"title" => _,
|
||||||
"description" => _,
|
"description" => _,
|
||||||
|
"short_description" => _,
|
||||||
"version" => _,
|
"version" => _,
|
||||||
"email" => from_config_email,
|
"email" => from_config_email,
|
||||||
"urls" => %{
|
"urls" => %{
|
||||||
|
|
Loading…
Reference in a new issue