diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 7e2e69c..f3650aa 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,8 +4,11 @@
-
+
+
+
+
@@ -39,23 +42,23 @@
- {
- "keyToString": {
- "ASKED_ADD_EXTERNAL_FILES": "true",
- "Python.INSTALL.executor": "Run",
- "Python.install.executor": "Run",
- "Python.main.executor": "Run",
- "Python.messagebox.executor": "Run",
- "Python.start_wg.executor": "Run",
- "Python.wg_func.executor": "Run",
- "Python.wg_main.executor": "Run",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "Shell Script.install.executor": "Run",
- "git-widget-placeholder": "main",
- "last_opened_file_path": "/home/punix/Pyapps/wire-py",
- "settings.editor.selected.configurable": "preferences.lookFeel"
+
+}]]>
@@ -132,14 +135,6 @@
1723279982210
-
-
- 1724048994613
-
-
-
- 1724048994613
-
1724102937260
@@ -524,7 +519,15 @@
1727379755537
-
+
+
+ 1727380793216
+
+
+
+ 1727380793216
+
+
@@ -565,7 +568,6 @@
-
@@ -590,17 +592,7 @@
-
-
-
-
-
-
- file://$PROJECT_DIR$/wg_func.py
- 182
-
-
-
-
+
+
\ No newline at end of file
diff --git a/Changelog b/Changelog
new file mode 100644
index 0000000..00544a1
--- /dev/null
+++ b/Changelog
@@ -0,0 +1,27 @@
+Changelog for Wire-Py
+
+## [Unreleased]
+ - os import in wg_func replaced by other methods
+ - Autoupdate in Options
+ - Guide to menu '?' with pictures
+ - Create file for settings (Autoupdate)
+ - UID and GID for another Systems (Fedora, Arch, ect.)
+ - installer optimize for another Systems
+ - In Gitea Readme enter text, images
+ - Dark Theme for Wire-Py
+ - Own filedialog for import
+
+### Added
+28-09-2024
+
+ - Changelog create
+
+ - When exporting, the folder is now copied to /tmp and the non .conf
+ files are deleted before the zip file is created.
+
+ - In main.py os import removed. Since os have been replaced by pathlib and shutil.
+
+ - Start with version number 1.4.7
+
+ - Message window size corrected so text is displayed better
+
diff --git a/wg_func.py b/wg_func.py
index 9ef5e7e..b17d029 100755
--- a/wg_func.py
+++ b/wg_func.py
@@ -2,12 +2,12 @@
import os
import shutil
import subprocess
+import tkinter as tk
import zipfile
from datetime import datetime
-from tkinter import filedialog, ttk
-import tkinter as tk
from pathlib import Path
from subprocess import check_call
+from tkinter import filedialog
font_color = '#4011a7'
dk_theme = '#2e2e2e'
@@ -300,7 +300,7 @@ class ImportTunnel:
ShowAddress.init_and_report(self, data)
ShowAddress.show_data(self)
check_call(['nmcli', 'con', 'mod', self.a, 'connection.autoconnect', 'no'])
- os.chmod(str(wg_read), 0o600)
+ Path.chmod(wg_read, 0o600)
if 'PrivateKey = ' not in read:
"""img_w, img_i, w_title, w_txt x, y hand over"""
@@ -404,9 +404,13 @@ class ExportTunnels:
try:
if len(tl) != 0:
wg_tar = str(_u) + '/' + now_datetime
- p_to_conf = Path('/etc/wire_py/')
- shutil.make_archive(wg_tar, 'zip', p_to_conf)
- os.chown(wg_tar + '.zip', 1000, 1000)
+ shutil.copytree('/etc/wire_py', '/tmp/wire_py', dirs_exist_ok=True)
+ source = Path('/tmp/wire_py')
+ Path.unlink(Path(source) / 'wg_py', missing_ok=True)
+ Path.unlink(Path(source) / '.keys', missing_ok=True)
+ shutil.make_archive(wg_tar, 'zip', source)
+ shutil.chown(wg_tar + '.zip', 1000, 1000)
+ shutil.rmtree(source)
with zipfile.ZipFile((wg_tar + '.zip'), 'r') as zf:
if len(zf.namelist()) != 0:
"""img_w, img_i, w_title, w_txt hand over"""
@@ -431,9 +435,9 @@ class ExportTunnels:
iw = r'/usr/share/icons/wp-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = 'Select tunnel'
- msg_t = 'Please first import tunnel. '
- x = 340 # width
- y = 140 # height
+ msg_t = 'Please first import tunnel.'
+ x = 280 # width
+ y = 130 # height
msg_window(iw, ii, wt, msg_t, x, y)
except TypeError:
diff --git a/wg_main.py b/wg_main.py
index 540c5c4..f34df1f 100755
--- a/wg_main.py
+++ b/wg_main.py
@@ -1,5 +1,5 @@
#!/usr/bin/python3
-import os
+
import tkinter as tk
from subprocess import check_call
from tkinter import *
@@ -40,6 +40,8 @@ class MainWindow(tk.Tk):
self.app_menu = tk.Menu(self, borderwidth=0)
self.configure(menu=self.app_menu)
+ self.app_menu.add_cascade(label='v. 1.4.7')
+ self.app_menu.add_cascade(label='Options')
self.app_menu.add_cascade(label='?')
FrameWidgets(self).grid()
@@ -177,7 +179,9 @@ class FrameWidgets(ttk.Frame):
for line in readfile:
if pre_key not in line.strip("\n"):
writefile.write(line)
- os.replace('/etc/wire_py/.keys2', '/etc/wire_py/.keys')
+ file_one = Path('/etc/wire_py/.keys2')
+ file_two = file_one.with_name('.keys')
+ file_one.replace(file_two)
# for disable checkbox when Listbox empty
tl = ListTunnels.tl_list()
if len(tl) == 0:
@@ -207,9 +211,9 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/wp-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = 'Select tunnel'
- msg_t = 'Please first import tunnel. '
- x = 340 # width
- y = 140 # height
+ msg_t = 'Please first import tunnel.'
+ x = 280 # width
+ y = 130 # height
msg_window(iw, ii, wt, msg_t, x, y)
# Button Trash
@@ -365,9 +369,9 @@ class FrameWidgets(ttk.Frame):
iw = r'/usr/share/icons/wp-icons/64/info.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
wt = 'Select tunnel'
- msg_t = 'Please first import tunnel. '
- x = 340 # width
- y = 140 # height
+ msg_t = 'Please first import tunnel.'
+ x = 280 # width
+ y = 130 # height
msg_window(iw, ii, wt, msg_t, x, y)