8000 Improve the "Install ScanCode.io" docs #34 by tdruez · Pull Request #37 · aboutcode-org/dejacode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve the "Install ScanCode.io" docs #34 #37

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

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

10000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dje/templates/integrations_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<h5 class="card-header">{{ label }}</h5>
{% if status.service_url %}
<small class="d-inline-flex px-3 py-1 fw-semibold text-secondary-emphasis bg-secondary-subtle border border-secondary-subtle">
{% if status.has_api_key %}
<i class="fa fa-key me-1" data-bs-toggle="tooltip" title="API key provided"></i>
{% endif %}
{{ status.service_url }}
</small>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions dje/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,7 @@ def get_integration_status(self, integration_class):

if self.request.user.is_superuser:
status["service_url"] = integration.service_url
status["has_api_key"] = bool(integration.service_api_key)

return status

Expand Down
68 changes: 51 additions & 17 deletions docs/dataspace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,14 @@ Install and configure ScanCode.io
If you plan to run ScanCode.io **on the same server** (virtual or physical) as
the DejaCode instance, **ensure that the host machine has sufficient resources**
to handle both applications.
Also, you will have to provide custom network ports for the ScanCode.io application
as the ports 80 and 443 will be already used by the DejaCode application.

Also, you will have to **provide custom network ports for the ScanCode.io**
application as the ports 80 and 443 will be already used by the DejaCode
application.

See https://scancodeio.readthedocs.io/en/latest/installation.html#use-alternative-http-ports
Finally, it's essential to specify ``http://host.docker.internal:[port]`` as the
**ScanCode.io URL** instead of using ``http://localhost:[port]``.

1. Install a ScanCode.io server following instructions at
https://scancodeio.readthedocs.io/en/latest/installation.html
Expand All @@ -355,26 +360,55 @@ Install and configure ScanCode.io
| Disk | **2x500GB SDD** in RAID mirror setup (enterprise disk preferred). |
+-----------+---------------------------------------------------------------------+

2. Enable the ScanCode.io authentication system following:
https://scancodeio.readthedocs.io/en/latest/scancodeio-settings.html#scancodeio-require-authentication

3. Create a user in ScanCode.io and get its API key for authentication by your
DejaCode instance:
https://scancodeio.readthedocs.io/en/latest/command-line-interface.html#scanpipe-create-user-username
2. Set the ScanCode.io Server URL in your Dataspace Configuration:

4. Set the ScanCode.io Server URL and API key in your Dataspace Configuration:
- Access your DejaCode web application **Administration dashboard**.
- Navigate to the **Dataspaces** section and select your Dataspace name.
- Within the **Application Process Settings** section, enable the
**Enable package scanning** option.
- Update the values for the **ScanCode.io URL** field located in the **Configuration**
panel at the bottom of the form.

- Access your DejaCode web application **Administration dashboard**.
- Navigate to the **Dataspaces** section and select your Dataspace name.
- Within the **Application Process Settings** section, enable the
**Enable package scanning** option.
- Update the values for the **ScanCode.io URL** and **ScanCode.io API key** fields
located in the **Configuration** panel at the bottom of the form.
- Click the **Save** button.
.. warning:: If running ScanCode.io on the same docker host as DejaCode, you will have
to use ``http://host.docker.internal:[port]`` as the **ScanCode.io URL**.
- Click the **Save** button.

You can now access the **Scans** section from the **Tools** menu and request package
You can now access the **Scans** section from the **Tools** menu and initiate package
scans from this view.

.. tip:: To validate the setup of the integration, navigate to the top right menu
dropdown in the DejaCode header, and select **Integrations Status**.

Secure ScanCode.io enforcing Authentication
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In the context of deploying ScanCode.io as an enterprise solution, enforcing
**authentication** measures is **critical**. This section provides guidance on
**activating ScanCode.io authentication** and **generating an API key**.
This key is essential for enabling **secure interactions** between DejaCode and ScanCode.io.

1. Follow the instructions at `Scancode.io Application Settings <https://scancodeio.readthedocs.io/en/latest/application-settings.html#scancodeio-settings-require-authentication>`_
to enable the ScanCode.io authentication system.

2. After making the settings change, restart the ScanCode.io services using the
following commands:

.. code-block:: bash

docker compose restart web worker

3. Generate an API key for authentication by your DejaCode instance.
`Refer to CLI Create User <https://scancodeio.readthedocs.io/en/latest/command-line-interface.html#cli-create-user>`_
for detailed instructions.

4. Set the ScanCode.io API key in your Dataspace Configuration:

- Access your DejaCode web application **Administration dashboard**.
- Navigate to the **Dataspaces** section and select your Dataspace name.
- Update the value for the **ScanCode.io API key** field located in the
**Configuration** panel at the bottom of the form.
- Click the **Save** button.

.. _dejacode_dataspace_purldb:

Enable PurlDB service
Expand Down
2 changes: 1 addition & 1 deletion etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ server {
location / {
proxy_pass http://gunicorn_app;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header Host $http_host;
proxy_redirect off;
client_max_body_size 1G;
proxy_read_timeout 600s;
Expand Down
0