Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/roles/httpd/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ httpd_pulp_api_backend: http://localhost:24817
httpd_pulp_content_backend: http://localhost:24816
httpd_foreman_backend: http://localhost:3000
httpd_pub_dir: /var/www/html/pub
httpd_enabled_pulp_snippets: []

# MPM event module defaults
httpd_server_limit: 25
Expand Down
4 changes: 4 additions & 0 deletions src/roles/httpd/templates/foreman-ssl-vhost.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
ProxyPassReverse {{ httpd_pulp_content_backend }}/pulp/content
</Location>

{% for httpd_pulp_snippet in httpd_enabled_pulp_snippets %}
{% include httpd_pulp_snippet+'.j2' %}
{% endfor %}

<Location "/pulp/api/v3">
RequestHeader unset REMOTE_USER
RequestHeader unset REMOTE-USER
Expand Down
7 changes: 7 additions & 0 deletions src/roles/httpd/templates/pypi.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Location "/pypi">
RequestHeader unset X-CLIENT-CERT
RequestHeader set X-CLIENT-CERT "%{SSL_CLIENT_CERT}s" env=SSL_CLIENT_CERT
RequestHeader set X-FORWARDED-PROTO expr=%{REQUEST_SCHEME}
ProxyPass {{ httpd_pulp_api_backend }}/pypi timeout=600
ProxyPassReverse {{ httpd_pulp_api_backend }}/pypi
</Location>
1 change: 1 addition & 0 deletions src/vars/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ httpd_server_ca_certificate: "{{ server_ca_certificate }}"
httpd_client_ca_certificate: "{{ client_ca_certificate }}"
httpd_server_certificate: "{{ server_certificate }}"
httpd_server_key: "{{ server_key }}"
httpd_enabled_pulp_snippets: "{{ ['pypi'] if 'pulp_python' in pulp_plugins else [] }}"

pulp_content_origin: "https://{{ ansible_facts['fqdn'] }}"
pulp_pulp_url: "https://{{ ansible_facts['fqdn'] }}"
Expand Down
1 change: 1 addition & 0 deletions src/vars/flavors/katello.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ flavor_features:
- content/ansible
- content/container
- content/deb
- content/python
- content/rpm
8 changes: 8 additions & 0 deletions tests/httpd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ def test_https_pulp_auth(server, certificates, server_fqdn):
assert cmd.stdout == '200'


def test_https_pypi_endpoint(server, certificates, server_fqdn):
cmd = server.run(f"curl --cacert {certificates['server_ca_certificate']} https://{server_fqdn}/pypi/test/")
assert cmd.succeeded
# Verify route proxies to Pulp's Python plugin by checking for PythonDistribution in response
# (Rails or unconfigured routes would return different errors)
assert "PythonDistribution" in cmd.stdout


def test_pub_directory_exists(server):
pub_dir = server.file(HTTPD_PUB_DIR)
assert pub_dir.exists
Expand Down