This is a variant of "tailscale configure flash-appliance" but for running on Proxmox PVE hosts to make a Proxmox VM running the experimental Tailscale Appliance. This also makes the "Esc" key make the fbstatus GUI open up a terminal, instead of Control-Alt-F2 which is hard to type over NoVNC. And make gafpush unidirectional, to not require a local port be opened locally, which I hit while working on this. And make fbstatus included in all appliance variants, but bail out early and stop respawing if the machine has no framebuffer (e.g. AWS VMs). Updates #1866 Change-Id: I18ec2a16e4d5ff5574e16fe55c0e8d06cf4fab7f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
56 lines
1.3 KiB
Go
56 lines
1.3 KiB
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package cli
|
|
|
|
import (
|
|
"flag"
|
|
"strings"
|
|
|
|
"github.com/peterbourgon/ff/v3/ffcli"
|
|
)
|
|
|
|
var (
|
|
maybeJetKVMConfigureCmd,
|
|
maybeConfigSynologyCertCmd,
|
|
_ func() *ffcli.Command // non-nil only on Linux/arm for JetKVM
|
|
)
|
|
|
|
func configureCmd() *ffcli.Command {
|
|
return &ffcli.Command{
|
|
Name: "configure",
|
|
ShortUsage: "tailscale configure <subcommand>",
|
|
ShortHelp: "Configure the host to enable more Tailscale features",
|
|
LongHelp: strings.TrimSpace(`
|
|
The 'configure' set of commands are intended to provide a way to enable different
|
|
services on the host to use Tailscale in more ways.
|
|
`),
|
|
FlagSet: (func() *flag.FlagSet {
|
|
fs := newFlagSet("configure")
|
|
return fs
|
|
})(),
|
|
Subcommands: nonNilCmds(
|
|
configureKubeconfigCmd(),
|
|
synologyConfigureCmd(),
|
|
flashApplianceCmd(),
|
|
pveApplianceCmd(),
|
|
ccall(maybeConfigSynologyCertCmd),
|
|
ccall(maybeSysExtCmd),
|
|
ccall(maybeVPNConfigCmd),
|
|
ccall(maybeJetKVMConfigureCmd),
|
|
ccall(maybeSystrayCmd),
|
|
),
|
|
}
|
|
}
|
|
|
|
// ccall calls the function f if it is non-nil, and returns its result.
|
|
//
|
|
// It returns the zero value of the type T if f is nil.
|
|
func ccall[T any](f func() T) T {
|
|
var zero T
|
|
if f == nil {
|
|
return zero
|
|
}
|
|
return f()
|
|
}
|