Skip to content

Commit

Permalink
[enh] #20: form install: resolve domain name with '--resolve' curl op…
Browse files Browse the repository at this point in the history
…tion.

- instead of modifying '/etc/hosts'.
  • Loading branch information
M5oul committed Apr 5, 2017
1 parent 29f0f56 commit 3c9860d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ ynh_app_setting_set "$app" unprotected_uris "/"
sudo service nginx reload
sudo yunohost app ssowatconf

# Temporary add domain name to /etc/hosts
sudo sed -i "1 i\127.0.0.1 $domain #pluxml_hosts" /etc/hosts

# Make request to install app
# Get the html page
curl_path=$([ "$path" == "/" ] || echo $path)
Expand All @@ -74,7 +71,7 @@ curl -kL -o install_page.html https://$domain$curl_path/install.php >/dev/null 2
# Get the token for form validation
token=$(cat install_page.html | grep "input" | grep "token" | tail -1 | cut -d' ' -f3 | cut -d'"' -f2)
# Send http POST values
curl -k -X POST \
curl -k -X POST --resolve "$domain:443:localhost"\
--data-urlencode "default_lang=$default_lang" \
--data-urlencode "install=Installer" \
--data-urlencode "name=$admin" \
Expand All @@ -86,9 +83,6 @@ curl -k -X POST \

sudo rm -f $src_path/install.php

# Remove domain name from /etc/hosts
sudo sed -i "/#pluxml_hosts/d" /etc/hosts

# If app is private, remove url to SSOWat conf from skipped_uris
if [ "$is_public" == "No" ]; then
ynh_app_setting_delete "$app" unprotected_uris
Expand Down

0 comments on commit 3c9860d

Please sign in to comment.