Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Barbican WSGI Files #30

Open
d34dh0r53 opened this issue Aug 31, 2023 · 1 comment
Open

Missing Barbican WSGI Files #30

d34dh0r53 opened this issue Aug 31, 2023 · 1 comment

Comments

@d34dh0r53
Copy link
Contributor

barbican_api container

/var/www/cgi-bin/barbican/main

#!/usr/bin/python3
#PBR Generated from 'wsgi_scripts'

import threading

from barbican.api.app import get_api_wsgi_script

if __name__ == "__main__":
    import argparse
    import socket
    import sys
    import wsgiref.simple_server as wss

    parser = argparse.ArgumentParser(
        description=get_api_wsgi_script.__doc__,
        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
        usage='%(prog)s [-h] [--port PORT] [--host IP] -- [passed options]')
    parser.add_argument('--port', '-p', type=int, default=8000,
                        help='TCP port to listen on')
    parser.add_argument('--host', '-b', default='',
                        help='IP to bind the server to')
    parser.add_argument('args',
                        nargs=argparse.REMAINDER,
                        metavar='-- [passed options]',
                        help="'--' is the separator of the arguments used "
                        "to start the WSGI server and the arguments passed "
                        "to the WSGI application.")
    args = parser.parse_args()
    if args.args:
        if args.args[0] == '--':
            args.args.pop(0)
        else:
            parser.error("unrecognized arguments: %s" % ' '.join(args.args))
    sys.argv[1:] = args.args
    server = wss.make_server(args.host, args.port, get_api_wsgi_script())

    print("*" * 80)
    print("STARTING test server barbican.api.app.get_api_wsgi_script")
    url = "http://%s:%d/" % (server.server_name, server.server_port)
    print("Available at %s" % url)
    print("DANGER! For testing only, do not use in production")
    print("*" * 80)
    sys.stdout.flush()

    server.serve_forever()

/var/lib/kolla/config_files/src/etc/httpd/conf.d/10-barbican_wsgi_main.conf

# ************************************
# Vhost template in module puppetlabs-apache
# Managed by Puppet
# ************************************
#
<VirtualHost 172.17.1.108:9311>
  ServerName controller-0.internalapi.redhat.local

  ## Vhost docroot
  DocumentRoot "/var/www/cgi-bin/barbican"

  ## Directories, there should at least be a declaration for /var/www/cgi-bin/barbican

  <Directory "/var/www/cgi-bin/barbican">
    Options -Indexes +FollowSymLinks +MultiViews
    AllowOverride None
    Require all granted
  </Directory>

  ## Logging
  ErrorLog "/var/log/httpd/barbican_wsgi_main_error.log"
  ServerSignature Off
  CustomLog "/var/log/httpd/barbican_wsgi_main_access.log" combined
  SetEnvIf X-Forwarded-Proto https HTTPS=1

  ## WSGI configuration
  WSGIApplicationGroup %{GLOBAL}
  WSGIDaemonProcess barbican-api display-name=barbican_wsgi_main group=barbican processes=8 threads=1 user=barbican
  WSGIProcessGroup barbican-api
  WSGIScriptAlias / "/var/www/cgi-bin/barbican/main"
</VirtualHost>
@d34dh0r53
Copy link
Contributor Author

/var/lib/kolla/config_files/config.json

{
  "command": "/usr/sbin/httpd -DFOREGROUND",
  "config_files": [
    {
      "dest": "/etc/httpd/conf.d",
      "merge": false,
      "preserve_properties": true,
      "source": "/var/lib/kolla/config_files/src/etc/httpd/conf.d"
    },
    {
      "dest": "/etc/httpd/conf.modules.d",
      "merge": false,
      "preserve_properties": true,
      "source": "/var/lib/kolla/config_files/src/etc/httpd/conf.modules.d"
    },
    {
      "dest": "/",
      "merge": true,
      "preserve_properties": true,
      "source": "/var/lib/kolla/config_files/src/*"
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant