1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00
funkwhale_ynh/scripts/_common.sh
yalh76 0e4482a2fd
Others var (#143)
* Upgrade to 1.1.1 (#138)

* Update README.md

* Test bump to 1.0

* Bump to Yunohost 4 (for Debian upgrade)

* Test removal of nonexistent scripts

* Correct Typo

* Update README.md

* Fix linter warnings

* Fix linter

* Fix linter warnings

* Cleaning up

* Update README.md

* Update to 1.0.1 (#119)

* Update to 1.0.1

* Set new permissions

* Add French Readme

* Readme update

* Update README.md

* Update README.md

* Update README_fr.md

* Update README.md

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Update README_fr.md

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Update README.md

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Update README_fr.md

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Finding an available port

* Uprade to 1.1 and fixes Twisted by retrograding it (#129)

* Fix linter warning : no need to use $is_public

* Clarify custom paths needed to import collections of music files in Readme. (#134)

* Update readme to indicate custom import path 

Yunohost installations of Funkwhale use a different path for file imports than those indicated in the Funkwhale documentation.. (/var/www/Funkwhale/import). We should therefore indicate to the admin user what that path is, and steps necessary to use it.   Addresses #132.

* Fix bash highlighting.

* Update README.md

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Apply Example_ynh (#131)

* Testing (#130)

* Uprade to 1.1 and fixes Twisted by retrograding it (#129)

* Apply example_ynh

Fix #15

* Fix services

* Fix several merging

* Stick to official install process

* fix path_transversal

* Using option '--log_type systemd' with 'yunohost service add' is not relevant anymore

* Try to fix package_check

* Fix package_check test

* Update check_process

* Trying to fix package_check

* Update env.prod

* remove sleep

* Better service name

* missing datadir

* line 111: upgrade_type: unbound variable

* Implement --is_big

* Fix stopping service from previous version

* Fix upgrade

* Fix upgrade

* Apply example_ynh

* Apply example_ynh

* Fix rights

* Update api.src

* Update env.prod

* Update front.src

* Update manifest.json

* Update README.md

* Update README_fr.md

* Fix chmod

* Fix rights

Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Update conf/nginx.conf

Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com>

* Update conf/nginx.conf

Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com>

* fix

* Fix rights for datadir from previous version

* Update upgrade

* Fix recursive chmod

* Fix import link

* Update README_fr.md

Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com>

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
Co-authored-by: Ciarán Ainsworth <cda@rootkey.co.uk>
Co-authored-by: Ciarán Ainsworth <ciaranainsworth@posteo.net>
Co-authored-by: ericgaspar <junk.eg@free.fr>
Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com>
Co-authored-by: Amos Blanton <lightnin@users.noreply.github.com>

* remove others_var

* no more needed

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
Co-authored-by: Ciarán Ainsworth <cda@rootkey.co.uk>
Co-authored-by: Ciarán Ainsworth <ciaranainsworth@posteo.net>
Co-authored-by: ericgaspar <junk.eg@free.fr>
Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com>
Co-authored-by: Amos Blanton <lightnin@users.noreply.github.com>
2021-05-19 19:43:05 +02:00

65 lines
1.7 KiB
Bash

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
# dependencies used by the app
pkg_dependencies="curl python3-pip python3-venv git unzip libldap2-dev libsasl2-dev gettext-base zlib1g-dev libffi-dev libssl-dev \
build-essential ffmpeg libjpeg-dev libmagic-dev libpq-dev postgresql postgresql-contrib python3-dev make \
redis-server \
`# add arm support` \
zlib1g-dev libffi-dev libssl-dev"
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
#
# Redis HELPERS
#
# Point of contact : Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr>
#=================================================
# 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 --message="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
}