Merge pull request #23 from b068931cc450442b63f5b3d276ea4297/master
python venv to fix some problems
This commit is contained in:
commit
08c7c82919
@ -2,10 +2,10 @@ ipwhois==1.2.0
|
|||||||
pydig==0.4.0
|
pydig==0.4.0
|
||||||
pymisp==2.4.165.1
|
pymisp==2.4.165.1
|
||||||
netaddr==0.8.0
|
netaddr==0.8.0
|
||||||
pyyaml==5.3.1
|
pyyaml==6.0.1
|
||||||
flask==2.3.3
|
flask==2.3.3
|
||||||
flask_httpauth==4.7.0
|
flask_httpauth==4.7.0
|
||||||
pyjwt==1.7.1
|
pyjwt==2.8.0
|
||||||
sqlalchemy==1.4.44
|
sqlalchemy==1.4.44
|
||||||
psutil==5.8.0
|
psutil==5.8.0
|
||||||
pyudev==0.24.0
|
pyudev==0.24.0
|
||||||
|
19
install.sh
19
install.sh
@ -3,7 +3,7 @@
|
|||||||
CURRENT_USER="${SUDO_USER}"
|
CURRENT_USER="${SUDO_USER}"
|
||||||
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
||||||
HOST="$( hostname )"
|
HOST="$( hostname )"
|
||||||
LOCALES=(en fr es ru pt de it)
|
LOCALES=(de en es fr it pt ru)
|
||||||
|
|
||||||
welcome_screen() {
|
welcome_screen() {
|
||||||
cat << "EOF"
|
cat << "EOF"
|
||||||
@ -66,8 +66,8 @@ set_credentials() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create_directory() {
|
create_directory() {
|
||||||
# Create the Spyguard directory and move the whole stuff there.
|
# Create the SpyGuard directory and move the whole stuff there.
|
||||||
echo -e "[+] Creating Spyguard folder under /usr/share/"
|
echo -e "[+] Creating SpyGuard folder under /usr/share/"
|
||||||
mkdir /usr/share/spyguard
|
mkdir /usr/share/spyguard
|
||||||
cp -Rf ./* /usr/share/spyguard
|
cp -Rf ./* /usr/share/spyguard
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ Description=Spyguard frontend service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
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
|
Restart=on-abort
|
||||||
KillMode=process
|
KillMode=process
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ Description=Spyguard backend service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
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
|
Restart=on-abort
|
||||||
KillMode=process
|
KillMode=process
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ After=network-online.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
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
|
Restart=on-abort
|
||||||
KillMode=process
|
KillMode=process
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ check_dependencies() {
|
|||||||
"/usr/bin/dig"
|
"/usr/bin/dig"
|
||||||
"/usr/bin/suricata"
|
"/usr/bin/suricata"
|
||||||
"/usr/bin/sqlite3"
|
"/usr/bin/sqlite3"
|
||||||
"/usr/bin/pip3",
|
"/usr/bin/pip3"
|
||||||
"/usr/sbin/arp")
|
"/usr/sbin/arp")
|
||||||
|
|
||||||
echo -e "\e[39m[+] Checking dependencies...\e[39m"
|
echo -e "\e[39m[+] Checking dependencies...\e[39m"
|
||||||
@ -184,8 +184,11 @@ check_dependencies() {
|
|||||||
install_package ${bin##*/}
|
install_package ${bin##*/}
|
||||||
fi
|
fi
|
||||||
done
|
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"
|
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() {
|
get_version() {
|
||||||
|
13
uninstall.sh
13
uninstall.sh
@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
delete_folder(){
|
delete_folder(){
|
||||||
echo "[+] Deleting Spyguard folders"
|
echo "[+] Deleting SpyGuard folders"
|
||||||
rm -rf /usr/share/spyguard/
|
rm -rf /usr/share/spyguard/
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_services(){
|
delete_services(){
|
||||||
echo "[+] Deleting Spyguard services"
|
echo "[+] Deleting SpyGuard services"
|
||||||
|
|
||||||
systemctl disable spyguard-frontend &> /dev/null
|
systemctl disable spyguard-frontend &> /dev/null
|
||||||
systemctl disable spyguard-backend &> /dev/null
|
systemctl disable spyguard-backend &> /dev/null
|
||||||
@ -16,11 +16,6 @@ delete_services(){
|
|||||||
rm /lib/systemd/system/spyguard-watchers.service
|
rm /lib/systemd/system/spyguard-watchers.service
|
||||||
}
|
}
|
||||||
|
|
||||||
deleting_icon(){
|
|
||||||
echo "[+] Deleting desktop icon"
|
|
||||||
rm "/home/${SUDO_USER}/Desktop/spyguard.desktop"
|
|
||||||
}
|
|
||||||
|
|
||||||
delete_packages(){
|
delete_packages(){
|
||||||
pkgs=("tshark"
|
pkgs=("tshark"
|
||||||
"dnsutils"
|
"dnsutils"
|
||||||
@ -31,12 +26,13 @@ delete_packages(){
|
|||||||
read answer
|
read answer
|
||||||
if [[ "$answer" =~ ^([yY][eE][sS]|[yY])$ ]]
|
if [[ "$answer" =~ ^([yY][eE][sS]|[yY])$ ]]
|
||||||
then
|
then
|
||||||
|
rm -rf /var/log/suricata
|
||||||
for pkg in "${pkgs[@]}"
|
for pkg in "${pkgs[@]}"
|
||||||
do
|
do
|
||||||
apt -y remove $pkg && apt -y purge $pkg
|
apt -y remove $pkg && apt -y purge $pkg
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
apt autoremove &> /dev/null
|
apt autoremove &> /dev/null -y
|
||||||
}
|
}
|
||||||
|
|
||||||
update_hostname(){
|
update_hostname(){
|
||||||
@ -59,7 +55,6 @@ if [[ $EUID -ne 0 ]]; then
|
|||||||
else
|
else
|
||||||
delete_folder
|
delete_folder
|
||||||
delete_services
|
delete_services
|
||||||
deleting_icon
|
|
||||||
update_hostname
|
update_hostname
|
||||||
delete_packages
|
delete_packages
|
||||||
reboot_box
|
reboot_box
|
||||||
|
@ -11,7 +11,7 @@ if [ $PWD = "/usr/share/spyguard" ]; then
|
|||||||
cd /tmp/spyguard && bash update.sh
|
cd /tmp/spyguard && bash update.sh
|
||||||
elif [ $PWD = "/tmp/spyguard" ]; then
|
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/
|
mv /usr/share/spyguard/server/backend/*.pem /tmp/
|
||||||
|
|
||||||
echo "[+] Deleting the current SpyGuard folders and files."
|
echo "[+] Deleting the current SpyGuard folders and files."
|
||||||
|
Loading…
Reference in New Issue
Block a user