1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/calibreweb_ynh.git synced 2024-09-03 18:16:20 +02:00

Merge pull request #14 from YunoHost-Apps/Testing

Activate Multi-instance
This commit is contained in:
Krakinou 2018-12-28 20:35:09 +01:00 committed by GitHub
commit bf1e622694
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 100 additions and 7 deletions

View file

@ -23,7 +23,7 @@ Alternatively, you may use [COPS](https://github.com/YunoHost-Apps/cops_ynh) whi
## Backup library
By default, backup process will not backup Calibre library (backup_core_only logic).
By default, backup process will not backup Calibre library ([backup_core_only logic](https://yunohost.org/#/backup_fr)).
You may activate backup of the library with
```
yunohost app setting calibreweb backup_core_only -v 0
@ -52,7 +52,7 @@ chmod o+rw path/to/library
Developers info
----------------
Please do your pull request to the [testing branch](https://github.com/Yunohost-Apps/calibreweb_ynh/tree/Testing).
Please do your pull request to the [testing branch](https://github.com/Yunohost-Apps/calibre_ynh/tree/Testing).
To try the testing branch, please proceed like that.
```
@ -63,7 +63,7 @@ sudo yunohost app upgrade calibreweb -u https://github.com/Yunohost-Apps/calibre
## Todo
- [ ] Multiinstance
- [X] Multiinstance
- [ ] Better Multimedia integration : Integrate in Yunohost.multimedia
- [X] Package_check integration
- [X] On backup/remove/upgrade : check for database location to update settings

View file

@ -16,8 +16,9 @@
setup_private=1
setup_public=1
upgrade=1 from_commit=3b9c5041e4fa73cb965368379f2b83d076c65341
upgrade=1 from_commit=03bafd5219544c5d317eaf54182e4122ba63a4ad
backup_restore=1
multi_instance=0
multi_instance=1
incorrect_path=1
port_already_use=1 (8083)
change_url=1
@ -56,5 +57,6 @@ Notification=none
; commit=3b9c5041e4fa73cb965368379f2b83d076c65341
name=First in progress release of the app 0.9~ynh1
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=1&
; commit=03bafd5219544c5d317eaf54182e4122ba63a4ad
name=Release 0.91~ynh2
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=1&

View file

@ -16,7 +16,7 @@
"requirements": {
"yunohost": ">= 2.7.14"
},
"multi_instance": false,
"multi_instance": true,
"services": [
"nginx"
],

View file

@ -87,3 +87,89 @@ ynh_systemd_action() {
ynh_clean_check_starting
fi
}
#=================================================
#YNH_MULTIMEDIA
#=================================================
# Need also the helper https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_handle_getopts_args/ynh_handle_getopts_args
# Install or update the main directory yunohost.multimedia
#
# usage: ynh_multimedia_build_main_dir
ynh_multimedia_build_main_dir () {
local ynh_media_release="v1.1"
local checksum="9ec4321a92aa2c388af4ee0072735e3e"
# Download yunohost.multimedia scripts
wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz
# 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
}

View file

@ -120,6 +120,7 @@ ynh_add_systemd_config
# CREATE FILES AND DIRECTORIES
#=================================================
#Check if library folder exists. If not create it
if [ ! -e "$calibre_dir" ]; then
ynh_print_info "Create calibre library folder $calibre_dir"
@ -134,6 +135,10 @@ if [ ! -e "$calibre_dir"/metadata.db ]; then
fi
#ynh_multimedia_build_main_dir
#ynh_multimedia_addfolder "eBook" "$calibre_dir"
#ynh_multimedia_addaccess $app
#=================================================
# SETUP LOGROTATE