diff --git a/cmd/csaf_provider/config.go b/cmd/csaf_provider/config.go index bf87625..91dd659 100644 --- a/cmd/csaf_provider/config.go +++ b/cmd/csaf_provider/config.go @@ -23,7 +23,7 @@ import ( const ( // The environment name, that contains the path to the config file. configEnv = "CSAF_CONFIG" - configPrefix = "/usr/lib/csaf" + configPrefix = "/etc/csaf" defaultConfigPath = configPrefix + "/config.toml" // Default path to the config file. defaultOpenPGPPrivateKey = configPrefix + "/openpgp_private.asc" defaultOpenPGPPublicKey = configPrefix + "/openpgp_public.asc" diff --git a/docs/provider-setup.md b/docs/provider-setup.md index e4dd5c7..802a7ec 100644 --- a/docs/provider-setup.md +++ b/docs/provider-setup.md @@ -92,7 +92,7 @@ Create `cgi-bin` folder if it not exists: `mkdir -p /usr/lib/cgi-bin/`. Rename and place the `csaf_provider` binary file under `/usr/lib/cgi-bin/csaf_provider.go`. -Create configuration file under `/usr/lib/csaf/config.toml` +Create configuration file under `/etc/csaf/config.toml` and make sure is has good, restrictive permissions. It must be readable by the user(id), which the webserver's fastcgi interface uses to start the CGI-binary with, @@ -118,17 +118,6 @@ which you need to customize for a production setup, see the [options of `csaf_provider`](https://github.com/csaf-poc/csaf_distribution/blob/main/docs/csaf_provider.md). - -```sh -# upload_signature = true -openpgp_private_key = "/usr/lib/csaf/private.asc" -openpgp_public_key = "/usr/lib/csaf/public.asc" -#tlps = ["green", "red"] -canonical_url_prefix = "https://localhost:8443" -categories = ["Example Company Product A", "expr:document.lang"] -create_service_document = true -#no_passphrase = true -``` diff --git a/docs/scripts/setupProviderForITest.sh b/docs/scripts/setupProviderForITest.sh index 4c0e0b8..1f2a072 100755 --- a/docs/scripts/setupProviderForITest.sh +++ b/docs/scripts/setupProviderForITest.sh @@ -45,7 +45,7 @@ location /cgi-bin/ { fastcgi_param SCRIPT_FILENAME /usr/lib$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param CSAF_CONFIG /usr/lib/csaf/config.toml; + fastcgi_param CSAF_CONFIG /etc/csaf/config.toml; fastcgi_param SSL_CLIENT_VERIFY $ssl_client_verify; fastcgi_param SSL_CLIENT_S_DN $ssl_client_s_dn; @@ -78,28 +78,28 @@ sudo chgrp www-data /usr/lib/cgi-bin/ sudo chmod o-rwx /usr/lib/cgi-bin/ sudo cp bin-linux-amd64/csaf_provider /usr/lib/cgi-bin/csaf_provider.go -sudo mkdir /usr/lib/csaf/ -sudo chgrp www-data /usr/lib/csaf/ -sudo chmod g+s,o-rwx /usr/lib/csaf/ -sudo touch /usr/lib/csaf/config.toml -sudo chgrp www-data /usr/lib/csaf/config.toml -sudo chmod g+r,o-rwx /usr/lib/csaf/config.toml +sudo mkdir /etc/csaf/ +sudo chgrp www-data /etc/csaf/ +sudo chmod g+s,o-rwx /etc/csaf/ +sudo touch /etc/csaf/config.toml +sudo chgrp www-data /etc/csaf/config.toml +sudo chmod g+r,o-rwx /etc/csaf/config.toml -sudo cp docs/test-keys/*.asc /usr/lib/csaf/ -sudo chgrp www-data /usr/lib/csaf/private.asc -sudo chmod o-rwx /usr/lib/csaf/private.asc +sudo cp docs/test-keys/*.asc /etc/csaf/ +sudo chgrp www-data /etc/csaf/private.asc +sudo chmod o-rwx /etc/csaf/private.asc # Configuration file echo ' # upload_signature = true -openpgp_private_key = "/usr/lib/csaf/private.asc" -openpgp_public_key = "/usr/lib/csaf/public.asc" +openpgp_private_key = "/etc/csaf/private.asc" +openpgp_public_key = "/etc/csaf/public.asc" #tlps = ["green", "red"] canonical_url_prefix = "https://localhost:8443" categories = ["Example Company Product A", "expr:document.lang"] create_service_document = true #no_passphrase = true -' | sudo tee --append /usr/lib/csaf/config.toml +' | sudo tee --append /etc/csaf/config.toml # Create the Folders curl https://localhost:8443/cgi-bin/csaf_provider.go/create --cert-type p12 --cert ~/devca1/testclient1.p12 --insecure diff --git a/docs/scripts/setupValidationService.sh b/docs/scripts/setupValidationService.sh index ba6a43e..273eebc 100755 --- a/docs/scripts/setupValidationService.sh +++ b/docs/scripts/setupValidationService.sh @@ -9,7 +9,7 @@ sudo chmod g+rw,o-rwx /var/lib/csaf/validations.db echo ' remote_validator= { "url" = "http://localhost:3000", "presets" = ["mandatory"], "cache" = "/var/lib/csaf/validations.db" } -' | sudo tee --append /usr/lib/csaf/config.toml +' | sudo tee --append /etc/csaf/config.toml # Install nodejs curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -