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:
parent
2614c1a4ba
commit
86fb441446
4 changed files with 19 additions and 4 deletions
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue