diff --git a/purl_sync/requirements.txt b/purl_sync/requirements.txt index 616cf0e9a..e8c217d45 100644 --- a/purl_sync/requirements.txt +++ b/purl_sync/requirements.txt @@ -54,3 +54,4 @@ tzlocal==5.0.1 unidiff==0.7.5 urllib3==2.0.3 wrapt==1.15.0 +psycopg[binary]==3.1.12 \ No newline at end of file diff --git a/purl_sync/review/tests/docker-compose-dev-test-federation.yml b/purl_sync/review/tests/docker-compose-dev-test-federation.yml index 8242fbcc5..9adb9b954 100644 --- a/purl_sync/review/tests/docker-compose-dev-test-federation.yml +++ b/purl_sync/review/tests/docker-compose-dev-test-federation.yml @@ -16,7 +16,7 @@ services: purl_sync1: build: ../../ - command: /bin/sh -c "apt-get update && pip install psycopg2 --force-reinstall --no-cache-dir && python manage.py migrate && python manage.py runserver 0.0.0.0:8000" + command: /bin/sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8001" env_file: - docker-compose-dev-test-federation1.env volumes: @@ -24,13 +24,13 @@ services: expose: - 8000 ports: - - "8000:8000" + - "8001:8001" depends_on: - db1 purl_sync2: build: ../../ - command: /bin/sh -c "apt-get update && pip install psycopg2 --force-reinstall --no-cache-dir && python manage.py migrate && python manage.py runserver 0.0.0.0:8000" + command: /bin/sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8002" env_file: - docker-compose-dev-test-federation2.env volumes: @@ -38,7 +38,7 @@ services: expose: - 8000 ports: - - "8001:8000" + - "8002:8002" depends_on: - db2 diff --git a/purl_sync/review/utils.py b/purl_sync/review/utils.py index 6eeae1e0f..d0884d109 100644 --- a/purl_sync/review/utils.py +++ b/purl_sync/review/utils.py @@ -90,7 +90,7 @@ def ap_collection(objects): def webfinger_actor(domain, user): """ """ acct = generate_webfinger(user, domain) - url = f"https://{domain}/.well-known/webfinger?resource=acct:{acct}" + url = f"http://{domain}/.well-known/webfinger?resource=acct:{acct}" # TODO http -> https headers = {"User-Agent": ""} # TODO try: response = requests.get(url, headers=headers) diff --git a/purl_sync/review/views.py b/purl_sync/review/views.py index 15577edd7..2296e05b3 100644 --- a/purl_sync/review/views.py +++ b/purl_sync/review/views.py @@ -474,7 +474,7 @@ def post(self, request, *args, **kwargs): form = SubscribePurlForm(request.POST) if form.is_valid(): user, domain = parse_webfinger(form.cleaned_data.get("acct")) - remote_actor_url = webfinger_actor(user, domain) + remote_actor_url = webfinger_actor(domain, user) payload = json.dumps( {