mirror of
https://github.com/YunoHost-Apps/leed_ynh.git
synced 2024-09-03 19:26:32 +02:00
patch
This commit is contained in:
parent
23d3b70530
commit
79c0589a81
6 changed files with 8 additions and 147 deletions
|
@ -6,7 +6,7 @@
|
||||||
password="pass"
|
password="pass"
|
||||||
language="fr"
|
language="fr"
|
||||||
market=1
|
market=1
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1
|
||||||
; Actions
|
; Actions
|
||||||
is_public=0|1
|
is_public=0|1
|
||||||
; Config_panel
|
; Config_panel
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
"id": "leed",
|
"id": "leed",
|
||||||
"packaging_format": 1,
|
"packaging_format": 1,
|
||||||
"description": {
|
"description": {
|
||||||
"en": "Minimalistic RSS feed aggregator which allows quick and non-intrusive reading of feeds.",
|
"en": "Minimalistic RSS feed aggregator which allows quick and non-intrusive reading of feeds",
|
||||||
"fr": "Agrégateur RSS minimaliste qui permet la consultation de flux RSS de manière rapide et non intrusive."
|
"fr": "Agrégateur RSS minimaliste qui permet la consultation de flux RSS de manière rapide et non intrusive"
|
||||||
},
|
},
|
||||||
"version": "1.9.0~ynh1",
|
"version": "1.9.0~ynh1",
|
||||||
"url": "http://leed.idleman.fr/",
|
"url": "http://leed.idleman.fr/",
|
||||||
|
@ -18,12 +18,12 @@
|
||||||
"email": "maniackc_dev@crudelis.fr"
|
"email": "maniackc_dev@crudelis.fr"
|
||||||
}],
|
}],
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 4.1.0"
|
"yunohost": ">= 4.2.4"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
"nginx",
|
"nginx",
|
||||||
"php7.0-fpm",
|
"php7.3-fpm",
|
||||||
"mysql"
|
"mysql"
|
||||||
],
|
],
|
||||||
"arguments": {
|
"arguments": {
|
||||||
|
|
|
@ -6,118 +6,10 @@
|
||||||
|
|
||||||
YNH_PHP_VERSION="7.3"
|
YNH_PHP_VERSION="7.3"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# PACKAGE CHECK BYPASSING...
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
IS_PACKAGE_CHECK () {
|
|
||||||
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BOOLEAN CONVERTER
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
bool_to_01 () {
|
|
||||||
local var="$1"
|
|
||||||
[ "$var" = "true" ] && var=1
|
|
||||||
[ "$var" = "false" ] && var=0
|
|
||||||
echo "$var"
|
|
||||||
}
|
|
||||||
|
|
||||||
bool_to_true_false () {
|
|
||||||
local var="$1"
|
|
||||||
[ "$var" = "1" ] && var=true
|
|
||||||
[ "$var" = "0" ] && var=false
|
|
||||||
echo "$var"
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# FUTUR OFFICIAL HELPERS
|
# FUTUR OFFICIAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Install or update the main directory yunohost.multimedia
|
|
||||||
#
|
|
||||||
# usage: ynh_multimedia_build_main_dir
|
|
||||||
ynh_multimedia_build_main_dir () {
|
|
||||||
local ynh_media_release="v1.2"
|
|
||||||
local checksum="806a827ba1902d6911095602a9221181"
|
|
||||||
|
|
||||||
# Download yunohost.multimedia scripts
|
|
||||||
wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz 2>&1
|
|
||||||
|
|
||||||
# Check the control sum
|
|
||||||
echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
|
|
||||||
|| ynh_die "Corrupt source"
|
|
||||||
|
|
||||||
# Check if the package acl is installed. Or install it.
|
|
||||||
ynh_package_is_installed 'acl' \
|
|
||||||
|| ynh_package_install acl
|
|
||||||
|
|
||||||
# Extract
|
|
||||||
mkdir yunohost.multimedia-master
|
|
||||||
tar -xf ${ynh_media_release}.tar.gz -C yunohost.multimedia-master --strip-components 1
|
|
||||||
./yunohost.multimedia-master/script/ynh_media_build.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add a directory in yunohost.multimedia
|
|
||||||
# This "directory" will be a symbolic link to a existing directory.
|
|
||||||
#
|
|
||||||
# usage: ynh_multimedia_addfolder "Source directory" "Destination directory"
|
|
||||||
#
|
|
||||||
# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias.
|
|
||||||
# | arg: -d, --dest_dir= - Destination directory - The name and the place of the symbolic link, relative to "/home/yunohost.multimedia"
|
|
||||||
ynh_multimedia_addfolder () {
|
|
||||||
# Declare an array to define the options of this helper.
|
|
||||||
declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= )
|
|
||||||
local source_dir
|
|
||||||
local dest_dir
|
|
||||||
# Manage arguments with getopts
|
|
||||||
ynh_handle_getopts_args "$@"
|
|
||||||
|
|
||||||
./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$source_dir" --dest="$dest_dir"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Move a directory in yunohost.multimedia, and replace by a symbolic link
|
|
||||||
#
|
|
||||||
# usage: ynh_multimedia_movefolder "Source directory" "Destination directory"
|
|
||||||
#
|
|
||||||
# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias.
|
|
||||||
# It will be moved to "Destination directory"
|
|
||||||
# A symbolic link will replace it.
|
|
||||||
# | arg: -d, --dest_dir= - Destination directory - The new name and place of the directory, relative to "/home/yunohost.multimedia"
|
|
||||||
ynh_multimedia_movefolder () {
|
|
||||||
# Declare an array to define the options of this helper.
|
|
||||||
declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= )
|
|
||||||
local source_dir
|
|
||||||
local dest_dir
|
|
||||||
# Manage arguments with getopts
|
|
||||||
ynh_handle_getopts_args "$@"
|
|
||||||
|
|
||||||
./yunohost.multimedia-master/script/ynh_media_addfolder.sh --inv --source="$source_dir" --dest="$dest_dir"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Allow an user to have an write authorisation in multimedia directories
|
|
||||||
#
|
|
||||||
# usage: ynh_multimedia_addaccess user_name
|
|
||||||
#
|
|
||||||
# | arg: -u, --user_name= - The name of the user which gain this access.
|
|
||||||
ynh_multimedia_addaccess () {
|
|
||||||
# Declare an array to define the options of this helper.
|
|
||||||
declare -Ar args_array=( [u]=user_name=)
|
|
||||||
local user_name
|
|
||||||
# Manage arguments with getopts
|
|
||||||
ynh_handle_getopts_args "$@"
|
|
||||||
|
|
||||||
groupadd -f multimedia
|
|
||||||
usermod -a -G multimedia $user_name
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -112,9 +112,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setuping application with CURL..." --weight=5
|
ynh_script_progression --message="Setuping application with CURL..." --weight=5
|
||||||
|
|
||||||
# Set the app as temporarily public for curl call
|
# Making the app public for cURL
|
||||||
ynh_script_progression --message="Configuring SSOwat..."
|
|
||||||
# Making the app public for curl
|
|
||||||
ynh_permission_update --permission="main" --add="visitors"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
|
|
||||||
# Installation with curl
|
# Installation with curl
|
||||||
|
@ -152,15 +150,11 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring SSOwat..." --weight=2
|
ynh_script_progression --message="Configuring permissions..." --weight=2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
# Everyone can access the app.
|
|
||||||
# The "main" permission is automatically created before the install script.
|
|
||||||
ynh_permission_update --permission="main" --add="visitors"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,6 @@ admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..."
|
ynh_script_progression --message="Validating restoration parameters..."
|
||||||
|
|
||||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
|
||||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
|
||||||
test ! -d $final_path \
|
test ! -d $final_path \
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|| ynh_die --message="There is already a directory: $final_path "
|
||||||
|
|
||||||
|
|
|
@ -79,27 +79,6 @@ if [ -z "$db_name" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If is_public doesn't exist, create it
|
|
||||||
if [ -z "$is_public" ]; then
|
|
||||||
public_check=$(ynh_app_setting_get --app=$app --key=skipped_uris)
|
|
||||||
# If skipped_uris is empty, that was a public installation.
|
|
||||||
if [ -z "$public_check" ]; then
|
|
||||||
is_public=1
|
|
||||||
else
|
|
||||||
is_public=0
|
|
||||||
fi
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
|
||||||
else
|
|
||||||
# Fix is_public as a boolean
|
|
||||||
if [ "$is_public" = "Yes" ]; then
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=1
|
|
||||||
is_public=1
|
|
||||||
elif [ "$is_public" = "No" ]; then
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=0
|
|
||||||
is_public=0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If overwrite_nginx doesn't exist, create it
|
# If overwrite_nginx doesn't exist, create it
|
||||||
if [ -z "$overwrite_nginx" ]; then
|
if [ -z "$overwrite_nginx" ]; then
|
||||||
overwrite_nginx=1
|
overwrite_nginx=1
|
||||||
|
@ -220,9 +199,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading Leed with cURL..." --weight=4
|
ynh_script_progression --message="Upgrading Leed with cURL..." --weight=4
|
||||||
# Set the app as temporarily public for curl call
|
# Set the app as temporarily public for curl call
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
# Regen SSOwat configuration
|
|
||||||
yunohost app ssowatconf
|
|
||||||
# Start the upgrade procedure of leed.
|
# Start the upgrade procedure of leed.
|
||||||
ynh_local_curl "/"
|
ynh_local_curl "/"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue