diff --git a/fet2020/documents/etherpadlib.py b/fet2020/documents/etherpadlib.py index 3e83ef7f..520fa5ea 100644 --- a/fet2020/documents/etherpadlib.py +++ b/fet2020/documents/etherpadlib.py @@ -38,7 +38,12 @@ def add_ep_cookie(request, response): domain=".2020.fet.at", path="/" ) - + response.set_cookie( + "sessionID", + ep_sessid, + expires=expires, + path="/etherpad" + ) return response diff --git a/fet2020/fet2020/settings.py b/fet2020/fet2020/settings.py index 96501bab..878dffa9 100644 --- a/fet2020/fet2020/settings.py +++ b/fet2020/fet2020/settings.py @@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/3.0/ref/settings/ import os import environ +from urllib.parse import urljoin + env = environ.Env( # set casting, default value DEBUG=(bool, True), @@ -186,10 +188,9 @@ USE_TZ = True STATIC_URL = '/assets/' STATICFILES_DIRS = [ - os.path.join(BASE_DIR, "static"), - os.path.join(BASE_DIR, "static_design1"), + os.path.join(BASE_DIR, "static") ] - +STATIC_ROOT = 'assets/' MEDIA_ROOT = os.path.join(BASE_DIR, 'files/') MEDIA_URL = '/files/' @@ -219,9 +220,22 @@ THUMBNAIL_ALIASES = { }, } -ETHERPAD_CLIENT = { - 'url': "http://localhost:9003", - 'exturl': "https://etherpad2.2020.fet.at/", - 'apikey': "/srv/andis_test/etherpad_test2/etherpad-lite/APIKEY.txt" -} +if DEBUG: + ETHERPAD_CLIENT = { + 'url': "http://localhost:9001", + 'exturl': "https://etherpad2.2020.fet.at/", + 'apikey': "/srv/etherpad/APIKEY.txt" + } +else: + ETHERPAD_CLIENT = { + 'url': "http://etherpad", + 'exturl': urljoin(env('HOST_NAME'),"etherpad"), + 'apikey': "/app/etherpad/APIKEY.txt" + } + +REST_FRAMEWORK = { + 'DEFAULT_PERMISSION_CLASSES': [ + 'rest_framework.permissions.AllowAny', + ] +} \ No newline at end of file