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

Update LDAP settings

This commit is contained in:
Krakinou 2021-07-25 09:30:10 +02:00
parent 5f7f465bcb
commit 377e397bb5
4 changed files with 8 additions and 22 deletions

View file

@ -5,6 +5,6 @@ config_ldap_authentication=0,
config_ldap_dn=\'dc=yunohost,dc=org\', config_ldap_dn=\'dc=yunohost,dc=org\',
config_ldap_user_object=\'\(\&\(objectClass=posixAccount\)\(permission=cn=calibreweb.main,ou=permission,dc=yunohost,dc=org\)\(uid=%s\)\)\', config_ldap_user_object=\'\(\&\(objectClass=posixAccount\)\(permission=cn=calibreweb.main,ou=permission,dc=yunohost,dc=org\)\(uid=%s\)\)\',
config_ldap_openldap=1, config_ldap_openldap=1,
config_ldap_group_object_filter=\'\(\&\(objectClass=posixGroup\)\(permission=cn=%s.main,ou=permission,dc=yunohost,dc=org\)\)\', config_ldap_group_object_filter=\'\(\&\(objectClass=posixGroup\)\(cn=%s.main\)\)\',
config_ldap_group_members_field=\'memberUid\', config_ldap_group_members_field=\'memberUid\',
config_ldap_group_name=\'calibreweb\' config_ldap_group_name=\'calibreweb\'

View file

@ -177,26 +177,6 @@ chown -R $app:$app /var/log/$app
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# SET SQLITE DATABASE SETTINGS
#=================================================
ynh_script_progression --message="Setting up database and settings..." --weight=5
#we need to start and stop the service so that initial app.db file is created and that we can set default data
#If port 8083 is already in use (ex for second instance), then service start will fail, which is expected : so we do not want
#to set $port on the line match. "server on" will be displayed in case the port is already in use and should be ok to spot the fact that the database is initialized.
#ynh_systemd_action --service_name=$app --action="start" --line_match="Starting Gevent server on" --log_path="$final_path/calibre-web.log" -t 30
#sleep required on low spec like raspberryPi
#sleep 2s
#remove unwanted calibre-web.log
#ynh_secure_remove --file="$final_path/calibre-web.log"
#ynh_systemd_action --service_name=$app --action="stop"
#set database settings as per conf file
#conf="\"UPDATE settings SET $(. <(echo -E echo $(<../conf/init_calibre_db_settings))), $(. <(echo -E echo $(<../conf/init_calibre_db_ldap_settings))) WHERE ID=1\""
#eval sqlite3 $final_path/app.db "$conf"
#conf="\"UPDATE user SET $(. <(echo -E echo $(<../conf/init_calibre_db_user))) WHERE ID=1\""
#eval sqlite3 $final_path/app.db "$conf"
#Update Imagick policy as per https://github.com/janeczku/calibre-web/wiki/FAQ#what-to-do-if-cover-pictures-are-not-extracted-from-pdf-files #Update Imagick policy as per https://github.com/janeczku/calibre-web/wiki/FAQ#what-to-do-if-cover-pictures-are-not-extracted-from-pdf-files
ynh_replace_string --match_string="<policy domain="coder" rights="none" pattern="PDF" />" \ ynh_replace_string --match_string="<policy domain="coder" rights="none" pattern="PDF" />" \

View file

@ -114,6 +114,12 @@ if version_gt "0.6.6" "$current_upstream_app_version" && [ "$current_upstream_pa
current_upstream_app_version="0.6.6" current_upstream_app_version="0.6.6"
fi fi
#LDAP settings were wrongly set in version prior to 0.6.13 and we could not retrieve LDAP users. This will change the settings to correct values
if sqlite3 app.db "SELECT config_ldap_group_object_filter FROM settings" \
| grep -xq "(&(objectClass=posixGroup)(permission=cn=%s.main,ou=permission,dc=yunohost,dc=org))" ; then
eval sqlite3 ./app.db "UPDATE settings SET config_ldap_group_object_filter='(&(objectClass=posixGroup)(cn=%s.main))' WHERE ID=1"
fi
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================

View file

@ -50,7 +50,7 @@
config_ldap_member_user_object = Column(String, default='') # config_ldap_member_user_object = Column(String, default='') #
config_ldap_openldap = Column(Boolean, default=True) config_ldap_openldap = Column(Boolean, default=True)
- config_ldap_group_object_filter = Column(String, default='(&(objectclass=posixGroup)(cn=%s))') - config_ldap_group_object_filter = Column(String, default='(&(objectclass=posixGroup)(cn=%s))')
+ config_ldap_group_object_filter = Column(String, default='(&(objectClass=posixGroup)(permission=cn=%s.main,ou=permission,dc=yunohost,dc=org))') + config_ldap_group_object_filter = Column(String, default='(&(objectClass=posixGroup)(cn=%s.main))')
config_ldap_group_members_field = Column(String, default='memberUid') config_ldap_group_members_field = Column(String, default='memberUid')
config_ldap_group_name = Column(String, default='calibreweb') config_ldap_group_name = Column(String, default='calibreweb')