mirror of
https://github.com/YunoHost-Apps/dato_ynh.git
synced 2024-09-03 18:16:33 +02:00
Fix config dir
This commit is contained in:
parent
184a376603
commit
552c37777d
5 changed files with 13 additions and 14 deletions
|
@ -8,7 +8,7 @@ User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__INSTALL_DIR__/sources/
|
WorkingDirectory=__INSTALL_DIR__/sources/
|
||||||
Environment=NODE_ENV=production
|
Environment=NODE_ENV=production
|
||||||
Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/config/
|
Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/sources/config/
|
||||||
Environment="__YNH_NODE_LOAD_PATH__"
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
ExecStart=__YNH_NPM__ start
|
ExecStart=__YNH_NPM__ start
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
|
|
|
@ -17,21 +17,21 @@ bool_to_str() {
|
||||||
}
|
}
|
||||||
|
|
||||||
dato_setup_config_files() {
|
dato_setup_config_files() {
|
||||||
mkdir -p "$install_dir/config/"
|
mkdir -p "$install_dir/sources/config/"
|
||||||
|
|
||||||
# setup public dato config
|
# setup public dato config
|
||||||
ynh_add_config --template="public.js" --destination="$install_dir/config/public.js"
|
ynh_add_config --template="public.js" --destination="$install_dir/sources/config/public.js"
|
||||||
chmod 400 "$install_dir/config/public.js"
|
chmod 400 "$install_dir/sources/config/public.js"
|
||||||
chown "$app:$app" "$install_dir/config/public.js"
|
chown "$app:$app" "$install_dir/sources/config/public.js"
|
||||||
|
|
||||||
# setup private dato config
|
# setup private dato config
|
||||||
if [[ $autosynchronize == true ]]; then
|
if [[ $autosynchronize == true ]]; then
|
||||||
ynh_add_config --template="private-autosync.js" --destination="$install_dir/config/private.js"
|
ynh_add_config --template="private-autosync.js" --destination="$install_dir/sources/config/private.js"
|
||||||
else
|
else
|
||||||
ynh_add_config --template="private.js" --destination="$install_dir/config/private.js"
|
ynh_add_config --template="private.js" --destination="$install_dir/sources/config/private.js"
|
||||||
fi
|
fi
|
||||||
chmod 400 "$install_dir/config/private.js"
|
chmod 400 "$install_dir/sources/config/private.js"
|
||||||
chown "$app:$app" "$install_dir/config/private.js"
|
chown "$app:$app" "$install_dir/sources/config/private.js"
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -111,7 +111,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
mkdir -p "$install_dir/sources/dist"
|
mkdir -p "$install_dir/sources/dist"
|
||||||
chown -R "$app:$app" "$install_dir/sources/dist" "$install_dir/config"
|
chown -R "$app:$app" "$install_dir/sources/dist" "$install_dir/sources/config"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SYSTEM CONFIGURATION
|
# SYSTEM CONFIGURATION
|
||||||
|
|
|
@ -27,7 +27,7 @@ chmod -R o-rwx "$install_dir"
|
||||||
chown -R "$app:www-data" "$install_dir"
|
chown -R "$app:www-data" "$install_dir"
|
||||||
|
|
||||||
mkdir -p "$install_dir/sources/dist"
|
mkdir -p "$install_dir/sources/dist"
|
||||||
chown -R "$app:$app" "$install_dir/sources/dist" "$install_dir/sources/global" "$install_dir/config"
|
chown -R "$app:$app" "$install_dir/sources/dist" "$install_dir/sources/global" "$install_dir/sources/config"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE VARIOUS FILES
|
# RESTORE VARIOUS FILES
|
||||||
|
|
|
@ -23,7 +23,6 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
if [ ! -d "$install_dir/sources" ]; then
|
if [ ! -d "$install_dir/sources" ]; then
|
||||||
mkdir "$install_dir/sources"
|
mkdir "$install_dir/sources"
|
||||||
find . -mindepth 1 -maxdepth 1 ! -name "sources" -exec mv -t "$install_dir/sources" "{}" +
|
find . -mindepth 1 -maxdepth 1 ! -name "sources" -exec mv -t "$install_dir/sources" "{}" +
|
||||||
mv "$install_dir/sources/config" "$install_dir"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -39,13 +38,13 @@ ynh_install_nodejs --nodejs_version="$nodejs_version"
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=3
|
ynh_script_progression --message="Upgrading source files..." --weight=3
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$install_dir/sources" --full_replace=1
|
ynh_setup_source --dest_dir="$install_dir/sources" --full_replace=1 --keep="config"
|
||||||
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R "$app:www-data" "$install_dir"
|
chown -R "$app:www-data" "$install_dir"
|
||||||
|
|
||||||
mkdir -p "$install_dir/sources/dist"
|
mkdir -p "$install_dir/sources/dist"
|
||||||
chown -R "$app:$app" "$install_dir/sources/dist" "$install_dir/sources/global" "$install_dir/config"
|
chown -R "$app:$app" "$install_dir/sources/dist" "$install_dir/sources/global" "$install_dir/sources/config"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
|
|
Loading…
Add table
Reference in a new issue