feat(web): add static file serving#2982
Open
lujian0571 wants to merge 5 commits into
Open
Conversation
- Introduce web config to enable and configure static file serving - Implement RegisterWebApps to register configured web apps - Add fileHandler for serving files, supporting directory index and SPA fallback - Set default web config to disabled - Define WebConfig and WebAppConfig structs - Integrate web app registration into router - Include unit tests covering various file handling scenarios - Update config examples with web UI instructions
- Add missing `apps` layer under `web` for multiple web apps
- Consolidate SPA and non-SPA scenarios in a single table-driven test - Cover directory access with and without index.html - Include access to files under root and subdirectories - Ensure URL path prefix is handled correctly - Document default 301 redirect behavior for /*/index.html access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Serve built-in web UIs directly from headscale
This change allows headscale to serve built-in static web interfaces
(e.g. admin or console UIs) directly from the headscale process.
By embedding and serving web assets internally:
This makes it easier to add and maintain management UIs while keeping
deployment minimal and self-contained.