Document standalone install

This commit is contained in:
Timothy Hobbs 2023-10-12 21:28:03 +02:00
parent 1db03af35b
commit cbb5dcdef9
9 changed files with 200 additions and 72 deletions

View File

@ -19,6 +19,7 @@ contributors reaching far beyond Jutda.
Complete documentation is available in the docs/ directory,
or online at http://django-helpdesk.readthedocs.org/.
Demo Quickstart
---------------
@ -54,25 +55,19 @@ to alert you to this shortcoming. There is no way around it, sorry.
Installation
------------
`django-helpdesk` requires:
* |standalone_icon| For **standalone** installation, refer to `standalone documentation <./docs/standalone.rst>`_.
* Python 3.8+
* Django 3.2 LTS or Django 4.*
* |django_icon| To **integrate** with an existing Django application, follow the guidelines in `installation documentation <./docs/install.rst>`_ and `configuration documentation <./docs/configuration.rst>`_.
You can quickly install the latest stable version of `django-helpdesk`
app via `pip`::
.. |standalone_icon| image:: helpdesk/static/helpdesk/img/icon512.png
:height: 24px
:width: 24px
:align: middle
pip install django-helpdesk
You may also check out the `master` branch on GitHub, and install manually::
python setup.py install
Either way, you will need to add `django-helpdesk` to an existing
Django project.
For further installation information see `docs/install.html`
and `docs/configuration.html`
.. |django_icon| image:: helpdesk/static/helpdesk/img/django-logo-positive.png
:height: 24px
:width: 60px
:align: middle
Developer Environment
---------------------

View File

@ -1,6 +1,10 @@
Installation
============
.. note::
For standalone installation, refer to the :doc:`standalone installation docs <standalone>`.
``django-helpdesk`` installation isn't difficult, but it requires you have a bit of existing know-how about Django.

108
docs/standalone.rst Normal file
View File

@ -0,0 +1,108 @@
==============================
Django-Helpdesk Standalone Installation
==============================
Installation
------------
1. Clone the django-helpdesk repository:
.. code-block:: bash
git clone git@github.com:django-helpdesk/django-helpdesk.git
2. Go to the standalone helpdesk installation directory:
.. code-block:: bash
cd django-helpdesk/standalone
3. Execute the installation script:
.. code-block:: bash
./setup.sh
4. Start the services:
.. code-block:: bash
docker-compose up
Creating an Admin User
----------------------
1. List the running containers:
.. code-block:: bash
docker ps
2. Execute into the `standalone-django-helpdesk-1` container:
.. code-block:: bash
docker exec -it standalone-django-helpdesk-1 bash
3. Change directory to the application's root:
.. code-block:: bash
cd /opt/django-helpdesk/standalone
4. Create a superuser:
.. code-block:: bash
python3 manage.py createsuperuser
5. Visit `localhost:80` in your browser to access the server. Navigate to the `/admin` URL to set up new users. Ensure to configure the "Site" in the admin section for ticket email URLs to function correctly.
Configuration for Production Use
--------------------------------
1. Update the `Caddyfile` to replace the `localhost` URL with your desired production URL.
2. Modify the `docker-compose` file to adjust the paths. By default, files are stored in `/tmp`.
3. For custom configurations, bindmount a `local_settings.py` into `/opt/django-helpdesk/standalone/config/local_settings.py`.
4. To customize the logo in the top-left corner of the helpdesk:
.. code-block:: html
<style>
.navbar-brand {
background: url("https://www.libertyaces.com/files/liberty-logo.png") no-repeat;
background-size: auto;
width: 320px;
background-size: contain;
height: 40px;
text-align: right;
}
</style>
AWS SES Email Configuration
---------------------------
An example `local_settings` configuration for utilizing AWS SES for email:
.. code-block:: python
import os
DEFAULT_FROM_EMAIL = "support@bitswan.space"
SERVER_EMAIL = "support@bitswan.space"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID")
EMAIL_BACKEND = "django_ses.SESBackend"
AWS_SES_REGION_NAME = "eu-west-1"
AWS_SES_REGION_ENDPOINT = "email.eu-west-1.amazonaws.com"
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY")
To integrate `django-ses`, bindmount a file to `/opt/extra-dependencies.txt` containing:
.. code-block:: text
django-ses
Ensure to update the `docker.env` file with your necessary secrets.

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1"
viewBox="0 0 48 48"
enable-background="new 0 0 48 48"
id="svg80"
sodipodi:docname="icon.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
inkscape:export-filename="icon64.png"
inkscape:export-xdpi="128"
inkscape:export-ydpi="128"
width="48"
height="48"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs84" />
<sodipodi:namedview
id="namedview82"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="14.723261"
inkscape:cx="23.975667"
inkscape:cy="21.564517"
inkscape:window-width="1918"
inkscape:window-height="1078"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg80" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.802;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stop-color:#000000"
id="rect1275"
width="46.454441"
height="46.285763"
x="0.82081562"
y="0.90725207"
rx="4.5999999" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:39.6725px;line-height:1.25;font-family:'Liberation Mono';-inkscape-font-specification:'Liberation Mono, Bold';letter-spacing:0px;word-spacing:0px;stroke-width:2.925;stroke-dasharray:none;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal"
x="2.4006474"
y="34.318501"
id="text546"
transform="scale(0.94599029,1.0570933)"><tspan
sodipodi:role="line"
id="tspan544"
x="2.4006474"
y="34.318501"
style="stroke-width:2.925;stroke-dasharray:none;-inkscape-font-specification:'Liberation Mono, Bold';font-family:'Liberation Mono';font-weight:bold;font-style:normal;font-stretch:normal;font-variant:normal;font-size:39.67250061px;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal">d</tspan></text>
<text
xml:space="preserve"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:44.6638px;line-height:1.25;font-family:'Liberation Mono';-inkscape-font-specification:'Liberation Mono, Bold Italic';letter-spacing:0px;word-spacing:0px;fill:#750900;fill-opacity:1;stroke-width:2.3927;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal"
x="21.424101"
y="-5.6638317"
id="text600"
transform="matrix(0.94975213,0.00239744,0.00650059,-1.0528899,0,0)"><tspan
sodipodi:role="line"
id="tspan598"
x="21.424101"
y="-5.6638317"
style="fill:#750900;fill-opacity:1;stroke-width:2.3927;-inkscape-font-specification:'Liberation Mono, Bold Italic';font-family:'Liberation Mono';font-weight:bold;font-style:italic;font-stretch:normal;font-variant:normal;font-size:44.66379929px;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal">?</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:2.61108px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 5.9800122,40.433928 36.5608698,0.03139 v 0"
id="path651" />
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -3,3 +3,4 @@ autopep8
flake8
pycodestyle
isort
freezegun

