1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/netdata_ynh.git synced 2024-09-03 19:46:33 +02:00

Install in /var/www/$app like any other app ..

This commit is contained in:
Alexandre Aubin 2024-01-06 20:50:12 +01:00
parent 0d9de5c6a6
commit f65fcc1bed
4 changed files with 30 additions and 37 deletions

View file

@ -55,7 +55,6 @@ ram.runtime = "50M"
[resources.system_user] [resources.system_user]
[resources.install_dir] [resources.install_dir]
dir = "/opt/__APP__"
[resources.permissions] [resources.permissions]
main.url = "/" main.url = "/"

View file

@ -18,6 +18,22 @@ ynh_script_progression --message="Setting up source files..." --weight=11
NETDATA_TMPDIR=$(mktemp -d) NETDATA_TMPDIR=$(mktemp -d)
ynh_setup_source --dest_dir="$NETDATA_TMPDIR" ynh_setup_source --dest_dir="$NETDATA_TMPDIR"
#=================================================
# BUILD
#=================================================
ynh_script_progression --message="Executing Netdata installer..." --weight=10
# create a temporary file for the log
tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
pushd $NETDATA_TMPDIR
# the installer.sh script will append "netdata" after the --install-prefix arg
./netdata-installer.sh --install-prefix /var/www/ --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
popd
# Specific configuration
configure_netdata
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -28,24 +44,6 @@ ynh_add_nginx_config
yunohost service add $app --description "Real-time performance and health monitoring" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log" yunohost service add $app --description "Real-time performance and health monitoring" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log"
#=================================================
# SPECIFIC SETUP
#=================================================
# EXECUTE NETDATA INSTALLER
#=================================================
ynh_script_progression --message="Executing Netdata installer..." --weight=10
# create a temporary file for the log
tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
# Launch netdata installation in /opt directory
pushd $NETDATA_TMPDIR
./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
popd
# Specific configuration
configure_netdata
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================

View file

@ -19,13 +19,6 @@ ynh_script_progression --message="Restoring Netdata configuration directory..."
ynh_restore_file --origin_path="$install_dir/etc/netdata" ynh_restore_file --origin_path="$install_dir/etc/netdata"
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# INSTALL AND RESTORE THE APP CONFIGURATION # INSTALL AND RESTORE THE APP CONFIGURATION
#================================================= #=================================================
@ -36,20 +29,23 @@ NETDATA_TMPDIR=$(mktemp -d)
ynh_setup_source --dest_dir="$NETDATA_TMPDIR" ynh_setup_source --dest_dir="$NETDATA_TMPDIR"
# create a temporary file for the log # create a temporary file for the log
tmp=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
# open fd 3 and send it to tmp
exec 3>${tmp}
# Launch netdata installation in /opt directory pushd $NETDATA_TMPDIR
cd $NETDATA_TMPDIR # the installer.sh script will append "netdata" after the --install-prefix arg
./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud --disable-telemetry --stable-channel >&3 2>&3 || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" ./netdata-installer.sh --install-prefix /var/www/ --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
popd
# close fd 3
exec 3<&-
# Specific configuration # Specific configuration
configure_netdata configure_netdata
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================

View file

@ -43,9 +43,9 @@ then
# create a temporary file for the log # create a temporary file for the log
tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log) tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
# Launch netdata installation in /opt directory
pushd $NETDATA_TMPDIR pushd $NETDATA_TMPDIR
./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA" # the installer.sh script will append "netdata" after the --install-prefix arg
./netdata-installer.sh --install-prefix /var/www/ --dont-wait --disable-cloud >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
popd popd
fi fi