Skip to content

Add apache config support for /pypi#400

Open
pavanshekar wants to merge 1 commit intotheforeman:masterfrom
pavanshekar:add-pypi-support
Open

Add apache config support for /pypi#400
pavanshekar wants to merge 1 commit intotheforeman:masterfrom
pavanshekar:add-pypi-support

Conversation

@pavanshekar
Copy link
Copy Markdown

Summary

Add Apache config support for /pypi in puppet-pulpcore

Fixes: SAT-44474

Changes

  • Added use_pypi_route parameter to pulpcore::plugin::python (default: true)
  • Generates Apache <Location "/pypi"> block that proxies to pulpcore-api service
  • Added comprehensive tests for the new parameter

Generated Apache Config

When use_pypi_route => true (default), the module should generate:

  <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 unix:///run/pulpcore-api.sock|http://pulpcore-api/pypi timeout=600
    ProxyPassReverse unix:///run/pulpcore-api.sock|http://pulpcore-api/pypi                                                                    
  </Location>

Comment thread manifests/plugin/python.pp Outdated
Comment thread spec/classes/plugin_python_spec.rb
Comment thread spec/classes/plugin_python_spec.rb Outdated
Copy link
Copy Markdown

@qcjames53 qcjames53 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was (finally) able to get this to run as a part of foreman-installer on a clean dev environment. After pulling changes and re-running installer, the Apache config successfully includes the new endpoint:

[vagrant@centos9-pulp-upgrade ~]$ sudo cat /etc/httpd/conf.d/05-foreman-ssl.conf
...
  <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 unix:///run/pulpcore-api.sock|http://pulpcore-api/pypi timeout=600
    ProxyPassReverse unix:///run/pulpcore-api.sock|http://pulpcore-api/pypi
  </Location>

The unit test passes and looks fit for purpose. The source seems good to me as well. Approving changes. @ekohl how are things looking to you?

Copy link
Copy Markdown
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I've kicked off CI to see if it agrees.

@ekohl ekohl added the Enhancement New feature or request label Apr 22, 2026
@ekohl ekohl enabled auto-merge (rebase) April 22, 2026 09:01
@pavanshekar
Copy link
Copy Markdown
Author

CI is failing. What should I do to resolve this?

@qcjames53
Copy link
Copy Markdown

The failure in test setup looks unrelated to me.

@ekohl
Copy link
Copy Markdown
Member

ekohl commented Apr 22, 2026

I think this is due to voxpupuli/gha-puppet@fd171ad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants