Skip to content

Commit

Permalink
Merge branch 'master' into issues/910-fix-config-editor-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier authored Sep 5, 2024
2 parents 2f53c4f + a40adbc commit d8e0155
Show file tree
Hide file tree
Showing 14 changed files with 186 additions and 116 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Python Package to Pypi.org

on:
release:
types: [published, edited]

permissions:
id-token: write

jobs:
pypi-publish:
name: Release Python Package on Pypi.org
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/openwisp-controller
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -U pip
pip install build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.9.0
46 changes: 24 additions & 22 deletions docs/developer/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Add ``openwisp_utils.loaders.DependencyLoader`` to ``TEMPLATES`` in your
}
]
5. Initial Database Setup
7. Initial Database Setup
-------------------------

Ensure you are using one of the available geodjango backends, e.g.:
Expand All @@ -213,7 +213,7 @@ Ensure you are using one of the available geodjango backends, e.g.:
For more information about GeoDjango, please refer to the `geodjango
documentation <https://docs.djangoproject.com/en/4.2/ref/contrib/gis/>`_.

6. Django Channels Setup
8. Django Channels Setup
------------------------

Create ``asgi.py`` in your project folder and add following lines in it:
Expand All @@ -239,7 +239,7 @@ Create ``asgi.py`` in your project folder and add following lines in it:
}
)
7. Other Settings
9. Other Settings
-----------------

Add the following settings to ``settings.py``:
Expand All @@ -263,8 +263,8 @@ For more information about CHANNEL_LAYERS setting, please refer to the
`CHANNEL_LAYERS documentation
<https://channels.readthedocs.io/en/latest/deploying.html#setting-up-a-channel-backend>`_.

6. Inherit the AppConfig Class
------------------------------
10. Inherit the AppConfig Class
-------------------------------

Please refer to the following files in the sample app of the test project:

Expand Down Expand Up @@ -300,8 +300,8 @@ For more information regarding the concept of ``AppConfig`` please refer
to the `"Applications" section in the django documentation
<https://docs.djangoproject.com/en/4.2/ref/applications/>`_.

7. Create Your Custom Models
----------------------------
11. Create Your Custom Models
-----------------------------

For the purpose of showing an example, we added a simple "details" field
to the models of the sample app in the test project.
Expand All @@ -325,8 +325,8 @@ You can add fields in a similar way in your ``models.py`` file.
please refer to the `"Models" section in the django documentation
<https://docs.djangoproject.com/en/4.2/topics/db/models/>`_.

8. Add Swapper Configurations
-----------------------------
12. Add Swapper Configurations
------------------------------

Once you have created the models, add the following to your
``settings.py``:
Expand Down Expand Up @@ -365,8 +365,8 @@ Substitute ``sample_config``, ``sample_pki``, ``sample_connection``,
``sample_geo`` & ``sample_subnet_division`` with the name you chose in
step 1.

9. Create Database Migrations
-----------------------------
13. Create Database Migrations
------------------------------

Create database migrations:

Expand Down Expand Up @@ -399,7 +399,7 @@ For more information, refer to the `"Migrations" section in the django
documentation
<https://docs.djangoproject.com/en/4.2/topics/migrations/>`_.

10. Create the Admin
14. Create the Admin
--------------------

Refer to the ``admin.py`` file of the sample app.
Expand All @@ -418,13 +418,15 @@ Refer to the ``admin.py`` file of the sample app.
To introduce changes to the admin, you can do it in two main ways which
are described below.

**Note**: for more information regarding how the django admin works, or
how it can be customized, please refer to `"The django admin site" section
in the django documentation
<https://docs.djangoproject.com/en/4.2/ref/contrib/admin/>`_.
.. note::

For more information regarding how the django admin works, or how it
can be customized, please refer to `"The django admin site" section in
the django documentation
<https://docs.djangoproject.com/en/4.2/ref/contrib/admin/>`_.

