Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change from int to boolean #15

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Upcoming changes...

## [1.3.3] - 2023-10-10
### Changed
- Changed option to enable/disable file_url reporting (`FileContents`) from integer to boolean

## [1.3.2] - 2023-10-03
### Added
- Added option to enable/disable file_url reporting (`FileContents`)
Expand Down Expand Up @@ -88,3 +92,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[1.3.0]: https://github.com/scanoss/api.go/compare/v1.2.3...v1.3.0
[1.3.1]: https://github.com/scanoss/api.go/compare/v1.3.0...v1.3.1
[1.3.2]: https://github.com/scanoss/api.go/compare/v1.3.1...v1.3.2
[1.3.3]: https://github.com/scanoss/api.go/compare/v1.3.2...v1.3.3
2 changes: 1 addition & 1 deletion pkg/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func setupEnvVars(cfg *myconfig.ServerConfig) {
if err != nil {
zlog.S.Infof("Failed to set SCANOSS_FILE_CONTENTS SCANOSS_API_URL value to %v: %v", cfg.Scanning.FileContents, err)
}
if customContents := os.Getenv("SCANOSS_FILE_CONTENTS"); len(customContents) > 0 && customContents == "0" {
if customContents := os.Getenv("SCANOSS_FILE_CONTENTS"); len(customContents) > 0 && customContents == "false" {
zlog.S.Infof("Skipping file_url datafield.")
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type ServerConfig struct {
KeepFailedWfps bool `env:"SCAN_KEEP_FAILED_WFP"` // true/false
ScanningURL string `env:"SCANOSS_API_URL"` // URL to present back in API responses - default https://osskb.org/api
HPSMEnabled bool `env:"SCAN_HPSM_ENABLED"` // Enable HPSM (High Precision Snippet Matching) or not (default true)
FileContents int `env:"SCANOSS_FILE_CONTENTS"` // Show matched file URL in scan results (default 1 - enabled, 0 - disabled)
FileContents bool `env:"SCANOSS_FILE_CONTENTS"` // Show matched file URL in scan results (default true)
}
TLS struct {
CertFile string `env:"SCAN_TLS_CERT"` // TLS Certificate
Expand Down Expand Up @@ -112,7 +112,7 @@ func setServerConfigDefaults(cfg *ServerConfig) {
cfg.Scanning.HPSMEnabled = true
cfg.Telemetry.Enabled = false
cfg.Telemetry.OltpExporter = "0.0.0.0:4317" // Default OTEL OLTP gRPC Exporter endpoint
cfg.Scanning.FileContents = 1 // Matched File URL response enabled (1) by default
cfg.Scanning.FileContents = true // Matched File URL response enabled (true) by default
}

// LoadFile loads the specified file and returns its contents in a string array.
Expand Down