Merge branch 'master' into add_pl_locales

This commit is contained in:
b068931cc450442b63f5b3d276ea4297 2024-01-21 10:55:30 +01:00 committed by GitHub
commit 3da99d826e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 26 deletions

View File

@ -66,8 +66,8 @@ set_credentials() {
}
create_directory() {
# Create the Spyguard directory and move the whole stuff there.
echo -e "[+] Creating Spyguard folder under /usr/share/"
# Create the SpyGuard directory and move the whole stuff there.
echo -e "[+] Creating SpyGuard folder under /usr/share/"
mkdir /usr/share/spyguard
cp -Rf ./* /usr/share/spyguard
}
@ -90,7 +90,7 @@ Description=Spyguard frontend service
[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/share/spyguard/server/frontend/main.py
ExecStart=/usr/share/spyguard/spyguard-venv/bin/python3 /usr/share/spyguard/server/frontend/main.py
Restart=on-abort
KillMode=process
@ -105,7 +105,7 @@ Description=Spyguard backend service
[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/share/spyguard/server/backend/main.py
ExecStart=/usr/share/spyguard/spyguard-venv/bin/python3 /usr/share/spyguard/server/backend/main.py
Restart=on-abort
KillMode=process
@ -122,7 +122,7 @@ After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/share/spyguard/server/backend/watchers.py
ExecStart=/usr/share/spyguard/spyguard-venv/bin/python3 /usr/share/spyguard/server/backend/watchers.py
Restart=on-abort
KillMode=process
@ -171,7 +171,7 @@ check_dependencies() {
"/usr/bin/dig"
"/usr/bin/suricata"
"/usr/bin/sqlite3"
"/usr/bin/pip3",
"/usr/bin/pip3"
"/usr/sbin/arp")
echo -e "\e[39m[+] Checking dependencies...\e[39m"
@ -184,8 +184,11 @@ check_dependencies() {
install_package ${bin##*/}
fi
done
echo -e "\e[39m[+] Create and activate Virtual Environment for Python packages\e[39m"
python3 -m venv /usr/share/spyguard/spyguard-venv
source /usr/share/spyguard/spyguard-venv/bin/activate
echo -e "\e[39m[+] Install Python packages...\e[39m"
python3 -m pip install -r "$SCRIPT_PATH/assets/requirements.txt"
python3 -m pip install -r "$SCRIPT_PATH/assets/requirements.txt" --no-cache-dir
}
get_version() {

View File

@ -1,11 +1,11 @@
delete_folder(){
echo "[+] Deleting Spyguard folders"
echo "[+] Deleting SpyGuard folders"
rm -rf /usr/share/spyguard/
}
delete_services(){
echo "[+] Deleting Spyguard services"
echo "[+] Deleting SpyGuard services"
systemctl disable spyguard-frontend &> /dev/null
systemctl disable spyguard-backend &> /dev/null
@ -16,11 +16,6 @@ delete_services(){
rm /lib/systemd/system/spyguard-watchers.service
}
deleting_icon(){
echo "[+] Deleting desktop icon"
rm "/home/${SUDO_USER}/Desktop/spyguard.desktop"
}
delete_packages(){
pkgs=("tshark"
"dnsutils"
@ -31,12 +26,13 @@ delete_packages(){
read answer
if [[ "$answer" =~ ^([yY][eE][sS]|[yY])$ ]]
then
rm -rf /var/log/suricata
for pkg in "${pkgs[@]}"
do
apt -y remove $pkg && apt -y purge $pkg
done
fi
apt autoremove &> /dev/null
apt autoremove &> /dev/null -y
}
update_hostname(){
@ -59,7 +55,6 @@ if [[ $EUID -ne 0 ]]; then
else
delete_folder
delete_services
deleting_icon
update_hostname
delete_packages
reboot_box

View File

@ -11,7 +11,7 @@ if [ $PWD = "/usr/share/spyguard" ]; then
cd /tmp/spyguard && bash update.sh
elif [ $PWD = "/tmp/spyguard" ]; then
echo "[+] Saving spyguard backend's SSL configuration in /tmp/"
echo "[+] Saving SpyGuard backend's SSL configuration in /tmp/"
mv /usr/share/spyguard/server/backend/*.pem /tmp/
echo "[+] Deleting the current SpyGuard folders and files."