From ac3d318fc9fed973d3b3abbb0e3cb83dc33e0190 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 28 Sep 2023 16:40:36 +0200 Subject: [PATCH] change the examples files --- examples/app.py | 16 ---------------- examples/env.example | 5 ++++- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/examples/app.py b/examples/app.py index 29edbc14..20463957 100644 --- a/examples/app.py +++ b/examples/app.py @@ -18,12 +18,6 @@ from ereuse_devicehub.modules.dpp.views import dpp from ereuse_devicehub.modules.oidc.views import oidc from ereuse_devicehub.modules.oidc.oauth2 import config_oauth -# from flask_wtf.csrf import CSRFProtect - - -# from werkzeug.middleware.profiler import ProfilerMiddleware - - app = Devicehub(inventory=DevicehubConfig.DB_SCHEMA) app.register_blueprint(core) app.register_blueprint(devices) @@ -37,13 +31,3 @@ app.register_blueprint(oidc) config_oauth(app) -# configure & enable CSRF of Flask-WTF -# NOTE: enable by blueprint to exclude API views -# TODO(@slamora: enable by default & exclude API views when decouple of Teal is completed -# csrf = CSRFProtect(app) -# csrf.protect(core) -# csrf.protect(devices) -# app.config["SQLALCHEMY_RECORD_QUERIES"] = True -# app.config['PROFILE'] = True -# app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30]) -# app.run(debug=True) diff --git a/examples/env.example b/examples/env.example index 1df25bbb..81fe7846 100644 --- a/examples/env.example +++ b/examples/env.example @@ -2,6 +2,7 @@ API_DLT='http://$IP_API_DLT' API_DLT_TOKEN=$TOKEN API_RESOLVER='http://$IP_API_RESOLVER' +# you might change or register ID_FEDERATED if you change DEVICEHUB_HOST ID_FEDERATED='DH12' # Database Variables @@ -15,7 +16,6 @@ DB_SCHEMA='dbtest' # TODO this should be guessed by DEVICEHUB_HOST, and avoid hardcode of ID_FEDERATED SERVER_ID_FEDERATED='DH12' CLIENT_ID_FEDERATED='DH20' -URL_MANUALS='http://localhost:4000' #SERVER_ID_DEVICEHUB_HOST='http://devicehub-server-id.example.com' SERVER_ID_DEVICEHUB_HOST='http://localhost:5000' @@ -36,3 +36,6 @@ SECRET_KEY='aaaa' #SNAPSHOTS_PATH='./relpath/to/snapshots' # full path starts with / SNAPSHOTS_PATH='/tmp/dhub_docker/snapshots' + +# If you have a URL_MANUALS implementation, please change this url +URL_MANUALS='http://localhost:4000'