1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Change default port for secvisogram (#262)

* Change default port for secvisogram

 * Following change from
   https://github.com/secvisogram/csaf-validator-service/pull/14

* Improve script for setting up validation service

 * Add a test to fail if we cannot connect.
 * Add copyright header.
This commit is contained in:
Bernhard E. Reiter 2022-07-26 15:13:02 +02:00 committed by GitHub
parent 2614c1a4ba
commit 86fb441446
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 4 deletions

View file

@ -23,7 +23,7 @@ import (
// defaultURL is default URL where to look for // defaultURL is default URL where to look for
// the validation service. // the validation service.
const ( const (
defaultURL = "http://localhost:3000" defaultURL = "http://localhost:8082"
validationPath = "/api/v1/validate" validationPath = "/api/v1/validate"
) )

View file

@ -83,7 +83,7 @@
# This example provides an overview over the syntax, # This example provides an overview over the syntax,
# adjust the parameters depending on your setup. # adjust the parameters depending on your setup.
#[remote_validator] #[remote_validator]
#url = "http://localhost:3000" #url = "http://localhost:8082"
#presets = ["mandatory"] #presets = ["mandatory"]
#cache = "/var/lib/csaf/validations.db" #cache = "/var/lib/csaf/validations.db"

View file

@ -116,12 +116,17 @@ set +e
echo echo
echo === Try to reach the validator service ten times, up to nine fails are ok echo === Try to reach the validator service ten times, up to nine fails are ok
for ((i = 1; i <= 10; i++)); do for ((i = 1; i <= 10; i++)); do
if [ $(curl -IL http://localhost:3000/api/v1/tests | grep -c HTTP ) != "0" ]; then if [ $(curl -IL http://localhost:8082/api/v1/tests | grep -c HTTP ) != "0" ]; then
break break
fi fi
sleep 3 sleep 3
done done
if [ $i == 11 ]; then
echo Could not connect to validation service!
exit 1
fi
# Upload files # Upload files
./uploadToProvider.sh ./uploadToProvider.sh

View file

@ -1,4 +1,14 @@
#!/usr/bin/env bash #!/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 mkdir -p /var/lib/csaf
sudo chgrp www-data /var/lib/csaf/ sudo chgrp www-data /var/lib/csaf/
@ -8,7 +18,7 @@ sudo chgrp www-data /var/lib/csaf/validations.db
sudo chmod g+rw,o-rwx /var/lib/csaf/validations.db sudo chmod g+rw,o-rwx /var/lib/csaf/validations.db
echo ' echo '
remote_validator= { "url" = "http://localhost:3000", "presets" = ["mandatory"], "cache" = "/var/lib/csaf/validations.db" } remote_validator= { "url" = "http://localhost:8082", "presets" = ["mandatory"], "cache" = "/var/lib/csaf/validations.db" }
' | sudo tee --append /etc/csaf/config.toml ' | sudo tee --append /etc/csaf/config.toml
# Install nodejs # Install nodejs