#6122 PDC api doc uses http:// instead of https://
Closed Opened by till.

PDC is properly available via https but for some reason the API doc uses http:// for links instead:
https://pdc.fedoraproject.org/rest_api/v1/

http://pdc.fedoraproject.org seems to be only mentioned for copr/mbs in ansible (which is a separate issue)

Just wondering, is PDC using http:// behind proxies and therefore maybe using the wrong protocol?


This might be:

BROWSABLE_DOCUMENT_MACROS = {
    # need to be rewrite with the real host name when deploy.
    'HOST_NAME': 'http://{{ inventory_hostname }}:80',
    # make consistent with rest api root.
    'API_PATH': '%s%s' % (REST_API_URL, REST_API_VERSION),
}

in roles/pdc/frontend/templates/settings_local.py

@ralph any ideas?

Metadata Update from @ralph:
- Issue assigned to ralph

Looks like this is what we need:

https://stackoverflow.com/questions/22279893/djangorestframework-https-links-with-routers-and-viewsets

Stripping X-Forwarded-Proto shouldn't be an issue for us, since the incoming requests should all come through the proxies anyways -- the firewall should disallow requests from outside that don't come through the proxies.

OK, got this working in staging:

https://pdc.stg.fedoraproject.org/rest_api/v1/

See the following two ansible commits needed:

  • https://infrastructure.fedoraproject.org/cgit/ansible.git/commit/?id=c3b20a632a14818e580225cdc0e905719a4fb57b
  • https://infrastructure.fedoraproject.org/cgit/ansible.git/commit/?id=75e333850150e211e21bad6f2b4e7916f50663f0

I guess.. let's wait until freeze is up to do this in prod?

Metadata Update from @ralph:
- Issue tagged with: unfreeze

In prod: https://infrastructure.fedoraproject.org/cgit/ansible.git/commit/?id=5752ba7fcbe87e0749da05d13b7c6e9e0ae8d983

Metadata Update from @ralph:
- Issue status updated to: Closed (was: Open)

Metadata