mirror of
https://github.com/YunoHost-Apps/calibreweb_ynh.git
synced 2024-09-03 18:16:20 +02:00
kepubify for multi-instance
This commit is contained in:
parent
82c8532b5f
commit
09b4c213f6
6 changed files with 20 additions and 12 deletions
|
@ -32,7 +32,7 @@ ynh_backup --src_path="$install_dir"
|
||||||
# BACKUP THE KEPUBIFY BINARY
|
# BACKUP THE KEPUBIFY BINARY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/opt/kepubify"
|
ynh_backup --src_path="/opt/kepubify/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
|
|
|
@ -43,7 +43,7 @@ fi
|
||||||
|
|
||||||
#install kepubify converter
|
#install kepubify converter
|
||||||
ynh_script_progression --message="Installing kepubify..." --weight=1
|
ynh_script_progression --message="Installing kepubify..." --weight=1
|
||||||
ynh_setup_source --dest_dir="/opt/kepubify" --source_id="kepubify"
|
ynh_setup_source --dest_dir="/opt/kepubify/$app/" --source_id="kepubify"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -152,8 +152,8 @@ yunohost service add $app --description="Browse eBook in the web" --log="$log_fi
|
||||||
|
|
||||||
chown -R $app: $install_dir
|
chown -R $app: $install_dir
|
||||||
chmod 740 $install_dir
|
chmod 740 $install_dir
|
||||||
chown -R $app: /opt/kepubify
|
chown -R $app: /opt/kepubify/$app
|
||||||
chmod 770 /opt/kepubify/kepubify
|
chmod 770 /opt/kepubify/$app/kepubify
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
|
|
|
@ -48,7 +48,7 @@ fi
|
||||||
|
|
||||||
# Remove the data directory if --purge option is used
|
# Remove the data directory if --purge option is used
|
||||||
ynh_script_progression --message="Removing kepubify directory..." --weight=1
|
ynh_script_progression --message="Removing kepubify directory..." --weight=1
|
||||||
ynh_secure_remove --file="/opt/kepubify"
|
ynh_secure_remove --file="/opt/kepubify/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
|
|
|
@ -28,7 +28,7 @@ ynh_restore_file --origin_path="$install_dir"
|
||||||
# RESTORE THE KEPUBIFY BINARIES
|
# RESTORE THE KEPUBIFY BINARIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring Kepubify..." --weight=1
|
ynh_script_progression --message="Restoring Kepubify..." --weight=1
|
||||||
ynh_restore_file --origin_path="/opt/kepubify"
|
ynh_restore_file --origin_path="/opt/kepubify/$app"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -79,11 +79,19 @@ fi
|
||||||
|
|
||||||
#Adding kepubify converter
|
#Adding kepubify converter
|
||||||
if [ -z $(sqlite3 $install_dir/app.db "SELECT config_kepubifypath FROM settings") ]; then
|
if [ -z $(sqlite3 $install_dir/app.db "SELECT config_kepubifypath FROM settings") ]; then
|
||||||
eval sqlite3 $install_dir/app.db "\"UPDATE settings SET config_kepubifypath='/opt/kepubify/kepubify-linux-$mach' WHERE ID=1\""
|
eval sqlite3 $install_dir/app.db "\"UPDATE settings SET config_kepubifypath='/opt/kepubify/$app/kepubify' WHERE ID=1\""
|
||||||
fi
|
fi
|
||||||
if [ ! -d /opt/kepubify ]; then
|
if [ ! -d /opt/kepubify/$app ]; then
|
||||||
ynh_setup_source --dest_dir="/opt/kepubify" --source_id="kepubify"
|
ynh_setup_source --dest_dir="/opt/kepubify/$app" --source_id="kepubify"
|
||||||
chmod 770 /opt/kepubify/kepubify
|
chmod 770 /opt/kepubify/$app/kepubify
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Change kepubify to new path (for multiinstance
|
||||||
|
if [ -f /opt/kepubify/kepubify ]; then
|
||||||
|
rm /opt/kepubify/kepubify
|
||||||
|
fi
|
||||||
|
if sqlite3 $install_dir/app.db "SELECT config_kepubifypath FROM settings" | grep -xq "/opt/kepubify/kepubify" ; then
|
||||||
|
eval sqlite3 $install_dir/app.db "\"UPDATE settings SET config_kepubifypath='/opt/kepubify/$app/kepubify' WHERE ID=1\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -214,7 +222,7 @@ ynh_add_systemd_config
|
||||||
|
|
||||||
# Set permissions on app files
|
# Set permissions on app files
|
||||||
chown -R $app: $install_dir
|
chown -R $app: $install_dir
|
||||||
chown -R $app: /opt/kepubify
|
chown -R $app: /opt/kepubify/$app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
config_ldap_group_name = Column(String, default='calibreweb')
|
config_ldap_group_name = Column(String, default='calibreweb')
|
||||||
|
|
||||||
- config_kepubifypath = Column(String, default=None)
|
- config_kepubifypath = Column(String, default=None)
|
||||||
+ config_kepubifypath = Column(String, default='/opt/kepubify/kepubify')
|
+ config_kepubifypath = Column(String, default='/opt/kepubify/__APP__/kepubify')
|
||||||
config_converterpath = Column(String, default=None)
|
config_converterpath = Column(String, default=None)
|
||||||
config_calibre = Column(String)
|
config_calibre = Column(String)
|
||||||
config_rarfile_location = Column(String, default=None)
|
config_rarfile_location = Column(String, default=None)
|
||||||
|
|
Loading…
Add table
Reference in a new issue