Skip to content

Commit 47bb7f5

Browse files
committed
Fix federation of Follow request
Fix cache and add psycopg[binary] to requirements.txt Signed-off-by: ziadhany <ziadhany2016@gmail.com>
1 parent cf9a99c commit 47bb7f5

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

purl_sync/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ tzlocal==5.0.1
5454
unidiff==0.7.5
5555
urllib3==2.0.3
5656
wrapt==1.15.0
57+
psycopg[binary]==3.1.12

purl_sync/review/tests/docker-compose-dev-test-federation.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,29 @@ services:
1616

1717
purl_sync1:
1818
build: ../../
19-
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"
19+
command: /bin/sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8001"
2020
env_file:
2121
- docker-compose-dev-test-federation1.env
2222
volumes:
2323
- /etc/purl_sync1/:/etc/purl_sync1/
2424
expose:
2525
- 8000
2626
ports:
27-
- "8000:8000"
27+
- "8001:8001"
2828
depends_on:
2929
- db1
3030

3131
purl_sync2:
3232
build: ../../
33-
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"
33+
command: /bin/sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8002"
3434
env_file:
3535
- docker-compose-dev-test-federation2.env
3636
volumes:
3737
- /etc/purl_sync2/:/etc/purl_sync2/
3838
expose:
3939
- 8000
4040
ports:
41-
- "8001:8000"
41+
- "8002:8002"
4242
depends_on:
4343
- db2
4444

purl_sync/review/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def ap_collection(objects):
9090
def webfinger_actor(domain, user):
9191
""" """
9292
acct = generate_webfinger(user, domain)
93-
url = f"https://{domain}/.well-known/webfinger?resource=acct:{acct}"
93+
url = f"http://{domain}/.well-known/webfinger?resource=acct:{acct}" # TODO http -> https
9494
headers = {"User-Agent": ""} # TODO
9595
try:
9696
response = requests.get(url, headers=headers)

purl_sync/review/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def post(self, request, *args, **kwargs):
474474
form = SubscribePurlForm(request.POST)
475475
if form.is_valid():
476476
user, domain = parse_webfinger(form.cleaned_data.get("acct"))
477-
remote_actor_url = webfinger_actor(user, domain)
477+
remote_actor_url = webfinger_actor(domain, user)
478478

479479
payload = json.dumps(
480480
{

0 commit comments

Comments
 (0)