Exemplo n.º 1
0
    def create_app(self):
        logging.getLogger("connexion.operation").setLevel("ERROR")
        extra_config = {
            "TESTING": True,
            "LIVESERVER_PORT": 0,
            "SQLALCHEMY_DATABASE_URI": "sqlite:///:memory:",
            "GOOGLE_CLIENT_ID": "*****@*****.**",
            "GITHUB_CLIENT_ID": None,
            "FACEBOOK_APP_ID": None,
            "GITLAB_CLIENT_ID": "dfgfdgh4563453456dsfgdsfg456",
            "GITLAB_BASE_URL": "https://gitlab.com",
            "JWT_SECRET": "89807erkjhdfgu768dfsgdsfg345r",
            "KEYCLOAK_BASE_URL": None,
            "KEYCLOAK_CLIENT_ID": None,
        }
        app = get_app(**extra_config)
        create_celery_app(app)

        # Add a test user
        with app.app_context():
            self.test_user = User(name="Test User",
                                  email="*****@*****.**",
                                  is_active=True)
            session.add(self.test_user)
            session.commit()
            self.jwt_token = generate_token(self.test_user.id)
            token = Token(name="login-token",
                          user=self.test_user,
                          token=self.jwt_token)
            session.add(token)
            session.commit()
            session.refresh(self.test_user)

        if ibutsu_server.tasks.task is None:
            ibutsu_server.tasks.task = mock_task
        return app
Exemplo n.º 2
0
#!/usr/bin/env python3
from ibutsu_server import get_app

if __name__ == "__main__":
    get_app().run(port=8080, debug=True)
Exemplo n.º 3
0
"""This file provides an entry point for the Docker container"""
from ibutsu_server import get_app

app = get_app()
Exemplo n.º 4
0
#!/usr/bin/env python3
import sys
from pathlib import Path

from ibutsu_server import get_app

SSL_CERT = Path("../certs/dev.ibutsu.org+2.pem")
SSL_KEY = Path("../certs/dev.ibutsu.org+2-key.pem")

if __name__ == "__main__":
    kwargs = {}
    if "--ssl" in sys.argv:
        if not SSL_CERT.exists() or not SSL_CERT.exists():
            print(
                "SSL certificate and/or key files not found. Please download and install mkcert "
                "and run the following command to generate these files:")
            print("")
            print("  mkcert dev.ibutsu.org devapi.ibutsu.org localhost")
            print("")
            print(
                "Then place these two files in a `certs` directory in the top level directory of "
                "the project (the same directory containing `backend` and `frontend`)."
            )
            sys.exit(1)
        else:
            kwargs["ssl_context"] = (SSL_CERT, SSL_KEY)
    if "--host" in sys.argv:
        kwargs["host"] = sys.argv[sys.argv.index("--host") + 1]
    get_app().run(port=8080, debug=True, **kwargs)
Exemplo n.º 5
0
"""This file provides an entry point for the OpenShift container"""
from ibutsu_server import get_app

application = get_app()
Exemplo n.º 6
0
from ibutsu_server import get_app
from ibutsu_server.tasks import create_celery_app

app = create_celery_app(get_app())