Documentation
¶
Overview ¶
Package serverutil holds the install and launch helpers shared by the browser IDE servers under pkg/ide.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChownIfNeeded ¶
ChownIfNeeded recursively hands location to userName. It is a no-op when userName is empty.
func PrepareLocation ¶
PrepareLocation returns <home>/<dirName> for userName, creating it if needed.
func SuOrSh ¶
SuOrSh builds an *exec.Cmd that runs runCommand either as the unprivileged user (via `su <user> -c`) or as the current user (via `sh -c`). All arg elements are constants from this package - runCommand itself is built from constants plus internal values, not user-controlled binary paths.
Types ¶
type ExtensionInstall ¶
type ExtensionInstall struct {
UserName string
Extensions []string
// Command returns the shell command that installs one extension.
Command func(extension string) string
// Quote formats an extension name for log lines. Nil logs names as-is.
Quote func(string) string
// FailOnTotalFailure makes Run return an error when every extension fails.
// Partial failures are always logged and tolerated.
FailOnTotalFailure bool
}
ExtensionInstall runs one CLI install per extension, logging each outcome.
func (ExtensionInstall) Run ¶
func (e ExtensionInstall) Run() error
Run installs each extension in order. Failures are logged and collected.
type ReleaseSpec ¶
type ReleaseSpec struct {
Options ide.Options
Amd64Option string
Arm64Option string
Amd64Template string
Arm64Template string
}
ReleaseSpec describes how one IDE picks its server download URL per arch.
func (ReleaseSpec) URL ¶
func (s ReleaseSpec) URL(values map[string]config.OptionValue, goarch string, args ...any) string
URL returns the value of the arch's override option when set, otherwise the arch's template filled with args. Any goarch other than "arm64" selects the amd64 settings.