-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89e825a
commit c649ed5
Showing
46 changed files
with
2,413 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=sshuttle | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/etc/sshuttle-gui/connect.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
if [ -f "/etc/sshuttle-gui/clear" ]; then | ||
#zenity --question --no-wrap --title="Browser Сleaner" \ | ||
# --text="Clear the Cache and Cookies of installed Browsers?" | ||
|
||
#if [ "$?" -eq "0" ]; then | ||
# Caches (Mozilla, Chrome, Opera, Chromium, Palemoon) | ||
rm -rf ~/.cache/mozilla/* \ | ||
~/.cache/google-chrome/* \ | ||
~/.cache/opera/* \ | ||
~/.cache/chromium/* \ | ||
~/.cache/moonchild\ productions/* | ||
|
||
# Cookies | ||
rm -f $(find ~/.mozilla/* -type f -name "cookies.sqlite") \ | ||
~/.config/google-chrome/Default/Cookies* \ | ||
~/.config/opera/Cookies* \ | ||
~/.config/chromium/Default/Cookies* \ | ||
"$(find ~/.moonchild\ productions/pale\ moon/* -type f -name "cookies.sqlite")" | ||
#fi; | ||
fi; | ||
# --- | ||
|
||
# Detect KDE | ||
if [[ $(type -p kdesu) && $XDG_CURRENT_DESKTOP == KDE ]]; then | ||
kdesu /usr/share/sshuttle-gui/sshuttle_gui "$@" | ||
else | ||
pkexec /usr/share/sshuttle-gui/sshuttle_gui "$@" | ||
fi; | ||
|
||
exit 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Desktop Entry] | ||
Name=SShuttle-GUI | ||
Comment=SSH VPN connector | ||
Comment[ru]=SSH VPN коннектор | ||
Icon=sshuttle-gui | ||
Exec=sshuttle-gui | ||
Type=Application | ||
Categories=System; | ||
Terminal=false |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions
17
sshuttle-gui/all/usr/share/polkit-1/actions/sshuttle-gui.policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE policyconfig PUBLIC | ||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" | ||
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"> | ||
<policyconfig> | ||
|
||
<action id="com.mageia.pkexec.sshuttle-gui"> | ||
<message>Authentication to run SShuttle-GUI</message> | ||
<message xml:lang="ru">Аутентификация для запуска SShuttle-GUI</message> | ||
<defaults> | ||
<allow_any>auth_admin</allow_any> | ||
<allow_inactive>auth_admin</allow_inactive> | ||
<allow_active>auth_admin</allow_active> | ||
</defaults> | ||
<annotate key="org.freedesktop.policykit.exec.path">/usr/share/sshuttle-gui/sshuttle_gui</annotate> | ||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> | ||
</action> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
unit PingTRD; | ||
|
||
{$mode objfpc}{$H+} | ||
|
||
interface | ||
|
||
uses | ||
Classes, Forms, Controls, SysUtils, Process, Graphics; | ||
|
||
type | ||
CheckPing = class(TThread) | ||
private | ||
|
||
{ Private declarations } | ||
protected | ||
var | ||
PingStr: TStringList; | ||
|
||
procedure Execute; override; | ||
procedure ShowStatus; | ||
|
||
end; | ||
|
||
implementation | ||
|
||
uses unit1; | ||
|
||
{ TRD } | ||
|
||
procedure CheckPing.Execute; | ||
var | ||
PingProcess: TProcess; | ||
begin | ||
try | ||
FreeOnTerminate := True; //Уничтожать по завершении | ||
PingStr := TStringList.Create; | ||
|
||
PingProcess := TProcess.Create(nil); | ||
PingProcess.Executable := 'bash'; | ||
|
||
while not Terminated do | ||
begin | ||
PingProcess.Parameters.Clear; | ||
PingProcess.Parameters.Add('-c'); | ||
PingProcess.Parameters.Add( | ||
'[[ $(fping google.com) && $(systemctl is-active sshuttle) == "active" ]] && echo "yes" || echo "no"'); | ||
|
||
PingProcess.Options := [poUsePipes, poWaitOnExit]; | ||
|
||
PingProcess.Execute; | ||
PingStr.LoadFromStream(PingProcess.Output); | ||
Synchronize(@ShowStatus); | ||
|
||
Sleep(500); | ||
end; | ||
|
||
finally | ||
PingStr.Free; | ||
PingProcess.Free; | ||
Terminate; | ||
end; | ||
end; | ||
|
||
//Индикация - светодиод | ||
procedure CheckPing.ShowStatus; | ||
begin | ||
with MainForm do | ||
begin | ||
if Trim(PingStr[0]) = 'yes' then | ||
begin | ||
StartBtn.Caption := SStop; | ||
Shape1.Brush.Color := clLime; | ||
end | ||
else | ||
begin | ||
StartBtn.Caption := SStart; | ||
Shape1.Brush.Color := clYellow; | ||
end; | ||
|
||
Shape1.Repaint; | ||
StartBtn.Repaint; | ||
end; | ||
end; | ||
|
||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CONFIG> | ||
<ProjectOptions> | ||
<Version Value="12"/> | ||
<General> | ||
<SessionStorage Value="InProjectDir"/> | ||
<Title Value="SShuttle-GUI v0.1"/> | ||
<Scaled Value="True"/> | ||
<ResourceType Value="res"/> | ||
<UseXPManifest Value="True"/> | ||
<XPManifest> | ||
<DpiAware Value="True"/> | ||
</XPManifest> | ||
<Icon Value="0"/> | ||
</General> | ||
<i18n> | ||
<EnableI18N Value="True"/> | ||
<OutDir Value="languages"/> | ||
</i18n> | ||
<BuildModes> | ||
<Item Name="Default" Default="True"/> | ||
<Item Name="Debug"> | ||
<CompilerOptions> | ||
<Version Value="11"/> | ||
<Target> | ||
<Filename Value="sshuttle_gui"/> | ||
</Target> | ||
<SearchPaths> | ||
<IncludeFiles Value="$(ProjOutDir)"/> | ||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> | ||
</SearchPaths> | ||
<Parsing> | ||
<SyntaxOptions> | ||
<IncludeAssertionCode Value="True"/> | ||
</SyntaxOptions> | ||
</Parsing> | ||
<CodeGeneration> | ||
<Checks> | ||
<IOChecks Value="True"/> | ||
<RangeChecks Value="True"/> | ||
<OverflowChecks Value="True"/> | ||
<StackChecks Value="True"/> | ||
</Checks> | ||
<VerifyObjMethodCallValidity Value="True"/> | ||
</CodeGeneration> | ||
<Linking> | ||
<Debugging> | ||
<DebugInfoType Value="dsDwarf3"/> | ||
<UseHeaptrc Value="True"/> | ||
<TrashVariables Value="True"/> | ||
<UseExternalDbgSyms Value="True"/> | ||
</Debugging> | ||
<Options> | ||
<Win32> | ||
<GraphicApplication Value="True"/> | ||
</Win32> | ||
</Options> | ||
</Linking> | ||
</CompilerOptions> | ||
</Item> | ||
</BuildModes> | ||
<PublishOptions> | ||
<Version Value="2"/> | ||
<UseFileFilters Value="True"/> | ||
</PublishOptions> | ||
<RunParams> | ||
<FormatVersion Value="2"/> | ||
</RunParams> | ||
<RequiredPackages> | ||
<Item> | ||
<PackageName Value="LCL"/> | ||
</Item> | ||
</RequiredPackages> | ||
<Units> | ||
<Unit> | ||
<Filename Value="sshuttle_gui.lpr"/> | ||
<IsPartOfProject Value="True"/> | ||
</Unit> | ||
<Unit> | ||
<Filename Value="unit1.pas"/> | ||
<IsPartOfProject Value="True"/> | ||
<ComponentName Value="MainForm"/> | ||
<HasResources Value="True"/> | ||
<ResourceBaseClass Value="Form"/> | ||
<UnitName Value="Unit1"/> | ||
</Unit> | ||
<Unit> | ||
<Filename Value="pingtrd.pas"/> | ||
<IsPartOfProject Value="True"/> | ||
<UnitName Value="PingTRD"/> | ||
</Unit> | ||
</Units> | ||
</ProjectOptions> | ||
<CompilerOptions> | ||
<Version Value="11"/> | ||
<Target> | ||
<Filename Value="sshuttle_gui"/> | ||
</Target> | ||
<SearchPaths> | ||
<IncludeFiles Value="$(ProjOutDir)"/> | ||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> | ||
</SearchPaths> | ||
<Linking> | ||
<Options> | ||
<Win32> | ||
<GraphicApplication Value="True"/> | ||
</Win32> | ||
</Options> | ||
</Linking> | ||
</CompilerOptions> | ||
<Debugging> | ||
<Exceptions> | ||
<Item> | ||
<Name Value="EAbort"/> | ||
</Item> | ||
<Item> | ||
<Name Value="ECodetoolError"/> | ||
</Item> | ||
<Item> | ||
<Name Value="EFOpenError"/> | ||
</Item> | ||
</Exceptions> | ||
</Debugging> | ||
</CONFIG> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
program sshuttle_gui; | ||
|
||
{$mode objfpc}{$H+} | ||
|
||
uses | ||
{$IFDEF UNIX} | ||
cthreads, | ||
{$ENDIF} {$IFDEF HASAMIGA} | ||
athreads, | ||
{$ENDIF} | ||
Interfaces, // this includes the LCL widgetset | ||
Forms, | ||
Unit1, | ||
PingTRD { you can add units after this }; | ||
|
||
{$R *.res} | ||
|
||
begin | ||
RequireDerivedFormResource := True; | ||
Application.Title:='SShuttle-GUI v0.1'; | ||
Application.Scaled:=True; | ||
Application.Initialize; | ||
Application.CreateForm(TMainForm, MainForm); | ||
Application.Run; | ||
end. |
Oops, something went wrong.