diff --git a/README.md b/README.md index 7ed17a6..c1e8324 100644 --- a/README.md +++ b/README.md @@ -15,21 +15,33 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Web based FritzBox management using Python/Django. +Web based FritzBox management using Python/Django and the great [fritzconnection](https://github.com/kbr/fritzconnection) library. -**Shipped version:** 0.0.2~ynh1 +The basic idea is to block/unblock Internet access to a group of devices as easily as possible. - -## Disclaimers / important information - [![pytest](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/pytest.yml/badge.svg?branch=master)](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/pytest.yml) [![YunoHost apps package linter](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/package_linter.yml/badge.svg)](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/package_linter.yml) [![Coverage Status on codecov.io](https://codecov.io/gh/YunoHost-Apps/django-fritzconnection_ynh/branch/master/graph/badge.svg)](https://codecov.io/gh/YunoHost-Apps/django-fritzconnection_ynh) +![django-fritzconnection @ PyPi](https://img.shields.io/pypi/v/django-fritzconnection?label=django-fritzconnection%20%40%20PyPi) +![Python Versions](https://img.shields.io/pypi/pyversions/django-fritzconnection) +![License GPL V3+](https://img.shields.io/pypi/l/django-fritzconnection) + Pull requests welcome ;) This package for YunoHost used [django-yunohost-integration](https://github.com/YunoHost-Apps/django_yunohost_integration) +**Shipped version:** 0.1.0~ynh1 + + + +## Screenshots + +![](./doc/screenshots/v002_hosts_change_list.png) +![](./doc/screenshots/v010rc1_group_management.png) + +## Disclaimers / important information + ## Settings and upgrades Almost everything related to django-fritzconnection's configuration is handled in a `"../conf/settings.py"` file. diff --git a/README_fr.md b/README_fr.md index 956c7f4..bd537bc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,21 +11,33 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble +Web based FritzBox management using Python/Django and the great [fritzconnection](https://github.com/kbr/fritzconnection) library. +The basic idea is to block/unblock Internet access to a group of devices as easily as possible. -**Version incluse :** 0.0.2~ynh1 - - - -## Avertissements / informations importantes [![pytest](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/pytest.yml/badge.svg?branch=master)](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/pytest.yml) [![YunoHost apps package linter](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/package_linter.yml/badge.svg)](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/package_linter.yml) [![Coverage Status on codecov.io](https://codecov.io/gh/YunoHost-Apps/django-fritzconnection_ynh/branch/master/graph/badge.svg)](https://codecov.io/gh/YunoHost-Apps/django-fritzconnection_ynh) +![django-fritzconnection @ PyPi](https://img.shields.io/pypi/v/django-fritzconnection?label=django-fritzconnection%20%40%20PyPi) +![Python Versions](https://img.shields.io/pypi/pyversions/django-fritzconnection) +![License GPL V3+](https://img.shields.io/pypi/l/django-fritzconnection) + Pull requests welcome ;) This package for YunoHost used [django-yunohost-integration](https://github.com/YunoHost-Apps/django_yunohost_integration) +**Version incluse :** 0.1.0~ynh1 + + + +## Captures d'écran + +![](./doc/screenshots/v002_hosts_change_list.png) +![](./doc/screenshots/v010rc1_group_management.png) + +## Avertissements / informations importantes + ## Settings and upgrades Almost everything related to django-fritzconnection's configuration is handled in a `"../conf/settings.py"` file. diff --git a/conf/requirements.txt b/conf/requirements.txt index eb60401..130024f 100644 --- a/conf/requirements.txt +++ b/conf/requirements.txt @@ -4,12 +4,12 @@ asgiref==3.5.0; python_version >= "3.7" and python_full_version < "4.0.0" \ async-timeout==4.0.2; python_version >= "3.7" and python_full_version < "4.0.0" \ --hash=sha256:2163e1640ddb52b7a8c80d0a67a08587e5d245cc9c553a74a847056bc2976b15 \ --hash=sha256:8ca1e4fcf50d07413d66d1a5e416e42cfdf5851c981d679a09851a6853383b3c -bleach==4.1.0; python_version >= "3.7" and python_full_version < "4.0.0" \ - --hash=sha256:4d2651ab93271d1129ac9cbc679f524565cc8a1b791909c4a51eac4446a15994 \ - --hash=sha256:0900d8b37eba61a802ee40ac0061f8c2b5dee29c1927dd1d233e075ebf5a71da -bx-django-utils==20; python_version >= "3.7" and python_full_version < "4.0.0" \ - --hash=sha256:7daf89de453cfaff49117dc24a1c2408fcc91279cd11554e0c16683095cec8b3 \ - --hash=sha256:6a5be502414a63fbd462c0f29a1403def436b89450a1325a24fa1233a5410ada +bleach==5.0.0; python_version >= "3.7" and python_full_version < "4.0.0" \ + --hash=sha256:08a1fe86d253b5c88c92cc3d810fd8048a16d15762e1e5b74d502256e5926aa1 \ + --hash=sha256:c6d6cc054bdc9c83b48b8083e236e5f00f238428666d2ce2e083eaa5fd568565 +bx-django-utils==21; python_version >= "3.7" and python_full_version < "4.0.0" \ + --hash=sha256:414ada254464b6db851a4eed20460e3d6d78c749459419cbadc7341019d69379 \ + --hash=sha256:ccd90e09c5f334d848508b9ba0fe1857291548cfb49a41cc56d3c78744773951 bx-py-utils==60; python_version >= "3.6" and python_full_version < "4.0.0" \ --hash=sha256:e321f7275aaf36829fc193023b1d0daca17415aaf74632915de2c202ecc26bd8 \ --hash=sha256:d3395a9f72d2e2633b1e322ff8608204601e14eb3f6dc5d346953002a309ffcf @@ -40,9 +40,9 @@ django-axes==5.31.0; python_version >= "3.7" and python_full_version < "4.0.0" \ django-debug-toolbar==3.2.4; python_version >= "3.7" and python_full_version < "4.0.0" \ --hash=sha256:644bbd5c428d3283aa9115722471769cac1bec189edf3a0c855fd8ff870375a9 \ --hash=sha256:6b633b6cfee24f232d73569870f19aa86c819d750e7f3e833f2344a9eb4b4409 -django-fritzconnection==0.0.2; python_version >= "3.7" and python_full_version < "4.0.0" \ - --hash=sha256:665614f4c628a4430d41b72f6eb9bfaf88e37d401619a70ff7ed3eb46072e755 \ - --hash=sha256:13e5a8222b2261a1ff342541556741d7b037f1a183c0d69016db1f3664971023 +django-fritzconnection==0.1.0; python_version >= "3.7" and python_full_version < "4.0.0" \ + --hash=sha256:f1eb6c2d99f1d417a7ce0ed73b2aaea0788b0d743ae699b5b2abbdd0f1806458 \ + --hash=sha256:89f820756d4194c0361ba87a3ba3b945c99976dab0beb4bf1d3422cbeb68047c django-ipware==4.0.2; python_version >= "3.7" and python_full_version < "3.0.0" or python_version >= "3.7" and python_full_version < "4.0.0" and python_full_version >= "3.6.0" \ --hash=sha256:602a58325a4808bd19197fef2676a0b2da2df40d0ecf21be414b2ff48c72ad05 \ --hash=sha256:878dbb06a87e25550798e9ef3204ed70a200dd8b15e47dcef848cf08244f04c9 @@ -73,8 +73,8 @@ fritzconnection==1.9.1; python_version >= "3.7" and python_full_version < "4.0.0 gunicorn==20.1.0; python_version >= "3.7" and python_full_version < "4.0.0" \ --hash=sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e \ --hash=sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8 -icdiff==2.0.4; python_version >= "3.7" and python_full_version < "4.0.0" \ - --hash=sha256:c72572e5ce087bc7a7748af2664764d4a805897caeefb665bdc12677fefb2212 +icdiff==2.0.5; python_version >= "3.7" and python_full_version < "4.0.0" \ + --hash=sha256:35d24b728e48b7e0a12bdb69386d3bfc7eef4fe922d0ac1cd70d6e5c11630bae idna==3.3; python_version >= "3.7" and python_full_version < "3.0.0" or python_version >= "3.7" and python_full_version < "4.0.0" and python_full_version >= "3.6.0" \ --hash=sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff \ --hash=sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..a7baad6 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,14 @@ +Web based FritzBox management using Python/Django and the great [fritzconnection](https://github.com/kbr/fritzconnection) library. + +The basic idea is to block/unblock Internet access to a group of devices as easily as possible. + + +[![pytest](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/pytest.yml/badge.svg?branch=master)](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/pytest.yml) [![YunoHost apps package linter](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/package_linter.yml/badge.svg)](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/package_linter.yml) [![Coverage Status on codecov.io](https://codecov.io/gh/YunoHost-Apps/django-fritzconnection_ynh/branch/master/graph/badge.svg)](https://codecov.io/gh/YunoHost-Apps/django-fritzconnection_ynh) + +![django-fritzconnection @ PyPi](https://img.shields.io/pypi/v/django-fritzconnection?label=django-fritzconnection%20%40%20PyPi) +![Python Versions](https://img.shields.io/pypi/pyversions/django-fritzconnection) +![License GPL V3+](https://img.shields.io/pypi/l/django-fritzconnection) + +Pull requests welcome ;) + +This package for YunoHost used [django-yunohost-integration](https://github.com/YunoHost-Apps/django_yunohost_integration) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index effe062..5ab59e1 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,10 +1,3 @@ -[![pytest](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/pytest.yml/badge.svg?branch=master)](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/pytest.yml) [![YunoHost apps package linter](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/package_linter.yml/badge.svg)](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/actions/workflows/package_linter.yml) [![Coverage Status on codecov.io](https://codecov.io/gh/YunoHost-Apps/django-fritzconnection_ynh/branch/master/graph/badge.svg)](https://codecov.io/gh/YunoHost-Apps/django-fritzconnection_ynh) - -Pull requests welcome ;) - -This package for YunoHost used [django-yunohost-integration](https://github.com/YunoHost-Apps/django_yunohost_integration) - - ## Settings and upgrades Almost everything related to django-fritzconnection's configuration is handled in a `"../conf/settings.py"` file. diff --git a/doc/screenshots/v002_hosts_change_list.png b/doc/screenshots/v002_hosts_change_list.png new file mode 100644 index 0000000..de3a5e4 Binary files /dev/null and b/doc/screenshots/v002_hosts_change_list.png differ diff --git a/doc/screenshots/v010rc1_group_management.png b/doc/screenshots/v010rc1_group_management.png new file mode 100644 index 0000000..e44450d Binary files /dev/null and b/doc/screenshots/v010rc1_group_management.png differ diff --git a/manifest.json b/manifest.json index 5fb41b8..d03adfa 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "Web based FritzBox management using Python/Django." }, - "version": "0.0.2~ynh1", + "version": "0.1.0~ynh1", "url": "https://github.com/jedie/django-fritzconnection", "upstream": { "license": "GPL-3.0", diff --git a/poetry.lock b/poetry.lock index af6ca5a..37cf3a5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -78,20 +78,23 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "bleach" -version = "4.1.0" +version = "5.0.0" description = "An easy safelist-based HTML-sanitizing tool." category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.dependencies] -packaging = "*" six = ">=1.9.0" webencodings = "*" +[package.extras] +css = ["tinycss2 (>=1.1.0)"] +dev = ["pip-tools (==6.5.1)", "pytest (==7.1.1)", "flake8 (==4.0.1)", "tox (==3.24.5)", "sphinx (==4.3.2)", "twine (==4.0.0)", "wheel (==0.37.1)", "hashin (==0.17.0)", "black (==22.3.0)", "mypy (==0.942)"] + [[package]] name = "bx-django-utils" -version = "20" +version = "21" description = "Various Django utility functions" category = "main" optional = false @@ -295,7 +298,7 @@ sqlparse = ">=0.2.0" [[package]] name = "django-fritzconnection" -version = "0.0.2" +version = "0.1.0" description = "Web based FritzBox management using Python/Django." category = "main" optional = false @@ -479,7 +482,7 @@ tornado = ["tornado (>=0.2)"] [[package]] name = "icdiff" -version = "2.0.4" +version = "2.0.5" description = "improved colored diff" category = "main" optional = false @@ -947,7 +950,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = ">=3.7,<4.0.0" -content-hash = "4c39c72fdad761c8491a5f92d4f347d4fa3102a6b776f32769b93ba85d093b83" +content-hash = "37b18c0bb33f8711595ce5e90a425ec623b8f1a0ecd202116009e89ce176ef2a" [metadata.files] asgiref = [ @@ -996,12 +999,12 @@ black = [ {file = "black-22.3.0.tar.gz", hash = "sha256:35020b8886c022ced9282b51b5a875b6d1ab0c387b31a065b84db7c33085ca79"}, ] bleach = [ - {file = "bleach-4.1.0-py2.py3-none-any.whl", hash = "sha256:4d2651ab93271d1129ac9cbc679f524565cc8a1b791909c4a51eac4446a15994"}, - {file = "bleach-4.1.0.tar.gz", hash = "sha256:0900d8b37eba61a802ee40ac0061f8c2b5dee29c1927dd1d233e075ebf5a71da"}, + {file = "bleach-5.0.0-py3-none-any.whl", hash = "sha256:08a1fe86d253b5c88c92cc3d810fd8048a16d15762e1e5b74d502256e5926aa1"}, + {file = "bleach-5.0.0.tar.gz", hash = "sha256:c6d6cc054bdc9c83b48b8083e236e5f00f238428666d2ce2e083eaa5fd568565"}, ] bx-django-utils = [ - {file = "bx_django_utils-20-py3-none-any.whl", hash = "sha256:7daf89de453cfaff49117dc24a1c2408fcc91279cd11554e0c16683095cec8b3"}, - {file = "bx_django_utils-20.tar.gz", hash = "sha256:6a5be502414a63fbd462c0f29a1403def436b89450a1325a24fa1233a5410ada"}, + {file = "bx_django_utils-21-py3-none-any.whl", hash = "sha256:414ada254464b6db851a4eed20460e3d6d78c749459419cbadc7341019d69379"}, + {file = "bx_django_utils-21.tar.gz", hash = "sha256:ccd90e09c5f334d848508b9ba0fe1857291548cfb49a41cc56d3c78744773951"}, ] bx-py-utils = [ {file = "bx_py_utils-60-py3-none-any.whl", hash = "sha256:e321f7275aaf36829fc193023b1d0daca17415aaf74632915de2c202ecc26bd8"}, @@ -1107,8 +1110,8 @@ django-debug-toolbar = [ {file = "django_debug_toolbar-3.2.4-py3-none-any.whl", hash = "sha256:6b633b6cfee24f232d73569870f19aa86c819d750e7f3e833f2344a9eb4b4409"}, ] django-fritzconnection = [ - {file = "django-fritzconnection-0.0.2.tar.gz", hash = "sha256:665614f4c628a4430d41b72f6eb9bfaf88e37d401619a70ff7ed3eb46072e755"}, - {file = "django_fritzconnection-0.0.2-py3-none-any.whl", hash = "sha256:13e5a8222b2261a1ff342541556741d7b037f1a183c0d69016db1f3664971023"}, + {file = "django-fritzconnection-0.1.0.tar.gz", hash = "sha256:f1eb6c2d99f1d417a7ce0ed73b2aaea0788b0d743ae699b5b2abbdd0f1806458"}, + {file = "django_fritzconnection-0.1.0-py3-none-any.whl", hash = "sha256:89f820756d4194c0361ba87a3ba3b945c99976dab0beb4bf1d3422cbeb68047c"}, ] django-ipware = [ {file = "django-ipware-4.0.2.tar.gz", hash = "sha256:602a58325a4808bd19197fef2676a0b2da2df40d0ecf21be414b2ff48c72ad05"}, @@ -1162,7 +1165,7 @@ gunicorn = [ {file = "gunicorn-20.1.0.tar.gz", hash = "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8"}, ] icdiff = [ - {file = "icdiff-2.0.4.tar.gz", hash = "sha256:c72572e5ce087bc7a7748af2664764d4a805897caeefb665bdc12677fefb2212"}, + {file = "icdiff-2.0.5.tar.gz", hash = "sha256:35d24b728e48b7e0a12bdb69386d3bfc7eef4fe922d0ac1cd70d6e5c11630bae"}, ] idna = [ {file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"}, diff --git a/pyproject.toml b/pyproject.toml index df7b257..8f03e26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "django-fritzconnection_ynh" -version = "0.0.2~ynh1" +version = "0.1.0~ynh1" description = "Test django-fritzconnection_ynh via local_test.py" authors = ["JensDiemer "] license = "GPL" @@ -8,7 +8,7 @@ license = "GPL" [tool.poetry.dependencies] # Keep Python 3.7 until Yunohost contains a newer Python Version ;) python = ">=3.7,<4.0.0" -django-fritzconnection = ">=0.0.2" +django-fritzconnection = ">=0.1.0" # Note: "ynh" extras will install gunicorn, psycopg2, django-redis and django-axes django_yunohost_integration = {version = ">=v0.2.0", extras = ["ynh"]} diff --git a/tests/test_django_project.py b/tests/test_django_project.py index 850008c..5add95c 100644 --- a/tests/test_django_project.py +++ b/tests/test_django_project.py @@ -58,7 +58,14 @@ class DjangoYnhTestCase(HtmlAssertionMixin, TestCase): response = self.client.get('/app_path/', secure=True) self.assertRedirects( - response, expected_url='/app_path/admin/', fetch_redirect_response=False + response, expected_url='/app_path/group_management/', fetch_redirect_response=False + ) + + response = self.client.get('/app_path/group_management/', secure=True) + self.assertRedirects( + response, + expected_url='/app_path/admin/login/?next=/app_path/group_management/', + fetch_redirect_response=False, ) response = self.client.get('/app_path/admin/', secure=True) diff --git a/tests/test_project_setup.py b/tests/test_project_setup.py index 479476f..793fd87 100644 --- a/tests/test_project_setup.py +++ b/tests/test_project_setup.py @@ -4,7 +4,8 @@ import shutil import subprocess from pathlib import Path -from bx_py_utils.path import assert_is_file +from bx_django_utils.filename import clean_filename +from bx_py_utils.path import assert_is_dir, assert_is_file import djfritz @@ -69,3 +70,20 @@ def test_requirements_txt(): ) print(diff) assert diff == '', f'{requirements_txt} is not up-to-date! (Hint: call: "make update")' + + +def test_screenshot_filenames(): + """ + https://forum.yunohost.org/t/yunohost-bot-cant-handle-spaces-in-screenshots/19483 + """ + screenshot_path = PACKAGE_ROOT / 'doc' / 'screenshots' + assert_is_dir(screenshot_path) + renamed = [] + for file_path in screenshot_path.iterdir(): + file_name = file_path.name + cleaned_name = clean_filename(file_name) + if cleaned_name != file_name: + new_path = file_path.with_name(cleaned_name) + file_path.rename(new_path) + renamed.append(f'{file_name!r} renamed to {cleaned_name!r}') + assert not renamed, f'Bad screenshots file names found: {", ".join(renamed)}'