Compare commits
84 Commits
1.11.0824
...
2a3bf2bbcb
Author | SHA1 | Date | |
---|---|---|---|
2a3bf2bbcb | |||
8896f59efd | |||
c58a630e25 | |||
dc6f8cb094 | |||
dcda647e90 | |||
2a995eabd5 | |||
ea750b0cfc | |||
980ce3c7a7 | |||
28cc423138 | |||
39550b392d | |||
582ef21042 | |||
ca58ac86a4 | |||
177fa1cc34 | |||
ca1a7a6b94 | |||
a49c5b00e1 | |||
75a247797d | |||
4b019b0c1f | |||
ab78eb4f59 | |||
9f3f0246b4 | |||
5302aae807 | |||
13832d916f | |||
1667682c9d | |||
8771be760d | |||
97bf9df041 | |||
1bba45a6c1 | |||
a5eb6293c6 | |||
6e54529c0f | |||
e28235af4b | |||
862cc91fa1 | |||
5fe6fd3f29 | |||
48a48ffd4c | |||
1278b02a95 | |||
22abe9f8b9 | |||
52f22beec6 | |||
8754e7ecda | |||
a6742a0c0e | |||
6b75713121 | |||
762694aa94 | |||
cc54f329fe | |||
8c01c1b984 | |||
ebafdbdcb3 | |||
ce4f6c84dc | |||
b68908eaef | |||
c4565ed169 | |||
485cfff457 | |||
1a0fc74a80 | |||
971c86c97f | |||
66dd27cc64 | |||
cf71eae7d3 | |||
1f80d5342c | |||
e719a1f23f | |||
a0da356cec | |||
ac87e0a4a7 | |||
6a3a982057 | |||
aab90eec70 | |||
511d5f72df | |||
ed93e99026 | |||
10c3b07053 | |||
e9814f2b60 | |||
c470783ff2 | |||
2fac03a927 | |||
03a7e48018 | |||
090842ab28 | |||
9eb99f0859 | |||
feb6217637 | |||
5f6aaa6cf1 | |||
63ed0abc98 | |||
3102c685fd | |||
ec10f912ea | |||
96164eb132 | |||
a19f889950 | |||
de2929896d | |||
f9d4256679 | |||
a0b895438c | |||
4c89488950 | |||
c0ae2d2b75 | |||
e4774abf19 | |||
7b1e543428 | |||
6f83fc7162 | |||
b70400b456 | |||
e25bc154ea | |||
7aa3cd75fe | |||
0b9eec8d1d | |||
b9083d4698 |
238
.idea/workspace.xml
generated
@ -4,16 +4,9 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="- Optimize Class and Tooltip">
|
||||
<change afterPath="$PROJECT_DIR$/run_as" afterDir="false" />
|
||||
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment=" - Update Translate Files">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Changelog" beforeDir="false" afterPath="$PROJECT_DIR$/Changelog" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/install" beforeDir="false" afterPath="$PROJECT_DIR$/install" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/settings" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/start_wg.py" beforeDir="false" afterPath="$PROJECT_DIR$/start_wg.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/theme" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/wg_main.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/cls_mth_fc.py" beforeDir="false" afterPath="$PROJECT_DIR$/cls_mth_fc.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -30,7 +23,7 @@
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="main" />
|
||||
<entry key="$PROJECT_DIR$" value="1.11.0824" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
@ -65,13 +58,14 @@
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"Shell Script.install.executor": "Run",
|
||||
"Shell Script.run_as.executor": "Run",
|
||||
"git-widget-placeholder": "main",
|
||||
"git-widget-placeholder": "1.11.1024",
|
||||
"last_opened_file_path": "/home/punix/Pyapps/wire-py",
|
||||
"settings.editor.selected.configurable": "reference.settingsdialog.IDE.editor.colors"
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$/lx-icons" />
|
||||
<recent name="$PROJECT_DIR$" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
@ -135,7 +129,7 @@
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-python-sdk-0e3be3396995-c546a90a8094-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-242.23339.19" />
|
||||
<option value="bundled-python-sdk-8336bb23522e-31b6be0877a2-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-241.19072.16" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
@ -148,102 +142,6 @@
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1723279982210</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00017" summary="remove a ',' in DNS Name">
|
||||
<option name="closed" value="true" />
|
||||
<created>1724576599289</created>
|
||||
<option name="number" value="00017" />
|
||||
<option name="presentableId" value="LOCAL-00017" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724576599289</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00018" summary="fix when Filname > 17 first copy file after rename">
|
||||
<option name="closed" value="true" />
|
||||
<created>1724593165879</created>
|
||||
<option name="number" value="00018" />
|
||||
<option name="presentableId" value="LOCAL-00018" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724593165879</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00019" summary="add export Tunnel as zip">
|
||||
<option name="closed" value="true" />
|
||||
<created>1724610514657</created>
|
||||
<option name="number" value="00019" />
|
||||
<option name="presentableId" value="LOCAL-00019" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724610514658</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00020" summary="columnconfigure on all widgets set">
|
||||
<option name="closed" value="true" />
|
||||
<created>1724778892233</created>
|
||||
<option name="number" value="00020" />
|
||||
<option name="presentableId" value="LOCAL-00020" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724778892233</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00021" summary="little fixes a " " to ' '">
|
||||
<option name="closed" value="true" />
|
||||
<created>1725119445803</created>
|
||||
<option name="number" value="00021" />
|
||||
<option name="presentableId" value="LOCAL-00021" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725119445803</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00022" summary="add class FileHandle, add Label to show autoconnect Tunnel disable checkbox when Listbox is empty or no select Tunnel">
|
||||
<option name="closed" value="true" />
|
||||
<created>1725391658456</created>
|
||||
<option name="number" value="00022" />
|
||||
<option name="presentableId" value="LOCAL-00022" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725391658456</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00023" summary="add if question and add autoconnect, autoconnect_var to class Filehandle in box_set no finish!">
|
||||
<option name="closed" value="true" />
|
||||
<created>1725434328731</created>
|
||||
<option name="number" value="00023" />
|
||||
<option name="presentableId" value="LOCAL-00023" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725434328731</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00024" summary="fixes on empty Listbox now is disable and now works autoconnect label with read and write, delete works now with read and write">
|
||||
<option name="closed" value="true" />
|
||||
<created>1725475967338</created>
|
||||
<option name="number" value="00024" />
|
||||
<option name="presentableId" value="LOCAL-00024" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725475967338</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00025" summary="add Frame widget 3 for Buttons and Listbox with Scrollbar. all Widgets new format delete works now of disable checkbox when Listbox empty (part two)">
|
||||
<option name="closed" value="true" />
|
||||
<created>1725567453540</created>
|
||||
<option name="number" value="00025" />
|
||||
<option name="presentableId" value="LOCAL-00025" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725567453540</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00026" summary="little fixes">
|
||||
<option name="closed" value="true" />
|
||||
<created>1725639633873</created>
|
||||
<option name="number" value="00026" />
|
||||
<option name="presentableId" value="LOCAL-00026" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725639633873</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00027" summary="little fixes">
|
||||
<option name="closed" value="true" />
|
||||
<created>1725746027132</created>
|
||||
<option name="number" value="00027" />
|
||||
<option name="presentableId" value="LOCAL-00027" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725746027132</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00028" summary="little fixes replace os.system with check_call first steps in install Script add wg_start.service file">
|
||||
<option name="closed" value="true" />
|
||||
<created>1725820337669</created>
|
||||
<option name="number" value="00028" />
|
||||
<option name="presentableId" value="LOCAL-00028" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725820337669</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00029" summary="little fixes a labels when stop and start, installer first functions works">
|
||||
<option name="closed" value="true" />
|
||||
<created>1725991610908</created>
|
||||
@ -540,18 +438,109 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1729938941027</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="66" />
|
||||
<task id="LOCAL-00066" summary="- methods from class MainWindow move to class FrameWidgets for active color_label when theme change - optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets - add new Frame for Widgets on Bottom - optimize from tkinter * to from tkinter import filedialog, ttk, TclError">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731097309468</created>
|
||||
<option name="number" value="00066" />
|
||||
<option name="presentableId" value="LOCAL-00066" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731097309468</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00067" summary="- methods from class MainWindow move to class FrameWidgets for active color_label when theme change - optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets - add new Frame for Widgets on Bottom - optimize from tkinter * to from tkinter import filedialog, ttk, TclError">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731097969343</created>
|
||||
<option name="number" value="00067" />
|
||||
<option name="presentableId" value="LOCAL-00067" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731097969344</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00068" summary="- methods from class MainWindow move to class FrameWidgets for active color_label when theme change - optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets - add new Frame for Widgets on Bottom - optimize from tkinter * to from tkinter import filedialog, ttk, TclError">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731098372497</created>
|
||||
<option name="number" value="00068" />
|
||||
<option name="presentableId" value="LOCAL-00068" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731098372497</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00069" summary=" - - Fix Checkbutton Autostart when first install Wire-Py">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731690583059</created>
|
||||
<option name="number" value="00069" />
|
||||
<option name="presentableId" value="LOCAL-00069" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731690583060</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00070" summary=" - - Fix Checkbutton Autostart when first install Wire-Py">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731836942211</created>
|
||||
<option name="number" value="00070" />
|
||||
<option name="presentableId" value="LOCAL-00070" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731836942212</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00071" summary=" - Update Translate Files">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731840048762</created>
|
||||
<option name="number" value="00071" />
|
||||
<option name="presentableId" value="LOCAL-00071" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731840048763</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00072" summary=" - Update Translate Files">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731840089956</created>
|
||||
<option name="number" value="00072" />
|
||||
<option name="presentableId" value="LOCAL-00072" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731840089956</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00073" summary=" - Update Translate Files">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731840188277</created>
|
||||
<option name="number" value="00073" />
|
||||
<option name="presentableId" value="LOCAL-00073" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731840188278</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00074" summary=" - Update Translate Files">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731840383592</created>
|
||||
<option name="number" value="00074" />
|
||||
<option name="presentableId" value="LOCAL-00074" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731840383592</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00075" summary=" - Update Translate Files">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731841930614</created>
|
||||
<option name="number" value="00075" />
|
||||
<option name="presentableId" value="LOCAL-00075" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731841930615</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00076" summary=" - Update Translate Files">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731844213239</created>
|
||||
<option name="number" value="00076" />
|
||||
<option name="presentableId" value="LOCAL-00076" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731844213239</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00077" summary=" - Update Translate Files">
|
||||
<option name="closed" value="true" />
|
||||
<created>1731844339039</created>
|
||||
<option name="number" value="00077" />
|
||||
<option name="presentableId" value="LOCAL-00077" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1731844339039</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="78" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="UnknownFeatures">
|
||||
<option featureType="com.intellij.fileTypeFactory" implementationName="*.policy" />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="OPEN_GENERIC_TABS">
|
||||
<map>
|
||||
<entry key="f9756e7d-0c5c-4b84-84e4-660314c46ea4" value="TOOL_WINDOW" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
@ -562,7 +551,7 @@
|
||||
<entry key="branch">
|
||||
<value>
|
||||
<list>
|
||||
<option value="origin/wire-py-reformat-14-08-2024" />
|
||||
<option value="1.11.0824" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
@ -571,19 +560,11 @@
|
||||
</State>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="f9756e7d-0c5c-4b84-84e4-660314c46ea4">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
<MESSAGE value="fix a filedialog for hidden Files work install rollback to bash for start wirepy and wirepy rollback to bash" />
|
||||
<MESSAGE value="install rollback bash to py wirepy and wirepy rollback to py" />
|
||||
<MESSAGE value="fix install and .desktop File Tar works now for user home and filebrowser.askfilebrowser start now in user home" />
|
||||
<MESSAGE value="replace tar with zip and Check if Zip file is empty" />
|
||||
<MESSAGE value="Create your own message boxes for export" />
|
||||
<MESSAGE value="chown Export File to 1000:1000" />
|
||||
@ -606,15 +587,18 @@
|
||||
<MESSAGE value=" - Add Options, Help, Update Label and Update Menubutton - Theme now separate Light and Dark" />
|
||||
<MESSAGE value="- Optimize Class. Move to wg_main Import Start/StopBTN and Tooltip" />
|
||||
<MESSAGE value="- Optimize Class and Tooltip" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="- Optimize Class and Tooltip" />
|
||||
<MESSAGE value="- methods from class MainWindow move to class FrameWidgets for active color_label when theme change - optimize columnconfigure, rowconfigure in class MainWindow and FrameWidgets - add new Frame for Widgets on Bottom - optimize from tkinter * to from tkinter import filedialog, ttk, TclError" />
|
||||
<MESSAGE value=" - - Fix Checkbutton Autostart when first install Wire-Py" />
|
||||
<MESSAGE value=" - Update Translate Files" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value=" - Update Translate Files" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
||||
<url>file://$PROJECT_DIR$/start_wg.py</url>
|
||||
<line>1</line>
|
||||
<option name="timeStamp" value="2" />
|
||||
<url>file://$PROJECT_DIR$/wg_main.py</url>
|
||||
<line>1128</line>
|
||||
<option name="timeStamp" value="3" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
|
76
Changelog
@ -3,10 +3,77 @@ My standard System: Linux Mint 22 Cinnamon
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- os import in wg_func replaced by other methods
|
||||
- os import in cls_mth_fc.py replaced by other methods
|
||||
- If Wire-Py already runs, prevent further start
|
||||
- for loops with lists replaced by List Comprehensions
|
||||
- Update search after start of Wire-Py
|
||||
|
||||
|
||||
### Added
|
||||
13-04-0725
|
||||
|
||||
- Installer update for Open Suse Tumbleweed and Leap
|
||||
- add symbolic link wirepy.py
|
||||
|
||||
|
||||
### Added
|
||||
09-04-0725
|
||||
|
||||
- Installer now with query and remove
|
||||
- Icons merged
|
||||
|
||||
|
||||
### Added
|
||||
07-04-0725
|
||||
|
||||
- Installers will support other systems again
|
||||
- Installer is now finished clean with wrong password
|
||||
- Rename wg_main to wirepy
|
||||
|
||||
|
||||
### Added
|
||||
03-03-2025
|
||||
|
||||
- Fixes a new user files create
|
||||
|
||||
|
||||
### Added
|
||||
02-03-2025
|
||||
|
||||
- Fix ipv6 in Config File on import
|
||||
- Wirepy run now as user
|
||||
- settings, keys and Config Files now in ~/.config/wire_py
|
||||
- For new users, the required files are created and autostart service is started.
|
||||
- Tunnels are now read from the directory to view them in the list.
|
||||
To display only own tunnels, and read errors are minimized.
|
||||
|
||||
### Added
|
||||
10-11-2024
|
||||
|
||||
- Fix Checkbutton Autostart when first install Wire-Py
|
||||
- Update Translate Files
|
||||
|
||||
### Added
|
||||
10-11-2024
|
||||
|
||||
- Translate file de_De complete
|
||||
- new FrameWidget for rename Entry and rename Button
|
||||
|
||||
|
||||
### Added
|
||||
09-11-2024
|
||||
|
||||
- Move Tips Method in separate class for Tooltips in another Apps
|
||||
- Move Version Variable in main script
|
||||
- Edit Class GiteaUpdate for requests in api_down and download
|
||||
- Description on Class GiteaUpdate
|
||||
|
||||
|
||||
### Added
|
||||
08-11-2024
|
||||
|
||||
- Preparation for language translation part 1
|
||||
- separate folder for general icons
|
||||
- install edit for new dir lx-icons
|
||||
|
||||
|
||||
### Added
|
||||
@ -17,6 +84,7 @@ My standard System: Linux Mint 22 Cinnamon
|
||||
- add new Frame for Widgets on Bottom
|
||||
- optimize from tkinter * to from tkinter import filedialog, ttk, TclError
|
||||
|
||||
|
||||
### Added
|
||||
07-11-2024
|
||||
|
||||
@ -26,7 +94,7 @@ My standard System: Linux Mint 22 Cinnamon
|
||||
### Added
|
||||
27-10-2024
|
||||
|
||||
- Add Autoconnect settings to settings.conf
|
||||
- Add Autoconnect settings to settings
|
||||
|
||||
|
||||
### Added
|
||||
@ -34,7 +102,7 @@ My standard System: Linux Mint 22 Cinnamon
|
||||
|
||||
- Add run_as Bash script and open_gitea.py python script
|
||||
- Add Tooltip disable/enable
|
||||
- Rename settings to settings.conf for theme, updates and tooltip enable in one file
|
||||
- Rename settings to settings for theme, updates and tooltip enable in one file
|
||||
|
||||
|
||||
### Added
|
||||
|
4
Wire-Py.desktop
Executable file → Normal file
@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Wire-Py
|
||||
Exec=/usr/bin/wirepy.py
|
||||
Exec=/usr/local/bin/wirepy.py
|
||||
Terminal=false
|
||||
Categories=Network;
|
||||
Icon=/usr/share/icons/wp-icons/128/wg_vpn.png
|
||||
Icon=/usr/share/icons/lx-icons/128/wg_vpn.png
|
BIN
__pycache__/cls_mth_fc.cpython-312.pyc
Normal file
BIN
__pycache__/message.cpython-312.pyc
Normal file
BIN
__pycache__/start_wg.cpython-312.pyc
Normal file
BIN
__pycache__/wg_main.cpython-312.pyc
Normal file
429
cls_mth_fc.py
Executable file
@ -0,0 +1,429 @@
|
||||
""" Classes Method and Functions for lx Apps """
|
||||
|
||||
import gettext
|
||||
import locale
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tkinter as tk
|
||||
import zipfile
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from subprocess import check_call
|
||||
from tkinter import ttk
|
||||
|
||||
import requests
|
||||
|
||||
APP = "wirepy"
|
||||
LOCALE_DIR = "/usr/share/locale/"
|
||||
locale.bindtextdomain(APP, LOCALE_DIR)
|
||||
gettext.bindtextdomain(APP, LOCALE_DIR)
|
||||
gettext.textdomain(APP)
|
||||
_ = gettext.gettext
|
||||
|
||||
wg_set = Path(Path.home() / ".config/wire_py/settings")
|
||||
|
||||
|
||||
class Create:
|
||||
"""
|
||||
This class is for the creation of the folders and files
|
||||
required by Wire-Py, as well as for decryption
|
||||
the tunnel from the user's home directory
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def dir_and_files():
|
||||
"""
|
||||
check and create folders and files if not present
|
||||
"""
|
||||
|
||||
pth = Path.home() / ".config/wire_py"
|
||||
pth.mkdir(parents=True, exist_ok=True)
|
||||
sett = Path.home() / ".config/wire_py/settings"
|
||||
ks = Path.home() / ".config/wire_py/keys"
|
||||
|
||||
if sett.exists():
|
||||
pass
|
||||
|
||||
else:
|
||||
sett.touch()
|
||||
sett.write_text(
|
||||
"[UPDATES]\non\n[THEME]\nlight\n[TOOLTIP]\nTrue\n[AUTOSTART ON]\noff\n"
|
||||
)
|
||||
|
||||
if ks.exists():
|
||||
pass
|
||||
|
||||
else:
|
||||
ks.touch()
|
||||
|
||||
@staticmethod
|
||||
def files_for_autostart():
|
||||
"""
|
||||
check and create file for auto start if not present and enable the service
|
||||
"""
|
||||
|
||||
pth2 = Path.home() / ".config/systemd/user"
|
||||
pth2.mkdir(parents=True, exist_ok=True)
|
||||
wg_ser = Path.home() / ".config/systemd/user/wg_start.service"
|
||||
|
||||
if wg_ser.exists():
|
||||
pass
|
||||
|
||||
else:
|
||||
wg_ser.touch()
|
||||
wg_ser.write_text(
|
||||
"[Unit]\nDescription=Automatic Tunnel Start\nAfter=network-online.target"
|
||||
"\n\n[Service]\nType=oneshot\nExecStartPre=/bin/sleep 5\nExecStart=/usr/"
|
||||
"local/bin/start_wg.py\n[Install]\nWantedBy=default.target"
|
||||
)
|
||||
check_call(["systemctl", "--user", "enable", "wg_start.service"])
|
||||
|
||||
@staticmethod
|
||||
def make_dir():
|
||||
"""Dirname "tlecdewg" = Tunnel Encrypt Decrypt Wireguard"""
|
||||
|
||||
dirname = Path("/tmp/tlecdcwg/")
|
||||
if dirname.exists():
|
||||
pass
|
||||
else:
|
||||
dirname.mkdir()
|
||||
|
||||
@staticmethod
|
||||
def decrypt():
|
||||
"""
|
||||
This start ssl_decrypt file
|
||||
"""
|
||||
process = subprocess.run(
|
||||
["pkexec", "/usr/local/bin/ssl_decrypt.py"],
|
||||
stdout=subprocess.PIPE,
|
||||
text=True,
|
||||
check=True,
|
||||
)
|
||||
# print(process.stdout)
|
||||
if process.returncode == 0:
|
||||
print("File successfully decrypted...")
|
||||
else:
|
||||
print(f"Error with the following code... {process.returncode}")
|
||||
|
||||
@staticmethod
|
||||
def encrypt():
|
||||
"""
|
||||
this start ssl_encrypt file
|
||||
"""
|
||||
process = subprocess.run(
|
||||
["pkexec", "/usr/local/bin/ssl_encrypt.py"],
|
||||
stdout=subprocess.PIPE,
|
||||
text=True,
|
||||
check=True,
|
||||
)
|
||||
print(process.stdout)
|
||||
if process.returncode == 0:
|
||||
print("All Files successfully encrypted...")
|
||||
else:
|
||||
print(f"Error with the following code... {process.returncode}")
|
||||
|
||||
|
||||
def uos():
|
||||
"""
|
||||
|
||||
uos = LOGIN USERNAME
|
||||
|
||||
This method displays the user name of the logged-in user,
|
||||
even if you are rooted in a shell
|
||||
"""
|
||||
logname = str(Path.home())[6:]
|
||||
file = Path.home() / "/tmp/.loguser"
|
||||
with open(file, "w", encoding="utf-8") as f:
|
||||
f.write(logname)
|
||||
|
||||
|
||||
class GiteaUpdate:
|
||||
"""
|
||||
Calling download requests the download URL of the running script,
|
||||
the taskbar image for the “Download OK” window, the taskbar image for the
|
||||
“Download error” window and the variable res
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def api_down(update_api_url, version):
|
||||
"""
|
||||
Calling api_down requests the URL and the version of the running script.
|
||||
Example: version = 'v. 1.1.1.1' GiteaUpdate.api_down(http://example.de, version)
|
||||
"""
|
||||
try:
|
||||
response = requests.get(update_api_url, timeout=10)
|
||||
response_dict = response.json()
|
||||
response_dict = response_dict[0]
|
||||
with open(wg_set, "r", encoding="utf-8") as set_file:
|
||||
set_file = set_file.read()
|
||||
if "on\n" in set_file:
|
||||
if version[3:] != response_dict["tag_name"]:
|
||||
req = response_dict["tag_name"]
|
||||
else:
|
||||
req = "No Updates"
|
||||
else:
|
||||
req = "False"
|
||||
return req
|
||||
except requests.exceptions.RequestException:
|
||||
req = "No Internet Connection!"
|
||||
return req
|
||||
|
||||
@staticmethod
|
||||
def download(urld, down_ok_image, down_not_ok_image, res):
|
||||
"""
|
||||
this is for download new Version of wirepy
|
||||
"""
|
||||
try:
|
||||
to_down = "wget -qP " + str(Path.home()) + " " + urld
|
||||
result = subprocess.call(to_down, shell=True)
|
||||
if result == 0:
|
||||
shutil.chown(str(Path.home()) + f"/{res}.zip", 1000, 1000)
|
||||
|
||||
# img_w, img_i, w_title, w_txt hand over
|
||||
iw = r"/usr/share/icons/lx-icons/64/info.png"
|
||||
ii = down_ok_image
|
||||
wt = _("Download Successful")
|
||||
msg_t = _("Your zip file is in home directory")
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
else:
|
||||
|
||||
# img_w, img_i, w_title, w_txt hand over
|
||||
iw = r"/usr/share/icons/lx-icons/64/error.png"
|
||||
ii = down_not_ok_image
|
||||
wt = _("Download error")
|
||||
msg_t = _("Download failed! Please try again")
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
except subprocess.CalledProcessError:
|
||||
|
||||
# img_w, img_i, w_title, w_txt hand over
|
||||
iw = r"/usr/share/icons/lx-icons/64/error.png"
|
||||
ii = down_not_ok_image
|
||||
wt = _("Download error")
|
||||
msg_t = _("Download failed! No internet connection!")
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
|
||||
def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None):
|
||||
"""
|
||||
Function for different message windows for the user. with 4 arguments to be passed.
|
||||
To create messages with your own images, icons, and titles.
|
||||
As an alternative to Python Messagebox.
|
||||
Paths to images must be specified: r'/usr/share/icons/lx-icons/64/info.png'
|
||||
img_w = Image for Tk Window
|
||||
img_i = Image for Icon
|
||||
w_title = Windows Title
|
||||
w_txt = Text for Tk Window
|
||||
txt2 = Text for Button two
|
||||
com = function for Button command
|
||||
"""
|
||||
msg = tk.Toplevel()
|
||||
msg.resizable(width=False, height=False)
|
||||
msg.title(w_title)
|
||||
msg.configure(pady=15, padx=15)
|
||||
msg.img = tk.PhotoImage(file=img_w)
|
||||
msg.i_window = tk.Label(msg, image=msg.img)
|
||||
|
||||
label = tk.Label(msg, text=w_txt)
|
||||
|
||||
label.grid(column=1, row=0)
|
||||
|
||||
if txt2 is not None and com is not None:
|
||||
label.config(font=("Ubuntu", 11), padx=15, justify="left")
|
||||
msg.i_window.grid(column=0, row=0, sticky="nw")
|
||||
button2 = ttk.Button(msg, text=f"{txt2}", command=com, padding=4)
|
||||
button2.grid(column=0, row=1, sticky="e", columnspan=2)
|
||||
button = ttk.Button(msg, text="OK", command=msg.destroy, padding=4)
|
||||
button.grid(column=0, row=1, sticky="w", columnspan=2)
|
||||
|
||||
else:
|
||||
label.config(font=("Ubuntu", 11), padx=15)
|
||||
msg.i_window.grid(column=0, row=0)
|
||||
button = ttk.Button(msg, text="OK", command=msg.destroy, padding=4)
|
||||
button.grid(column=0, columnspan=2, row=1)
|
||||
|
||||
img_i = tk.PhotoImage(file=img_i)
|
||||
msg.iconphoto(True, img_i)
|
||||
msg.columnconfigure(0, weight=1)
|
||||
msg.rowconfigure(0, weight=1)
|
||||
msg.winfo_toplevel()
|
||||
|
||||
|
||||
class Tunnel:
|
||||
"""
|
||||
Class of Methods for Wire-Py
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def con_to_dict(cls, file):
|
||||
"""
|
||||
The config file is packed into a dictionary,
|
||||
to display the values Address , DNS and Peer in the labels
|
||||
"""
|
||||
|
||||
dictlist = []
|
||||
for lines in file.readlines():
|
||||
line_plit = lines.split()
|
||||
dictlist = dictlist + line_plit
|
||||
dictlist.remove("[Interface]")
|
||||
dictlist.remove("[Peer]")
|
||||
for items in dictlist:
|
||||
if items == "=":
|
||||
dictlist.remove(items)
|
||||
if items == "::/0":
|
||||
dictlist.remove(items)
|
||||
|
||||
# Here is the beginning (Loop) of convert List to Dictionary
|
||||
for _ in dictlist:
|
||||
a = [dictlist[0], dictlist[1]]
|
||||
b = [dictlist[2], dictlist[3]]
|
||||
c = [dictlist[4], dictlist[5]]
|
||||
d = [dictlist[6], dictlist[7]]
|
||||
e = [dictlist[8], dictlist[9]]
|
||||
f = [dictlist[10], dictlist[11]]
|
||||
g = [dictlist[12], dictlist[13]]
|
||||
h = [dictlist[14], dictlist[15]]
|
||||
new_list = [a, b, c, d, e, f, g, h]
|
||||
final_dict = {}
|
||||
for elements in new_list:
|
||||
final_dict[elements[0]] = elements[1]
|
||||
|
||||
# end... result a Dictionary
|
||||
|
||||
address = final_dict["Address"]
|
||||
dns = final_dict["DNS"]
|
||||
if "," in dns:
|
||||
dns = dns[:-1]
|
||||
endpoint = final_dict["Endpoint"]
|
||||
pre_key = final_dict.get("PresharedKey")
|
||||
if pre_key is None:
|
||||
pre_key = final_dict.get("PreSharedKey")
|
||||
return address, dns, endpoint, pre_key
|
||||
|
||||
@staticmethod
|
||||
def active():
|
||||
"""
|
||||
Shows the Active Tunnel
|
||||
"""
|
||||
active = (
|
||||
os.popen('nmcli con show --active | grep -iPo "(.*)(wireguard)"')
|
||||
.read()
|
||||
.split()
|
||||
)
|
||||
if not active:
|
||||
active = ""
|
||||
else:
|
||||
active = active[0]
|
||||
|
||||
return active
|
||||
|
||||
@staticmethod
|
||||
def list():
|
||||
"""
|
||||
Shows all existing Wireguard tunnels a login user
|
||||
"""
|
||||
dirname = Path("/tmp/tlecdcwg/")
|
||||
wg_s = os.listdir(dirname)
|
||||
|
||||
return wg_s
|
||||
|
||||
@staticmethod
|
||||
def export():
|
||||
"""
|
||||
This will export the tunnels.
|
||||
A zipfile with current date and time is created
|
||||
in the user's home directory with correct right
|
||||
"""
|
||||
now_time = datetime.now()
|
||||
now_datetime = now_time.strftime("wg-exp-" + "%m-%d-%Y" + "-" + "%H:%M")
|
||||
tl = Tunnel.list()
|
||||
|
||||
try:
|
||||
if len(tl) != 0:
|
||||
wg_tar = str(Path.home()) + "/" + now_datetime
|
||||
shutil.copytree("/tmp/tlecdcwg/", "/tmp/wire_py", dirs_exist_ok=True)
|
||||
source = Path("/tmp/wire_py")
|
||||
shutil.make_archive(wg_tar, "zip", source)
|
||||
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
|
||||
iw = r"/usr/share/icons/lx-icons/64/info.png"
|
||||
ii = r"/usr/share/icons/lx-icons/48/wg_vpn.png"
|
||||
wt = _("Export Successful")
|
||||
msg_t = _("Your zip file is in home directory")
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
else:
|
||||
|
||||
# img_w, img_i, w_title, w_txt hand over
|
||||
iw = r"/usr/share/icons/lx-icons/64/error.png"
|
||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||
wt = _("Export error")
|
||||
msg_t = _("Export failed! Please try again")
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
else:
|
||||
|
||||
# img_w, img_i, w_title, w_txt hand over
|
||||
iw = r"/usr/share/icons/lx-icons/64/info.png"
|
||||
ii = r"/usr/share/icons/lx-icons/48/wg_msg.png"
|
||||
wt = _("Select tunnel")
|
||||
msg_t = _("Please first import tunnel")
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
|
||||
def if_tip(path):
|
||||
"""
|
||||
method that writes in file whether tooltip is displayed or not
|
||||
"""
|
||||
with open(path, "r", encoding="utf-8") as set_file2:
|
||||
lines2 = set_file2.readlines()
|
||||
if "False\n" in lines2:
|
||||
tip = False
|
||||
else:
|
||||
tip = True
|
||||
return tip
|
||||
|
||||
class Tooltip:
|
||||
"""
|
||||
class for Tooltip
|
||||
|
||||
imoprt Tooltip
|
||||
|
||||
example: Tooltip(label, "Show tooltip on label")
|
||||
examble: Tooltip(button, "Show tooltip on button")
|
||||
info: label and button is parrent.
|
||||
"""
|
||||
def __init__(self, widget, text):
|
||||
self.widget = widget
|
||||
self.text = text
|
||||
self.tooltip_window = None
|
||||
self.widget.bind("<Enter>", self.show_tooltip)
|
||||
self.widget.bind("<Leave>", self.hide_tooltip)
|
||||
|
||||
def show_tooltip(self, event=None):
|
||||
if self.tooltip_window or not self.text:
|
||||
return
|
||||
|
||||
x, y, _, _ = self.widget.bbox("insert")
|
||||
x += self.widget.winfo_rootx() + 25
|
||||
y += self.widget.winfo_rooty() + 20
|
||||
self.tooltip_window = tw = tk.Toplevel(self.widget)
|
||||
tw.wm_overrideredirect(True)
|
||||
tw.wm_geometry(f"+{x}+{y}")
|
||||
|
||||
label = tk.Label(tw, text=self.text, relief="solid", borderwidth=1, padx=5, pady=5)
|
||||
label.grid()
|
||||
|
||||
def hide_tooltip(self, event=None):
|
||||
if self.tooltip_window:
|
||||
self.tooltip_window.destroy()
|
||||
self.tooltip_window = None
|
||||
|
||||
|
203
install
@ -6,56 +6,79 @@ BLUE='\033[30;1;34m'
|
||||
|
||||
install_file_with(){
|
||||
clear
|
||||
mkdir -p ~/.config/wire_py && touch ~/.config/wire_py/keys && cp -u settings ~/.config/wire_py/ && \
|
||||
mkdir -p ~/.config/systemd/user && cp -u wg_start.service ~/.config/systemd/user/ && \
|
||||
systemctl --user enable wg_start.service >/dev/null 2>&1
|
||||
sudo cp -f org.sslcrypt.policy /usr/share/polkit-1/actions/
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
systemctl --user disable wg_start.service
|
||||
rm -r ~/.config/wire_py && rm -r ~/.config/systemd
|
||||
exit 0
|
||||
else
|
||||
sudo apt install python3-tk && \
|
||||
sudo cp -u wg_main.py start_wg.py wg_func.py wirepy.py run_as open_gitea.py /usr/bin/ && \
|
||||
sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && sudo cp -u settings.conf /etc/wire_py/ && \
|
||||
sudo cp -uR wp-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
|
||||
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
|
||||
sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
|
||||
sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \
|
||||
sudo cp -u Wire-Py.desktop /usr/share/applications/ && \
|
||||
sudo cp -u wg_start.service /lib/systemd/system/ && \
|
||||
sudo systemctl enable wg_start.service
|
||||
sudo cp -fv wirepy.py start_wg.py cls_mth_fc.py ssl_encrypt.py ssl_decrypt.py /usr/local/bin/ && \
|
||||
sudo cp -uR lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
|
||||
sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
|
||||
sudo cp -fv Wire-Py.desktop /usr/share/applications/ && \
|
||||
sudo ln -sf /usr/local/bin/wirepy.py /usr/local/bin/wirepy
|
||||
sudo mkdir -p /usr/local/etc/ssl
|
||||
if [ ! -f /usr/local/etc/ssl/pwgk.pem ]
|
||||
then
|
||||
sudo openssl genrsa -out /usr/local/etc/ssl/pwgk.pem 4096
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
install_arch_d(){
|
||||
clear
|
||||
mkdir -p ~/.config/wire_py && touch ~/.config/wire_py/keys && cp -u settings ~/.config/wire_py/ && \
|
||||
mkdir -p ~/.config/systemd/user && cp -u wg_start.service ~/.config/systemd/user/ && \
|
||||
systemctl --user enable wg_start.service >/dev/null 2>&1
|
||||
sudo cp -f org.sslcrypt.policy /usr/share/polkit-1/actions/
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
systemctl --user disable wg_start.service
|
||||
rm -r ~/.config/wire_py && rm -r ~/.config/systemd
|
||||
exit 0
|
||||
else
|
||||
sudo pacman -S --noconfirm tk python3 python-requests && \
|
||||
sudo cp -u wg_main.py start_wg.py wg_func.py wirepy.py run_as open_gitea.py /usr/bin/ && \
|
||||
sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && sudo cp -u settings.conf /etc/wire_py/ && \
|
||||
sudo cp -uR wp-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
|
||||
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
|
||||
sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
|
||||
sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \
|
||||
sudo cp -u Wire-Py.desktop /usr/share/applications/ && \
|
||||
sudo cp -u wg_start.service /lib/systemd/system/ && \
|
||||
sudo systemctl enable wg_start.service
|
||||
sudo cp -fv wirepy.py start_wg.py cls_mth_fc.py ssl_encrypt.py ssl_decrypt.py /usr/local/bin/ && \
|
||||
sudo cp -uR lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
|
||||
sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
|
||||
sudo cp -fv Wire-Py.desktop /usr/share/applications/ && \
|
||||
sudo ln -sf /usr/local/bin/wirepy.py /usr/local/bin/wirepy
|
||||
sudo mkdir -p /usr/local/etc/ssl
|
||||
if [ ! -f /usr/local/etc/ssl/pwgk.pem ]
|
||||
then
|
||||
sudo openssl genrsa -out /usr/local/etc/ssl/pwgk.pem 4096
|
||||
fi
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
install(){
|
||||
if grep -i 'debian' /etc/os-release > /dev/null 2>&1
|
||||
then
|
||||
groups > /tmp/isgroup
|
||||
if grep 'sudo' /tmp/isgroup
|
||||
then
|
||||
install_file_with
|
||||
|
||||
else
|
||||
|
||||
echo -e "$BLUE"The installer found that they are not in the group sudo.""
|
||||
echo -e "with "$RED"su -"$BLUE" "they can enter the root shell in which they then""
|
||||
echo -e "enter "$GREEN""usermod -aG sudo $USER.""$BLUE""
|
||||
echo -e ""after logging in from the system, they can then run Wire-Py install again." $NORMAL"
|
||||
read -n 1 -s -r -p $"To close the Window press a button"
|
||||
read -n 1 -s -r -p $"Press Enter to exit"
|
||||
clear
|
||||
exit 0
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
elif grep -i 'mint\|ubuntu\|pop|' /etc/os-release > /dev/null 2>&1
|
||||
then
|
||||
install_file_with
|
||||
|
||||
|
||||
elif grep -i 'arch' /etc/os-release > /dev/null 2>&1
|
||||
then
|
||||
groups > /tmp/isgroup
|
||||
@ -73,7 +96,7 @@ elif grep -i 'arch' /etc/os-release > /dev/null 2>&1
|
||||
echo "remove '#' on # %wheel ALL=(ALL) ALL and save the file"
|
||||
echo -e "then enter "$GREEN"gpasswd -a $USER wheel.""$NORMAL"
|
||||
echo "after logging in from the system, they can then run Wire-Py install again."
|
||||
read -n 1 -s -r -p $"To close the Window press a button"
|
||||
read -n 1 -s -r -p $"Press Enter to exit"
|
||||
clear
|
||||
exit 0
|
||||
|
||||
@ -83,49 +106,123 @@ elif grep -i '|manjaro\|garuda\|endeavour|' /etc/os-release > /dev/null 2>&1
|
||||
then
|
||||
install_arch_d
|
||||
|
||||
|
||||
elif grep -i 'fedora' /etc/os-release > /dev/null 2>&1
|
||||
then
|
||||
if ! which python3-tkinter &> /dev/null
|
||||
then sudo dnf install python3-tkinter -y
|
||||
|
||||
sudo cp -u wg_main.py start_wg.py wg_func.py wirepy.py run_as open_gitea.py /usr/bin/ && \
|
||||
sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && \
|
||||
sudo cp -u settings.conf /etc/wire_py/ && \
|
||||
sudo cp -uR wp-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
|
||||
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
|
||||
sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
|
||||
sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \
|
||||
sudo cp -u Wire-Py.desktop /usr/share/applications/ && \
|
||||
sudo cp -u wg_start.service /lib/systemd/system/ && \
|
||||
sudo systemctl enable wg_start.service
|
||||
clear
|
||||
mkdir -p ~/.config/wire_py && touch ~/.config/wire_py/keys && cp -u settings ~/.config/wire_py/ && \
|
||||
mkdir -p ~/.config/systemd/user && cp -u wg_start.service ~/.config/systemd/user/ && \
|
||||
systemctl --user enable wg_start.service >/dev/null 2>&1
|
||||
sudo cp -f org.sslcrypt.policy /usr/share/polkit-1/actions/
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
systemctl --user disable wg_start.service
|
||||
rm -r ~/.config/wire_py && rm -r ~/.config/systemd
|
||||
exit 0
|
||||
else
|
||||
sudo dnf install python3-tkinter -y
|
||||
sudo cp -fv wirepy.py start_wg.py cls_mth_fc.py ssl_encrypt.py ssl_decrypt.py /usr/local/bin/ && \
|
||||
sudo cp -uR lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
|
||||
sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
|
||||
sudo cp -fv Wire-Py.desktop /usr/share/applications/ && \
|
||||
sudo ln -sf /usr/local/bin/wirepy.py /usr/local/bin/wirepy
|
||||
sudo mkdir -p /usr/local/etc/ssl
|
||||
if [ ! -f /usr/local/etc/ssl/pwgk.pem ]
|
||||
then
|
||||
sudo openssl genrsa -out /usr/local/etc/ssl/pwgk.pem 4096
|
||||
fi
|
||||
|
||||
fi
|
||||
elif grep -i 'suse' /etc/os-release > /dev/null 2>&1
|
||||
then
|
||||
if ! which python311-tk &> /dev/null
|
||||
then sudo zypper install python311-tk
|
||||
sudo cp -u wg_main.py start_wg.py wg_func.py wirepy.py run_as open_gitea.py /usr/bin/ && \
|
||||
sudo mkdir -p /etc/wire_py && sudo touch /etc/wire_py/.keys && \
|
||||
sudo cp -u settings.conf /etc/wire_py/ && \
|
||||
sudo cp -uR wp-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
|
||||
sudo chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
|
||||
sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
|
||||
sudo cp -u org.wirepy.policy /usr/share/polkit-1/actions/ && \
|
||||
sudo cp -u Wire-Py.desktop /usr/share/applications/ && \
|
||||
sudo cp -u wg_start.service /lib/systemd/system/ && \
|
||||
sudo systemctl enable wg_start.service
|
||||
clear
|
||||
mkdir -p ~/.config/wire_py && touch ~/.config/wire_py/keys && cp -u settings ~/.config/wire_py/ && \
|
||||
mkdir -p ~/.config/systemd/user && cp -u wg_start.service ~/.config/systemd/user/ && \
|
||||
systemctl --user enable wg_start.service >/dev/null 2>&1
|
||||
sudo cp -f org.sslcrypt.policy /usr/share/polkit-1/actions/
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
systemctl --user disable wg_start.service
|
||||
rm -r ~/.config/wire_py && rm -r ~/.config/systemd
|
||||
exit 0
|
||||
else
|
||||
sudo cp -fv wirepy.py start_wg.py cls_mth_fc.py ssl_encrypt.py ssl_decrypt.py /usr/local/bin/ && \
|
||||
sudo cp -uR lx-icons /usr/share/icons/ && sudo cp -uR TK-Themes /usr/share/ && \
|
||||
sudo cp -u languages/de/*.mo /usr/share/locale/de/LC_MESSAGES/ && \
|
||||
sudo cp -fv Wire-Py.desktop /usr/share/applications/ && \
|
||||
sudo ln -sf /usr/local/bin/wirepy.py /usr/local/bin/wirepy
|
||||
sudo mkdir -p /usr/local/etc/ssl
|
||||
if [ ! -f /usr/local/etc/ssl/pwgk.pem ]
|
||||
then
|
||||
sudo openssl genrsa -out /usr/local/etc/ssl/pwgk.pem 4096
|
||||
fi
|
||||
if grep -i 'Tumbleweed' /etc/os-release > /dev/null 2>&1
|
||||
then
|
||||
sudo zypper install python313-tk
|
||||
else
|
||||
sudo zypper install python36-tk
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
clear
|
||||
echo $"Your System could not be determined."
|
||||
echo
|
||||
read -n 1 -s -r -p $"To close the window press a button"
|
||||
read -n 1 -s -r -p $"Press Enter to exit"
|
||||
clear
|
||||
exit 0
|
||||
|
||||
fi
|
||||
clear
|
||||
read -n 1 -s -r -p $"To close the Window press a button"
|
||||
#clear
|
||||
read -n 1 -s -r -p $"Press Enter to exit"
|
||||
clear
|
||||
|
||||
}
|
||||
|
||||
remove(){
|
||||
sudo rm -f /usr/local/bin/wirepy /usr/local/bin/wirepy.py /usr/local/bin/start_wg.py \
|
||||
/usr/local/bin/cls_mth_fc.py /usr/local/bin/ssl_encrypt.py /usr/local/bin/ssl_decrypt.py
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
exit 0
|
||||
else
|
||||
systemctl --user disable wg_start.service
|
||||
rm -r ~/.config/wire_py && rm -r ~/.config/systemd
|
||||
sudo rm /usr/share/applications/Wire-Py.desktop
|
||||
sudo rm /usr/share/locale/de/LC_MESSAGES/languages/de/wirepy.mo
|
||||
sudo rm -r /usr/local/etc/ssl
|
||||
which syncpy >/dev/null
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
sudo rm -r /usr/share/icons/lx-icons && sudo rm -r /usr/share/TK-Themes
|
||||
|
||||
fi
|
||||
|
||||
echo
|
||||
read -p "Press Enter to exit..."
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
which wirepy >/dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "Do you want to update/reinstall or uninstall wirepy?"
|
||||
echo
|
||||
echo "Update/reinstall: press y, uninstall press r"
|
||||
echo
|
||||
read -n 1 -s -r -p "Cancel with any other key..." result
|
||||
case $result in
|
||||
[y]* ) clear; install; exit;;
|
||||
[Y]* ) clear; install; exit;;
|
||||
[j]* ) clear; install; exit;;
|
||||
[J]* ) clear; install; exit;;
|
||||
[r]* ) clear; remove; exit;;
|
||||
[R]* ) clear; remove; exit;;
|
||||
esac
|
||||
clear
|
||||
else
|
||||
install
|
||||
|
||||
fi
|
BIN
languages/de/wirepy.mo
Normal file
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import webbrowser
|
||||
|
||||
webbrowser.open('https://git.ilunix.de/punix/Wire-Py')
|
42
org.sslcrypt.policy
Normal file
@ -0,0 +1,42 @@
|
||||
<?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">
|
||||
|
||||
<!--
|
||||
Policy definitions for ssl_encrypt and ssl_decrypt
|
||||
|
||||
Copyright (C) 2025 Désiré Werner Menrath <polunga40@unity-mail.de>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<policyconfig>
|
||||
<action id="org.ssl_encrypt">
|
||||
<defaults>
|
||||
<allow_any>auth_admin_keep</allow_any>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/local/bin/ssl_encrypt.py</annotate>
|
||||
</action>
|
||||
|
||||
<action id="org.ssl_decrypt">
|
||||
<defaults>
|
||||
<allow_any>auth_admin_keep</allow_any>
|
||||
<allow_inactive>auth_admin_keep</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/local/bin/ssl_decrypt.py</annotate>
|
||||
|
||||
</action>
|
||||
</policyconfig>
|
@ -1,16 +0,0 @@
|
||||
<?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>
|
||||
<vendor>Project Wire-Py</vendor>
|
||||
<vendor_url>https://git.ilunix.de/punix/Wire-Py</vendor_url>
|
||||
<icon_name>wg-vpn</icon_name>
|
||||
<action id="org.wirepy">
|
||||
<defaults>
|
||||
<allow_any>auth_admin_keep</allow_any>
|
||||
<allow_inactive>auth_admin_keep</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/wg_main.py</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
</policyconfig>
|
59
ssl_decrypt.py
Executable file
@ -0,0 +1,59 @@
|
||||
#!/usr/bin/python3
|
||||
""" This Script decrypt Wireguardfiles for Wirepy users """
|
||||
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from subprocess import check_call
|
||||
|
||||
uname = Path("/tmp/.loguser")
|
||||
|
||||
with open(uname, "r", encoding="utf-8") as f:
|
||||
logname = f.readline()
|
||||
|
||||
# Dirname "tlecdewg" = Tunnel Encrypt Decrypt Wireguard
|
||||
dirname = Path("/tmp/tlecdcwg/")
|
||||
keyfile = Path(f"/home/{logname}/.config/wire_py/pbwgk.pem")
|
||||
PKEYFILE = "/usr/local/etc/ssl/pwgk.pem"
|
||||
|
||||
if not keyfile.is_file():
|
||||
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
"rsa",
|
||||
"-in",
|
||||
PKEYFILE,
|
||||
"-out",
|
||||
keyfile,
|
||||
"-outform",
|
||||
"PEM",
|
||||
"-pubout",
|
||||
]
|
||||
)
|
||||
shutil.chown(keyfile, 1000, 1000)
|
||||
|
||||
dirname2 = "/home/" + logname + "/.config/wire_py/"
|
||||
detl = os.listdir(dirname2)
|
||||
os.chdir(dirname2)
|
||||
detl.remove("keys")
|
||||
detl.remove("settings")
|
||||
if os.path.exists(dirname2 + "pbwgk.pem"):
|
||||
detl.remove("pbwgk.pem")
|
||||
for detunnels in detl:
|
||||
tlname2 = detunnels[:-4] + ".conf"
|
||||
extpath = str(dirname) + "/" + tlname2
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
"pkeyutl",
|
||||
"-decrypt",
|
||||
"-inkey",
|
||||
PKEYFILE,
|
||||
"-in",
|
||||
detunnels,
|
||||
"-out",
|
||||
extpath,
|
||||
]
|
||||
)
|
||||
shutil.chown(extpath, 1000, 1000)
|
83
ssl_encrypt.py
Executable file
@ -0,0 +1,83 @@
|
||||
#!/usr/bin/python3
|
||||
""" This Script encrypt Wireguardfiles for Wirepy users for more Security """
|
||||
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from subprocess import check_call
|
||||
|
||||
uname = Path("/tmp/.loguser")
|
||||
|
||||
with open(uname, "r", encoding="utf-8") as f:
|
||||
logname = f.readline()
|
||||
|
||||
keyfile = Path(f"/home/{logname}/.config/wire_py/pbwgk.pem")
|
||||
dirname = Path("/tmp/tlecdcwg/")
|
||||
PKEYFILE = "/usr/local/etc/ssl/pwgk.pem"
|
||||
|
||||
if not keyfile.is_file():
|
||||
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
"rsa",
|
||||
"-in",
|
||||
PKEYFILE,
|
||||
"-out",
|
||||
keyfile,
|
||||
"-outform",
|
||||
"PEM",
|
||||
"-pubout",
|
||||
]
|
||||
)
|
||||
shutil.chown(keyfile, 1000, 1000)
|
||||
|
||||
if dirname.exists():
|
||||
tl = os.listdir(str(dirname))
|
||||
CPTH = str(keyfile)
|
||||
CRYPTFILES = CPTH[:-9]
|
||||
|
||||
if keyfile.exists() and len(tl) != 0:
|
||||
for tunnels in tl:
|
||||
sourcetl = str(dirname) + "/" + tunnels
|
||||
tlname = CRYPTFILES + tunnels[:-5] + ".dat"
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
"pkeyutl",
|
||||
"-encrypt",
|
||||
"-inkey",
|
||||
keyfile,
|
||||
"-pubin",
|
||||
"-in",
|
||||
sourcetl,
|
||||
"-out",
|
||||
tlname,
|
||||
]
|
||||
)
|
||||
|
||||
else:
|
||||
|
||||
if dirname.exists():
|
||||
tl = os.listdir(str(dirname))
|
||||
CPTH = str(keyfile)
|
||||
CRYPTFILES = CPTH[:-9]
|
||||
|
||||
if keyfile.exists() and len(tl) != 0:
|
||||
for tunnels in tl:
|
||||
sourcetl = str(dirname) + "/" + tunnels
|
||||
tlname = CRYPTFILES + tunnels[:-5] + ".dat"
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
"pkeyutl",
|
||||
"-encrypt",
|
||||
"-inkey",
|
||||
keyfile,
|
||||
"-pubin",
|
||||
"-in",
|
||||
sourcetl,
|
||||
"-out",
|
||||
tlname,
|
||||
]
|
||||
)
|
16
start_wg.py
@ -1,14 +1,18 @@
|
||||
#!/usr/bin/python3
|
||||
from subprocess import check_call
|
||||
"""
|
||||
This script belongs to wirepy and is for the auto start of the tunnel
|
||||
"""
|
||||
from pathlib import Path
|
||||
from subprocess import check_call
|
||||
|
||||
path_to_file = Path('/etc/wire_py/settings.conf')
|
||||
path_to_file = Path(Path.home() / ".config/wire_py/settings")
|
||||
|
||||
with open(path_to_file, 'r') as a_con:
|
||||
with open(path_to_file, "r", encoding="utf-8") as a_con:
|
||||
|
||||
# This funtion is for the independent autostart of the previously selected tunnel
|
||||
lines = a_con.readlines()
|
||||
a_con = lines[7].strip()
|
||||
if a_con != 'off':
|
||||
check_call(['nmcli', 'connection', 'up', a_con])
|
||||
if a_con != "off":
|
||||
check_call(["nmcli", "connection", "up", a_con])
|
||||
else:
|
||||
pass
|
||||
|
||||
|
267
wg_func.py
@ -1,267 +0,0 @@
|
||||
""" Wireguard Classes and Method for Wire-Py """
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
import tkinter as tk
|
||||
import zipfile
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from subprocess import check_call
|
||||
from tkinter import ttk
|
||||
import requests
|
||||
|
||||
|
||||
''' 1 = 1. Year, 09 = Month of the Year, 2924 = Day and Year of the Year '''
|
||||
version = 'v. 1.11.0824'
|
||||
|
||||
path_to_file2 = Path('/etc/wire_py/settings.conf')
|
||||
_u = Path.read_text(Path('/tmp/_u'))
|
||||
|
||||
UPDATE_API_URL = 'https://git.ilunix.de/api/v1/repos/punix/Wire-Py/releases'
|
||||
|
||||
|
||||
class WirePyUpdate:
|
||||
@staticmethod
|
||||
def api_down():
|
||||
try:
|
||||
response = requests.get(UPDATE_API_URL)
|
||||
response_dict = response.json()
|
||||
response_dict = response_dict[0]
|
||||
with open(path_to_file2, 'r') as set_file:
|
||||
set_file = set_file.read()
|
||||
if 'on\n' in set_file:
|
||||
if version[3:] != response_dict['tag_name']:
|
||||
return response_dict['tag_name']
|
||||
else:
|
||||
return 'No Updates'
|
||||
else:
|
||||
return 'False'
|
||||
except requests.exceptions.ConnectionError:
|
||||
return 'No Internet Connection!'
|
||||
|
||||
@staticmethod
|
||||
def download():
|
||||
try:
|
||||
url = f'https://git.ilunix.de/punix/Wire-Py/archive/{res}.zip'
|
||||
to_down = 'wget -qP ' + str(_u) + ' ' + url
|
||||
result = subprocess.call(to_down, shell=True)
|
||||
if result == 0:
|
||||
shutil.chown(str(_u) + f'/{res}.zip', 1000, 1000)
|
||||
"""img_w, img_i, w_title, w_txt hand over"""
|
||||
iw = r'/usr/share/icons/wp-icons/64/info.png'
|
||||
ii = r'/usr/share/icons/wp-icons/48/wg_vpn.png'
|
||||
wt = 'Download Successful'
|
||||
msg_t = 'Your zip file is in home directory'
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
else:
|
||||
"""img_w, img_i, w_title, w_txt hand over"""
|
||||
iw = r'/usr/share/icons/wp-icons/64/error.png'
|
||||
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
|
||||
wt = 'Download error'
|
||||
msg_t = 'Download failed! Please try again'
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
except subprocess.CalledProcessError:
|
||||
"""img_w, img_i, w_title, w_txt hand over"""
|
||||
iw = r'/usr/share/icons/wp-icons/64/error.png'
|
||||
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
|
||||
wt = 'Download error'
|
||||
msg_t = 'Download failed! No internet connection!'
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
|
||||
res = WirePyUpdate.api_down()
|
||||
|
||||
|
||||
|
||||
def msg_window(img_w, img_i, w_title, w_txt, txt2=None, com=None):
|
||||
"""
|
||||
Function for different message windows for the user. with 4 arguments to be passed.
|
||||
To create messages with your own images, icons, and titles. As an alternative to Python Messagebox.
|
||||
Paths to images must be specified: r'/usr/share/icons/wp-icons/64/info.png'
|
||||
img_w = Image for Tk Window
|
||||
img_i = Image for Icon
|
||||
w_title = Windows Title
|
||||
w_txt = Text for Tk Window
|
||||
"""
|
||||
|
||||
msg = tk.Toplevel()
|
||||
msg.resizable(width=False, height=False)
|
||||
msg.title(w_title)
|
||||
msg.configure(pady=15, padx=15)
|
||||
msg.img = tk.PhotoImage(file=img_w)
|
||||
msg.i_window = tk.Label(msg, image=msg.img)
|
||||
|
||||
label = tk.Label(msg, text=w_txt)
|
||||
|
||||
label.grid(column=1, row=0)
|
||||
|
||||
if txt2 != None and com != None:
|
||||
label.config(font=('Ubuntu', 11), padx=15, justify='left')
|
||||
msg.i_window.grid(column=0, row=0, sticky='nw')
|
||||
button2 = ttk.Button(msg, text=f'{txt2}', command=com, padding=4)
|
||||
button2.grid(column=0, row=1, sticky='e', columnspan=2)
|
||||
button = ttk.Button(msg, text='OK', command=msg.destroy, padding=4)
|
||||
button.grid(column=0, row=1, sticky='w', columnspan=2)
|
||||
|
||||
else:
|
||||
label.config(font=('Ubuntu', 11), padx=15)
|
||||
msg.i_window.grid(column=0, row=0)
|
||||
button = ttk.Button(msg, text='OK', command=msg.destroy, padding=4)
|
||||
button.grid(column=0, columnspan=2, row=1)
|
||||
|
||||
img_i = tk.PhotoImage(file=img_i)
|
||||
msg.iconphoto(True, img_i)
|
||||
msg.columnconfigure(0, weight=1)
|
||||
msg.rowconfigure(0, weight=1)
|
||||
msg.winfo_toplevel()
|
||||
|
||||
|
||||
class Tunnel:
|
||||
|
||||
"""
|
||||
Class of Methods for Wire-Py
|
||||
"""
|
||||
|
||||
"""
|
||||
The config file is packed into a dictionary,
|
||||
to display the values Address , DNS and Peer in the labels
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def con_to_dict(cls, file):
|
||||
|
||||
dictlist = []
|
||||
for lines in file.readlines():
|
||||
line_plit = lines.split()
|
||||
dictlist = dictlist + line_plit
|
||||
dictlist.remove('[Interface]')
|
||||
dictlist.remove('[Peer]')
|
||||
for items in dictlist:
|
||||
if items == '=':
|
||||
dictlist.remove(items)
|
||||
|
||||
''' Here is the beginning (Loop) of convert List to Dictionary '''
|
||||
for _ in dictlist:
|
||||
a = [dictlist[0], dictlist[1]]
|
||||
b = [dictlist[2], dictlist[3]]
|
||||
c = [dictlist[4], dictlist[5]]
|
||||
d = [dictlist[6], dictlist[7]]
|
||||
e = [dictlist[8], dictlist[9]]
|
||||
f = [dictlist[10], dictlist[11]]
|
||||
g = [dictlist[12], dictlist[13]]
|
||||
h = [dictlist[14], dictlist[15]]
|
||||
new_list = [a, b, c, d, e, f, g, h]
|
||||
final_dict = {}
|
||||
for elements in new_list:
|
||||
final_dict[elements[0]] = elements[1]
|
||||
|
||||
''' end... result a Dictionary '''
|
||||
|
||||
address = final_dict['Address']
|
||||
dns = final_dict['DNS']
|
||||
if ',' in dns:
|
||||
dns = dns[:-1]
|
||||
endpoint = final_dict['Endpoint']
|
||||
if 'PresharedKey' in final_dict:
|
||||
pre_key = final_dict['PresharedKey']
|
||||
else:
|
||||
pre_key = final_dict['PreSharedKey']
|
||||
return address, dns, endpoint, pre_key
|
||||
|
||||
|
||||
"""
|
||||
Shows the Active Tunnel
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def active():
|
||||
|
||||
active = os.popen('nmcli con show --active | grep -iPo "(.*)(wireguard)"').read().split()
|
||||
if not active:
|
||||
active = ''
|
||||
else:
|
||||
active = active[0]
|
||||
|
||||
return active
|
||||
|
||||
"""
|
||||
Shows all existing Wireguard tunnels
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def list():
|
||||
wg_s = os.popen('nmcli con show | grep -iPo "(.*)(wireguard)"').read().split()
|
||||
|
||||
''' tl = Tunnel list # Show of 4.Element in list '''
|
||||
tl = wg_s[::3]
|
||||
return tl
|
||||
|
||||
|
||||
"""
|
||||
This will export the tunnels.
|
||||
A zipfile with current date and time is created
|
||||
in the user's home directory with correct right
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def export():
|
||||
_u1 = str(_u[6:])
|
||||
now_time = datetime.now()
|
||||
now_datetime = now_time.strftime('wg-exp-' + '%m-%d-%Y' + '-' + '%H:%M')
|
||||
tl = Tunnel.list()
|
||||
|
||||
try:
|
||||
if len(tl) != 0:
|
||||
wg_tar = str(_u) + '/' + now_datetime
|
||||
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)
|
||||
Path.unlink(Path(source) / 'settings.conf', 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"""
|
||||
iw = r'/usr/share/icons/wp-icons/64/info.png'
|
||||
ii = r'/usr/share/icons/wp-icons/48/wg_vpn.png'
|
||||
wt = 'Export Successful'
|
||||
msg_t = 'Your zip file is in home directory'
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
else:
|
||||
|
||||
"""img_w, img_i, w_title, w_txt hand over"""
|
||||
iw = r'/usr/share/icons/wp-icons/64/error.png'
|
||||
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'
|
||||
wt = 'Export error'
|
||||
msg_t = 'Export failed! Please try again'
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
else:
|
||||
|
||||
"""img_w, img_i, w_title, w_txt hand over"""
|
||||
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.'
|
||||
msg_window(iw, ii, wt, msg_t)
|
||||
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def if_tip():
|
||||
with open(path_to_file2, 'r') as set_file2:
|
||||
lines2 = set_file2.readlines()
|
||||
if 'False\n' in lines2:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
tips = Tunnel.if_tip()
|
1137
wg_main.py
@ -5,6 +5,6 @@ After=network-online.target
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=/bin/sleep 5
|
||||
ExecStart=/usr/bin/start_wg.py
|
||||
ExecStart=/usr/local/bin/start_wg.py
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=default.target
|
||||
|