mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-19 05:19:40 +02:00
work in progress
This commit is contained in:
parent
fca068ce17
commit
bf30f44a08
2 changed files with 35 additions and 11 deletions
27
install.sh
27
install.sh
|
@ -1,13 +1,17 @@
|
|||
#/usr/bin/bash -e
|
||||
# Install procedure for Pandora-Box
|
||||
|
||||
#================================
|
||||
# Install script for Pandora-Box
|
||||
#================================
|
||||
|
||||
set -e
|
||||
cd ..
|
||||
cd ~
|
||||
|
||||
#---------------------
|
||||
# Python
|
||||
#---------------------
|
||||
apt install -y python-is-python3 python3-pip
|
||||
sudo apt install -y python-is-python3 python3-pip
|
||||
sudo apt install -y libssl-dev
|
||||
|
||||
#---------------------
|
||||
# Peotry
|
||||
|
@ -51,7 +55,6 @@ chown -R $SUDO_USER kvrocks
|
|||
# Pandora
|
||||
#---------------------
|
||||
su - $SUDO_USER -c "git clone https://github.com/pandora-analysis/pandora.git"
|
||||
cd pandorra
|
||||
|
||||
# install packages
|
||||
apt install -y python3-dev # for compiling things
|
||||
|
@ -61,16 +64,17 @@ apt install -y exiftool # for extracting exif information
|
|||
apt install -y unrar # for extracting rar files
|
||||
apt install -y libxml2-dev libxslt1-dev antiword unrtf poppler-utils pstotext tesseract-ocr flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev swig # for textract
|
||||
|
||||
# install yara-python
|
||||
su - $SUDO_USER -c "python3 -m pip show yara-python"
|
||||
|
||||
# set .env
|
||||
cd ~/pandora
|
||||
echo PANDORA_HOME="`pwd`" >> .env
|
||||
chown $SUDO_USER .env
|
||||
|
||||
su - $SUDO_USER -c "cd ~/pandora; poetry install"
|
||||
su - $SUDO_USER -c "cd ~/pandora; cp config/generic.json.sample config/generic.json"
|
||||
|
||||
# install yara-python
|
||||
su - $SUDO_USER -c "pip install yara-python"
|
||||
|
||||
# ClamAV
|
||||
apt-get install -y clamav-daemon
|
||||
# In order for the module to work, you need the signatures.
|
||||
|
@ -95,6 +99,7 @@ su - $SUDO_USER -c "cd pandora; for file in pandora/workers/*.sample; do cp -i $
|
|||
#---------------------
|
||||
# Pandora-box
|
||||
#---------------------
|
||||
cd ~/pandora-box
|
||||
|
||||
# Python libraries
|
||||
su - $SUDO_USER -c "pip install pypandora psutil pyudev"
|
||||
|
@ -118,9 +123,10 @@ usermod -a -G video $SUDO_USER
|
|||
# allow read mouse input
|
||||
usermod -a -G input $SUDO_USER
|
||||
|
||||
# Start Poetry at boot
|
||||
echo "su - $SUDO_USER -c \"cd pandora ; poetry run update --yes\"" > /etc/rc.local
|
||||
chmod +x /etc/rc.local
|
||||
# Start Pandora at boot
|
||||
sudo cp pandora.service.sample /etc/systemd/system/pandora.service
|
||||
sudpo sed -i "s/_USER_/$SUDO_USER/g" /etc/systemd/system/pandora.service
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
# getty1 autostart
|
||||
mkdir -p /etc/systemd/system/getty@tty1.service.d
|
||||
|
@ -133,4 +139,3 @@ echo "Type=idle" >> /etc/systemd/system/getty@tty1.service.d/override.conf
|
|||
|
||||
reboot
|
||||
|
||||
|
||||
|
|
19
pandora.service
Normal file
19
pandora.service
Normal file
|
@ -0,0 +1,19 @@
|
|||
[Unit]
|
||||
Description=Pandora service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=_USER_
|
||||
Group=_USER_
|
||||
Type=forking
|
||||
WorkingDirectory=/home/_USER_/pandora
|
||||
Environment="PATH=/home/_USER_/.poetry/bin:/usr/bin"
|
||||
Environment="PANDORA_HOME=/home/_USER_/pandora"
|
||||
ExecStart=/bin/bash -c "exec poetry run start"
|
||||
ExecStop=/bin/bash -c "exec poetry run stop"
|
||||
StandardOutput=append:/var/log/pandora_message.log
|
||||
StandardError=append:/var/log/pandora_error.log
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue