forked from SUNET/soc-ops
Fixes for fody.
This commit is contained in:
parent
503e8bd695
commit
fa9c66771f
4 changed files with 26 additions and 8 deletions
|
@ -20,7 +20,6 @@ PY_INTELMQ='intelmq intelmq-api intelmqmail intelmq-manager gunicorn certstream'
|
|||
pip3 install $PY_INTELMQ
|
||||
pip3 install $PY_CERTBUND_CONTACT
|
||||
|
||||
|
||||
# Junk
|
||||
|
||||
mkdir /opt/intelmq/src
|
||||
|
@ -36,7 +35,7 @@ for api in tickets_api checkticket_api session contactdb_api events_api; do
|
|||
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 build ; cd dist ; cp -r * /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
|
||||
|
||||
|
|
|
@ -18,11 +18,11 @@ GRANT ALL PRIVILEGES ON DATABASE contactdb TO intelmq;
|
|||
CREATE SCHEMA intelmq AUTHORIZATION intelmq;
|
||||
EOSQL
|
||||
|
||||
rm -f /tmp/initdb.sql
|
||||
sudo -u intelmq /opt/intelmq/venv/bin/intelmq_psql_initdb
|
||||
sudo -u intelmq psql eventdb -f /tmp/initdb.sql
|
||||
rm -f /tmp/initdb.sql
|
||||
rm -f /opt/intelmq/install/eventdb-initdb.sql
|
||||
sudo -u intelmq /opt/intelmq/venv/bin/intelmq_psql_initdb -o /opt/intelmq/install/eventdb-initdb.sql
|
||||
sudo -u intelmq psql eventdb -f /opt/intelmq/install/eventdb-initdb.sql
|
||||
|
||||
sudo -u intelmq psql eventdb -f /opt/intelmq/install/eventdb-notifications.sql
|
||||
test -f /opt/intelmq/install/contactdb-initdb.sql && sudo -u intelmq psql contacdb -f /opt/intelmq/install/contactdb-initdb.sql
|
||||
test -f /opt/intelmq/install/eventdb-notifications.sql && sudo -u intelmq psql eventdb -f /opt/intelmq/install/eventdb-notifications.sql
|
||||
|
||||
touch /opt/intelmq/.pgsql-installed
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
sudo -u intelmq PATH=/opt/intelmq/venv/bin:/usr/local/bin:/usr/bin:/bin /opt/intelmq/venv/bin/intelmqctl $*
|
||||
|
|
@ -72,10 +72,19 @@ class soc::intelmq(
|
|||
creates => '/etc/apt/sources.list.d/nodesource.list',
|
||||
}
|
||||
|
||||
package { ['postgresql', 'python3-venv', 'python3-pip', 'python3-gpg', 'python3-psycopg2', 'redict', 'nodejs', 'yarn', ]:
|
||||
package { ['postgresql', 'python3-venv', 'python3-pip', 'python3-gpg', 'python3-psycopg2', 'redict', 'nodejs', ]:
|
||||
ensure => 'latest',
|
||||
}
|
||||
|
||||
package { ['cmdtest', ]:
|
||||
ensure => 'absent',
|
||||
}
|
||||
|
||||
exec { 'Install yarn from npm':
|
||||
command => 'npm install --global yarn',
|
||||
creates => '/usr/bin/yarn',
|
||||
}
|
||||
|
||||
exec { 'Install IntelMQ venv':
|
||||
command => 'sudo -u intelmq /usr/bin/python3 -m venv --system-site-packages /opt/intelmq/venv',
|
||||
creates => '/opt/intelmq/venv',
|
||||
|
@ -108,6 +117,12 @@ class soc::intelmq(
|
|||
returns => ['0', '1',],
|
||||
}
|
||||
|
||||
file { '/usr/bin/intelmqctl':
|
||||
ensure => file,
|
||||
mode => '0555',
|
||||
content => file('soc/intelmq/usr-bin-intelmqctl'),
|
||||
}
|
||||
|
||||
file { '/opt/intelmq/install/setup-pgsql.sh':
|
||||
ensure => file,
|
||||
content => file('soc/intelmq/setup-pgsql.sh'),
|
||||
|
|
Loading…
Add table
Reference in a new issue