mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
Fix SSO authentication
This commit is contained in:
parent
aa2679881f
commit
ecc8aae39d
3 changed files with 16 additions and 0 deletions
|
@ -84,6 +84,8 @@ ynh_replace_string --match_string 'MEDIA_URL = "'"$old_path2"'media/"' --replace
|
||||||
ynh_replace_string --match_string "LOGIN_URL = '${old_path2}accounts/login/'" --replace_string "LOGIN_URL = '${path_url2}accounts/login/'" --target_file $final_path/conf/seahub_settings.py
|
ynh_replace_string --match_string "LOGIN_URL = '${old_path2}accounts/login/'" --replace_string "LOGIN_URL = '${path_url2}accounts/login/'" --target_file $final_path/conf/seahub_settings.py
|
||||||
ynh_replace_string --match_string ' = "seafile@'"$old_domain"'"' --replace_string ' = "seafile@'"$domain"'"' --target_file $final_path/conf/seahub_settings.py
|
ynh_replace_string --match_string ' = "seafile@'"$old_domain"'"' --replace_string ' = "seafile@'"$domain"'"' --target_file $final_path/conf/seahub_settings.py
|
||||||
sed --in-place "s@ALLOWED_HOSTS = \['${old_domain}'\]@ALLOWED_HOSTS = \['${domain}'\]@g" --target_file $final_path/conf/seahub_settings.py
|
sed --in-place "s@ALLOWED_HOSTS = \['${old_domain}'\]@ALLOWED_HOSTS = \['${domain}'\]@g" --target_file $final_path/conf/seahub_settings.py
|
||||||
|
ynh_replace_string --match_string "REMOTE_USER_DOMAIN = '$old_domain'" --replace_string "REMOTE_USER_DOMAIN = '$domain'" --target_file $final_path/conf/seahub_settings.py
|
||||||
|
ynh_replace_string --match_string "REMOTE_USER_PROTECTED_PATH = ['$old_path', '$old_path/accounts/login']" --replace_string "REMOTE_USER_PROTECTED_PATH = ['$path_url', '$path_url/accounts/login']" --target_file $final_path/conf/seahub_settings.py
|
||||||
|
|
||||||
ynh_script_progression --message="Updating seafile database" --weight=7
|
ynh_script_progression --message="Updating seafile database" --weight=7
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,12 @@ echo 'SERVER_EMAIL = "seafile@'$domain'"' | tee -a $final_path/conf/seahub_setti
|
||||||
echo 'EMAIL_HOST_PASSWORD = ""' | tee -a $final_path/conf/seahub_settings.py
|
echo 'EMAIL_HOST_PASSWORD = ""' | tee -a $final_path/conf/seahub_settings.py
|
||||||
echo "TIME_ZONE = \"$(cat /etc/timezone)\"" | tee -a $final_path/conf/seahub_settings.py
|
echo "TIME_ZONE = \"$(cat /etc/timezone)\"" | tee -a $final_path/conf/seahub_settings.py
|
||||||
|
|
||||||
|
# SSO authentication
|
||||||
|
echo 'ENABLE_REMOTE_USER_AUTHENTICATION = True' | tee -a $final_path/conf/seahub_settings.py
|
||||||
|
echo 'REMOTE_USER_CREATE_UNKNOWN_USER = False' | tee -a $final_path/conf/seahub_settings.py
|
||||||
|
echo "REMOTE_USER_DOMAIN = '$domain'" | tee -a $final_path/conf/seahub_settings.py
|
||||||
|
echo "REMOTE_USER_PROTECTED_PATH = ['$path_url', '$path_url/accounts/login']" | tee -a $final_path/conf/seahub_settings.py
|
||||||
|
|
||||||
# LDAP configuration
|
# LDAP configuration
|
||||||
echo '[LDAP]' | tee -a $final_path/conf/ccnet.conf
|
echo '[LDAP]' | tee -a $final_path/conf/ccnet.conf
|
||||||
echo 'HOST = ldap://localhost:389' | tee -a $final_path/conf/ccnet.conf
|
echo 'HOST = ldap://localhost:389' | tee -a $final_path/conf/ccnet.conf
|
||||||
|
|
|
@ -122,6 +122,14 @@ case $installed_version in
|
||||||
"6.3."* )
|
"6.3."* )
|
||||||
# Update seafile by script
|
# Update seafile by script
|
||||||
expect_scripts/upgrade_7.0.exp $final_path/seafile-server-$seafile_version $root_pwd
|
expect_scripts/upgrade_7.0.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||||
|
# SSO authentication
|
||||||
|
echo 'ENABLE_REMOTE_USER_AUTHENTICATION = True' | tee -a $final_path/conf/seahub_settings.py
|
||||||
|
echo 'REMOTE_USER_CREATE_UNKNOWN_USER = False' | tee -a $final_path/conf/seahub_settings.py
|
||||||
|
echo "REMOTE_USER_DOMAIN = '$domain'" | tee -a $final_path/conf/seahub_settings.py
|
||||||
|
echo "REMOTE_USER_PROTECTED_PATH = ['$path_url', '$path_url/accounts/login']" | tee -a $final_path/conf/seahub_settings.py
|
||||||
|
|
||||||
|
# Clean connexion from the SSO. If we don't do this we could have some when the user was loged by the old SSO auth mecanisme
|
||||||
|
ynh_mysql_execute_as_root --sql "DELETE FROM `django_session`" --database seahubdb
|
||||||
;&
|
;&
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue