-
-
Notifications
You must be signed in to change notification settings - Fork 33
Local js/css scripts #115
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
base: main
Are you sure you want to change the base?
Local js/css scripts #115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables PiOSK to function in air-gapped environments by downloading external JavaScript and CSS dependencies locally during setup instead of relying on CDN links. This addresses the issue where external scripts (Bootstrap and jQuery) fail to load when internet access is restricted or unavailable.
- Downloads external dependencies (jQuery, Bootstrap JS/CSS) to local files during setup
- Updates HTML to reference local files instead of CDN URLs
- Maintains integrity hashes for security validation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/setup.sh | Adds download logic for external JS/CSS dependencies to store them locally |
| dashboard/index.html | Updates script and stylesheet references from CDN URLs to local file paths |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| <script src="libs/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script> | ||
| <script src="libs/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> |
Copilot
AI
Sep 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The integrity hashes will fail when loading local files since they were calculated for the original CDN versions. Remove the integrity attributes or update them to match the downloaded files' hashes.
Co-authored-by: Copilot <[email protected]>
From Discussion: #113
I hit a small road block when using PiOSK in an air gaped environment. The js and css scripts (bootstrap.bundle.min.js, bootstrap.min.css, jquery-3.7.1.min.js) don't load. I also can imagine usecases where the Pi are not allowed to load something from outside.
I implemented the downloading of the external scripts within the setup script and the paths in the index.html from the external to local.