Skip to content

Commit c649ed5

Browse files
committed
v0.1 - Initial release
1 parent 89e825a commit c649ed5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2413
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Unit]
2+
Description=sshuttle
3+
After=network.target
4+
5+
[Service]
6+
Type=simple
7+
ExecStart=/etc/sshuttle-gui/connect.sh
8+
9+
[Install]
10+
WantedBy=multi-user.target
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
if [ -f "/etc/sshuttle-gui/clear" ]; then
4+
#zenity --question --no-wrap --title="Browser Сleaner" \
5+
# --text="Clear the Cache and Cookies of installed Browsers?"
6+
7+
#if [ "$?" -eq "0" ]; then
8+
# Caches (Mozilla, Chrome, Opera, Chromium, Palemoon)
9+
rm -rf ~/.cache/mozilla/* \
10+
~/.cache/google-chrome/* \
11+
~/.cache/opera/* \
12+
~/.cache/chromium/* \
13+
~/.cache/moonchild\ productions/*
14+
15+
# Cookies
16+
rm -f $(find ~/.mozilla/* -type f -name "cookies.sqlite") \
17+
~/.config/google-chrome/Default/Cookies* \
18+
~/.config/opera/Cookies* \
19+
~/.config/chromium/Default/Cookies* \
20+
"$(find ~/.moonchild\ productions/pale\ moon/* -type f -name "cookies.sqlite")"
21+
#fi;
22+
fi;
23+
# ---
24+
25+
# Detect KDE
26+
if [[ $(type -p kdesu) && $XDG_CURRENT_DESKTOP == KDE ]]; then
27+
kdesu /usr/share/sshuttle-gui/sshuttle_gui "$@"
28+
else
29+
pkexec /usr/share/sshuttle-gui/sshuttle_gui "$@"
30+
fi;
31+
32+
exit 0;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Desktop Entry]
2+
Name=SShuttle-GUI
3+
Comment=SSH VPN connector
4+
Comment[ru]=SSH VPN коннектор
5+
Icon=sshuttle-gui
6+
Exec=sshuttle-gui
7+
Type=Application
8+
Categories=System;
9+
Terminal=false
9.32 KB
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE policyconfig PUBLIC
3+
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
4+
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
5+
<policyconfig>
6+
7+
<action id="com.mageia.pkexec.sshuttle-gui">
8+
<message>Authentication to run SShuttle-GUI</message>
9+
<message xml:lang="ru">Аутентификация для запуска SShuttle-GUI</message>
10+
<defaults>
11+
<allow_any>auth_admin</allow_any>
12+
<allow_inactive>auth_admin</allow_inactive>
13+
<allow_active>auth_admin</allow_active>
14+
</defaults>
15+
<annotate key="org.freedesktop.policykit.exec.path">/usr/share/sshuttle-gui/sshuttle_gui</annotate>
16+
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
17+
</action>

sshuttle-gui/backup/pingtrd.pas

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
unit PingTRD;
2+
3+
{$mode objfpc}{$H+}
4+
5+
interface
6+
7+
uses
8+
Classes, Forms, Controls, SysUtils, Process, Graphics;
9+
10+
type
11+
CheckPing = class(TThread)
12+
private
13+
14+
{ Private declarations }
15+
protected
16+
var
17+
PingStr: TStringList;
18+
19+
procedure Execute; override;
20+
procedure ShowStatus;
21+
22+
end;
23+
24+
implementation
25+
26+
uses unit1;
27+
28+
{ TRD }
29+
30+
procedure CheckPing.Execute;
31+
var
32+
PingProcess: TProcess;
33+
begin
34+
try
35+
FreeOnTerminate := True; //Уничтожать по завершении
36+
PingStr := TStringList.Create;
37+
38+
PingProcess := TProcess.Create(nil);
39+
PingProcess.Executable := 'bash';
40+
41+
while not Terminated do
42+
begin
43+
PingProcess.Parameters.Clear;
44+
PingProcess.Parameters.Add('-c');
45+
PingProcess.Parameters.Add(
46+
'[[ $(fping google.com) && $(systemctl is-active sshuttle) == "active" ]] && echo "yes" || echo "no"');
47+
48+
PingProcess.Options := [poUsePipes, poWaitOnExit];
49+
50+
PingProcess.Execute;
51+
PingStr.LoadFromStream(PingProcess.Output);
52+
Synchronize(@ShowStatus);
53+
54+
Sleep(500);
55+
end;
56+
57+
finally
58+
PingStr.Free;
59+
PingProcess.Free;
60+
Terminate;
61+
end;
62+
end;
63+
64+
//Индикация - светодиод
65+
procedure CheckPing.ShowStatus;
66+
begin
67+
with MainForm do
68+
begin
69+
if Trim(PingStr[0]) = 'yes' then
70+
begin
71+
StartBtn.Caption := SStop;
72+
Shape1.Brush.Color := clLime;
73+
end
74+
else
75+
begin
76+
StartBtn.Caption := SStart;
77+
Shape1.Brush.Color := clYellow;
78+
end;
79+
80+
Shape1.Repaint;
81+
StartBtn.Repaint;
82+
end;
83+
end;
84+
85+
end.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CONFIG>
3+
<ProjectOptions>
4+
<Version Value="12"/>
5+
<General>
6+
<SessionStorage Value="InProjectDir"/>
7+
<Title Value="SShuttle-GUI v0.1"/>
8+
<Scaled Value="True"/>
9+
<ResourceType Value="res"/>
10+
<UseXPManifest Value="True"/>
11+
<XPManifest>
12+
<DpiAware Value="True"/>
13+
</XPManifest>
14+
<Icon Value="0"/>
15+
</General>
16+
<i18n>
17+
<EnableI18N Value="True"/>
18+
<OutDir Value="languages"/>
19+
</i18n>
20+
<BuildModes>
21+
<Item Name="Default" Default="True"/>
22+
<Item Name="Debug">
23+
<CompilerOptions>
24+
<Version Value="11"/>
25+
<Target>
26+
<Filename Value="sshuttle_gui"/>
27+
</Target>
28+
<SearchPaths>
29+
<IncludeFiles Value="$(ProjOutDir)"/>
30+
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
31+
</SearchPaths>
32+
<Parsing>
33+
<SyntaxOptions>
34+
<IncludeAssertionCode Value="True"/>
35+
</SyntaxOptions>
36+
</Parsing>
37+
<CodeGeneration>
38+
<Checks>
39+
<IOChecks Value="True"/>
40+
<RangeChecks Value="True"/>
41+
<OverflowChecks Value="True"/>
42+
<StackChecks Value="True"/>
43+
</Checks>
44+
<VerifyObjMethodCallValidity Value="True"/>
45+
</CodeGeneration>
46+
<Linking>
47+
<Debugging>
48+
<DebugInfoType Value="dsDwarf3"/>
49+
<UseHeaptrc Value="True"/>
50+
<TrashVariables Value="True"/>
51+
<UseExternalDbgSyms Value="True"/>
52+
</Debugging>
53+
<Options>
54+
<Win32>
55+
<GraphicApplication Value="True"/>
56+
</Win32>
57+
</Options>
58+
</Linking>
59+
</CompilerOptions>
60+
</Item>
61+
</BuildModes>
62+
<PublishOptions>
63+
<Version Value="2"/>
64+
<UseFileFilters Value="True"/>
65+
</PublishOptions>
66+
<RunParams>
67+
<FormatVersion Value="2"/>
68+
</RunParams>
69+
<RequiredPackages>
70+
<Item>
71+
<PackageName Value="LCL"/>
72+
</Item>
73+
</RequiredPackages>
74+
<Units>
75+
<Unit>
76+
<Filename Value="sshuttle_gui.lpr"/>
77+
<IsPartOfProject Value="True"/>
78+
</Unit>
79+
<Unit>
80+
<Filename Value="unit1.pas"/>
81+
<IsPartOfProject Value="True"/>
82+
<ComponentName Value="MainForm"/>
83+
<HasResources Value="True"/>
84+
<ResourceBaseClass Value="Form"/>
85+
<UnitName Value="Unit1"/>
86+
</Unit>
87+
<Unit>
88+
<Filename Value="pingtrd.pas"/>
89+
<IsPartOfProject Value="True"/>
90+
<UnitName Value="PingTRD"/>
91+
</Unit>
92+
</Units>
93+
</ProjectOptions>
94+
<CompilerOptions>
95+
<Version Value="11"/>
96+
<Target>
97+
<Filename Value="sshuttle_gui"/>
98+
</Target>
99+
<SearchPaths>
100+
<IncludeFiles Value="$(ProjOutDir)"/>
101+
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
102+
</SearchPaths>
103+
<Linking>
104+
<Options>
105+
<Win32>
106+
<GraphicApplication Value="True"/>
107+
</Win32>
108+
</Options>
109+
</Linking>
110+
</CompilerOptions>
111+
<Debugging>
112+
<Exceptions>
113+
<Item>
114+
<Name Value="EAbort"/>
115+
</Item>
116+
<Item>
117+
<Name Value="ECodetoolError"/>
118+
</Item>
119+
<Item>
120+
<Name Value="EFOpenError"/>
121+
</Item>
122+
</Exceptions>
123+
</Debugging>
124+
</CONFIG>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
program sshuttle_gui;
2+
3+
{$mode objfpc}{$H+}
4+
5+
uses
6+
{$IFDEF UNIX}
7+
cthreads,
8+
{$ENDIF} {$IFDEF HASAMIGA}
9+
athreads,
10+
{$ENDIF}
11+
Interfaces, // this includes the LCL widgetset
12+
Forms,
13+
Unit1,
14+
PingTRD { you can add units after this };
15+
16+
{$R *.res}
17+
18+
begin
19+
RequireDerivedFormResource := True;
20+
Application.Title:='SShuttle-GUI v0.1';
21+
Application.Scaled:=True;
22+
Application.Initialize;
23+
Application.CreateForm(TMainForm, MainForm);
24+
Application.Run;
25+
end.

0 commit comments

Comments
 (0)