Skip to content

Commit 100b64e

Browse files
authored
Improve the documentation about external service (integrations) (#1073)
Signed-off-by: tdruez <[email protected]>
1 parent b945f4c commit 100b64e

File tree

5 files changed

+108
-53
lines changed

5 files changed

+108
-53
lines changed

docs/application-settings.rst

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ file.
2424
2525
docker compose restart web worker
2626
27+
Instance settings
28+
-----------------
29+
2730
DATABASE
28-
--------
31+
^^^^^^^^
2932

3033
The database can be configured using the following settings::
3134

@@ -38,7 +41,7 @@ The database can be configured using the following settings::
3841
.. _scancodeio_settings_require_authentication:
3942

4043
SCANCODEIO_REQUIRE_AUTHENTICATION
41-
---------------------------------
44+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4245

4346
By default, the ScanCode.io Web UI and REST API are available without any
4447
authentication.
@@ -59,7 +62,7 @@ authentication system in the REST API.
5962
.. _scancodeio_settings_workspace_location:
6063

6164
SCANCODEIO_WORKSPACE_LOCATION
62-
-----------------------------
65+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6366

6467
This setting defines the workspace location of a given project.
6568
The **workspace** is the directory where **all of the project's files are stored**
@@ -74,7 +77,7 @@ See :ref:`project_workspace` for more details.
7477
.. _scancodeio_settings_config_dir:
7578

7679
SCANCODEIO_CONFIG_DIR
77-
---------------------
80+
^^^^^^^^^^^^^^^^^^^^^
7881

7982
The location of the :guilabel:`.scancode/` configuration directory within the project
8083
codebase.
@@ -91,7 +94,7 @@ it to ScanCode.io. The expected location of the attribution template is::
9194
.scancode/templates/attribution.html
9295

9396
SCANCODEIO_PROCESSES
94-
--------------------
97+
^^^^^^^^^^^^^^^^^^^^
9598

9699
By default, multiprocessing is enabled and configured to use an optimal number of CPUs
97100
available on the machine. You can control the number of parallel processes available
@@ -114,7 +117,7 @@ To disable both multiprocessing and threading, use "-1"::
114117
.. _scancodeio_settings_async:
115118

116119
SCANCODEIO_ASYNC
117-
----------------
120+
^^^^^^^^^^^^^^^^
118121

119122
When enabled, pipeline runs are **executed asynchronously**, meaning that users can
120123
continue using the app while the pipeline are run in the background.
@@ -139,7 +142,7 @@ synchronously in the web server process.
139142
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
140143

141144
SCANCODEIO_TASK_TIMEOUT
142-
-----------------------
145+
^^^^^^^^^^^^^^^^^^^^^^^
143146

144147
Maximum time allowed for a pipeline to complete.
145148
The pipeline run will be stopped and marked as failed if that limit is reached.
@@ -152,7 +155,7 @@ The value is a string with specify unit including hour, minute, second
152155
Default: ``24h``
153156

154157
SCANCODEIO_SCAN_FILE_TIMEOUT
155-
----------------------------
158+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156159

157160
Maximum time allowed for a file to be analyzed when scanning a codebase.
158161

@@ -165,7 +168,7 @@ Default: ``120`` (2 minutes)
165168
.. _scancodeio_settings_pipelines_dirs:
166169

167170
SCANCODEIO_PIPELINES_DIRS
168-
-------------------------
171+
^^^^^^^^^^^^^^^^^^^^^^^^^
169172

170173
This setting defines any additional locations that ScanCode.io will search in
171174
for pipelines.
@@ -177,7 +180,7 @@ of additional pipelines directories::
177180
.. _scancodeio_settings_policies_file:
178181

179182
SCANCODEIO_POLICIES_FILE
180-
------------------------
183+
^^^^^^^^^^^^^^^^^^^^^^^^
181184

182185
This setting defines the location of the policies file, or ``policies.yml``.
183186
A valid policies file is required to enable compliance-related features.
@@ -208,15 +211,15 @@ A valid policies file is required to enable compliance-related features.
208211
this feature.
209212

210213
SCANCODEIO_PAGINATE_BY
211-
----------------------
214+
^^^^^^^^^^^^^^^^^^^^^^
212215

213216
The number of objects display per page for each object type can be customized with the
214217
following setting::
215218

216219
SCANCODEIO_PAGINATE_BY=project=30,error=50,resource=100,package=100,dependency=100
217220

218221
SCANCODEIO_REST_API_PAGE_SIZE
219-
-----------------------------
222+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
220223

221224
A numeric value indicating the number of objects returned per page in the REST API::
222225

@@ -228,7 +231,7 @@ Default: ``50``
228231
Using a large page size may have an impact on performances.
229232

230233
SCANCODEIO_LOG_LEVEL
231-
--------------------
234+
^^^^^^^^^^^^^^^^^^^^
232235

233236
By default, only a minimum of logging messages is displayed in the console, mostly
234237
to provide some progress about pipeline run execution.
@@ -254,7 +257,7 @@ The web server can be started in DEBUG mode with:
254257
$ SCANCODEIO_LOG_LEVEL=DEBUG make run
255258
256259
TIME_ZONE
257-
---------
260+
^^^^^^^^^
258261

259262
A string representing the time zone for the current ScanCode.io installation. By
260263
default the ``UTC`` time zone is used::
@@ -265,30 +268,48 @@ default the ``UTC`` time zone is used::
265268
You can view a detailed list of time zones `here.
266269
<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`_
267270

271+
.. _scancodeio_settings_external_services:
272+
273+
External services (integrations)
274+
--------------------------------
275+
268276
.. _scancodeio_settings_purldb:
269277

270278
PURLDB
271-
------
279+
^^^^^^
280+
281+
A public instance of **PurlDB** is accessible at https://public.purldb.io/.
272282

273-
Provide the URL and API key of your `PurlDB <https://github.com/nexB/purldb/>`_
274-
instance.
283+
Alternatively, you can deploy your own instance of PurlDB by
284+
following the instructions provided in the documentation at
285+
https://purldb.readthedocs.io/.
275286

276-
::
287+
To configure your local environment, set the ``PURLDB_URL`` in your ``.env`` file::
277288

278-
PURLDB_URL=https://your-purldb-domain/
279-
PURLDB_API_KEY=apikeyexample
289+
PURLDB_URL=https://public.purldb.io/
290+
291+
While using the public PurlDB instance, providing an API key is optional.
292+
However, if authentication is enabled on your PurlDB instance, you can provide the
293+
API key using ``PURLDB_API_KEY``::
294+
295+
PURLDB_API_KEY=insert_your_api_key_here
280296

281297
.. _scancodeio_settings_vulnerablecode:
282298

283299
VULNERABLECODE
284-
--------------
300+
^^^^^^^^^^^^^^
285301

286-
You can either run your own instance of
302+
You have the option to either deploy your instance of
287303
`VulnerableCode <https://github.com/nexB/vulnerablecode/>`_
288-
or connect to the public one.
304+
or connect to the `public instance <https://public.vulnerablecode.io/>`_.
289305

290-
Authentication is provided using an API key that you can obtain by registering at
291-
https://public.vulnerablecode.io/account/request_api_key/ ::
306+
To configure your local environment, set the ``VULNERABLECODE_URL`` in your ``.env``
307+
file::
292308

293309
VULNERABLECODE_URL=https://public.vulnerablecode.io/
294-
VULNERABLECODE_API_KEY=apikeyexample
310+
311+
When using the public VulnerableCode instance, providing an API key is optional.
312+
However, if authentication is enabled on your VulnerableCode instance,
313+
you can provide the API key using ``VULNERABLECODE_API_KEY``::
314+
315+
VULNERABLECODE_API_KEY=insert_your_api_key_here

docs/built-in-pipelines.rst

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ Analyse Docker Windows Image
4444

4545
.. _pipeline_find_vulnerabilities:
4646

47-
Find Vulnerabilities
48-
--------------------
47+
Find Vulnerabilities (addon)
48+
----------------------------
49+
50+
.. warning::
51+
This pipeline requires access to a VulnerableCode database.
52+
Refer to :ref:`scancodeio_settings_vulnerablecode` to configure access to
53+
VulnerableCode in your ScanCode.io instance.
54+
4955
.. autoclass:: scanpipe.pipelines.find_vulnerabilities.FindVulnerabilities()
5056
:members:
5157
:member-order: bysource
@@ -84,10 +90,30 @@ Map Deploy To Develop
8490
:members:
8591
:member-order: bysource
8692

93+
.. _pipeline_match_to_purldb:
94+
95+
Match to PurlDB (addon)
96+
-----------------------
97+
98+
.. warning::
99+
This pipeline requires access to a PurlDB service.
100+
Refer to :ref:`scancodeio_settings_purldb` to configure access to PurlDB in your
101+
ScanCode.io instance.
102+
103+
.. autoclass:: scanpipe.pipelines.match_to_purldb.MatchToPurlDB()
104+
:members:
105+
:member-order: bysource
106+
87107
.. _pipeline_populate_purldb:
88108

89-
Populate PurlDB
90-
---------------
109+
Populate PurlDB (addon)
110+
-----------------------
111+
112+
.. warning::
113+
This pipeline requires access to a PurlDB service.
114+
Refer to :ref:`scancodeio_settings_purldb` to configure access to PurlDB in your
115+
ScanCode.io instance.
116+
91117
.. autoclass:: scanpipe.pipelines.populate_purldb.PopulatePurlDB()
92118
:members:
93119
:member-order: bysource

docs/faq.rst

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,26 @@ Here are some general guidelines based on different input scenarios:
4343
These pipelines will automatically execute the necessary steps to scan and create the
4444
packages, dependencies, and resources for your project based on the input data provided.
4545

46-
After running one of the above pipelines, you may further **enhance your project data**
47-
by running some of the following additional pipelines:
46+
After executing one of the pipelines mentioned above, you have the option to
47+
**augment your project's data** by executing additional pipelines, often referred to
48+
as **addon** pipelines.
49+
These additional pipelines offer further enhancements and modifications to your
50+
existing data, allowing for more comprehensive analysis and insights.
4851

4952
- If you wish to **find vulnerabilities** for packages and dependencies, you can use the
5053
:ref:`find_vulnerabilities <pipeline_find_vulnerabilities>` pipeline.
5154
Note that setting up :ref:`VulnerableCode <scancodeio_settings_vulnerablecode>` is
5255
required for this pipeline to function properly.
5356

54-
- To **populate the PurlDB** with your project discovered packages, use the
55-
:ref:`populate_purldb <pipeline_populate_purldb>` pipeline.
56-
Please ensure that you have set up
57-
:ref:`PurlDB <scancodeio_settings_purldb>` before running this pipeline.
57+
- To **populate PurlDB with the packages discovered in your project**,
58+
use the :ref:`populate_purldb <pipeline_populate_purldb>` pipeline.
59+
Before executing this pipeline, make sure to set up
60+
:ref:`PurlDB <scancodeio_settings_purldb>`.
61+
62+
- To **match your project codebase resources to PurlDB for Package matches**,
63+
utilize the :ref:`match_to_purldb <pipeline_match_to_purldb>` pipeline.
64+
It's essential to set up :ref:`PurlDB <scancodeio_settings_purldb>` before executing
65+
this pipeline.
5866

5967
What is the difference between scan_codebase and scan_single_package pipelines?
6068
-------------------------------------------------------------------------------

docs/tutorial_vulnerablecode_integration.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,20 @@ Configure VulnerableCode integration
1616
.. warning::
1717
The ``find_vulnerabilities`` pipeline requires access to a VulnerableCode database.
1818

19-
You can either run your own instance of VulnerableCode or connect to the public one.
20-
Authentication is provided using an API key that you can obtain by registering at
21-
https://public.vulnerablecode.io/account/request_api_key/
19+
You have the option to either deploy your instance of
20+
`VulnerableCode <https://github.com/nexB/vulnerablecode/>`_
21+
or connect to the `public instance <https://public.vulnerablecode.io/>`_.
2222

23-
Set the ``VULNERABLECODE_URL`` and ``VULNERABLECODE_API_KEY`` in your local settings:
24-
- in the ``docker.env`` file if your run with docker
25-
- in the ``.env`` for a local development deployment
26-
27-
For example::
23+
To configure your local environment, set the ``VULNERABLECODE_URL`` in your ``.env``
24+
file::
2825

2926
VULNERABLECODE_URL=https://public.vulnerablecode.io/
30-
VULNERABLECODE_API_KEY=c1fa7dc1fd0a408880ba2dfdf63c1124abca9477
3127

32-
.. note::
33-
Optionally contact nexB support at [email protected] with your API user email if
34-
you are doing a larger scale evaluation and need to ease API throttling limitations.
28+
**Restarting the services is required following any changes to .env:**
29+
30+
.. code-block:: bash
31+
32+
docker compose restart web worker
3533
3634
Run the ``find_vulnerabilities`` pipeline
3735
-----------------------------------------

scanpipe/pipelines/match_to_purldb.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626

2727
class MatchToPurlDB(Pipeline):
2828
"""
29-
Check CodebaseResources of a Project against PurlDB for Package matches.
29+
Match the codebase resources of a project against PurlDB to identify packages.
3030
31-
This involves creating a JSON scan of the Project codebase, sending it to
32-
MatchCode on PurlDB, waiting for match results, creating DiscoveredPackages
33-
from the match results Package data and associating the proper
34-
CodebaseResources to those DiscoveredPackges.
31+
This process involves:
32+
33+
1. generating a JSON scan of the project codebase
34+
2. transmitting it to MatchCode on PurlDB and awaiting match results
35+
3. creating discovered packages from the package data obtained
36+
4. associating the codebase resources with those discovered packages
3537
"""
3638

3739
download_inputs = False

0 commit comments

Comments
 (0)