doctor

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2026 License: AGPL-3.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package doctor is `remohop doctor`: one report of this machine's network situation as RemoHop sees it, Tailscale and the mesh network included, with what each finding means for connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(w io.Writer, r *Report)

Print writes the report for people.

Types

type HostReport

type HostReport struct {
	ID        string `json:"id,omitempty"`
	Online    bool   `json:"online"`
	NAT       string `json:"nat,omitempty"`
	Transport string `json:"transport,omitempty"`
	Sessions  int    `json:"sessions"`
}

HostReport is the running host daemon.

type Report

type Report struct {
	Identity  string          `json:"identity"`
	ConfigDir string          `json:"config_dir"`
	Host      *HostReport     `json:"host,omitempty"`
	Signal    SignalReport    `json:"signal"`
	Addresses []string        `json:"addresses"`
	Screen    ScreenReport    `json:"screen"`
	Target    *TargetReport   `json:"target,omitempty"`
	Tailscale *tailnet.Status `json:"tailscale"`
	Net       *mesh.Status    `json:"net,omitempty"`
	NetOn     bool            `json:"net_on"`
	VPN       int             `json:"vpn_tunnels"`
	Advice    []string        `json:"advice,omitempty"`
}

Report is what remohop doctor finds.

func Collect

func Collect(ctx context.Context, signalOverride string, offline bool) (*Report, error)

Collect gathers the report.

type ScreenReport

type ScreenReport struct {
	FFmpeg string `json:"ffmpeg,omitempty"`
	// FFmpegKind is where it comes from: env (REMOHOP_FFMPEG), system
	// (PATH) or remohop (RemoHop's copy, `remohop ffmpeg install`).
	FFmpegKind ffmpeg.Kind `json:"ffmpeg_kind,omitempty"`
	// FFmpegVersion is the first line of `ffmpeg -version`, empty when it
	// did not run.
	FFmpegVersion string `json:"ffmpeg_version,omitempty"`
	FFmpegError   string `json:"ffmpeg_error,omitempty"`
	Display       string `json:"display,omitempty"`
	DisplayError  string `json:"display_error,omitempty"`
	Warning       string `json:"warning,omitempty"`
}

ScreenReport is what screen sharing to helpers needs here.

type SignalReport

type SignalReport struct {
	Server string `json:"server,omitempty"`
	Pinned bool   `json:"pinned"`
	Bridge string `json:"bridge,omitempty"`
	// BridgeFound is how the bridge is known when it is not configured:
	// "announced" by the server earlier, or "guessed" at the server's
	// own name (see internal/signal, bridge.go). BridgeChecked says the
	// bridge was tried, BridgeReachable that it answered, BridgeError why
	// not.
	BridgeFound     string `json:"bridge_found,omitempty"`
	BridgeChecked   bool   `json:"bridge_checked,omitempty"`
	BridgeReachable bool   `json:"bridge_reachable,omitempty"`
	BridgeError     string `json:"bridge_error,omitempty"`
	// Proxy is how the bridge is reached: the HTTP proxy and where it is
	// configured, without credentials (sysproxy.Info.String).
	Proxy      string `json:"proxy,omitempty"`
	Checked    bool   `json:"checked"`
	Reachable  bool   `json:"reachable"`
	NAT        string `json:"nat,omitempty"`
	Error      string `json:"error,omitempty"`
	RelayLocal bool   `json:"relay_allowed"`
	// PinMismatch: the server presented another key than signal-pin.
	PinMismatch bool `json:"pin_mismatch,omitempty"`
	// WrongServer: something answered at the address, but not a
	// rendezvous server.
	WrongServer bool `json:"wrong_server,omitempty"`
}

SignalReport is the rendezvous server.

type TargetReport

type TargetReport struct {
	Target string `json:"target"`
	// ID is the 9-digit ID dialled, if any (an alias resolves to it).
	ID      string `json:"id,omitempty"`
	Address string `json:"address,omitempty"`
	Saved   bool   `json:"saved"`
	Alias   string `json:"alias,omitempty"`
	// Login is how this machine would log in: pairing, grant, key,
	// saved_password or password (asked for).
	Login string `json:"login"`
	// Presence is online, offline, unknown (no host has the ID),
	// rate_limited, not_checked or error.
	Presence string `json:"presence"`
	Error    string `json:"error,omitempty"`
}

TargetReport is a machine looked up with ` + "`remohop doctor TARGET`" + `.

func CheckTarget

func CheckTarget(ctx context.Context, target, signalOverride string, offline bool) *TargetReport

CheckTarget looks target up without logging in: what this machine has saved for it, and, for an ID, whether the rendezvous server has it online.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL