diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5b91594..c290777 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,8 +4,13 @@
-
+
+
+
+
+
+
@@ -404,7 +409,15 @@
1726650691719
-
+
+
+ 1726652747322
+
+
+
+ 1726652747322
+
+
@@ -445,7 +458,6 @@
-
@@ -470,6 +482,23 @@
-
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/wg_main.py
+ 1
+
+
+
+ file://$PROJECT_DIR$/wg_func.py
+ 11
+
+
+
+
\ No newline at end of file
diff --git a/Wire-Py.desktop b/Wire-Py.desktop
index 7ae15e9..293408b 100755
--- a/Wire-Py.desktop
+++ b/Wire-Py.desktop
@@ -4,4 +4,4 @@ Name=Wire-Py
Exec=/usr/bin/wirepy
Terminal=false
Categories=Network;
-Icon=/usr/share/icons/wp-icons/128/wg-vpn.png
+Icon=/usr/share/icons/wp-icons/128/wg_vpn.png
diff --git a/install b/install
index 84faa4e..7e56afc 100755
--- a/install
+++ b/install
@@ -4,12 +4,13 @@ which sudo >/dev/null
if [ $? -ne 0 ]
then
su -
- apt install python3-tk && apt install tcl-ttkthemes && \
+ apt install python3-tk -y && apt install tcl-ttkthemes -y && \
cp wg_main.py start_wg.py wg_func.py wirepy /usr/bin/ && \
mkdir -p /etc/wire_py && cp -R wp-icons /usr/share/icons/ && \
- if [ ! -e /usr/local/bin/wirepy ]
+ chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
+ if [ ! -f /usr/local/bin/wirepy ]
then
- sudo ln -s /usr/bin/wirepy.py /usr/local/bin/wirepy
+ ln -s /usr/bin/wirepy.py /usr/local/bin/wirepy >/dev/null
fi
cp org.wirepy.policy /usr/share/polkit-1/actions/ && \
cp Wire-Py.desktop /usr/share/applications/ && \
@@ -20,7 +21,8 @@ else
sudo apt install python3-tk && sudo apt install tcl-ttkthemes && \
sudo cp wg_main.py start_wg.py wg_func.py wirepy /usr/bin/ && \
sudo mkdir -p /etc/wire_py && sudo cp -R wp-icons /usr/share/icons/ && \
- if [ ! -e /usr/local/bin/wirepy ]
+ sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
+ if [ ! -f /usr/local/bin/wirepy ]
then
sudo ln -s /usr/bin/wirepy.py /usr/local/bin/wirepy
fi
diff --git a/org.wirepy.policy b/org.wirepy.policy
index 7b65957..c4c1694 100644
--- a/org.wirepy.policy
+++ b/org.wirepy.policy
@@ -10,7 +10,7 @@
auth_admin_keep
yes
- /usr/bin/wire-py/wg_main.py
+ /usr/bin/wg_main.py
true
diff --git a/wg_func.py b/wg_func.py
index d0ec097..37a51b5 100755
--- a/wg_func.py
+++ b/wg_func.py
@@ -181,8 +181,10 @@ class ImportTunnel:
def wg_import_select(self):
try:
- filepath = filedialog.askopenfilename(initialdir=Path('/home/*/'), title='Select Wireguard config File',
+ filepath = filedialog.askopenfilename(initialdir=Path('/home/'), title='Select Wireguard config '
+ 'File',
filetypes=[('WG config files', '*.conf')], )
+ os.chmod(filepath, 0o600)
with open(filepath, 'r') as file:
read = file.read()
path_split = filepath.split('/')
@@ -197,8 +199,9 @@ class ImportTunnel:
if self.a != '':
check_call(['nmcli', 'connection', 'down', TunnelActiv.active()])
ShowAddress.label_empty(self)
- check_call(['nmcli', 'connection', 'import', 'type', 'wireguard', 'file', 'etc', '/wire_py',
+ check_call(['nmcli', 'connection', 'import', 'type', 'wireguard', 'file', Path('/etc') / 'wire_py' /
path_split])
+
else:
shutil.copy(filepath, Path('/etc/wire_py/'))
if self.a != '':
@@ -221,6 +224,7 @@ class ImportTunnel:
ShowAddress.init_and_report(self, data)
ShowAddress.show_data(self)
check_call(['nmcli', 'con', 'mod', self.a, 'connection.autoconnect', 'no'])
+
if 'PrivateKey = ' not in read:
msg_window()
except EOFError:
@@ -295,7 +299,7 @@ class ExportTunnels:
tl = ListTunnels.tl_list()
try:
if len(tl) != 0:
- wg_tar = Path('/home/*/') / now_datetime
+ wg_tar = Path(f'/{home}/'), now_datetime
p_to_conf = Path('/etc/wire_py/')
shutil.make_archive(wg_tar, 'zip', p_to_conf)
#if zip_full != 0:
diff --git a/wg_main.py b/wg_main.py
index 992c723..f1c11b3 100755
--- a/wg_main.py
+++ b/wg_main.py
@@ -58,7 +58,7 @@ class FrameWidgets(ttk.Frame):
self.imp_pic = tk.PhotoImage(file=r'/usr/share/icons/wp-icons/48/wg_import.png')
self.tr_pic = tk.PhotoImage(file=r'/usr/share/icons/wp-icons/48/wg_trash.png')
self.exp_pic = tk.PhotoImage(file=r'/usr/share/icons/wp-icons/48/wg_export.png')
- self.warning_pic = tk.PhotoImage(file=r'/usr/share/icons/wp-icons/64/warning.png')
+ self.warning_pic = tk.PhotoImage(file=r'/usr/share/icons/wp-icons/64/error.png')
# Show active Tunnel
self.a = TunnelActiv.active()