ports/security/go-cve-dictionary/files/patch-commands_root.go
Palle Girgensohn 6e1d089e3b security/go-cve-dictionary: Upgrade to 0.10.1.
This port is mainly here as a dependency of security/vuls. Update and
take maintainership due to maintainer timeout. [1]

Adding a default config file that should work more or less out the box
for a simple local setup. It has examples for a larger deployment.

PR:	259948 [1] Maintainer timeout
2024-02-25 00:37:44 +01:00

29 lines
1.3 KiB
Go

--- commands/root.go.orig 1979-11-29 23:00:00 UTC
+++ commands/root.go
@@ -3,7 +3,6 @@ import (
import (
"fmt"
"os"
- "path/filepath"
homedir "github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
@@ -25,7 +24,7 @@ func init() {
func init() {
cobra.OnInitialize(initConfig)
- RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.go-cve-dictionary.yaml)")
+ RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "%%PREFIX%%/etc/go-cve-dictionary.yaml", "config file")
RootCmd.PersistentFlags().Bool("log-to-file", false, "output log to file")
_ = viper.BindPFlag("log-to-file", RootCmd.PersistentFlags().Lookup("log-to-file"))
@@ -42,8 +41,7 @@ func init() {
RootCmd.PersistentFlags().Bool("debug-sql", false, "SQL debug mode")
_ = viper.BindPFlag("debug-sql", RootCmd.PersistentFlags().Lookup("debug-sql"))
- pwd := os.Getenv("PWD")
- RootCmd.PersistentFlags().String("dbpath", filepath.Join(pwd, "cve.sqlite3"), "/path/to/sqlite3 or SQL connection string")
+ RootCmd.PersistentFlags().String("dbpath", "/var/db/vuls/cve.sqlite3", "/path/to/sqlite3 or SQL connection string")
_ = viper.BindPFlag("dbpath", RootCmd.PersistentFlags().Lookup("dbpath"))
RootCmd.PersistentFlags().String("dbtype", "sqlite3", "Database type to store data in (sqlite3, mysql, postgres or redis supported)")