From 5c151c277d46f7673a314e1bab8f1b6ac6546a14 Mon Sep 17 00:00:00 2001 From: "Philip (a-0)" <@ph:a-0.me> Date: Fri, 29 Jul 2022 00:45:13 +0200 Subject: [PATCH] Improved npm install process --- roles/cyberchef/tasks/main.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/roles/cyberchef/tasks/main.yml b/roles/cyberchef/tasks/main.yml index fec5470..88a44b2 100644 --- a/roles/cyberchef/tasks/main.yml +++ b/roles/cyberchef/tasks/main.yml @@ -21,6 +21,12 @@ clone: yes update: yes +- name: Patch Gruntfile.js + lineinfile: + path: "{{ cyberchef_root_dir }}Gruntfile.js" + regexp: "fixCryptoApiImports" + line: "fixCryptoApiImports: { options: { shell: "/bin/bash" }," + - name: Set permissions on repo become: yes file: @@ -30,7 +36,15 @@ - name: Install CyberChef become_user: cyberchef - command: "cd {{ cyberchef_root_dir }}; npm install" + command: + cmd: "npm install" + chdir: "{{ cyberchef_root_dir }}" + +- name: Perform npm audit and fix + become_user: cyberchef + command: + cmd: "npm audit fix" + chdir: "{{ cyberchef_root_dir }}" - name: Set systemd service become: yes