Skip to content

Commit

Permalink
v0.6 + DNS Leak protection
Browse files Browse the repository at this point in the history
  • Loading branch information
AKotov-dev committed Oct 25, 2022
1 parent 2ca81ab commit 62aae47
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 90 deletions.
13 changes: 5 additions & 8 deletions luntik/backup/luntik.lps
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="106"/>
<CursorPos X="19" Y="110"/>
<UsageCount Value="28"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit1>
<Unit2>
<Filename Value="pingtrd.pas"/>
Expand All @@ -66,12 +65,10 @@
<UsageCount Value="26"/>
</Unit2>
</Units>
<JumpHistory Count="1">
<Position1>
<Filename Value="unit1.pas"/>
<Caret Line="150" Column="38" TopLine="137"/>
</Position1>
</JumpHistory>
<General>
<ActiveWindowIndexAtStart Value="-1"/>
</General>
<JumpHistory HistoryIndex="-1"/>
<RunParams>
<FormatVersion Value="2"/>
<Modes ActiveMode="default"/>
Expand Down
3 changes: 3 additions & 0 deletions luntik/backup/unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ procedure TMainForm.Timer1Timer(Sender: TObject);
procedure TMainForm.ReStartBtnClick(Sender: TObject);
begin
//Перезапуск соединения
Shape1.Brush.Color := clYellow;
Shape1.Repaint;

if FileExists('/etc/luntik/luntik.conf') then
StartProcess('systemctl stop luntik; systemctl start luntik');
end;
Expand Down
52 changes: 22 additions & 30 deletions luntik/etc/luntik/update-resolv-conf
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
#!/bin/bash
#
# Parses DHCP options from openvpn to update resolv.conf
# To use set as 'up' and 'down' script in your openvpn *.conf:
# up /etc/openvpn/update-resolv-conf
# down /etc/openvpn/update-resolv-conf
#
# Used snippets of resolvconf script by Thomas Hood <jdthood@yahoo.co.uk>
# and Chris Hanson
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
# 07/2013 colin@daedrum.net Fixed intet name
# 05/2006 chlauber@bnc.ch
#
# Example envs set from openvpn:
# foreign_option_1='dhcp-option DNS 193.43.27.132'
# foreign_option_2='dhcp-option DNS 193.43.27.133'
# foreign_option_3='dhcp-option DOMAIN be.bnc.ch'
# foreign_option_4='dhcp-option DOMAIN-SEARCH bnc.local'

## The 'type' builtins will look for file in $PATH variable, so we set the
## PATH below. You might need to directly set the path to 'resolvconf'
## manually if it still doesn't work, i.e.
## RESOLVCONF=/usr/sbin/resolvconf
# Upgraded script with DNS leak closure for Mageia Linux
# The original: https://github.com/alfredopalhares/openvpn-update-resolv-conf

export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
RESOLVCONF=$(type -p resolvconf)

case $script_type in

Expand Down Expand Up @@ -56,17 +37,28 @@ up)
R="${R}nameserver $NS
"
done
#echo -n "$R" | $RESOLVCONF -x -p -a "${dev}"
echo -n "$R" | $RESOLVCONF -a "${dev}.inet"
#DNS replace
echo "# Generated by Luntik" > /etc/resolv.conf
case $(echo -n "$R" | wc -l) in
0)
echo -e "nameserver 1.0.0.1\nnameserver 9.9.9.9" >> /etc/resolv.conf
;;
1)
echo -e "${R}nameserver 9.9.9.9" >> /etc/resolv.conf
;;
*)
echo -n "$R" >> /etc/resolv.conf
;;
esac
;;
down)
$RESOLVCONF -d "${dev}.inet"
pgrep NetworkManager && systemctl restart NetworkManager.service
#DNS restore
if [[ $(systemctl is-active systemd-resolved) == "active" ]]; then
systemctl restart systemd-resolved
else
pgrep NetworkManager && systemctl restart NetworkManager.service || resolvconf -u
fi;
;;
esac

