Skip to content

Commit d046b62

Browse files
committed
fix install
1 parent 457dbe9 commit d046b62

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

conf/nginx.conf

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
location /YNH_PATH {
2-
alias /var/www/openid/ ;
1+
location YNH_PATH {
2+
alias /var/www/openidldap/ ;
33
if ($scheme = http) {
44
rewrite ^ https://$server_name$request_uri? permanent;
55
}
66
index index.php;
7-
#try_files $uri $uri/ /YNH_PATH/index.php?user=$uri&$args;
8-
#try_files $uri $uri/ index.php;
9-
#location ~ [^/]\.php(/|$) {
10-
117
location ~* .php$ {
128
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
139
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -17,4 +13,4 @@ location /YNH_PATH {
1713
fastcgi_param PATH_INFO $fastcgi_path_info;
1814
}
1915
}
20-
rewrite ^/YNH_PATH/([A-Za-z0-9]+)$ https://$server_name/YNH_PATH/index.php?user=$1 break;
16+
rewrite ^YNH_PATH/([A-Za-z0-9]+)$ https://$server_nameYNH_PATH/index.php?user=$1 break;

scripts/install

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ domain=$1
55
path=$2
66

77
# Check domain/path availability
8-
sudo yunohost app checkurl $domain$path -a openid
8+
sudo yunohost app checkurl $domain$path -a openidldap
99
if [[ ! $? -eq 0 ]]; then
1010
exit 1
1111
fi
1212

1313
# Copy files to the right place
14-
final_path=/var/www/openid
14+
final_path=/var/www/openidldap
1515

1616
# owner=julienmalik
1717
# repo=openid-ldap
@@ -25,20 +25,20 @@ sudo cp -a ../sources/* $final_path
2525

2626
# Extract default language and timezone that will be provided unless they are by LDAP
2727
ynh_lang=sudo bash -c "echo $LANG | cut -d '_' -f 1"
28-
sudo sed -i "s/YNH_DFT_LANG/$ynh_lang/g" $final_path/ldap.php
29-
ynh_timezone=`cat /etc/timezone`
30-
sudo sed -i "s/YNH_DFT_TIMEZONE/$ynh_timezone/g" $final_path/ldap.php
28+
sudo sed -i "s@YNH_DFT_LANG@$ynh_lang@g" $final_path/ldap.php
29+
ynh_timezone=$(cat /etc/timezone)
30+
sudo sed -i "s@YNH_DFT_TIMEZONE@$ynh_timezone@g" $final_path/ldap.php
3131

3232
# Nginx config
3333
sudo sed -i "s@YNH_PATH@$path@g" ../conf/nginx.conf
34-
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/openid.conf
34+
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/openidldap.conf
3535

3636
# Init log file
37-
sudo rm -f /var/log/openid
38-
sudo touch /var/log/openid
39-
sudo chown www-data: /var/log/openid
37+
sudo rm -f /var/log/openidldap
38+
sudo touch /var/log/openidldap
39+
sudo chown www-data: /var/log/openidldap
4040

4141
# Reload Nginx and regenerate SSOwat conf
4242
sudo service nginx reload
43-
sudo yunohost app setting openid skipped_uris -v "/"
43+
sudo yunohost app setting openidldap skipped_uris -v "/"
4444
sudo yunohost app ssowatconf

scripts/remove

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

33
domain=$(sudo yunohost app setting openid domain)
4-
sudo rm -f /etc/nginx/conf.d/$domain.d/openid.conf
4+
sudo rm -f /etc/nginx/conf.d/$domain.d/openidldap.conf
55

6-
sudo rm -rf /var/www/openid
7-
sudo rm -f /var/log/openid
6+
sudo rm -rf /var/www/openidldap
7+
sudo rm -f /var/log/openidldap
88

99
sudo service nginx reload
1010
sudo yunohost app ssowatconf

0 commit comments

Comments
 (0)