Skip to content

Commit

Permalink
chg: [documentation] Added information about how to start the website…
Browse files Browse the repository at this point in the history
… with systemd.
  • Loading branch information
cedricbonhomme committed Jul 10, 2024
1 parent 04faa6e commit a599995
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,37 @@ You can stop it with
With the default configuration, you can access the web interface on http://0.0.0.0:10001,
where you will find the API and can start playing with it.


Launching the website with systemd
----------------------------------

Create a file ``/etc/systemd/system/vulnerability-lookup-web.service`` with the following contents:


.. code-block:: ini
[Unit]
Description=Vulnerability Lookup webservice
After=network.target
[Service]
User=<username>
WorkingDirectory=/home/<username>/vulnerability-lookup
ExecStart=/bin/sh -c '<path-to-virtualenv>/bin/gunicorn -b 127.0.0.1:5000 -w 4 website.app'
Restart=always
[Install]
WantedBy=multi-user.target
- Appropriately adjust the ``User`` and ``WorkindDirectory``
- Replace ``<path-to-virtualenv>`` with the path indicated by the command ``poetry shell``.


.. code-block:: bash
$ sudo systemctl daemon-reload
$ sudo systemctl enable vulnerability-lookup-web.service
$ sudo systemctl start vulnerability-lookup-web.service
$ systemctl status vulnerability-lookup-web.service

0 comments on commit a599995

Please sign in to comment.