diff --git a/api/config/settings/common.py b/api/config/settings/common.py
index a6a46a85a2f1394197a53597ea1fc215d1b20165..32cdb5b7f53e54dedcab0a3665d647e349553170 100644
--- a/api/config/settings/common.py
+++ b/api/config/settings/common.py
@@ -10,6 +10,7 @@ https://docs.djangoproject.com/en/dev/ref/settings/
 """
 from __future__ import absolute_import, unicode_literals
 
+from urllib.parse import urlsplit
 import os
 import environ
 from funkwhale_api import __version__
@@ -24,8 +25,13 @@ try:
 except FileNotFoundError:
     pass
 
-ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS')
 FUNKWHALE_URL = env('FUNKWHALE_URL')
+FUNKWHALE_HOSTNAME = urlsplit(FUNKWHALE_URL).netloc
+
+FEDERATION_ENABLED = env.bool('FEDERATION_ENABLED', default=True)
+FEDERATION_HOSTNAME = env('FEDERATION_HOSTNAME', default=FUNKWHALE_HOSTNAME)
+
+ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS')
 
 # APP CONFIGURATION
 # ------------------------------------------------------------------------------
@@ -395,4 +401,5 @@ ACCOUNT_USERNAME_BLACKLIST = [
     'owner',
     'superuser',
     'staff',
+    'service',
 ] + env.list('ACCOUNT_USERNAME_BLACKLIST', default=[])
diff --git a/api/funkwhale_api/federation/utils.py b/api/funkwhale_api/federation/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..e83f54b5d54c79d684d80c057e7e0fbb7cd5d1f1
--- /dev/null
+++ b/api/funkwhale_api/federation/utils.py
@@ -0,0 +1,14 @@
+from django.conf import settings
+
+
+def full_url(path):
+    """
+    Given a relative path, return a full url usable for federation purpose
+    """
+    root = settings.FUNKWHALE_URL
+    if path.startswith('/') and root.endswith('/'):
+        return root + path[1:]
+    elif not path.startswith('/') and not root.endswith('/'):
+        return root + '/' + path
+    else:
+        return root + path
diff --git a/api/tests/federation/test_utils.py b/api/tests/federation/test_utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..8bada65bb03c2b17bbc3428b3846a8c1a3f416b7
--- /dev/null
+++ b/api/tests/federation/test_utils.py
@@ -0,0 +1,14 @@
+import pytest
+
+from funkwhale_api.federation import utils
+
+
+@pytest.mark.parametrize('url,path,expected', [
+    ('http://test.com', '/hello', 'http://test.com/hello'),
+    ('http://test.com/', 'hello', 'http://test.com/hello'),
+    ('http://test.com/', '/hello', 'http://test.com/hello'),
+    ('http://test.com', 'hello', 'http://test.com/hello'),
+])
+def test_full_url(settings, url, path, expected):
+    settings.FUNKWHALE_URL = url
+    assert utils.full_url(path) == expected