47 lines
1.5 KiB
Bash
47 lines
1.5 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Script to install IntelMQ
|
|
#
|
|
|
|
if [ "x$(whoami)" != "xintelmq" ]; then
|
|
echo "Exectuing as wrong user."
|
|
exit -1
|
|
fi
|
|
|
|
if ! test -f /opt/intelmq/venv/bin/activate; then
|
|
echo "Issues with venv."
|
|
exit -1
|
|
else
|
|
source /opt/intelmq/venv/bin/activate
|
|
fi
|
|
|
|
PY_INTELMQ='intelmq intelmq-api intelmqmail intelmq-manager gunicorn certstream'
|
|
|
|
pip3 install $PY_INTELMQ
|
|
pip3 install $PY_CERTBUND_CONTACT
|
|
|
|
# Junk
|
|
|
|
mkdir /opt/intelmq/src
|
|
cd /opt/intelmq/src
|
|
git clone https://github.com/Intevation/intelmq-certbund-contact.git
|
|
git clone https://github.com/Intevation/intelmq-fody-backend.git
|
|
git clone https://github.com/Intevation/intelmq-fody.git
|
|
( cd /opt/intelmq/src/intelmq-certbund-contact ; pip3 install . ; true )
|
|
cp /opt/intelmq/src/intelmq-certbund-contact/sql/initdb.sql /opt/intelmq/install/contactdb-initdb.sql
|
|
( cd /opt/intelmq/src/intelmq-fody-backend ; pip3 install . ; true )
|
|
for api in tickets_api checkticket_api session contactdb_api events_api; do
|
|
(cd /opt/intelmq/src/intelmq-fody-backend/$api ; pip3 install . ; true )
|
|
done
|
|
sqlite3 /etc/intelmq/fody/fody-session.sqlite < /opt/intelmq/src/intelmq-fody-backend/config/fody-session.sql
|
|
mkdir /opt/intelmq/www/fody
|
|
( cd /opt/intelmq/src/intelmq-fody ; yarn ; yarn build ; cd dist ; cp -r * /opt/intelmq/www/fody )
|
|
cd
|
|
rm -rf /opt/intelmq/src
|
|
|
|
# Due to Certbund contact overwrite files for some reason, reinstall intelmq
|
|
pip3 install --force-reinstall intelmq
|
|
|
|
intelmq-manager-build -o /opt/intelmq/www/intelmq-manager
|
|
|
|
touch /opt/intelmq/.installed
|