streamd v0.2.2: session uptimes, egress DNS, Support, agent/Widevine
All checks were successful
release / build-and-upload (push) Successful in 7m2s
All checks were successful
release / build-and-upload (push) Successful in 7m2s
Dashboard Live uptimes + Recent runs from stream_sessions; overview.recent_sessions. WireGuard netns resolv.conf + missing-deps WARN. Support donations card. Agent start/stop/update, job_backoff default off, wvkey ensure/venv, phonecap retries, modhost YAML enrich, DRM SetCredentials requires keys.
This commit is contained in:
parent
3ae1dd58b3
commit
a091922efa
34 changed files with 2391 additions and 154 deletions
|
|
@ -58,14 +58,21 @@ func FetchWrapAll(opt Options) ([]string, error) {
|
|||
}
|
||||
|
||||
func run(opt Options, mode string, all bool) ([]string, error) {
|
||||
py := opt.Python
|
||||
if py == "" {
|
||||
py = findPython()
|
||||
}
|
||||
py := resolvePython(opt.Python)
|
||||
script := opt.Script
|
||||
if script == "" {
|
||||
return nil, fmt.Errorf("wvkey script path required")
|
||||
}
|
||||
if !fileExists(script) {
|
||||
return nil, fmt.Errorf("wvkey script not found: %s", script)
|
||||
}
|
||||
if !fileExists(py) {
|
||||
// Bare names like "python3" are OK via LookPath inside resolvePython;
|
||||
// absolute/relative paths must exist.
|
||||
if filepath.IsAbs(py) || strings.Contains(py, string(os.PathSeparator)) || strings.Contains(py, "/") {
|
||||
return nil, fmt.Errorf("wvkey python not found: %s (run agent once to auto-create .venv, or set python: in agent.yaml)", py)
|
||||
}
|
||||
}
|
||||
if strings.TrimSpace(opt.WVD) == "" {
|
||||
return nil, fmt.Errorf("wvkey --wvd path required")
|
||||
}
|
||||
|
|
@ -120,12 +127,30 @@ func run(opt Options, mode string, all bool) ([]string, error) {
|
|||
return out, nil
|
||||
}
|
||||
|
||||
// resolvePython uses an explicit path only when the file exists; otherwise
|
||||
// discovers a usable interpreter. Passing a missing absolute path used to make
|
||||
// exec fail with a confusing "not found in %PATH%" on Windows.
|
||||
func resolvePython(explicit string) string {
|
||||
if strings.TrimSpace(explicit) != "" {
|
||||
if st, err := os.Stat(explicit); err == nil && !st.IsDir() {
|
||||
return explicit
|
||||
}
|
||||
if !strings.Contains(explicit, string(os.PathSeparator)) && !strings.Contains(explicit, "/") {
|
||||
if p, err := exec.LookPath(explicit); err == nil {
|
||||
return p
|
||||
}
|
||||
}
|
||||
}
|
||||
return findPython()
|
||||
}
|
||||
|
||||
func findPython() string {
|
||||
candidates := []string{
|
||||
filepath.Join(".venv", "Scripts", "python.exe"),
|
||||
filepath.Join(".venv", "bin", "python"),
|
||||
"python3",
|
||||
"python",
|
||||
"py",
|
||||
}
|
||||
for _, c := range candidates {
|
||||
if filepath.IsAbs(c) || strings.Contains(c, string(os.PathSeparator)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue