Skip to content

Commit 1597f9e

Browse files
committed
v0.3 + Re-creating SSH keys (ssh-keyscan)
1 parent 398de6d commit 1597f9e

File tree

13 files changed

+91
-68
lines changed

13 files changed

+91
-68
lines changed

sshuttle-gui/backup/sshuttle_gui.lps

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
<CursorPos X="13"/>
5353
<UsageCount Value="40"/>
5454
<Loaded Value="True"/>
55-
<LoadedDesigner Value="True"/>
5655
</Unit>
5756
<Unit>
5857
<Filename Value="pingtrd.pas"/>
@@ -71,7 +70,7 @@
7170
<UsageCount Value="35"/>
7271
</Unit>
7372
</Units>
74-
<JumpHistory HistoryIndex="5">
73+
<JumpHistory HistoryIndex="7">
7574
<Position>
7675
<Filename Value="unit1.pas"/>
7776
<Caret Column="13"/>
@@ -96,6 +95,14 @@
9695
<Filename Value="unit1.pas"/>
9796
<Caret Column="13"/>
9897
</Position>
98+
<Position>
99+
<Filename Value="unit1.pas"/>
100+
<Caret Line="3" Column="52"/>
101+
</Position>
102+
<Position>
103+
<Filename Value="unit1.pas"/>
104+
<Caret Line="141" Column="62" TopLine="113"/>
105+
</Position>
99106
</JumpHistory>
100107
<RunParams>
101108
<FormatVersion Value="2"/>

sshuttle-gui/backup/unit1.lfm

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
object MainForm: TMainForm
22
Left = 287
3-
Height = 192
3+
Height = 189
44
Top = 125
55
Width = 531
66
Caption = 'SShuttle-GUI'
7-
ClientHeight = 192
7+
ClientHeight = 189
88
ClientWidth = 531
99
OnCreate = FormCreate
1010
OnShow = FormShow
@@ -62,7 +62,7 @@ object MainForm: TMainForm
6262
AnchorSideTop.Side = asrCenter
6363
Left = 8
6464
Height = 17
65-
Top = 58
65+
Top = 59
6666
Width = 40
6767
Caption = 'Server:'
6868
ParentColor = False
@@ -74,10 +74,10 @@ object MainForm: TMainForm
7474
AnchorSideTop.Side = asrBottom
7575
Left = 51
7676
Height = 37
77-
Top = 48
77+
Top = 49
7878
Width = 221
7979
BorderSpacing.Left = 3
80-
BorderSpacing.Top = 5
80+
BorderSpacing.Top = 6
8181
BorderSpacing.Right = 10
8282
TabOrder = 2
8383
end
@@ -87,7 +87,7 @@ object MainForm: TMainForm
8787
AnchorSideRight.Side = asrBottom
8888
Left = 283
8989
Height = 32
90-
Top = 135
90+
Top = 136
9191
Width = 242
9292
Anchors = [akTop, akRight]
9393
BorderSpacing.Right = 6
@@ -102,7 +102,7 @@ object MainForm: TMainForm
102102
AnchorSideRight.Side = asrBottom
103103
Left = 343
104104
Height = 32
105-
Top = 100
105+
Top = 101
106106
Width = 182
107107
Anchors = [akTop, akRight]
108108
BorderSpacing.Right = 6
@@ -119,7 +119,7 @@ object MainForm: TMainForm
119119
AnchorSideBottom.Control = PortEdit
120120
AnchorSideBottom.Side = asrBottom
121121
Left = 433
122-
Height = 79
122+
Height = 80
123123
Top = 6
124124
Width = 92
125125
Anchors = [akTop, akLeft, akRight, akBottom]
@@ -134,7 +134,7 @@ object MainForm: TMainForm
134134
object StaticText1: TStaticText
135135
Left = 0
136136
Height = 20
137-
Top = 172
137+
Top = 169
138138
Width = 531
139139
Align = alBottom
140140
BorderStyle = sbsSingle
@@ -153,7 +153,7 @@ object MainForm: TMainForm
153153
AnchorSideRight.Control = StartBtn
154154
Left = 416
155155
Height = 12
156-
Top = 39
156+
Top = 40
157157
Width = 12
158158
BorderSpacing.Left = 9
159159
BorderSpacing.Right = 5
@@ -168,7 +168,7 @@ object MainForm: TMainForm
168168
AnchorSideRight.Control = PortEdit
169169
Left = 282
170170
Height = 17
171-
Top = 58
171+
Top = 59
172172
Width = 29
173173
BorderSpacing.Right = 3
174174
Caption = 'Port:'
@@ -182,7 +182,7 @@ object MainForm: TMainForm
182182
AnchorSideRight.Side = asrBottom
183183
Left = 314
184184
Height = 37
185-
Top = 48
185+
Top = 49
186186
Width = 93
187187
Anchors = [akTop, akLeft, akRight]
188188
BorderSpacing.Left = 3
@@ -194,7 +194,7 @@ object MainForm: TMainForm
194194
AnchorSideTop.Side = asrBottom
195195
Left = 8
196196
Height = 32
197-
Top = 100
197+
Top = 101
198198
Width = 120
199199
BorderSpacing.Top = 15
200200
Caption = '--disable-ipv6'
@@ -205,12 +205,10 @@ object MainForm: TMainForm
205205
AnchorSideTop.Side = asrBottom
206206
Left = 8
207207
Height = 32
208-
Top = 135
208+
Top = 136
209209
Width = 161
210210
BorderSpacing.Top = 3
211211
Caption = '--no-latency-control'
212-
Checked = True
213-
State = cbChecked
214212
TabOrder = 6
215213
end
216214
object IniPropStorage1: TIniPropStorage

sshuttle-gui/backup/unit1.pas

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ procedure TMainForm.FormCreate(Sender: TObject);
117117
FCheckPingThread.Priority := tpNormal;
118118
end;
119119

120+
//Флаг очистки кеша браузеров при старте GUI
120121
procedure TMainForm.ClearBoxChange(Sender: TObject);
121122
var
122123
S: ansistring;
@@ -127,6 +128,7 @@ procedure TMainForm.ClearBoxChange(Sender: TObject);
127128
RunCommand('/bin/bash', ['-c', 'touch /etc/sshuttle-gui/clear'], S);
128129
end;
129130

131+
//Автостарт SShuttle после загрузки
130132
procedure TMainForm.AutoStartBoxChange(Sender: TObject);
131133
var
132134
S: ansistring;
@@ -135,9 +137,9 @@ procedure TMainForm.AutoStartBoxChange(Sender: TObject);
135137
Application.ProcessMessages;
136138

137139
if not AutoStartBox.Checked then
138-
RunCommand('/bin/bash', ['-c', 'systemctl disable sshuttle.service'], S)
140+
RunCommand('/bin/bash', ['-c', 'systemctl disable sshuttle'], S)
139141
else
140-
RunCommand('/bin/bash', ['-c', 'systemctl enable sshuttle.service'], S);
142+
RunCommand('/bin/bash', ['-c', 'systemctl enable sshuttle'], S);
141143
Screen.Cursor := crDefault;
142144
end;
143145

@@ -167,10 +169,10 @@ procedure TMainForm.StartBtnClick(Sender: TObject);
167169
if (UserEdit.Text = '') or (PasswordEdit.Text = '') or
168170
(ServerEdit.Text = '') or (PortEdit.Text = '') then Exit;
169171

170-
//Сохранение параметров
172+
//Сохраняем параметры
171173
IniPropStorage1.Save;
172174

173-
//Дополнительные параметры
175+
//Построение дополнительных параметров
174176
Pars := '';
175177
if IPv6Box.Checked then Pars := IPv6Box.Caption;
176178
if LatencyBox.Checked then Pars := Concat(Pars, ' ', LatencyBox.Caption);
@@ -180,7 +182,7 @@ procedure TMainForm.StartBtnClick(Sender: TObject);
180182
if StartBtn.Caption = SStop then
181183
begin
182184
Shape1.Brush.Color := clYellow;
183-
StartProcess('systemctl stop sshuttle.service; pidof sshpass && killall sshpass; iptables -t nat -F');
185+
StartProcess('systemctl stop sshuttle; pidof sshpass && killall sshpass; iptables -t nat -F');
184186
end
185187
else
186188
try
@@ -202,6 +204,8 @@ procedure TMainForm.StartBtnClick(Sender: TObject);
202204
Trim(UserEdit.Text) + '@' + Trim(ServerEDit.Text) + ' -p ' +
203205
Trim(PortEdit.Text) + ' exit 0'); }
204206

207+
//Забираем публичные ключи с сервера
208+
S.Add('# Забираем публичные ключи с сервера');
205209
S.Add('pidof sshpass && killall sshpass; iptables -t nat -F');
206210
S.Add('ssh-keyscan -p ' + PortEdit.Text + ' ' + ServerEDit.Text +
207211
' >> /root/.ssh/known_hosts');
@@ -216,14 +220,15 @@ procedure TMainForm.StartBtnClick(Sender: TObject);
216220

217221
S.Add('');
218222

223+
S.Add('# Принудительная очистка iptables nat');
219224
S.Add('iptables -t nat -F');
220225

221226
S.Add('exit 0;');
222227

223228
S.SaveToFile('/etc/sshuttle-gui/connect.sh');
224229

225230
//Запускаем скрипт через systemd
226-
StartProcess('chmod +x /etc/sshuttle-gui/connect.sh; systemctl restart sshuttle.service');
231+
StartProcess('chmod +x /etc/sshuttle-gui/connect.sh; systemctl restart sshuttle');
227232

228233
finally
229234
S.Free;
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

sshuttle-gui/lib/x86_64-linux/unit1.lfm

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
object MainForm: TMainForm
22
Left = 287
3-
Height = 192
3+
Height = 189
44
Top = 125
55
Width = 531
66
Caption = 'SShuttle-GUI'
7-
ClientHeight = 192
7+
ClientHeight = 189
88
ClientWidth = 531
99
OnCreate = FormCreate
1010
OnShow = FormShow
@@ -62,7 +62,7 @@ object MainForm: TMainForm
6262
AnchorSideTop.Side = asrCenter
6363
Left = 8
6464
Height = 17
65-
Top = 58
65+
Top = 59
6666
Width = 40
6767
Caption = 'Server:'
6868
ParentColor = False
@@ -74,10 +74,10 @@ object MainForm: TMainForm
7474
AnchorSideTop.Side = asrBottom
7575
Left = 51
7676
Height = 37
77-
Top = 48
78-
Width = 221
77+
Top = 49
78+
Width = 213
7979
BorderSpacing.Left = 3
80-
BorderSpacing.Top = 5
80+
BorderSpacing.Top = 6
8181
BorderSpacing.Right = 10
8282
TabOrder = 2
8383
end
@@ -87,7 +87,7 @@ object MainForm: TMainForm
8787
AnchorSideRight.Side = asrBottom
8888
Left = 283
8989
Height = 32
90-
Top = 135
90+
Top = 136
9191
Width = 242
9292
Anchors = [akTop, akRight]
9393
BorderSpacing.Right = 6
@@ -102,7 +102,7 @@ object MainForm: TMainForm
102102
AnchorSideRight.Side = asrBottom
103103
Left = 343
104104
Height = 32
105-
Top = 100
105+
Top = 101
106106
Width = 182
107107
Anchors = [akTop, akRight]
108108
BorderSpacing.Right = 6
@@ -119,7 +119,7 @@ object MainForm: TMainForm
119119
AnchorSideBottom.Control = PortEdit
120120
AnchorSideBottom.Side = asrBottom
121121
Left = 433
122-
Height = 79
122+
Height = 80
123123
Top = 6
124124
Width = 92
125125
Anchors = [akTop, akLeft, akRight, akBottom]
@@ -134,7 +134,7 @@ object MainForm: TMainForm
134134
object StaticText1: TStaticText
135135
Left = 0
136136
Height = 20
137-
Top = 172
137+
Top = 169
138138
Width = 531
139139
Align = alBottom
140140
BorderStyle = sbsSingle
@@ -153,7 +153,7 @@ object MainForm: TMainForm
153153
AnchorSideRight.Control = StartBtn
154154
Left = 416
155155
Height = 12
156-
Top = 39
156+
Top = 40
157157
Width = 12
158158
BorderSpacing.Left = 9
159159
BorderSpacing.Right = 5
@@ -166,9 +166,9 @@ object MainForm: TMainForm
166166
AnchorSideTop.Control = ServerEdit
167167
AnchorSideTop.Side = asrCenter
168168
AnchorSideRight.Control = PortEdit
169-
Left = 282
169+
Left = 274
170170
Height = 17
171-
Top = 58
171+
Top = 59
172172
Width = 29
173173
BorderSpacing.Right = 3
174174
Caption = 'Port:'
@@ -180,10 +180,10 @@ object MainForm: TMainForm
180180
AnchorSideTop.Control = ServerEdit
181181
AnchorSideRight.Control = PasswordEdit
182182
AnchorSideRight.Side = asrBottom
183-
Left = 314
183+
Left = 306
184184
Height = 37
185-
Top = 48
186-
Width = 93
185+
Top = 49
186+
Width = 101
187187
Anchors = [akTop, akLeft, akRight]
188188
BorderSpacing.Left = 3
189189
TabOrder = 3
@@ -194,7 +194,7 @@ object MainForm: TMainForm
194194
AnchorSideTop.Side = asrBottom
195195
Left = 8
196196
Height = 32
197-
Top = 100
197+
Top = 101
198198
Width = 120
199199
BorderSpacing.Top = 15
200200
Caption = '--disable-ipv6'
@@ -205,7 +205,7 @@ object MainForm: TMainForm
205205
AnchorSideTop.Side = asrBottom
206206
Left = 8
207207
Height = 32
208-
Top = 135
208+
Top = 136
209209
Width = 161
210210
BorderSpacing.Top = 3
211211
Caption = '--no-latency-control'
616 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

sshuttle-gui/pingtrd.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ procedure CheckPing.Execute;
6161
end;
6262
end;
6363

64-
//Индикация: Cветодиод, Режим
64+
//Индикация: светодиод, режим
6565
procedure CheckPing.ShowStatus;
6666
begin
6767
with MainForm do

sshuttle-gui/sshuttle_gui

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)