Skip to content

Installer script fixes #2585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions extra/yara_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ if [ ! -d /tmp/yara-python ]; then
git clone --recursive https://github.com/VirusTotal/yara-python /tmp/yara-python
fi

cd /tmp/yara-python
/etc/poetry/bin/poetry --directory /opt/CAPEv2 run bash -c "cd /tmp/yara-python && python setup.py build --enable-cuckoo --enable-magic --enable-profiling"
/etc/poetry/bin/poetry --directory /opt/CAPEv2 run pip install /tmp/yara-python

/etc/poetry/bin/poetry --directory /opt/CAPEv2 run python setup.py build --enable-cuckoo --enable-magic --enable-profiling
/etc/poetry/bin/poetry --directory /opt/CAPEv2 run pip install .

cd ..
cd /tmp

if [ -d yara-python ]; then
rm -rf yara-python
Expand Down
6 changes: 3 additions & 3 deletions installer/cape2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ function install_suricata() {
python3 -c "pa = '/etc/suricata/suricata.yaml';q=open(pa, 'rb').read().replace(b'eve-log:\n enabled: no\n', b'eve-log:\n enabled: yes\n');open(pa, 'wb').write(q);"
python3 -c "pa = '/etc/suricata/suricata.yaml';q=open(pa, 'rb').read().replace(b'unix-command:\n enabled: auto\n #filename: custom.socket', b'unix-command:\n enabled: yes\n filename: /tmp/suricata-command.socket');open(pa, 'wb').write(q);"
# file-store
python3 -c "pa = '/etc/suricata/suricata.yaml';q=open(pa, 'rb').read().replace(b'file-store:\n version: 2\n enabled: no', b'file-store:\n version: 2\n enabled: yes');open(pa, 'wb').write(q);"
python3 -c "pa = '/etc/suricata/suricata.yaml';q=open(pa, 'rb').read().replace(b'file-store:\n version: 2\n enabled: no', b'file-store:\n version: 2\n enabled: yes');open(pa, 'wb').write(q);"

chown ${USER}:${USER} -R /etc/suricata
chown ${USER}:${USER} -R /var/log/suricata
Expand Down Expand Up @@ -797,7 +797,7 @@ function install_yara() {
ldconfig

# Run yara installer script
sudo -u ${USER} /etc/poetry/bin/poetry --directory /opt/CAPEv2 run /opt/CAPEv2/extra/yara_installer.sh
sudo -u ${USER} /etc/poetry/bin/poetry --directory /opt/CAPEv2 run extra/yara_installer.sh

Comment on lines 799 to 801
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

In the pull request description, you asked @doomedraven if this script needs to run in the installer script. It would be good to resolve this question, and either remove the script if it's not needed, or add a comment explaining why it's necessary.

if [ -d yara-python ]; then
sudo rm -rf yara-python
Expand Down Expand Up @@ -944,7 +944,7 @@ function install_capa() {
cd capa || return
git pull
git submodule update --init rules
/etc/poetry/bin/poetry --directory /opt/CAPEv2/ run pip install .
/etc/poetry/bin/poetry --directory /opt/CAPEv2/ run pip install /tmp/capa
cd /opt/CAPEv2
if [ -d /tmp/capa ]; then
sudo rm -rf /tmp/capa
Expand Down
Loading