Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
interfect
funkwhale
Commits
703d70d5
Verified
Commit
703d70d5
authored
Mar 31, 2018
by
Eliot Berriot
Browse files
Use absolute urls
parent
0c8faf83
Changes
2
Hide whitespace changes
Inline
Side-by-side
api/funkwhale_api/federation/actors.py
View file @
703d70d5
...
...
@@ -6,6 +6,7 @@ from django.conf import settings
from
dynamic_preferences.registries
import
global_preferences_registry
from
.
import
models
from
.
import
utils
def
get_actor_data
(
actor_url
):
...
...
@@ -29,18 +30,22 @@ def get_base_system_actor_arguments(name):
'type'
:
'Person'
,
'name'
:
'{}
\'
s library'
.
format
(
settings
.
FEDERATION_HOSTNAME
),
'manually_approves_followers'
:
True
,
'url'
:
reverse
(
'federation:instance-actors-detail'
,
kwargs
=
{
'actor'
:
name
}),
'shared_inbox_url'
:
reverse
(
'federation:instance-actors-inbox'
,
kwargs
=
{
'actor'
:
name
}),
'inbox_url'
:
reverse
(
'federation:instance-actors-inbox'
,
kwargs
=
{
'actor'
:
name
}),
'outbox_url'
:
reverse
(
'federation:instance-actors-outbox'
,
kwargs
=
{
'actor'
:
name
}),
'url'
:
utils
.
full_url
(
reverse
(
'federation:instance-actors-detail'
,
kwargs
=
{
'actor'
:
name
})),
'shared_inbox_url'
:
utils
.
full_url
(
reverse
(
'federation:instance-actors-inbox'
,
kwargs
=
{
'actor'
:
name
})),
'inbox_url'
:
utils
.
full_url
(
reverse
(
'federation:instance-actors-inbox'
,
kwargs
=
{
'actor'
:
name
})),
'outbox_url'
:
utils
.
full_url
(
reverse
(
'federation:instance-actors-outbox'
,
kwargs
=
{
'actor'
:
name
})),
'public_key'
:
preferences
[
'federation__public_key'
],
'summary'
:
'Bot account to federate with {}
\'
s library'
.
format
(
settings
.
FEDERATION_HOSTNAME
...
...
api/tests/federation/test_actors.py
View file @
703d70d5
from
django.urls
import
reverse
from
funkwhale_api.federation
import
actors
from
funkwhale_api.federation
import
utils
def
test_actor_fetching
(
r_mock
):
...
...
@@ -24,15 +25,18 @@ def test_get_library(settings, preferences):
'type'
:
'Person'
,
'name'
:
'{}
\'
s library'
.
format
(
settings
.
FEDERATION_HOSTNAME
),
'manually_approves_followers'
:
True
,
'url'
:
reverse
(
'federation:instance-actors-detail'
,
kwargs
=
{
'actor'
:
'library'
}),
'shared_inbox_url'
:
reverse
(
'federation:instance-actors-inbox'
,
kwargs
=
{
'actor'
:
'library'
}),
'inbox_url'
:
reverse
(
'federation:instance-actors-inbox'
,
kwargs
=
{
'actor'
:
'library'
}),
'url'
:
utils
.
full_url
(
reverse
(
'federation:instance-actors-detail'
,
kwargs
=
{
'actor'
:
'library'
})),
'shared_inbox_url'
:
utils
.
full_url
(
reverse
(
'federation:instance-actors-inbox'
,
kwargs
=
{
'actor'
:
'library'
})),
'inbox_url'
:
utils
.
full_url
(
reverse
(
'federation:instance-actors-inbox'
,
kwargs
=
{
'actor'
:
'library'
})),
'public_key'
:
'public_key'
,
'summary'
:
'Bot account to federate with {}
\'
s library'
.
format
(
settings
.
FEDERATION_HOSTNAME
),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment