mirror of
https://github.com/YunoHost-Apps/haste_ynh.git
synced 2024-09-03 20:36:28 +02:00
fix dependancies and path must be root
This commit is contained in:
parent
fc7b3eb3d9
commit
2c0f85715b
4 changed files with 13 additions and 14 deletions
|
@ -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;
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue