1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-19 13:29:42 +02:00

after first test

This commit is contained in:
dbarzin 2022-07-04 20:24:06 +02:00
parent 411fbf11dd
commit f7921b097b
2 changed files with 70 additions and 31 deletions

View file

@ -4,6 +4,30 @@ Pandora-BOX
Pandorabox is a USB scaning station base on Pandora Pandorabox is a USB scaning station base on Pandora
Install
-------
Install Ubuntu 22.04 server LTS
select (x) Ubuntu Server (minumized)
Choose to install OpenSSH server
That's all, no other packages needed
After reboot, login with the user create during the install and type :
sudo apt install git
git clone https://github.com/dbarzin/pandora-box
cd pandora-box
sudo ./install.sh
=========================================================================
Mouse terminal Mouse terminal
--------------- ---------------
@ -109,14 +133,15 @@ convert -resize 1920x1080 -background black -gravity center -extent 1920x1080 im
AutoStart on console AutoStart on console
-------------------- --------------------
cat > /etc/systemd/system/getty@tty1.service.d/override.conf mkdir -p /etc/systemd/system/getty@tty1.service.d
echo "[Service]" > /etc/systemd/system/getty@tty1.service.d/override.conf
echo "ExecStart=" >> /etc/systemd/system/getty@tty1.service.d/override.conf
echo "ExecStart=-su - pandora -c ./pandora-box/pandora-box.py" >> /etc/systemd/system/getty@tty1.service.d/override.conf
echo "StandardInput=tty" >> /etc/systemd/system/getty@tty1.service.d/override.conf
echo "StandardOutput=tty" >> /etc/systemd/system/getty@tty1.service.d/override.conf
echo "Type=idle" >> /etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
ExecStart=
ExecStart=-su - didier -c ./pandora-box/pandora-box.py
StandardInput=tty
StandardOutput=tty
Type=idle
Restert getty1 Restert getty1

View file

@ -2,59 +2,60 @@
# Install procedure for Pandora-Box # Install procedure for Pandora-Box
set -e set -e
cd .. cd ..
# Python
apt install -y python-is-python3 python3-pip
# Peotry # Peotry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - su - $SUDO_USER -c "curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -"
poetry --version su - $SUDO_USER -c "poetry --version"
# REDIS # REDIS
apt-get update apt-get update
apt install build-essential tcl apt install -y build-essential tcl
git clone https://github.com/redis/redis.git git clone https://github.com/redis/redis.git
cd redis cd redis
git checkout 6.2 git checkout 6.2
make make
# Optionally, you can run the tests: # Optionally, you can run the tests:
make test # make test
cd .. cd ..
chown -R $SUDO_USER redis chown -R $SUDO_USER redis
# Kvrocks # Kvrocks
apt-get update apt-get update
apt install gcc g++ make libsnappy-dev autoconf automake libtool googletest libgtest-dev apt install -y gcc g++ make libsnappy-dev autoconf automake libtool googletest libgtest-dev
git clone --recursive https://github.com/apache/incubator-kvrocks.git kvrocks git clone --recursive https://github.com/apache/incubator-kvrocks.git kvrocks
cd kvrocks cd kvrocks
git checkout 2.0 git checkout 2.0
make -j4 make -j4
# Optionally, you can run the tests: # Optionally, you can run the tests:
make test # make test
cd .. cd ..
chown -R $SUDO_USER kvrocks chown -R $SUDO_USER kvrocks
# Pandora # Pandora
git clone https://github.com/pandora-analysis/pandora.git su - $SUDO_USER -c "git clone https://github.com/pandora-analysis/pandora.git"
apt install python3-dev # for compiling things apt install -y python3-dev # for compiling things
apt install libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0 # For HTML -> PDF apt install -y libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0 # For HTML -> PDF
apt install libreoffice-base-nogui libreoffice-calc-nogui libreoffice-draw-nogui libreoffice-impress-nogui libreoffice-math-nogui libreoffice-writer-nogui # For Office -> PDF apt install -y libreoffice-base-nogui libreoffice-calc-nogui libreoffice-draw-nogui libreoffice-impress-nogui libreoffice-math-nogui libreoffice-writer-nogui # For Office -> PDF
apt install exiftool # for extracting exif information apt install -y exiftool # for extracting exif information
apt install unrar # for extracting rar files apt install -y unrar # for extracting rar files
apt install libxml2-dev libxslt1-dev antiword unrtf poppler-utils pstotext tesseract-ocr flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev swig # for textract 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
cd pandora cd pandora
poetry install su - $SUDO_USER -c "cd ~/pandora; poetry install"
echo PANDORA_HOME="`pwd`" >> .env echo PANDORA_HOME="`pwd`" >> .env
su - $SUDO_USER -c "cd ~/pandora; cp config/generic.json.sample config/generic.json"
cp config/generic.json.sample config/generic.json
# ClamAV # ClamAV
apt-get install clamav-daemon apt-get install -y clamav-daemon
# In order for the module to work, you need the signatures. # In order for the module to work, you need the signatures.
# Running the command "freshclam" will do it but if the script is already running # Running the command "freshclam" will do it but if the script is already running
# (it is started by the systemd service clamav-freshclam) # (it is started by the systemd service clamav-freshclam)
@ -77,21 +78,22 @@ for file in pandora/workers/*.sample; do cp -i ${file} ${file%%.sample}; done
chown -R $SUDO_USER . chown -R $SUDO_USER .
poetry run update --yes su - $SUDO_USER -c "cd pandora; poetry run update --yes"
#--------------------- #---------------------
# Pandora-box # Pandora-box
#--------------------- #---------------------
# Python libraries # Python libraries
pip install psutil pyudev su - $SUDO_USER -c "pip install pypandora psutil pyudev"
# Quarantine folder # Quarantine folder
mkdir /var/quarantine mkdir -p /var/quarantine
chown $SUDO_USER /var/quarantine chown $SUDO_USER /var/quarantine
# Mouse terminal # ImageMagick and pmount
apt install imagemagick pmount apt --fix-broken install -y
apt install -y imagemagick pmount
# Suppress all messages from the kernel (and its drivers) except panic messages from appearing on the console. # Suppress all messages from the kernel (and its drivers) except panic messages from appearing on the console.
echo "kernel.printk = 3 4 1 3" | tee -a /etc/sysctl.conf echo "kernel.printk = 3 4 1 3" | tee -a /etc/sysctl.conf
@ -103,6 +105,18 @@ usermod -a -G video $SUDO_USER
usermod -a -G input $SUDO_USER usermod -a -G input $SUDO_USER
# Start Poetry at boot # Start Poetry at boot
echo "su - $USER -c \"cd /home/$USER/pandora ; poetry run update --yes\" 2>&1 >storage/pandora.log" >> /etc/rc.local echo "su - $SUDO_USER -c \"cd /home/$SUDO_USER/pandora ; poetry run start\" 2>&1 >storage/pandora.log" > /etc/rc.local
chmod +x /etc/rc.local chmod +x /etc/rc.local
# getty1 autostart
mkdir -p /etc/systemd/system/getty@tty1.service.d
echo "[Service]" > /etc/systemd/system/getty@tty1.service.d/override.conf
echo "ExecStart=" >> /etc/systemd/system/getty@tty1.service.d/override.conf
echo "ExecStart=-su - pandora -c ./pandora-box/pandora-box.py" >> /etc/systemd/system/getty@tty1.service.d/override.conf
echo "StandardInput=tty" >> /etc/systemd/system/getty@tty1.service.d/override.conf
echo "StandardOutput=tty" >> /etc/systemd/system/getty@tty1.service.d/override.conf
echo "Type=idle" >> /etc/systemd/system/getty@tty1.service.d/override.conf
reboot