@@ -44,6 +44,29 @@ func showDeployDialog(g *Gui, doneListener binding.DataListener, shidaiInfra bin
44
44
showSudoEnteringDialog (g , sudoPasswordBinding , sudoCheck )
45
45
})
46
46
47
+ log .Printf ("rootState = %v" , g .sshClient .User () == "root" )
48
+
49
+ if g .sshClient .User () == "root" {
50
+ sudoCheck .Set (true )
51
+ if ! sudoPasswordEntryButton .Hidden {
52
+ sudoPasswordEntryButton .Hide ()
53
+ }
54
+ }
55
+ if g .Host .UserPassword == nil && g .sshClient .User () != "root" {
56
+ sudoCheck .Set (false )
57
+ if sudoPasswordEntryButton .Hidden {
58
+ sudoPasswordEntryButton .Show ()
59
+ }
60
+ log .Println ("Sudo password is nil, assuming we connected with key" )
61
+ } else if g .Host .UserPassword != nil && g .sshClient .User () != "root" {
62
+ sudoCheck .Set (true )
63
+ if ! sudoPasswordEntryButton .Hidden {
64
+ sudoPasswordEntryButton .Hide ()
65
+ }
66
+ log .Println ("Sudo password is not nil, applying password from connect dialog" )
67
+ sudoPasswordBinding .Set (* g .Host .UserPassword )
68
+ }
69
+
47
70
doneMnemonicDataListener := binding .NewDataListener (func () {
48
71
mnemonicCheck .Set (true )
49
72
})
@@ -143,14 +166,18 @@ func showDeployDialog(g *Gui, doneListener binding.DataListener, shidaiInfra bin
143
166
144
167
bootstrapFileUrl := types .BOOTSTRAP_SCRIPT
145
168
// filePathToSaveOnRemote := filepath.Join("/home/", g.sshClient.User(), "bootstrap.sh")
169
+ // var cmdForDeploy string:= fmt.Sprintf(`echo '%v' | sudo -S sh -c "%v --sekai=%v --interx=%v 2>&1"`, sP, filePathToSaveOnRemote, sekaiVersion, interxVersion)
146
170
var filePathToSaveOnRemote string
147
171
bootstrapFileName := "bootstrap.sh"
172
+
173
+ var cmdForDeploy string
148
174
if g .sshClient .User () == "root" {
149
175
filePathToSaveOnRemote = fmt .Sprintf ("/%v/%v" , g .sshClient .User (), bootstrapFileName )
176
+ cmdForDeploy = fmt .Sprintf (`%v --sekai=%v --interx=%v 2>&1` , filePathToSaveOnRemote , sekaiVersion , interxVersion )
150
177
} else {
151
178
filePathToSaveOnRemote = fmt .Sprintf ("/home/%v/%v" , g .sshClient .User (), bootstrapFileName )
179
+ cmdForDeploy = fmt .Sprintf (`echo '%v' | sudo -S sh -c "%v --sekai=%v --interx=%v 2>&1"` , sP , filePathToSaveOnRemote , sekaiVersion , interxVersion )
152
180
}
153
-
154
181
log .Println ("Bootstrap file save path:" , filePathToSaveOnRemote )
155
182
f , err := httph .MakeHttpRequest (bootstrapFileUrl , "GET" )
156
183
if err != nil {
@@ -174,9 +201,8 @@ func showDeployDialog(g *Gui, doneListener binding.DataListener, shidaiInfra bin
174
201
return
175
202
}
176
203
177
- cmdForDeploy := fmt . Sprintf ( `echo '%v' | sudo -S sh -c "%v --sekai=%v --interx=%v 2>&1"` , sP , filePathToSaveOnRemote , sekaiVersion , interxVersion )
204
+ log . Printf ( "CMD for deploy: <%v>" , cmdForDeploy )
178
205
showCmdExecDialogAndRunCmdV4 (g , "Deploying" , cmdForDeploy , true , deployErrorBinding , errorMessageBinding )
179
-
180
206
errB , _ = deployErrorBinding .Get ()
181
207
if errB {
182
208
errMsg , _ := errorMessageBinding .Get ()
0 commit comments