mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 01:29:16 +02:00
Added FUNKWHALE_HOSTNAME and FEDERATION_HOSTNAME settings
This commit is contained in:
parent
588da6ff33
commit
90c1d02919
3 changed files with 36 additions and 1 deletions
14
api/funkwhale_api/federation/utils.py
Normal file
14
api/funkwhale_api/federation/utils.py
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue