Documentation Index
Fetch the complete documentation index at: https://docs.scanoss.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before installing the SCANOSS Go API, ensure the following components are
already installed and operational on the target system.
Installation
Before starting the installation, ensure you have received a .tar.gz archive
containing the following:
- Installation scripts
- API binary
- Engine binary (optional)
Note: The Engine binary is optional if the SCANOSS Engine is already
installed as a prerequisite (see above).
Create a Dedicated User
Create a system user under which the SCANOSS Go API service will run:
sudo useradd --system scanoss
Download the API
Download the latest release for your architecture (AMD64 or ARM64)
from the SCANOSS Go API releases,
or use the following commands:
mkdir api.go
curl -L https://api.github.com/repos/scanoss/api.go/tarball -o api.go.tar.gz
tar -xzvf api.go.tar.gz -C api.go --strip-components=1
Build the API Binary
Note: This step is only required if you are building from source rather
than using a pre-built release binary.
Navigate to the source directory and build the binary for your architecture:
cd api.go
make build_amd # For AMD64
# or
make build_arm # For ARM64
Set Up the Environment and Install
Run the setup script included in the package:
cd scripts
./env-setup.sh
Start the Service
sudo systemctl start scanoss-go-api
Verify the Service
Confirm the service is running by checking the following endpoints:
curl -i -X GET http://localhost:5443/
curl -i -X GET http://localhost:5443/api/health
curl -i -X GET http://localhost:5443/api/metrics/all
View logs in real time:
tail -f /var/log/scanoss/api/scanoss-api-prod.log
Check the service status:
sudo systemctl status scanoss-go-api
Stop the service:
sudo systemctl stop scanoss-go-api
Configuration & Tuning
The behaviour of the SCANOSS Go API can be customised by modifying the
configuration file located at:
/usr/local/etc/scanoss/api/app-config-prod.json
Default Configuration
{
"App": {
"Name": "SCANOSS API Server",
"Port": "5443",
"Addr": "",
"Debug": false,
"Trace": false,
"Mode": "prod"
},
"Logging": {
"DynamicLogging": false,
"DynamicPort": "localhost:60085",
"ConfigFile": ""
},
"Scanning": {
"WfpLoc": "",
"ScanBinary": "scanoss",
"ScanDebug": false,
"ScanFlags": 0,
"ScanTimeout": 300,
"WfpGrouping": 3,
"Workers": 2,
"TmpFileDelete": true,
"KeepFailedWfps": true
},
"Tls": {
"CertFile": "",
"KeyFile": ""
}
}
Configuration Parameters
Application Settings (App)
| Parameter | Description |
|---|
App.Name | Display name for the API, shown on startup. |
App.Port | Port to which the service binds. |
App.Addr | Hostname or IP address for binding. Leave blank to bind to all interfaces (0.0.0.0), allowing remote connections. |
App.Debug | Enables debug-level logging when set to true. |
App.Trace | Enables trace-level logging when set to true. |
App.Mode | Logging and behaviour mode. Accepted values: prod (production) or dev (development). |
Logging Settings (Logging)
| Parameter | Description |
|---|
Logging.DynamicLogging | Enables dynamic log-level adjustment at runtime when set to true. |
Logging.DynamicPort | Host and port used for runtime log-level control. |
Logging.ConfigFile | Optional path to a Zap logging configuration file. If left blank, default logging settings are used. |
Scanning Settings (Scanning)
WFP refers to Winnowing Fingerprint, the hashing method used by the SCANOSS
Engine to fingerprint source files.
| Parameter | Description |
|---|
Scanning.WfpLoc | Directory for temporary WFP files. Defaults to the system temporary directory if left blank. |
Scanning.ScanBinary | Name or absolute path of the SCANOSS Engine binary. |
Scanning.ScanDebug | Enables debug mode for scan operations when set to true. |
Scanning.ScanFlags | Default flags passed to the SCANOSS Engine. Set to 0 for no additional flags. Refer to the Engine documentation for valid values. |
Scanning.ScanTimeout | Timeout in seconds for individual scan commands. |
Scanning.WfpGrouping | Number of WFP requests batched per worker. Increase this value to reduce per-request overhead under high load. |
Scanning.Workers | Number of concurrent scan workers. Tune based on available CPU cores and expected request volume. |
Scanning.TmpFileDelete | Deletes temporary WFP files after processing when set to true. |
Scanning.KeepFailedWfps | Retains WFP files for failed scan operations when set to true. Useful for debugging. |
TLS Settings (Tls)
| Parameter | Description |
|---|
Tls.CertFile | Path to the TLS certificate file. |
Tls.KeyFile | Path to the private TLS key file. |