Repository navigation
feat(gateway): send the gui plane's index to the harbor's SWITCH tab - #288
Merged
Merged
Conversation
--harbor URL makes /gui/ and / answer 302 to URL/#switch, so an old bookmark lands on the harbor's board. The wake pages, their state endpoints and the wake POST keep answering: an engine's own bookmark still works. Without the flag both index URLs serve the index page, as before.
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.
Step 7 of the switchboard plan. With
berth gateway --harbor URL, the gateway's/gui/index and/answer 302 toURL/#switch, so an old bookmark of the engine list lands on the harbor's SWITCH tab. That leaves one board.What stays
The per-engine wake pages (
/gui/NAME), their state (/gui/NAME/state), the wake POST and/gui/stateanswer as before. They are bookmarks to an engine's own web UI, and the harbor does not replace them. Without--harbornothing changes, because a user who does not run the harbor still needs the index.How
GUIHandlerpicks the index handler once. With a harbor set, it is a redirect toURL/#switch, and/points at the same place.guiGuardstays in front of every route.--harboris checked when the gateway starts. It must be anhttporhttpsaddress with a host, or the gateway exits 1 with--harbor "ftp://x" is not an http or https address. A trailing/is trimmed, and a pasted#switchis dropped./gui/section ofdocs/gateway.md, the SWITCH section ofdocs/harbor.md, and a comment incontrib/berth-gateway.service. The wake page's Host paragraph indocs/gateway.mdnow also says that a wake page opened by a tailnet name needs that name in--allow-hostand its owntailscale serveforwarder.Proof
TestGUIPlaneIndexToSwitchasserts the status and the exactLocationfor/gui/and/, with and without a harbor.TestGUIPlaneWakeAndStateWithHarborchecks that the wake page and/gui/statestill answer with a harbor set.TestGatewayHarborBaseandTestGatewayHarborFlagcover the flag's accepted and refused values and the exit code./redirect, or removing the flag check each fails a test./gui/and/with 302 tohttps://aphotic.tail2a8bb.ts.net:9798/#switch, and/gui/statewith 200.--harbor ftp://xwas refused.go build,gofmt,go vet,go test ./..., the Windows build and vet, and golangci-lint (0 issues) pass locally.