1. Monkey Patching
~~~~~~~~~~~~~~~~~~
14.1. Monkey Patching
~~~~~~~~~~~~~~~~~~~~~

If the changes you need to add are relatively small, you can resort to
monkey patching.
Expand Down Expand Up @@ -485,8 +487,8 @@ For example:
"example"
] # <-- monkey patching example
2. Inheriting admin classes
~~~~~~~~~~~~~~~~~~~~~~~~~~~
14.2. Inheriting admin classes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you need to introduce significant changes and/or you don't want to
resort to monkey patching, you can proceed as follows:
Expand Down Expand Up @@ -659,7 +661,7 @@ resort to monkey patching, you can proceed as follows:
pass
# add your changes here
11. Create Root URL Configuration
15. Create Root URL Configuration
---------------------------------

.. code-block:: python
Expand Down Expand Up @@ -692,7 +694,7 @@ For more information about URL configuration in django, please refer to
the `"URL dispatcher" section in the django documentation
<https://docs.djangoproject.com/en/4.2/topics/http/urls/>`_.

12. Import the Automated Tests
16. Import the Automated Tests
------------------------------

When developing a custom application based on this module, it's a good
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ Developer Docs

Other useful resources:

- :doc:`../user/rest-api`
- :doc:`../user/settings`
- :doc:`../user/rest-api`
- :doc:`../user/settings`
4 changes: 2 additions & 2 deletions docs/developer/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ If you are incurring in the following exception:
You need to specify ``SPATIALITE_LIBRARY_PATH`` in your ``settings.py`` as
explained in `django documentation regarding how to install and configure
spatialte
<https://docs.djangoproject.com/en/2.1/ref/contrib/gis/install/spatialite/>`_.
<https://docs.djangoproject.com/en/4.2/ref/contrib/gis/install/spatialite/>`_.

Having Issues with Other Geospatial Libraries?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please refer `troubleshooting issues related to geospatial libraries
<https://docs.djangoproject.com/en/2.1/ref/contrib/gis/install/#library-environment-settings/>`_.
<https://docs.djangoproject.com/en/4.2/ref/contrib/gis/install/#library-environment-settings/>`_.

.. important::

Expand Down
21 changes: 11 additions & 10 deletions docs/user/push-operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ Introduction

.. important::

If you have installed OpenWISP with the `ansbile-openwisp2 role
<https://galaxy.ansible.com/openwisp/openwisp2>`_ you can skip the
following steps, which are handled automatically by the ansible role
during the first installation.
If you have installed OpenWISP with one of the :doc:`Official
installers </installers>` you can skip the following steps, which are
handled automatically during the first installation.

The Ansible role automatically creates a default template to update
``authorized_keys`` on networking devices using the default access
Expand All @@ -34,20 +33,22 @@ command:

.. code-block:: shell
echo './sshkey' | ssh-keygen -t ed25519 -C "openwisp"
ssh-keygen -f ./sshkey -t ed25519 -C "openwisp" -N ""
This will create two files in the current directory, one called ``sshkey``
(the private key) and one called ``sshkey.pub`` (the public key).

Store the content of these files in a secure location.

**Note:** Support for **ED25519** was added in OpenWrt 21.02 (requires
Dropbear > 2020.79). If you are managing devices with OpenWrt < 21, then
you will need to use RSA keys:
.. note::

.. code-block:: shell
Support for **ED25519** was added in OpenWrt 21.02 (requires Dropbear
> 2020.79). If you are managing devices with OpenWrt < 21, then you
will need to use RSA keys:

.. code-block:: shell
echo './sshkey' | ssh-keygen -t rsa -b 4096 -C "openwisp"
ssh-keygen -f ./sshkey -t rsa -b 4096 -C "openwisp"
2. Save SSH Private Key in "Access Credentials"
-----------------------------------------------
Expand Down
Loading

0 comments on commit d8e0155

Please sign in to comment.