Merge pull request #27 from YunoHost-Apps/helpers
Some checks failed
pytest / test (3.10) (push) Has been cancelled
pytest / test (3.7) (push) Has been cancelled
pytest / test (3.8) (push) Has been cancelled
pytest / test (3.9) (push) Has been cancelled

Use standard redis helpers
This commit is contained in:
Salamandar 2024-05-20 18:06:50 +02:00 committed by GitHub
commit 68eb65b6a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 182 additions and 43 deletions

View file

@ -1,6 +1,8 @@
# All available README files by language
- [Read the README in English](README.md)
- [Lee el README en español](README_es.md)
- [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md)
- [Leggi il “README” in italiano](README_it.md)
- [阅读中文(简体)的 README](README_zh_Hans.md)

View file

@ -9,7 +9,7 @@ It shall NOT be edited by hand.
[![Install django-fritzconnection with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=django-fritzconnection)
*[Read this README is other languages.](./ALL_README.md)*
*[Read this README in other languages.](./ALL_README.md)*
> *This package allows you to install django-fritzconnection quickly and simply on a YunoHost server.*
> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*

59
README_es.md Normal file
View file

@ -0,0 +1,59 @@
<!--
Este archivo README esta generado automaticamente<https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
No se debe editar a mano.
-->
# django-fritzconnection para Yunohost
[![Nivel de integración](https://dash.yunohost.org/integration/django-fritzconnection.svg)](https://dash.yunohost.org/appci/app/django-fritzconnection) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/django-fritzconnection.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/django-fritzconnection.maintain.svg)
[![Instalar django-fritzconnection con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=django-fritzconnection)
*[Leer este README en otros idiomas.](./ALL_README.md)*
> *Este paquete le permite instalardjango-fritzconnection rapidamente y simplement en un servidor YunoHost.*
> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.*
## Descripción general
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)
**Versión actual:** 0.2.0~ynh3
## Capturas
![Captura de django-fritzconnection](./doc/screenshots/screenshot.png)
## Documentaciones y recursos
- Repositorio del código fuente oficial de la aplicación : <https://github.com/jedie/django-fritzconnection>
- Catálogo YunoHost: <https://apps.yunohost.org/app/django-fritzconnection>
- Reportar un error: <https://github.com/YunoHost-Apps/django-fritzconnection_ynh/issues>
## Información para desarrolladores
Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/testing
Para probar la rama `testing`, sigue asÍ:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/testing --debug
o
sudo yunohost app upgrade django-fritzconnection -u https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/testing --debug
```
**Mas informaciones sobre el empaquetado de aplicaciones:** <https://yunohost.org/packaging_apps>

59
README_eu.md Normal file
View file

@ -0,0 +1,59 @@
<!--
Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
EZ editatu eskuz.
-->
# django-fritzconnection YunoHost-erako
[![Integrazio maila](https://dash.yunohost.org/integration/django-fritzconnection.svg)](https://dash.yunohost.org/appci/app/django-fritzconnection) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/django-fritzconnection.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/django-fritzconnection.maintain.svg)
[![Instalatu django-fritzconnection YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=django-fritzconnection)
*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
> *Pakete honek django-fritzconnection YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
## Aurreikuspena
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)
**Paketatutako bertsioa:** 0.2.0~ynh3
## Pantaila-argazkiak
![django-fritzconnection(r)en pantaila-argazkia](./doc/screenshots/screenshot.png)
## Dokumentazioa eta baliabideak
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/jedie/django-fritzconnection>
- YunoHost Denda: <https://apps.yunohost.org/app/django-fritzconnection>
- Eman errore baten berri: <https://github.com/YunoHost-Apps/django-fritzconnection_ynh/issues>
## Garatzaileentzako informazioa
Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/testing).
`testing` abarra probatzeko, ondorengoa egin:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/testing --debug
edo
sudo yunohost app upgrade django-fritzconnection -u https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/testing --debug
```
**Informazio gehiago aplikazioaren paketatzeari buruz:** <https://yunohost.org/packaging_apps>

59
README_zh_Hans.md Normal file
View file

@ -0,0 +1,59 @@
<!--
注意:此 README 由 <https://github.com/YunoHost/apps/tree/master/tools/readme_generator> 自动生成
请勿手动编辑。
-->
# YunoHost 上的 django-fritzconnection
[![集成程度](https://dash.yunohost.org/integration/django-fritzconnection.svg)](https://dash.yunohost.org/appci/app/django-fritzconnection) ![工作状态](https://ci-apps.yunohost.org/ci/badges/django-fritzconnection.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/django-fritzconnection.maintain.svg)
[![使用 YunoHost 安装 django-fritzconnection](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=django-fritzconnection)
*[阅读此 README 的其它语言版本。](./ALL_README.md)*
> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 django-fritzconnection。*
> *如果您还没有 YunoHost请参阅[指南](https://yunohost.org/install)了解如何安装它。*
## 概况
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)
**分发版本:** 0.2.0~ynh3
## 截图
![django-fritzconnection 的截图](./doc/screenshots/screenshot.png)
## 文档与资源
- 上游应用代码库: <https://github.com/jedie/django-fritzconnection>
- YunoHost 商店: <https://apps.yunohost.org/app/django-fritzconnection>
- 报告 bug <https://github.com/YunoHost-Apps/django-fritzconnection_ynh/issues>
## 开发者信息
请向 [`testing` 分支](https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/testing) 发送拉取请求。
如要尝试 `testing` 分支,请这样操作:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/testing --debug
sudo yunohost app upgrade django-fritzconnection -u https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/testing --debug
```
**有关应用打包的更多信息:** <https://yunohost.org/packaging_apps>

View file

@ -15,7 +15,7 @@ license = "GPL-3.0"
code = "https://github.com/jedie/django-fritzconnection"
[integration]
yunohost = ">= 11.2"
yunohost = ">= 11.2.12"
architectures = "all"
multi_instance = true
ldap = true

View file

@ -34,43 +34,3 @@ _build_app() {
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
#=================================================
# Redis HELPERS
#=================================================
# get the first available redis database
#
# usage: ynh_redis_get_free_db
# | returns: the database number to use
ynh_redis_get_free_db() {
local result max db
result=$(redis-cli INFO keyspace)
# get the num
max=$(cat /etc/redis/redis.conf | grep ^databases | grep -Eow "[0-9]+")
db=0
# default Debian setting is 15 databases
for i in $(seq 0 "$max"); do
if ! echo "$result" | grep -q "db$i"; then
db=$i
break 1
fi
db=-1
done
test "$db" -eq -1 && ynh_die "No available Redis databases..."
echo "$db"
}
# Create a master password and set up global settings
# Please always call this script in install and restore scripts
#
# usage: ynh_redis_remove_db database
# | arg: database - the database to erase
ynh_redis_remove_db() {
local db=$1
redis-cli -n "$db" flushall
}