Flask-AppBuilder icon indicating copy to clipboard operation
Flask-AppBuilder copied to clipboard

CSS Use of fonts.googleapis.com

Open geoffo-dev opened this issue 2 years ago • 2 comments

Hello,

Sorry this isn't an issue as such, but we are looking to try and deploy Airflow that uses FAB and have had a bit of an issue with using the CSS that contains fonts.googleapis.com as we are using it in a restricted environment.

Is there anyway to integrate this into the FAB project? Or would it be the case of standing up an offline server?

Sorry to be a pain, but CSS/Web Development is not my strongpoint!

geoffo-dev avatar Jun 28 '22 16:06 geoffo-dev

Are you using a non-default FAB theme? E.g. via the config parameter APP_THEME, or however Airflow might set it. If you are using the default theme (APP_THEME = "") there should no outside resources being requested.

Dosenpfand avatar Jun 30 '22 10:06 Dosenpfand

So looking through the source it seems to be set to:

def init_app(self, app, session):
        """
        Will initialize the Flask app, supporting the app factory pattern.
        :param app:
        :param session: The SQLAlchemy session
        """
        app.config.setdefault("APP_NAME", "F.A.B.")
        app.config.setdefault("APP_THEME", "")
        app.config.setdefault("APP_ICON", "")
        app.config.setdefault("LANGUAGES", {"en": {"flag": "gb", "name": "English"}})
        app.config.setdefault("ADDON_MANAGERS", [])
        app.config.setdefault("FAB_API_MAX_PAGE_SIZE", 100)
        app.config.setdefault("FAB_BASE_TEMPLATE", self.base_template)
        app.config.setdefault("FAB_STATIC_FOLDER", self.static_folder)
        app.config.setdefault("FAB_STATIC_URL_PATH", self.static_url_path)

So it looks like it is not being set but still requesting? Might have to dig into it a bit more - but I assume if the above is correct, it shouldnt be applying a theme and therefore the external resources should not be being requested?

geoffo-dev avatar Jun 30 '22 11:06 geoffo-dev