Skip to main content

Prerequisites

Before installing the API, ensure that the following components are already installed and operational on the target system.

Installation

Before starting the installation, ensure you have received a compressed file which contains the following:
  • Scripts for Installation
  • Binary API
  • Binary Engine (Optional)

Create a Dedicated User

Set up a system user for running the SCANOSS GO-API:
sudo useradd --system scanoss

Obtain the API Source Code

Download the latest release for your architecture (AMD64/ARM64) from the SCANOSS GO-API releases or use the following script:
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

Navigate to the source folder and build the binary:
cd api.go
make build_amd   # For AMD64
# or
make build_arm   # For ARM64

Set Up the Environment and Install

Run the setup script provided in the package:
cd scripts
./env-setup.sh
Start the service:
sudo systemctl start scanoss-go-api

Verify the Service

Check that the API is running correctly:
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
Stop the service if needed:
sudo systemctl stop scanoss-go-api
Check the service status:
sudo systemctl status scanoss-go-api

Configuration & Tuning

The behavior 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)

  • App.Name: Display name for the API on startup
  • App.Port: Port the service will bind to
  • App.Addr: Hostname for binding the port (leave blank to allow remote connections)
  • App.Debug: Enable or disable debug mode
  • App.Trace: Enable or disable trace logging
  • App.Mode: Logging mode (prod or dev)

Logging Settings (Logging)

  • Logging.DynamicLogging: Enable/disable dynamic log level changes at runtime
  • Logging.DynamicPort: Host and port for dynamic log control
  • Logging.ConfigFile: Optional ZAP logging configuration file

Scanning Settings (Scanning)

  • Scanning.WfpLoc: Directory for temporary WFP files (defaults to system temp)
  • Scanning.ScanBinary: Name or absolute path of the SCANOSS engine binary
  • Scanning.ScanDebug: Enable/disable debug mode for scan operations
  • Scanning.ScanFlags: Default flags passed to the scan engine
  • Scanning.ScanTimeout: Timeout (seconds) for scan commands
  • Scanning.WfpGrouping: Number of WFP requests grouped per worker thread
  • Scanning.Workers: Number of worker threads per scan (tune based on CPU cores and expected load)
  • Scanning.TmpFileDelete: Enable/disable deletion of temporary WFP files after processing
  • Scanning.KeepFailedWfps: Enable/disable retention of failed WFP files

TLS Settings (Tls)

  • Tls.CertFile: Path to TLS certificate file
  • Tls.KeyFile: Path to private TLS key file