# Workaround / jm@epiclabs.io
# force exit with no errors. Due to an apparent conflict with the Network Manager
# $RESOLVCONF sometimes exits with error code 6 even though it has performed the
# action correctly and OpenVPN shuts down.
exit 0
2 changes: 1 addition & 1 deletion luntik/lib/x86_64-linux/luntik.compiled
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Compiler Value="/usr/bin/fpc" Date="1644254403"/>
<Compiler Value="/usr/bin/fpc" Date="1648204554"/>
<Params Value=" -MObjFPC -Scghi -CX -Cg -O3 -XX -l -vewnhibq &quot;-Fi/home/marsik/Рабочий стол/luntik/lib/x86_64-linux&quot; -Fu/usr/lib64/lazarus/lcl/units/x86_64-linux/gtk2 -Fu/usr/lib64/lazarus/lcl/units/x86_64-linux -Fu/usr/lib64/lazarus/components/freetype/lib/x86_64-linux -Fu/usr/lib64/lazarus/components/lazutils/lib/x86_64-linux -Fu/usr/lib64/lazarus/packager/units/x86_64-linux &quot;-Fu/home/marsik/Рабочий стол/luntik/&quot; &quot;-FU/home/marsik/Рабочий стол/luntik/lib/x86_64-linux/&quot; &quot;-FE/home/marsik/Рабочий стол/luntik/&quot; &quot;-o/home/marsik/Рабочий стол/luntik/luntik&quot; -dLCL -dLCLgtk2 luntik.pas"/>
</CONFIG>
Binary file modified luntik/lib/x86_64-linux/luntik.o
Binary file not shown.
Binary file modified luntik/lib/x86_64-linux/luntik.or
Binary file not shown.
Binary file modified luntik/lib/x86_64-linux/pingtrd.ppu
Binary file not shown.
30 changes: 15 additions & 15 deletions luntik/lib/x86_64-linux/unit1.lfm
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
object MainForm: TMainForm
Left = 290
Height = 700
Height = 683
Top = 124
Width = 940
Width = 918
ActiveControl = ReStartBtn
Caption = 'Luntik'
ClientHeight = 700
ClientWidth = 940
ClientHeight = 683
ClientWidth = 918
OnClose = FormClose
OnCreate = FormCreate
OnShow = FormShow
Expand All @@ -16,7 +16,7 @@ object MainForm: TMainForm
object ReStartBtn: TButton
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 845
Left = 823
Height = 32
Top = 8
Width = 90
Expand All @@ -28,9 +28,9 @@ object MainForm: TMainForm
end
object Memo1: TMemo
Left = 0
Height = 633
Height = 616
Top = 50
Width = 940
Width = 918
Align = alClient
BorderSpacing.Top = 50
Font.Height = -12
Expand All @@ -45,7 +45,7 @@ object MainForm: TMainForm
end
object StopBtn: TButton
AnchorSideRight.Control = ReStartBtn
Left = 753
Left = 731
Height = 32
Top = 8
Width = 90
Expand All @@ -59,7 +59,7 @@ object MainForm: TMainForm
AnchorSideTop.Control = StopBtn
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = StopBtn
Left = 659
Left = 637
Height = 32
Top = 8
Width = 91
Expand Down Expand Up @@ -89,9 +89,9 @@ object MainForm: TMainForm
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = LoadBtn
Left = 22
Height = 36
Height = 37
Top = 6
Width = 590
Width = 568
Anchors = [akTop, akLeft, akRight]
AutoSelect = False
BorderSpacing.Left = 5
Expand All @@ -105,8 +105,8 @@ object MainForm: TMainForm
AnchorSideRight.Control = AutoStartCheckBox
AnchorSideBottom.Control = FileEdit
AnchorSideBottom.Side = asrBottom
Left = 613
Height = 36
Left = 591
Height = 37
Top = 6
Width = 38
Anchors = [akTop, akRight, akBottom]
Expand All @@ -117,8 +117,8 @@ object MainForm: TMainForm
object StaticText2: TStaticText
Left = 0
Height = 17
Top = 683
Width = 940
Top = 666
Width = 918
Align = alBottom
Caption = 'License: GPLv3 Author: alex_q_2000 (C) 2021 URL: https://linuxforum.ru'
Color = clDefault
Expand Down
Binary file modified luntik/lib/x86_64-linux/unit1.ppu
Binary file not shown.
Binary file modified luntik/luntik
Binary file not shown.
2 changes: 1 addition & 1 deletion luntik/luntik.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="Luntik v0.5"/>
<Title Value="Luntik v0.6"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
Expand Down
6 changes: 2 additions & 4 deletions luntik/luntik.lps
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="106"/>
<CursorPos X="19" Y="110"/>
<UsageCount Value="28"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit1>
<Unit2>
<Filename Value="pingtrd.pas"/>
Expand All @@ -65,9 +66,6 @@
<UsageCount Value="26"/>
</Unit2>
</Units>
<General>
<ActiveWindowIndexAtStart Value="-1"/>
</General>
<JumpHistory HistoryIndex="-1"/>
<RunParams>
<FormatVersion Value="2"/>
Expand Down
2 changes: 1 addition & 1 deletion luntik/luntik.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

begin
RequireDerivedFormResource:=True;
Application.Title:='Luntik v0.5';
Application.Title:='Luntik v0.6';
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TMainForm, MainForm);
Expand Down
34 changes: 19 additions & 15 deletions luntik/package-project/luntik.prj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name=luntik

[VERSION]
version=0.5
version=0.6

[RELEASE]
release=0.mrx9
Expand Down Expand Up @@ -84,19 +84,23 @@ toolversion=2.2.0
3=
4=Note: Don't forget to open the iptables ports required for configurations.
5=
6=v0.5
7=+ using fping to check the connection
8=+ changing the prefix of rpm-packages to mrx9
6=v0.6
7=+ DNS Leak protection
8=+ Release for Mageia-9 and higher
9=
10=v0.4
11=+ final release
12=
13=v0.3
14=+ rpm deps: resolvconf procps-ng
15=+ improved luntik.service
10=v0.5
11=+ using fping to check the connection
12=+ changing the prefix of rpm-packages to mrx9
13=
14=v0.4
15=+ final release
16=
17=v0.2
18=+ bypass auth-user-pass
19=
20=v0.1
21=- initial release
17=v0.3
18=+ rpm deps: resolvconf procps-ng
19=+ improved luntik.service
20=
21=v0.2
22=+ bypass auth-user-pass
23=
24=v0.1
25=- initial release
30 changes: 15 additions & 15 deletions luntik/unit1.lfm
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
object MainForm: TMainForm
Left = 290
Height = 700
Height = 683
Top = 124
Width = 940
Width = 918
ActiveControl = ReStartBtn
Caption = 'Luntik'
ClientHeight = 700
ClientWidth = 940
ClientHeight = 683
ClientWidth = 918
OnClose = FormClose
OnCreate = FormCreate
OnShow = FormShow
Expand All @@ -16,7 +16,7 @@ object MainForm: TMainForm
object ReStartBtn: TButton
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 845
Left = 823
Height = 32
Top = 8
Width = 90
Expand All @@ -28,9 +28,9 @@ object MainForm: TMainForm
end
object Memo1: TMemo
Left = 0
Height = 633
Height = 616
Top = 50
Width = 940
Width = 918
Align = alClient
BorderSpacing.Top = 50
Font.Height = -12
Expand All @@ -45,7 +45,7 @@ object MainForm: TMainForm
end
object StopBtn: TButton
AnchorSideRight.Control = ReStartBtn
Left = 753
Left = 731
Height = 32
Top = 8
Width = 90
Expand All @@ -59,7 +59,7 @@ object MainForm: TMainForm
AnchorSideTop.Control = StopBtn
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = StopBtn
Left = 659
Left = 637
Height = 32
Top = 8
Width = 91
Expand Down Expand Up @@ -89,9 +89,9 @@ object MainForm: TMainForm
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = LoadBtn
Left = 22
Height = 36
Height = 37
Top = 6
Width = 590
Width = 568
Anchors = [akTop, akLeft, akRight]
AutoSelect = False
BorderSpacing.Left = 5
Expand All @@ -105,8 +105,8 @@ object MainForm: TMainForm
AnchorSideRight.Control = AutoStartCheckBox
AnchorSideBottom.Control = FileEdit
AnchorSideBottom.Side = asrBottom
Left = 613
Height = 36
Left = 591
Height = 37
Top = 6
Width = 38
Anchors = [akTop, akRight, akBottom]
Expand All @@ -117,8 +117,8 @@ object MainForm: TMainForm
object StaticText2: TStaticText
Left = 0
Height = 17
Top = 683
Width = 940
Top = 666
Width = 918
Align = alBottom
Caption = 'License: GPLv3 Author: alex_q_2000 (C) 2021 URL: https://linuxforum.ru'
Color = clDefault
Expand Down

0 comments on commit 62aae47

Please sign in to comment.