28-09-2024 #15

Merged
punix merged 28 commits from 28-09-2024 into main 2024-09-28 14:17:38 +02:00
3 changed files with 19 additions and 24 deletions
Showing only changes of commit ad59c3ba00 - Show all commits

View File

@ -4,11 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="fix rename in Messagebox warning to error">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Wire-Py.desktop" beforeDir="false" afterPath="$PROJECT_DIR$/Wire-Py.desktop" afterDir="false" />
<change beforePath="$PROJECT_DIR$/install" beforeDir="false" afterPath="$PROJECT_DIR$/install" afterDir="false" />
<change beforePath="$PROJECT_DIR$/org.wirepy.policy" beforeDir="false" afterPath="$PROJECT_DIR$/org.wirepy.policy" afterDir="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" />
</list>
@ -417,7 +415,15 @@
<option name="project" value="LOCAL" />
<updated>1726652747322</updated>
</task>
<option name="localTasksCounter" value="36" />
<task id="LOCAL-00036" summary="set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open">
<option name="closed" value="true" />
<created>1726691611936</created>
<option name="number" value="00036" />
<option name="presentableId" value="LOCAL-00036" />
<option name="project" value="LOCAL" />
<updated>1726691611936</updated>
</task>
<option name="localTasksCounter" value="37" />
<servers />
</component>
<component name="UnknownFeatures">
@ -458,7 +464,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="Set Style to Clam&#10;Improved layout of widgets" />
<MESSAGE value="Remove open file function, add Show Address Labels with tk.StrVar when remove a not active Tunnel Labels of Active Tunnel removed!" />
<MESSAGE value="fixed error when active tunnel is deleted,&#10;now also the Address Label is emptied" />
<MESSAGE value="In FrameWidged Class else Block StrVar, this resorts reference and variable assignment together" />
@ -483,7 +488,8 @@
<MESSAGE value="install fix for set dir right" />
<MESSAGE value="fix checkbox disable and policy rename main.py to wg_main.py" />
<MESSAGE value="fix rename in Messagebox warning to error" />
<option name="LAST_COMMIT_MESSAGE" value="fix rename in Messagebox warning to error" />
<MESSAGE value="set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" />
<option name="LAST_COMMIT_MESSAGE" value="set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -493,11 +499,6 @@
<line>1</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/wg_func.py</url>
<line>11</line>
<option name="timeStamp" value="2" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>

16
install
View File

@ -4,28 +4,22 @@ which sudo >/dev/null
if [ $? -ne 0 ]
then
su -
apt install python3-tk -y && apt install tcl-ttkthemes -y && \
apt install python3-tk -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/ && \
chown -R root:root /etc/wire_py && sudo chmod 755 /etc/wire_py && \
if [ ! -f /usr/local/bin/wirepy ]
then
ln -s /usr/bin/wirepy.py /usr/local/bin/wirepy >/dev/null
fi
chown -R root:root /etc/wire_py && chmod 755 /etc/wire_py && \
ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy >/dev/null && \
cp org.wirepy.policy /usr/share/polkit-1/actions/ && \
cp Wire-Py.desktop /usr/share/applications/ && \
cp wg_start.services /lib/systemd/system/ && \
systemctl enable wg_start.service
else
sudo apt install python3-tk && sudo apt install tcl-ttkthemes && \
sudo apt install python3-tk && \
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/ && \
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
sudo ln -sf /usr/bin/wirepy.py /usr/local/bin/wirepy && \
sudo cp org.wirepy.policy /usr/share/polkit-1/actions/ && \
sudo cp Wire-Py.desktop /usr/share/applications/ && \
sudo cp wg_start.service /lib/systemd/system/ && \

View File

@ -184,7 +184,7 @@ class ImportTunnel:
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('/')
@ -224,7 +224,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)
if 'PrivateKey = ' not in read:
msg_window()
except EOFError: