Rename project to Mobilizon
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
defmodule Eventos.Service.ActivityPub do
|
||||
defmodule Mobilizon.Service.ActivityPub do
|
||||
@moduledoc """
|
||||
# ActivityPub
|
||||
|
||||
Every ActivityPub method
|
||||
"""
|
||||
|
||||
alias Eventos.Events
|
||||
alias Eventos.Events.{Event, Category, Comment}
|
||||
alias Eventos.Service.ActivityPub.Transmogrifier
|
||||
alias Eventos.Service.WebFinger
|
||||
alias Eventos.Activity
|
||||
alias Mobilizon.Events
|
||||
alias Mobilizon.Events.{Event, Category, Comment}
|
||||
alias Mobilizon.Service.ActivityPub.Transmogrifier
|
||||
alias Mobilizon.Service.WebFinger
|
||||
alias Mobilizon.Activity
|
||||
|
||||
alias Eventos.Actors
|
||||
alias Eventos.Actors.Actor
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Actors.Actor
|
||||
|
||||
alias Eventos.Service.Federator
|
||||
alias Mobilizon.Service.Federator
|
||||
|
||||
import Logger
|
||||
import Eventos.Service.ActivityPub.Utils
|
||||
import Mobilizon.Service.ActivityPub.Utils
|
||||
|
||||
def get_recipients(data) do
|
||||
(data["to"] || []) ++ (data["cc"] || [])
|
||||
@@ -261,7 +261,7 @@ defmodule Eventos.Service.ActivityPub do
|
||||
host = URI.parse(inbox).host
|
||||
|
||||
signature =
|
||||
Eventos.Service.HTTPSignatures.sign(actor, %{host: host, "content-length": byte_size(json)})
|
||||
Mobilizon.Service.HTTPSignatures.sign(actor, %{host: host, "content-length": byte_size(json)})
|
||||
|
||||
Logger.debug("signature")
|
||||
Logger.debug(inspect(signature))
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
defmodule Eventos.Service.ActivityPub.Transmogrifier do
|
||||
defmodule Mobilizon.Service.ActivityPub.Transmogrifier do
|
||||
@moduledoc """
|
||||
A module to handle coding from internal to wire ActivityPub and back.
|
||||
"""
|
||||
alias Eventos.Actors.Actor
|
||||
alias Eventos.Actors
|
||||
alias Eventos.Events.{Event, Comment}
|
||||
alias Eventos.Service.ActivityPub
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Events.{Event, Comment}
|
||||
alias Mobilizon.Service.ActivityPub
|
||||
|
||||
import Ecto.Query
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
defmodule Eventos.Service.ActivityPub.Utils do
|
||||
defmodule Mobilizon.Service.ActivityPub.Utils do
|
||||
@moduledoc """
|
||||
# Utils
|
||||
|
||||
Various utils
|
||||
"""
|
||||
|
||||
alias Eventos.Repo
|
||||
alias Eventos.Actors
|
||||
alias Eventos.Actors.Actor
|
||||
alias Eventos.Events.Event
|
||||
alias Eventos.Events
|
||||
alias Eventos.Activity
|
||||
alias EventosWeb
|
||||
alias EventosWeb.Router.Helpers
|
||||
alias EventosWeb.Endpoint
|
||||
alias Mobilizon.Repo
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Events.Event
|
||||
alias Mobilizon.Events
|
||||
alias Mobilizon.Activity
|
||||
alias MobilizonWeb
|
||||
alias MobilizonWeb.Router.Helpers
|
||||
alias MobilizonWeb.Endpoint
|
||||
alias Ecto.{Changeset, UUID}
|
||||
import Ecto.Query
|
||||
|
||||
@@ -49,7 +49,7 @@ defmodule Eventos.Service.ActivityPub.Utils do
|
||||
# end
|
||||
|
||||
def generate_id(type) do
|
||||
"#{EventosWeb.Endpoint.url()}/#{type}/#{UUID.generate()}"
|
||||
"#{MobilizonWeb.Endpoint.url()}/#{type}/#{UUID.generate()}"
|
||||
end
|
||||
|
||||
# def create_context(context) do
|
||||
@@ -78,7 +78,7 @@ defmodule Eventos.Service.ActivityPub.Utils do
|
||||
_ -> 5
|
||||
end
|
||||
|
||||
Eventos.Service.Federator.enqueue(:publish, activity, priority)
|
||||
Mobilizon.Service.Federator.enqueue(:publish, activity, priority)
|
||||
:ok
|
||||
end
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
defmodule Eventos.Service.Federator do
|
||||
defmodule Mobilizon.Service.Federator do
|
||||
@moduledoc """
|
||||
Handle federated activities
|
||||
"""
|
||||
|
||||
use GenServer
|
||||
alias Eventos.Actors
|
||||
alias Eventos.Activity
|
||||
alias Eventos.Service.ActivityPub
|
||||
alias Eventos.Service.ActivityPub.Transmogrifier
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Activity
|
||||
alias Mobilizon.Service.ActivityPub
|
||||
alias Mobilizon.Service.ActivityPub.Transmogrifier
|
||||
require Logger
|
||||
|
||||
@max_jobs 20
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# https://tools.ietf.org/html/draft-cavage-http-signatures-08
|
||||
defmodule Eventos.Service.HTTPSignatures do
|
||||
defmodule Mobilizon.Service.HTTPSignatures do
|
||||
@moduledoc """
|
||||
# HTTP Signatures
|
||||
|
||||
Generates and checks HTTP Signatures
|
||||
"""
|
||||
|
||||
alias Eventos.Actors.Actor
|
||||
alias Eventos.Service.ActivityPub
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Service.ActivityPub
|
||||
import Logger
|
||||
|
||||
def split_signature(sig) do
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
defmodule Eventos.Service.Streamer do
|
||||
defmodule Mobilizon.Service.Streamer do
|
||||
@moduledoc """
|
||||
# Streamer
|
||||
|
||||
@@ -7,7 +7,7 @@ defmodule Eventos.Service.Streamer do
|
||||
|
||||
use GenServer
|
||||
require Logger
|
||||
alias Eventos.Accounts.Actor
|
||||
alias Mobilizon.Accounts.Actor
|
||||
|
||||
def init(args) do
|
||||
{:ok, args}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
defmodule Eventos.Service.WebFinger do
|
||||
defmodule Mobilizon.Service.WebFinger do
|
||||
@moduledoc """
|
||||
# WebFinger
|
||||
|
||||
Performs the WebFinger requests and responses (json only)
|
||||
"""
|
||||
|
||||
alias Eventos.Actors
|
||||
alias Eventos.Service.XmlBuilder
|
||||
alias Eventos.Repo
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Service.XmlBuilder
|
||||
alias Mobilizon.Repo
|
||||
require Jason
|
||||
require Logger
|
||||
|
||||
def host_meta do
|
||||
base_url = EventosWeb.Endpoint.url()
|
||||
base_url = MobilizonWeb.Endpoint.url()
|
||||
|
||||
{
|
||||
:XRD,
|
||||
@@ -30,7 +30,7 @@ defmodule Eventos.Service.WebFinger do
|
||||
end
|
||||
|
||||
def webfinger(resource, "JSON") do
|
||||
host = EventosWeb.Endpoint.host()
|
||||
host = MobilizonWeb.Endpoint.host()
|
||||
regex = ~r/(acct:)?(?<name>\w+)@#{host}/
|
||||
|
||||
with %{"name" => name} <- Regex.named_captures(regex, resource) do
|
||||
@@ -49,7 +49,7 @@ defmodule Eventos.Service.WebFinger do
|
||||
|
||||
def represent_user(user, "JSON") do
|
||||
%{
|
||||
"subject" => "acct:#{user.preferred_username}@#{EventosWeb.Endpoint.host() <> ":4001"}",
|
||||
"subject" => "acct:#{user.preferred_username}@#{MobilizonWeb.Endpoint.host() <> ":4001"}",
|
||||
"aliases" => [user.url],
|
||||
"links" => [
|
||||
%{"rel" => "self", "type" => "application/activity+json", "href" => user.url}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
defmodule Eventos.Service.XmlBuilder do
|
||||
defmodule Mobilizon.Service.XmlBuilder do
|
||||
@moduledoc """
|
||||
XML Builder.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user