aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md9
-rw-r--r--lib/pleroma/formatter.ex2
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api_controller.ex1
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api.ex1
-rw-r--r--test/formatter_test.exs7
-rw-r--r--test/web/mastodon_api/mastodon_api_controller_test.exs7
6 files changed, 26 insertions, 1 deletions
diff --git a/README.md b/README.md
index 3d909e776..a6bc5000e 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,9 @@ No release has been made yet, but several servers have been online for months al
By default, it listens on port 4000 (TCP), so you can access it on http://localhost:4000/ (if you are on the same machine). In case of an error it will restart automatically.
+### Frontends
+Pleroma comes with two frontends. The first one, Pleroma FE, can be reached by normally visiting the site. The other one, based on the Mastodon project, can be found by visiting the /web path of your site.
+
### As systemd service (with provided .service file)
Running `service pleroma start`
Logs can be watched by using `journalctl -fu pleroma.service`
@@ -72,3 +75,9 @@ Run `mix generate_password_reset username` to generate a password reset link tha
You can make users moderators. They will then be able to delete any post.
Run `mix set_moderator username [true|false]` to make user a moderator or not.
+
+## Troubleshooting
+
+### No incoming federation
+
+Check that you correctly forward the "host" header to backend. It is needed to validate signatures.
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex
index b30e04e3d..515909af1 100644
--- a/lib/pleroma/formatter.ex
+++ b/lib/pleroma/formatter.ex
@@ -144,7 +144,7 @@ defmodule Pleroma.Formatter do
@emoji
end
- @link_regex ~r/https?:\/\/[\w\.\/?=\-#\+%&@~\(\)]+[\w\/]/u
+ @link_regex ~r/https?:\/\/[\w\.\/?=\-#\+%&@~\(\):]+[\w\/]/u
def html_escape(text) do
Regex.split(@link_regex, text, include_captures: true)
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index ccba4710a..6339704a2 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -507,6 +507,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
from(
a in Activity,
where: fragment("?->>'type' = 'Create'", a.data),
+ where: "https://www.w3.org/ns/activitystreams#Public" in a.recipients,
where:
fragment(
"to_tsvector('english', ?->'object'->>'content') @@ plainto_tsquery('english', ?)",
diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex
index 027b97154..c12cd7f8a 100644
--- a/lib/pleroma/web/twitter_api/twitter_api.ex
+++ b/lib/pleroma/web/twitter_api/twitter_api.ex
@@ -193,6 +193,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
from(
a in Activity,
where: fragment("?->>'type' = 'Create'", a.data),
+ where: "https://www.w3.org/ns/activitystreams#Public" in a.recipients,
where:
fragment(
"to_tsvector('english', ?->'object'->>'content') @@ plainto_tsquery('english', ?)",
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index ff882f8f1..4c65b26f2 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -34,6 +34,13 @@ defmodule Pleroma.FormatterTest do
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
+ text = "https://mastodon.social:4000/@lambadalambda"
+
+ expected =
+ "<a href='https://mastodon.social:4000/@lambadalambda'>https://mastodon.social:4000/@lambadalambda</a>"
+
+ assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
+
text = "@lambadalambda"
expected = "@lambadalambda"
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs
index 2c9cdd194..5d39c25c6 100644
--- a/test/web/mastodon_api/mastodon_api_controller_test.exs
+++ b/test/web/mastodon_api/mastodon_api_controller_test.exs
@@ -564,6 +564,13 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
user_three = insert(:user, %{nickname: "shp@heldscal.la", name: "I love 2hu"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "This is about 2hu"})
+
+ {:ok, _activity} =
+ CommonAPI.post(user, %{
+ "status" => "This is about 2hu, but private",
+ "visibility" => "private"
+ })
+
{:ok, _} = CommonAPI.post(user_two, %{"status" => "This isn't"})
conn =