diff --git a/CHANGELOG.md b/CHANGELOG.md index 78a4622..b75f371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ and the release workflow reads it to set github's release notes. ### Added - the status command shows the chosen ICE candidate pairs for connected peers +- WEBEXEC environment variable to hold the unix socket path + +### Fixed + +- installer messages improved ## [1.4.0] 2024-4-14 diff --git a/conf.go b/conf.go index 0b32a6e..bc27086 100644 --- a/conf.go +++ b/conf.go @@ -184,9 +184,9 @@ func parseConf(s string) (*peers.Conf, httpserver.AddressType, error) { Conf.insecure = v.(bool) } // get env vars + peersConf.Env = map[string]string{"WEBEXEC": GetSockFP()} m := t.Get("env") if m != nil { - peersConf.Env = make(map[string]string) for k, v := range m.(*toml.Tree).ToMap() { peersConf.Env[k] = v.(string) } diff --git a/conf_test.go b/conf_test.go index 0005e21..7bc7fcf 100644 --- a/conf_test.go +++ b/conf_test.go @@ -9,6 +9,6 @@ import ( func TestConfEnv(t *testing.T) { initTest(t) - require.EqualValues(t, Conf.peerConf.Env["TERM"], "xterm") + require.EqualValues(t, Conf.peerConf.Env["TERM"], "xterm-256color") require.EqualValues(t, Conf.peerConf.Env["COLORTERM"], "truecolor") } diff --git a/sites/get/install.bash b/sites/get/install.bash index fc6ea3b..4ff2bf2 100755 --- a/sites/get/install.bash +++ b/sites/get/install.bash @@ -128,14 +128,14 @@ do_install() { cd $tmp fi get_n_extract $tmp - if [[ $(ps -o comm= -p $PPID) == *webexec ]] + if [ -v WEBEXEC ] then if [ ! -d $HOME/.config/webexec ] then ./webexec init fi - echo "Moving to another shell to survive this connection ending" - $sh_c "nohup bash ./replace_n_launch.sh $user ${HOME:-/root}" + echo "Closing connections, replacing and launching" + nohup bash ./replace_n_launch.sh "$sh_c" else if command_exists webexec then @@ -156,7 +156,6 @@ do_install() { then exit "Failed starting webexec" fi - echo "Install finished, please exit and reconnect to enjoy version $LATEST_VERSION." fi } do_install "$@" diff --git a/webexec.go b/webexec.go index 9533217..d478911 100644 --- a/webexec.go +++ b/webexec.go @@ -289,7 +289,7 @@ func start(c *cli.Context) error { if err != nil { return err } - fmt.Printf("agent started as process #%d\n", pid) + fmt.Printf("Agent started as process #%d\n", pid) versionNote := getVersionNote() if versionNote != "" { fmt.Println(versionNote)