View File

@ -3,60 +3,5 @@ Django-helpdesk standalone
This is a standalone installation of Django-helpdesk allowing you to run django-helpdesk as a production standalone application in docker.
To install run `setup.sh` and then `docker-compose up` in this directory.
For installation instructions see [the documentation](../docs/standalone.rst)
To create an admin user exec into the newly created container
docker ps
docker exec -it standalone-django-helpdesk-1 bash
In the container cd to `/opt/django-helpdesk/standalone` and run
python3 manage.py createsuperuser
You should now be able to log in to the server by visiting `localhost:80`. You will also need to access the `/admin` url to set up new users. You also need to set the Site in the admin so that URLs in ticket emails will work.
Configuration for production use
--------------------------------------
For production use you will need to change the URL from `localhost` in the `Caddyfile`. You will also need to update the `docker-compose` file to fix paths. By default all files are stored in `/tmp`.
You should be able to set custom settings by bindmounting a `local_settings.py` file into `/opt/django-helpdesk/standalone/config/local_settings.py`
You can change the logo at the top left of the helpdesk by bindmounting a file into `/opt/django-helpdesk/helpdesk/templates/helpdesk/custom_navigation_header.html` with contents like:
```
<style>
.navbar-brand {
background: url("https://www.libertyaces.com/files/liberty-logo.png") no-repeat;
background-size: auto;
width: 320px;
background-size: contain;
height: 40px;
text-align: right;
}
</style>
```
Here is an example `local_settings` file for using AWS SES for sending emails:
```
import os
DEFAULT_FROM_EMAIL = "support@bitswan.space"
SERVER_EMAIL = "support@bitswan.space"
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID")
EMAIL_BACKEND = "django_ses.SESBackend"
AWS_SES_REGION_NAME = "eu-west-1"
AWS_SES_REGION_ENDPOINT = "email.eu-west-1.amazonaws.com"
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY")
```
In this case you'll also have to bindmout a file to `/opt/extra-dependencies.txt` with the contents:
```
django-ses
```
You would of course also have to edit docker.env to add your secrets.