diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e514923..83d65f5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,6 +25,11 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} + - name: Get pip cache dir + id: pip-cache + run: | + echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT + - name: pip cache uses: actions/cache@v3 with: @@ -39,12 +44,19 @@ jobs: pip install setuptools wheel - name: Build Python package - run: python setup.py sdist + run: python setup.py sdist bdist_wheel - name: Upload package to artifacts uses: actions/upload-artifact@v2 with: name: python-packages path: | + dist/*.whl + dist/*.tar.gz + + - uses: crazy-max/ghaction-github-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | dist/*.whl dist/*.tar.gz \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 7e302e6..486cb1d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] name = django-wpm version = 0.1 -description = A Django app to manage wireguard peers on wireguard capeable routers. +description = A Django app to manage wireguard peers on wireguard capable routers. long_description = file: README.md url = https://github.com/secshellnet/wpm-django author = Nico Felbinger @@ -26,4 +26,6 @@ include_package_data = true packages = find: python_requires = >=3.8 install_requires = - Django >= 4.2 \ No newline at end of file + Django >= 4.2 + apscheduler >= 3.10 + requests >= 2.31.0 diff --git a/wpm/apps.py b/wpm/apps.py index aead859..f44b3cb 100644 --- a/wpm/apps.py +++ b/wpm/apps.py @@ -12,6 +12,8 @@ def ready(self): from wpm.services.check_valid import check_valid import wpm.signals + # add the check_valid task - which checks the status of invalid + # peers using the api on the wireguard endpoint - to the scheduler, to run it every 5 seconds scheduler = BackgroundScheduler() scheduler.add_job(check_valid, 'interval', seconds=5) scheduler.start() diff --git a/wpm/locale/de/LC_MESSAGES/django.po b/wpm/locale/de/LC_MESSAGES/django.po new file mode 100644 index 0000000..f41a4be --- /dev/null +++ b/wpm/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,99 @@ +# German translations for wpm-django. +# Copyright (C) 2023 +# This file is distributed under the same license as the secshell.de package. +# Nico Felbinger <26925347+felbinger@users.noreply.github.com>, 2023. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-10-01 12:15+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: wpm/models.py:74 +msgid "owner" +msgstr "Besitzer" + +#: wpm/models.py:95 +msgid "created" +msgstr "Erstellt" + +#: wpm/admin.py:29 +msgid "" +"This key has been generated in the browser.Feel free to overwrite the public " +"key below to use your own key." +msgstr "" +"Dieser Schlüssel wurde im Browser generiert. Sie können auch Ihren eigenen " +"Schlüssel nutzen und ihren öffentlichen Schlüssel unten angeben." + +#: wpm/admin.py:31 +msgid "configure psk" +msgstr "Pre-Shared Key konfigurieren" + +#: wpm/admin.py:75 wpm/models.py:96 +msgid "valid" +msgstr "Gültig" + +#: wpm/apps.py:8 +msgid "wpm" +msgstr "Wireguard Peer Manager" + +#: wpm/models.py:14 +msgid "dns server" +msgstr "DNS Server" + +#: wpm/models.py:15 +msgid "dns servers" +msgstr "DNS Server" + +#: wpm/models.py:17 +msgid "ip address" +msgstr "IP Adresse" + +#: wpm/models.py:26 wpm/models.py:73 +msgid "wireguard endpoint" +msgstr "Wireguard Endpunkt" + +#: wpm/models.py:27 +msgid "wireguard endpoints" +msgstr "Wireguard Endpunkte" + +#: wpm/models.py:53 wpm/models.py:83 +msgid "public key" +msgstr "Öffentlicher Schlüssel" + +#: wpm/models.py:60 +msgid "api token" +msgstr "API Token" + +#: wpm/models.py:70 +msgid "peer" +msgstr "Peer" + +#: wpm/models.py:71 +msgid "peers" +msgstr "Peers" + +#: wpm/models.py:75 +msgid "name" +msgstr "Bezeichnung" + +#: wpm/models.py:81 +msgid "tunnel ipv4" +msgstr "Tunnel IPv4 Adresse" + +#: wpm/models.py:82 +msgid "tunnel ipv6" +msgstr "Tunnel IPv6 Adresse" + +#: wpm/models.py:89 +msgid "psk" +msgstr "Pre-Shared Key" diff --git a/wpm/locale/en/LC_MESSAGES/django.po b/wpm/locale/en/LC_MESSAGES/django.po new file mode 100644 index 0000000..87fbea9 --- /dev/null +++ b/wpm/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,99 @@ +# German translations for wpm-django. +# Copyright (C) 2023 +# This file is distributed under the same license as the secshell.de package. +# Nico Felbinger <26925347+felbinger@users.noreply.github.com>, 2023. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-10-01 12:15+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: wpm/models.py:74 +msgid "owner" +msgstr "Owner" + +#: wpm/models.py:95 +msgid "created" +msgstr "Created" + +#: wpm/admin.py:29 +msgid "" +"This key has been generated in the browser.Feel free to overwrite the public " +"key below to use your own key." +msgstr "" +"This key has been generated in the browser.Feel free to overwrite the public " +"key below to use your own key." + +#: wpm/admin.py:31 +msgid "configure psk" +msgstr "Configure psk" + +#: wpm/admin.py:75 wpm/models.py:96 +msgid "valid" +msgstr "Valid" + +#: wpm/apps.py:8 +msgid "wpm" +msgstr "Wireguard Peer Manager" + +#: wpm/models.py:14 +msgid "dns server" +msgstr "DNS server" + +#: wpm/models.py:15 +msgid "dns servers" +msgstr "DNS servers" + +#: wpm/models.py:17 +msgid "ip address" +msgstr "Ip address" + +#: wpm/models.py:26 wpm/models.py:73 +msgid "wireguard endpoint" +msgstr "Wireguard Endpoint" + +#: wpm/models.py:27 +msgid "wireguard endpoints" +msgstr "Wireguard Endpoints" + +#: wpm/models.py:53 wpm/models.py:83 +msgid "public key" +msgstr "Public key" + +#: wpm/models.py:60 +msgid "api token" +msgstr "API token" + +#: wpm/models.py:70 +msgid "peer" +msgstr "Peer" + +#: wpm/models.py:71 +msgid "peers" +msgstr "Peers" + +#: wpm/models.py:75 +msgid "name" +msgstr "name" + +#: wpm/models.py:81 +msgid "tunnel ipv4" +msgstr "Tunnel ipv4 address" + +#: wpm/models.py:82 +msgid "tunnel ipv6" +msgstr "Tunnel ipv6 address" + +#: wpm/models.py:89 +msgid "psk" +msgstr "Pre shared key"