mirror of
https://github.com/YunoHost-Apps/calibreweb_ynh.git
synced 2024-09-03 18:16:20 +02:00
Generate ldap setting during upgrade
This commit is contained in:
parent
afcf08fefa
commit
987cd0e568
3 changed files with 15 additions and 14 deletions
3
conf/init_calibre_db_ldap_settings
Normal file
3
conf/init_calibre_db_ldap_settings
Normal file
|
@ -0,0 +1,3 @@
|
|||
config_use_ldap=1,
|
||||
config_ldap_provider_url=\'localhost:389\',
|
||||
config_ldap_dn=\'uid=%s,ou=users,dc=yunohost,dc=org\',
|
|
@ -8,7 +8,4 @@ config_use_goodreads=0,
|
|||
config_logfile=\'\',
|
||||
config_converterpath=\'\',
|
||||
config_calibre=\'\',
|
||||
config_use_ldap=1,
|
||||
config_ldap_provider_url=\'localhost:389\',
|
||||
config_ldap_dn=\'uid=%s,ou=users,dc=yunohost,dc=org\',
|
||||
config_uploading=\'$upload\'
|
||||
|
|
|
@ -89,22 +89,23 @@ ynh_system_user_create $app
|
|||
# ...
|
||||
#=================================================
|
||||
|
||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
||||
ynh_backup_if_checksum_is_different "$final_path/app.db"
|
||||
|
||||
#set database settings as per conf file
|
||||
conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_settings))) WHERE ID=1\""
|
||||
eval sqlite3 $final_path/app.db "$conf"
|
||||
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum "$final_path/app.db"
|
||||
|
||||
#build multimedia directory
|
||||
#Create multimedia directory but we do not change the calibre_dir : It's the user to make this choice.
|
||||
ynh_multimedia_build_main_dir
|
||||
ynh_multimedia_addaccess $app
|
||||
|
||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
||||
ynh_backup_if_checksum_is_different "$final_path/app.db"
|
||||
|
||||
#set database settings as per conf file : restart server so that app.db is regenerated, then add new ldap settings
|
||||
ynh_systemd_action -a restart -l "INFO in server: Starting Gevent server"
|
||||
conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_ldap_settings))) WHERE ID=1\""
|
||||
eval sqlite3 $final_path/app.db "$conf"
|
||||
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum "$final_path/app.db"
|
||||
|
||||
#=================================================
|
||||
# SETUP LOGROTATE
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue