Skip to content

Commit

Permalink
clean up some installation details
Browse files Browse the repository at this point in the history
  • Loading branch information
stitch committed Feb 18, 2025
1 parent a5e6eaf commit aaf65f3
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 39 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
For quick installation: Follow [these quick instructions](https://github.com/internetstandards/Internet.nl-dashboard/blob/50/docs/render/markdown/1_installation.md)
and watch [this 6 minute video](https://github.com/internetstandards/Internet.nl-dashboard/tree/50/docs/input/internet.nl%20dashboard%20installation%20video%20small.mp4).
For quick installation: Follow [these quick instructions](https://github.com/internetstandards/Internet.nl-dashboard/blob/main/docs/render/markdown/1_installation.md)
and watch [this 6 minute video](https://github.com/internetstandards/Internet.nl-dashboard/tree/main/docs/input/internet.nl%20dashboard%20installation%20video%20small.mp4).

# Internet.nl Dashboard
The internet.nl dashboard allows you to visualize batch scans from the internet.nl API. It allows:
Expand All @@ -18,8 +18,8 @@ The internet.nl dashboard allows you to visualize batch scans from the internet.

## Setup / installation

For quick installation: Follow [these quick instructions](https://github.com/internetstandards/Internet.nl-dashboard/blob/50/docs/render/markdown/1_installation.md)
and watch [this 6 minute video](https://github.com/internetstandards/Internet.nl-dashboard/tree/50/docs/input/internet.nl%20dashboard%20installation%20video%20small.mp4).
For quick installation: Follow [these quick instructions](https://github.com/internetstandards/Internet.nl-dashboard/blob/main/docs/render/markdown/1_installation.md)
and watch [this 6 minute video](https://github.com/internetstandards/Internet.nl-dashboard/tree/main/docs/input/internet.nl%20dashboard%20installation%20video%20small.mp4).


## Screenshots
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-License-Identifier: Apache-2.0
import logging

from django.core.management.base import BaseCommand
from django.contrib.auth.models import User

from dashboard.internet_nl_dashboard.models import DashboardUser, Account

log = logging.getLogger(__package__)


class Command(BaseCommand):

def handle(self, *args, **options):
superusers = User.objects.all().filter(is_superuser=True)

for user in superusers:
if not DashboardUser.objects.filter(user=user).first():
DashboardUser.objects.create(
user=user,
account=Account.objects.all().first(), # should always exist
mail_preferred_language='en',
mail_send_mail_after_scan_finished=False,
mail_after_mail_unsubscribe_code='',
)
print(f"Added DashboardUser for superuser {user}")
print("Done")
75 changes: 40 additions & 35 deletions docs/input/1_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ What do you need

* Optional: a domain name and SMTP settings

On this machine you need to be running docker, orbstack or something like that.


.. rst-class:: page-break
.. raw:: pdf
Expand All @@ -54,7 +56,7 @@ Installation is mostly configuration work inside the dashboard. Some of the belo
is released.


Running the dashboard (during development of 5.0)
Running the dashboard
-------------------------------------------------

In the command shell, perform the following commands.
Expand All @@ -63,32 +65,14 @@ In the command shell, perform the following commands.

git clone https://github.com/internetstandards/Internet.nl-dashboard/
cd Internet.nl-dashboard
git checkout 50
docker compose up --build

After a short while your dashboard instance will be ready at :8000.

You can start and restart the application by running ``docker compose up --build``, use control+c to stop.


Running the dashboard (when 5.0 is released)
--------------------------------------------
Download the version you want to run. These can be downloaded from the releases page, here:
https://github.com/internetstandards/Internet.nl-dashboard/releases

Releases from version 5.0 and over support docker compose. You can also download a release
from the command line, with the following command:

::

mkdir dashboard && cd dashboard
wget https://github.com/internetstandards/Internet.nl-dashboard/archive/refs/tags/v5.0.tar.gz
tar -zxvf v5.0.tar.gz
docker compose up --build
After a short while your dashboard instance will be ready at http://localhost:8000

After a short while your dashboard instance will be ready at :8000.
Note that on local environments the web application will not work well with the Apple Safari browser due to
CSRF security policies that come out of the box. Please use another browser for testing purposes.

You can start and restart the application by running ``docker compose up --build``, use control+c to stop.
For production environments we recommend running a reverse proxy to this port. Examples include nginx or apache.


Load up default configuration
Expand Down Expand Up @@ -120,21 +104,14 @@ If you also want an example lists to get started, run the following command.
Setting up the first user
-------------------------
After setting up the first user administration can be performed via the administrative interface.

Create a new user:

``docker exec -ti internetnl-dashboard-backend-1 dashboard createsuperuser``


Associate that user to the default account, assuming the createsuperuser was added with user id 1:

``docker exec -ti internetnl-dashboard-database-1 psql --user dashboard -c "update internet_nl_dashboard_dashboarduser set account_id=1 where user_id=1;"``


If you get an error that a certain user already exists, this might not be your first attempt to install the dashboard
via this method. The docker installation method shares the same database.
Make sure to associate the newly created super user also is connected to an account. This can be performed with SQL and
via the admin portal.

Then connect the superuser to a dashboard account. Superusers can join any account through the front-end or admin interface:
``docker exec -ti internetnl-dashboard-backend-1 dashboard connect_superusers``

Logging in
----------
Expand Down Expand Up @@ -196,6 +173,15 @@ Use the following commands, of course with your own personal settings::
docker exec -ti internetnl-dashboard-backend-1 dashboard constance set INTERNET_NL_SCAN_TRACKING_NAME "My Dashboard Instance"


Examples of these settings for internet.nl servers are:

- DASHBOARD_FRONTEND_URL https://dashboard.internet.nl
- INTERNET_NL_API_URL https://batch.internet.nl/api/batch/v2
- CREDENTIAL_CHECK_URL https://batch.internet.nl/api/batch/v2/requests
- INTERNET_NL_SCAN_TRACKING_NAME "My Internet.nl Dashboard"
- EMAIL_DASHBOARD_ADDRESS https://dashboard.internet.nl


4. Setup the API credentials for the account.

1. Go to the account management page
Expand All @@ -221,6 +207,7 @@ You are now set to perform your first scan.
PageBreak
Performing your first scan
==========================

Expand Down Expand Up @@ -272,7 +259,8 @@ Advanced configuration

Setting up e-mail notification after scanning
---------------------------------------------
After a scan completes it's possible to receive an e-mail. An SMTP server has to be configured.
After a scan completes it's possible to receive an e-mail. An SMTP server has to be configured in the admin interface,
here: http://localhost:8000/admin/django_mail_admin/outbox/

1. Visit the admin interface on ``/admin/`` and log in.

Expand All @@ -289,6 +277,23 @@ templates is English and several templates are pre-installed to be customized. F
check the :ref:`email templates` chapter.



Setting up subdomain suggestions
--------------------------------

It's possible to use subdomain suggestions when managing lists of urls. The exact instructions for running and installing
this feature are to be documented.

In the admin interface on http://localhost:8000/admin/constance/config/ you will find the possibility to use subdomain
suggestions via a separate installation of the CTLSSA tool.

The CTLSSA tool can be found here and run via docker:
https://github.com/internetstandards/Internet.nl-ct-log-subdomain-suggestions-api/

In the internet.nl dashboard settings, point the SUBDOMAIN_SUGGESTION_SERVER_ADDRESS setting to the CTLSSA instance.



.. rst-class:: page-break
.. raw:: pdf
Expand Down

0 comments on commit aaf65f3

Please sign in to comment.