Add the browser UI, terminal menu, and one-liner bootstrap
Deployr is now installable and drivable the way winutil is: one PowerShell or
shell line, no prior setup on the machine.
irm .../scripts/install.ps1 | iex
curl -fsSL .../scripts/install.sh | sh
The bootstrap self-elevates, picks the right binary for the machine's
architecture, verifies it against the release SHA256SUMS, puts it on PATH and
opens the UI. Arguments pass through for unattended use.
`deployr ui` serves a point-and-click page on loopback and opens a browser at
it: apps grouped by category, profile bundles, a filter box, and per-app
progress streamed live over SSE as the engine runs. A browser page rather than a
native window because it is the only GUI that behaves the same on all three
platforms without a toolkit or cgo, so the binary stays one static file.
It is not a hole in the endpoint: loopback-only on an OS-assigned port, a
session token minted per run and required on every request, plus Origin and
Host checks so no other page can drive a tool that installs software as SYSTEM.
A run keeps going if the tab closes -- aborting mid-installer is worse than
finishing without a spectator.
`deployr menu` is the same thing as a numbered terminal picker, for a machine
reached over SSH or a recovery console where no browser exists.
Engine gains optional OnAppStart/OnResult hooks, which is what makes progress
streamable instead of a report that only shows up at the end.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
77f88afd7a
commit
af2a96e072
8 files changed
+1460
-3
No files matched your search
@@ -54,6 +54,14 @@ type Config struct {
|
||||
KeepDownloads bool
|
||||
OnlyProvider string // restrict every app to a single provider
|
||||
Log *logx.Logger
|
||||
|
||||
// OnAppStart, when set, is called just before an app is processed. The UI
|
||||
// uses it to show what is happening during a long installer run.
|
||||
OnAppStart func(app *catalog.App)
|
||||
// OnResult, when set, is called as each app finishes, before the run
|
||||
// continues. It is what makes progress streamable instead of a report that
|
||||
// only appears at the end.
|
||||
OnResult func(Result)
|
||||
}
|
||||
|
||||
// Attempt records one source that was tried and did not work out.
|
||||
@@ -119,6 +127,9 @@ func Run(ctx context.Context, apps []*catalog.App, cfg Config) Summary {
|
||||
}
|
||||
|
||||
for _, app := range apps {
|
||||
if cfg.OnAppStart != nil {
|
||||
cfg.OnAppStart(app)
|
||||
}
|
||||
res := runOne(ctx, app, cfg)
|
||||
sum.Results = append(sum.Results, res)
|
||||
|
||||
@@ -138,6 +149,9 @@ func Run(ctx context.Context, apps []*catalog.App, cfg Config) Summary {
|
||||
if cfg.Log != nil {
|
||||
logResult(cfg.Log, res)
|
||||
}
|
||||
if cfg.OnResult != nil {
|
||||
cfg.OnResult(res)
|
||||
}
|
||||
if ctx.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user