Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(agent): expose HTTP debug server over tailnet API#12582

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 3 commits intomainfromcj/agent-debug-magicsock
Mar 14, 2024

Conversation

johnstcn
Copy link
Member

Related to#12161
Exposes the agent magicsock handler over tailnet so you can just dial it over an agent conn.

@@ -36,6 +36,8 @@ func (a *agent) apiHandler() http.Handler {
cacheDuration: cacheDuration,
}
r.Get("/api/v0/listening-ports", lp.handler)
r.Get("/debug/magicsock", a.HandleHTTPDebugMagicsock)
r.Get("/debug/magicsock/debug-logging/{state}", a.HandleHTTPMagicsockDebugLoggingState)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

nit:/debug/magicsock/debug... sounds weird. Maybe POST/debug/magicsock/enable-logger instead?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd rather keep this the same for consistency purposes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ok

func (a *agent) HandleHTTPDebugMagicsock(w http.ResponseWriter, r *http.Request) {
network, ok := a.requireNetwork()
if !ok {
w.WriteHeader(http.StatusNotFound)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

shouldn't that be a different HTTP status? 503?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You could make the arguemnt yeah, but I didn't see a huge need to change it in this PR. Since it's a debug endpoint though, it's probably fine to change.

@mtojekmtojek self-requested a reviewMarch 14, 2024 09:17
Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

@johnstcnjohnstcn merged commit3b40687 intomainMar 14, 2024
@johnstcnjohnstcn deleted the cj/agent-debug-magicsock branchMarch 14, 2024 10:02
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 14, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@mtojekmtojekmtojek approved these changes

@deansheatherdeansheatherAwaiting requested review from deansheather

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@johnstcn@mafredri@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp