mirror of
https://github.com/YunoHost-Apps/piwigo_ynh.git
synced 2024-09-03 20:06:03 +02:00
Use SSO in private AND public mode. In public mode, the user will be authenticated if logged in Yunohost portal. Depending of piwigo configuration, the user could otherwise log in as a guest, or via a specific piwigo-only account.
This commit is contained in:
parent
0cb4536a02
commit
9d624bf772
3 changed files with 12 additions and 9 deletions
|
@ -1,8 +1,10 @@
|
|||
<?php
|
||||
|
||||
/* Dans cette fenêtre, écrivez les informations pour configurer votre galerie Piwigo. */
|
||||
|
||||
// Use HTTP authentication
|
||||
$conf['apache_authentication'] = true;
|
||||
|
||||
// Use external authentication
|
||||
$conf['external_authentification'] = true;
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -8,7 +8,7 @@ location PATHTOCHANGE {
|
|||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param REMOTE_USER $remote_user;
|
||||
fastcgi_param REMOTE_USER $remote_user if_not_empty;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ sudo chmod 755 -R $final_path/galleries
|
|||
# Reload Nginx and regenerate SSOwat conf
|
||||
|
||||
sudo service nginx reload
|
||||
sudo yunohost app setting piwigo skipped_uris -v "/"
|
||||
sudo yunohost app setting piwigo unprotected_uris -v "/"
|
||||
sudo yunohost app ssowatconf
|
||||
|
||||
# Generate random password for admin
|
||||
|
@ -79,7 +79,10 @@ adm_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9'
|
|||
#configure piwigo via curl
|
||||
echo "127.0.0.1 $domain #yunopiwigo" | sudo tee -a /etc/hosts
|
||||
sleep 2
|
||||
curl -kL -X POST https://$domain$path/install.php?language=fr_FR --data "install=true&dbuser=$db_user&dbpasswd=$db_pwd&dbname=$db_user&admin_name=$user&admin_pass1=$adm_pwd&admin_pass2=$adm_pwd&admin_mail=webmaster@$domain" > /home/admin/test
|
||||
curl -kL -X POST https://$domain$path/install.php?language=fr_FR --data "install=true&dbuser=$db_user&dbpasswd=$db_pwd&dbname=$db_user&admin_name=$user&admin_pass1=$adm_pwd&admin_pass2=$adm_pwd&admin_mail=webmaster@$domain" > /home/yunohost.app/piwigo/piwigo-install.log
|
||||
|
||||
#Change local config
|
||||
sudo cp ../conf/config.inc.php $final_path/local/config/
|
||||
|
||||
#change variable in local/config/database.inc.php
|
||||
|
||||
|
@ -94,10 +97,8 @@ sudo cp ../conf/database.inc.php $final_path/local/config/database.inc.php
|
|||
mysql -u $db_user -p$db_pwd $db_user -e "INSERT INTO plugins (id,state,version) VALUES ('Ldap_Login','active','1.1');"
|
||||
|
||||
#protect URIs
|
||||
|
||||
if [ $is_public = "No" ];
|
||||
then
|
||||
sudo cp ../conf/config.inc.php $final_path/local/config/
|
||||
sudo yunohost app setting piwigo protected_uris -v "/"
|
||||
sudo yunohost app ssowatconf
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue