1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00
gocsaf/docs/scripts/setupValidationService.sh
Sascha L. Teichmann aa574406cf
Upgrade jsonschema library to 5.2.0 (#349)
* make jsonschema loading work with current versions of the jsonschema library
   again and simplify the code while at it.
* Improve itest workflow for validation service, to make them more robust.
    * Use a github action to setup nodejs and use a version that is
       required by https://github.com/secvisogram/csaf-validator-service/.
    * Add nodejs16 installation to prepareUbuntuInstanceForITests.sh.
       (so it can be done once in manual settings)
    * Add refreshing of apt cache before apt install because sometimes
       the cached ubuntu image does not have the apt cache current.

---------

Co-authored-by: Bernhard Reiter <bernhard@intevation.de>
2023-03-10 10:39:23 +01:00

31 lines
976 B
Bash
Executable file

#!/usr/bin/env bash
#
# This file is Free Software under the MIT License
# without warranty, see README.md and LICENSES/MIT.txt for details.
#
# SPDX-License-Identifier: MIT
#
# SPDX-FileCopyrightText: 2022 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
# Software-Engineering: 2022 Intevation GmbH <https://intevation.de>
set -e # to exit if a command in the script fails
sudo mkdir -p /var/lib/csaf
sudo chgrp www-data /var/lib/csaf/
sudo chmod g+s /var/lib/csaf/
sudo touch /var/lib/csaf/validations.db
sudo chgrp www-data /var/lib/csaf/validations.db
sudo chmod g+rw,o-rwx /var/lib/csaf/validations.db
echo '
remote_validator= { "url" = "http://localhost:8082", "presets" = ["mandatory"], "cache" = "/var/lib/csaf/validations.db" }
' | sudo tee --append /etc/csaf/config.toml
npm install pm2 -g
pushd ~
git clone https://github.com/secvisogram/csaf-validator-service.git
cd csaf-validator-service
npm ci
pm2 start npm -- run dev
popd