@cryptotaxi247 / CoPilot / commits / 5eddd249

Create __init__.py

taylor_socfortress committed Jul 10, 2023 at 16:48 UTC 5eddd249cf9da1673c223b0e848ea9515e153df2
1 file changed +58
backend/app/__init__.py new
+58
@@ -0,0 +1,58 @@
1 +from flask import Flask
2 +from flask_cors import CORS
3 +from flask_marshmallow import Marshmallow
4 +from flask_migrate import Migrate
5 +from flask_sqlalchemy import SQLAlchemy
6 +from flask_swagger_ui import get_swaggerui_blueprint
7 +
8 +# from app.routes import bp # Import the blueprint
9 +
10 +app = Flask(__name__)
11 +
12 +SWAGGER_URL = "/api/docs" # URL for exposing Swagger UI (without trailing '/')
13 +API_URL = "/static/swagger.json" # Our API url (can of course be a local resource)
14 +
15 +swaggerui_blueprint = get_swaggerui_blueprint(
16 + SWAGGER_URL, # Swagger UI static files will be mapped to '{SWAGGER_URL}/dist/'
17 + API_URL,
18 + config={"app_name": "Test application"}, # Swagger UI config overrides
19 + # oauth_config={ # OAuth config. See https://github.com/swagger-api/swagger-ui#oauth2-configuration .
20 + # 'clientId': "your-client-id",
21 + # 'clientSecret': "your-client-secret-if-required",
22 + # 'realm': "your-realms",
23 + # 'appName': "your-app-name",
24 + # 'scopeSeparator': " ",
25 + # 'additionalQueryStringParams': {'test': "hello"}
26 + # }
27 +)
28 +
29 +app.register_blueprint(swaggerui_blueprint)
30 +
31 +CORS(app)
32 +
33 +
34 +app.config.from_object("settings")
35 +
36 +db = SQLAlchemy(app)
37 +migrate = Migrate(app, db)
38 +ma = Marshmallow(app)
39 +
40 +from app.routes.connectors import bp as connectors_bp # Import the blueprint
41 +from app.routes.agents import bp as agents_bp # Import the blueprint
42 +from app.routes.rules import bp as rules_bp # Import the blueprint
43 +from app.routes.graylog import bp as graylog_bp # Import the blueprint
44 +from app.routes.alerts import bp as alerts_bp # Import the blueprint
45 +from app.routes.wazuhindexer import bp as wazuhindexer_bp # Import the blueprint
46 +from app.routes.shuffle import bp as shuffle_bp # Import the blueprint
47 +from app.routes.velociraptor import bp as velociraptor_bp # Import the blueprint
48 +from app.routes.dfir_iris import bp as dfir_iris_bp # Import the blueprint
49 +
50 +app.register_blueprint(connectors_bp) # Register the connectors blueprint
51 +app.register_blueprint(agents_bp) # Register the agents blueprint
52 +app.register_blueprint(rules_bp) # Register the rules blueprint
53 +app.register_blueprint(graylog_bp) # Register the graylog blueprint
54 +app.register_blueprint(alerts_bp) # Register the alerts blueprint
55 +app.register_blueprint(wazuhindexer_bp) # Register the wazuhindexer blueprint
56 +app.register_blueprint(shuffle_bp) # Register the shuffle blueprint
57 +app.register_blueprint(velociraptor_bp) # Register the velociraptor blueprint
58 +app.register_blueprint(dfir_iris_bp) # Register the dfir_iris blueprint