Skip to content

Make the application independent from external CDN when self-hosted #37

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

Closed
nanawel opened this issue Jul 27, 2023 · 4 comments
Closed

Comments

@nanawel
Copy link

nanawel commented Jul 27, 2023

Currently even with a self-hosted instance on a private area, there are still requests sent outside because of the dependency to tabler-icons and Google Fonts.

It's hardcoded in sqlpage/templates/shell.handlebars so there's no easy way to prevent it, unless overriding the component I guess.

https://github.com/lovasoa/SQLpage/blob/9c781dc593c3362b6dd24128d3b8eef744b80509/sqlpage/templates/shell.handlebars#L6-L22

Do you think you could add a way to make all dependencies (current and the ones to come) self-hostable too?
I'm not saying this should be the default behavior, but it would be very handy to have a defined procedure to replace CDN with custom URLs.

@lovasoa
Copy link
Collaborator

lovasoa commented Aug 2, 2023

Yes, I do want to bundle the icons in the executable, but still haven't got to it :)

@nanawel
Copy link
Author

nanawel commented Aug 2, 2023

I thought I could temporarily override the shell.handlebars for my app but then I can't use {{static_path}} with a custom value since it's currently limited to sqlpage.css and sqlpage.js.

For the same reason, I can't add Android & iOS PNG favicons either.

Don't get me wrong, it already does a lot, but developers always want more 😉

@lovasoa
Copy link
Collaborator

lovasoa commented Aug 2, 2023

Yes, you can override it for your app ! You don't need the static_path handlebar helper at all, it's just the thing that adds the content hash at the end of files (ee38880ed0dee496 in sqlpage.ee38880ed0dee496.css). Just hardcode the path.

Just hardcode <link rel="stylesheet" href="https://github.com/tabler-icons.min.css" /> in shell.handlebars and put tabler-icons.min.css at the root of your website.

@nanawel
Copy link
Author

nanawel commented Aug 2, 2023

My bad! It didn't work because I made a mistake in the path.
I prefer to use the existing css/ directory for all CSS files, it seems most appropriate. So the code is

<link rel="stylesheet" href="/css/tabler-icons.min.css">

(it does not handle a custom base path but it's another story)

@lovasoa lovasoa closed this as completed in 03b0885 Aug 2, 2023
lovasoa added a commit that referenced this issue Nov 5, 2023
icons are now loaded directly from the sqlpage binary instead of loading them from a CDN

This makes it possible to host a SQLPage website on an intranet without access to the internet.

Fixes #37
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

2 participants