diff --git a/conf/nginx.conf b/conf/nginx.conf index 0ea3a8e..8c68c6e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,4 @@ -location PATHTOCHANGE/ { - COMMENT_IF_ROOTrewrite ^PATHTOCHANGE$ PATHTOCHANGE/ permanent; +location / { proxy_pass http://localhost:7777/; proxy_set_header Host $host; proxy_buffering off; diff --git a/manifest.json b/manifest.json index 027dd2b..872012a 100644 --- a/manifest.json +++ b/manifest.json @@ -35,11 +35,11 @@ "name": "path", "type": "path", "ask": { - "en": "Choose a path for Haste", - "fr": "Choisissez un chemin pour Haste" + "en": "Choose a path for Haste, only root works for now.", + "fr": "Choisissez un chemin pour Haste, seul la racine fonctionne." }, - "example": "/example", - "default": "/example" + "example": "/", + "default": "/" }, { "name": "is_public", diff --git a/scripts/_common.sh b/scripts/_common.sh index cca262f..e501557 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -23,9 +23,10 @@ source /usr/share/yunohost/helpers # check_or_install_npm() { - if ! dpkg -s npm | grep "installed" > /dev/null 2>&1; then + if ! dpkg -s npm | grep "installed" > /dev/null 2>&1 \ + || dpkg -s nodejs-legacy | grep "installed" > /dev/null 2>&1; then sudo apt-get update - sudo apt-get install -y npm + sudo apt-get install -y npm nodejs-legacy fi } @@ -99,12 +100,6 @@ install_haste() { # Modify Nginx configuration file and copy it to Nginx conf directory sed -i "s@PATHTOCHANGE@${YNH_PATH%/}@g" ../conf/nginx.conf - if [ "$path" = "/" ] - then - sed -i "s@COMMENT_IF_ROOT@#@g" ../conf/nginx.conf - else - sed -i "s@COMMENT_IF_ROOT@@g" ../conf/nginx.conf - fi sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/"$app".conf # If app is public, add url to SSOWat conf as skipped_uris diff --git a/scripts/install b/scripts/install index 35de8c2..7c1953b 100755 --- a/scripts/install +++ b/scripts/install @@ -15,6 +15,11 @@ is_public=$YNH_APP_ARG_IS_PUBLIC sudo yunohost app checkurl "${domain}${path}" -a "$app" \ || ynh_die "Path not available: ${domain}${path}" +if ! [ "$path" = "/" ] +then + ynh_die "Path must be /" +fi + # Save app settings ynh_app_setting_set "$app" is_public "$is_public"