aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--installation/pleroma.nginx5
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub_controller.ex2
-rw-r--r--lib/pleroma/web/web_finger/web_finger.ex2
-rw-r--r--test/fixtures/httpoison_mock/status.alpicola.com_host_meta2
-rw-r--r--test/support/httpoison_mock.ex8
-rw-r--r--test/web/web_finger/web_finger_test.exs6
7 files changed, 22 insertions, 5 deletions
diff --git a/README.md b/README.md
index d736354a2..3523c9a92 100644
--- a/README.md
+++ b/README.md
@@ -74,7 +74,7 @@ This is useful for running pleroma inside Tor or i2p.
### Register a User
-Run `mix register_user <name> <nickname> <email> <bio>`. The `name` appears on statuses, while the nickname corresponds to the user, e.g. `@nickname@instance.tld`
+Run `mix register_user <name> <nickname> <email> <bio> <password>`. The `name` appears on statuses, while the nickname corresponds to the user, e.g. `@nickname@instance.tld`
### Password reset
diff --git a/installation/pleroma.nginx b/installation/pleroma.nginx
index 44905da49..b6ca30cc9 100644
--- a/installation/pleroma.nginx
+++ b/installation/pleroma.nginx
@@ -52,8 +52,9 @@ server {
# if you do not want remote frontends to be able to access your Pleroma backend
# server, remove these lines.
add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' 'POST, GET, OPTIONS' always;
- add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
+ add_header 'Access-Control-Allow-Methods' 'POST, PUT, DELETE, GET, PATCH, OPTIONS' always;
+ add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Idempotency-Key' always;
+ add_header 'Access-Control-Expose-Headers' 'Link, X-RateLimit-Reset, X-RateLimit-Limit, X-RateLimit-Remaining, X-Request-Id' always;
if ($request_method = OPTIONS) {
return 204;
}
diff --git a/lib/pleroma/web/activity_pub/activity_pub_controller.ex b/lib/pleroma/web/activity_pub/activity_pub_controller.ex
index 80aae4f0f..c7d50893f 100644
--- a/lib/pleroma/web/activity_pub/activity_pub_controller.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub_controller.ex
@@ -93,7 +93,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
Logger.info("Signature not from author, relayed message, fetching from source")
ActivityPub.fetch_object_from_id(params["object"]["id"])
else
- Logger.info("Signature error")
+ Logger.info("Signature error - make sure you are forwarding the HTTP Host header!")
Logger.info("Could not validate #{params["actor"]}")
Logger.info(inspect(conn.req_headers))
end
diff --git a/lib/pleroma/web/web_finger/web_finger.ex b/lib/pleroma/web/web_finger/web_finger.ex
index 6e5fc1401..9c6f1cb68 100644
--- a/lib/pleroma/web/web_finger/web_finger.ex
+++ b/lib/pleroma/web/web_finger/web_finger.ex
@@ -214,7 +214,7 @@ defmodule Pleroma.Web.WebFinger do
end
def get_template_from_xml(body) do
- xpath = "//Link[@rel='lrdd' and @type='application/xrd+xml']/@template"
+ xpath = "//Link[@rel='lrdd']/@template"
with doc when doc != :error <- XML.parse_document(body),
template when template != nil <- XML.string_from_xpath(xpath, doc) do
diff --git a/test/fixtures/httpoison_mock/status.alpicola.com_host_meta b/test/fixtures/httpoison_mock/status.alpicola.com_host_meta
new file mode 100644
index 000000000..6948c30ea
--- /dev/null
+++ b/test/fixtures/httpoison_mock/status.alpicola.com_host_meta
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><hm:Host xmlns:hm="http://host-meta.net/xrd/1.0">status.alpicola.com</hm:Host><Link rel="lrdd" template="http://status.alpicola.com/main/xrd?uri={uri}"><Title>Resource Descriptor</Title></Link></XRD> \ No newline at end of file
diff --git a/test/support/httpoison_mock.ex b/test/support/httpoison_mock.ex
index f28557975..6e8336a93 100644
--- a/test/support/httpoison_mock.ex
+++ b/test/support/httpoison_mock.ex
@@ -531,6 +531,14 @@ defmodule HTTPoisonMock do
}}
end
+ def get("http://status.alpicola.com/.well-known/host-meta", [], follow_redirect: true) do
+ {:ok,
+ %Response{
+ status_code: 200,
+ body: File.read!("test/fixtures/httpoison_mock/status.alpicola.com_host_meta")
+ }}
+ end
+
def get("http://macgirvin.com/.well-known/host-meta", [], follow_redirect: true) do
{:ok,
%Response{
diff --git a/test/web/web_finger/web_finger_test.exs b/test/web/web_finger/web_finger_test.exs
index 2d6ff2656..99bf210ea 100644
--- a/test/web/web_finger/web_finger_test.exs
+++ b/test/web/web_finger/web_finger_test.exs
@@ -88,6 +88,12 @@ defmodule Pleroma.Web.WebFingerTest do
assert template == "https://macgirvin.com/xrd/?uri={uri}"
end
+
+ test "it gets the xrd endpoint for statusnet" do
+ {:ok, template} = WebFinger.find_lrdd_template("status.alpicola.com")
+
+ assert template == "http://status.alpicola.com/main/xrd?uri={uri}"
+ end
end
describe "ensure_keys_present" do