Skip to content

Commit

Permalink
Check all Jinja templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ondj committed Jan 9, 2022
1 parent 6cfc5a5 commit 6f37bbe
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bin/misp_verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ php -v
cd /var/www/MISP/tests/
bash build-test.sh

# Validate syntax of config.php template
python3 -c 'import sys, jinja2; env = jinja2.Environment(); template = open("/var/www/MISP/app/Config/config.php"); env.parse(template.read()); sys.exit(0)'
check_jinja_template () {
python3 -c 'import sys, jinja2; env = jinja2.Environment(); template = open(sys.argv[1]).read(); env.parse(template); sys.exit(0)' $1
}

# Validate syntax of Apache config template
python3 -c 'import sys, jinja2; env = jinja2.Environment(); template = open("/etc/httpd/conf.d/misp.conf"); env.parse(template.read()); sys.exit(0)'
check_jinja_template /var/www/MISP/app/Config/config.php
check_jinja_template /var/www/MISP/app/Config/database.php
check_jinja_template /var/www/MISP/app/Config/email.php
check_jinja_template /etc/httpd/conf.d/misp.conf

# Check installed Python packages for vulnerabilities
safety check --full-report || true # ignore output for now

0 comments on commit 6f37bbe

Please sign in to comment.