mirror of
https://github.com/YunoHost-Apps/django-fmd_ynh.git
synced 2024-09-03 18:26:27 +02:00
Merge pull request #26 from YunoHost-Apps/helpers
Use standard redis helpers
This commit is contained in:
commit
2c10bbc818
5 changed files with 58 additions and 42 deletions
|
@ -1,6 +1,7 @@
|
|||
# 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)
|
||||
|
|
55
README_es.md
Normal file
55
README_es.md
Normal file
|
@ -0,0 +1,55 @@
|
|||
<!--
|
||||
Este archivo README esta generado automaticamente<https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||
No se debe editar a mano.
|
||||
-->
|
||||
|
||||
# django-fmd para Yunohost
|
||||
|
||||
[![Nivel de integración](https://dash.yunohost.org/integration/django-fmd.svg)](https://dash.yunohost.org/appci/app/django-fmd) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/django-fmd.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/django-fmd.maintain.svg)
|
||||
|
||||
[![Instalar django-fmd con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=django-fmd)
|
||||
|
||||
*[Leer este README en otros idiomas.](./ALL_README.md)*
|
||||
|
||||
> *Este paquete le permite instalardjango-fmd 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
|
||||
|
||||
Find My Device Server implemented in Python using Django.
|
||||
Usable for the Andorid App [**FindMyDevice**](https://gitlab.com/Nulide/findmydevice/) by [Nnulide](https://nulide.de/):
|
||||
|
||||
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get FindMyDevice on F-Droid" height="80">](https://f-droid.org/packages/de.nulide.findmydevice/)
|
||||
|
||||
[![pytest](https://github.com/YunoHost-Apps/django-fmd_ynh/actions/workflows/pytest.yml/badge.svg?branch=master)](https://github.com/YunoHost-Apps/django-fmd_ynh/actions/workflows/pytest.yml) [![YunoHost apps package linter](https://github.com/YunoHost-Apps/django-fmd_ynh/actions/workflows/package_linter.yml/badge.svg)](https://github.com/YunoHost-Apps/django-fmd_ynh/actions/workflows/package_linter.yml) [![Coverage Status on codecov.io](https://codecov.io/gh/YunoHost-Apps/django-fmd_ynh/branch/master/graph/badge.svg)](https://codecov.io/gh/YunoHost-Apps/django-fmd_ynh)
|
||||
|
||||
[![django-fmd @ PyPi](https://img.shields.io/pypi/v/django-fmd?label=django-fmd%20%40%20PyPi)](https://pypi.org/project/django-fmd/)
|
||||
[![Python Versions](https://img.shields.io/pypi/pyversions/django-fmd)](https://gitlab.com/jedie/django-find-my-device/-/blob/main/pyproject.toml)
|
||||
[![License GPL V3+](https://img.shields.io/pypi/l/django-fmd)](https://gitlab.com/jedie/django-find-my-device/-/blob/main/LICENSE)
|
||||
|
||||
Pull requests welcome ;)
|
||||
|
||||
This package for YunoHost used [django-yunohost-integration](https://github.com/YunoHost-Apps/django_yunohost_integration)
|
||||
|
||||
|
||||
**Versión actual:** 0.3.2~ynh2
|
||||
## Documentaciones y recursos
|
||||
|
||||
- Sitio web oficial: <https://gitlab.com/jedie/django-find-my-device>
|
||||
- Repositorio del código fuente oficial de la aplicación : <https://gitlab.com/jedie/django-find-my-device>
|
||||
- Catálogo YunoHost: <https://apps.yunohost.org/app/django-fmd>
|
||||
- Reportar un error: <https://github.com/YunoHost-Apps/django-fmd_ynh/issues>
|
||||
|
||||
## Información para desarrolladores
|
||||
|
||||
Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/django-fmd_ynh/tree/testing
|
||||
|
||||
Para probar la rama `testing`, sigue asÍ:
|
||||
|
||||
```bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/django-fmd_ynh/tree/testing --debug
|
||||
o
|
||||
sudo yunohost app upgrade django-fmd -u https://github.com/YunoHost-Apps/django-fmd_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Mas informaciones sobre el empaquetado de aplicaciones:** <https://yunohost.org/packaging_apps>
|
|
@ -3,7 +3,7 @@
|
|||
请勿手动编辑。
|
||||
-->
|
||||
|
||||
# YunoHost 的 django-fmd
|
||||
# YunoHost 上的 django-fmd
|
||||
|
||||
[![集成程度](https://dash.yunohost.org/integration/django-fmd.svg)](https://dash.yunohost.org/appci/app/django-fmd) ![工作状态](https://ci-apps.yunohost.org/ci/badges/django-fmd.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/django-fmd.maintain.svg)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ website = "https://gitlab.com/jedie/django-find-my-device"
|
|||
code = "https://gitlab.com/jedie/django-find-my-device"
|
||||
|
||||
[integration]
|
||||
yunohost = ">= 11.2"
|
||||
yunohost = ">= 11.2.12"
|
||||
architectures = "all"
|
||||
multi_instance = false
|
||||
ldap = true
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
@ -29,41 +27,3 @@ _install_fmd_venv() {
|
|||
#=================================================
|
||||
# FUTURE OFFICIAL 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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue