1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/peertube_ynh.git synced 2024-09-03 19:56:29 +02:00

More section reordering..

This commit is contained in:
Alexandre Aubin 2023-12-27 18:23:51 +01:00
parent 677adeb352
commit 9b4881b0e8

View file

@ -47,10 +47,22 @@ ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# BUILD YARN DEPENDENCIES
#=================================================
ynh_script_progression --message="Building Yarn dependencies..."
pushd "$install_dir"
ynh_use_nodejs
npm install -g npm
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --production --pure-lockfile
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn cache clean
popd
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..."
ynh_script_progression --message="Adding system configurations..."
# Create a dedicated NGINX config
ynh_add_nginx_config
@ -66,22 +78,10 @@ ynh_use_logrotate
yunohost service add $app --description="Federated video streaming platform" --log="/var/log/$app/$app.log" --needs_exposed_ports $port_rtmp
#=================================================
# BUILD YARN DEPENDENCIES
#=================================================
ynh_script_progression --message="Building Yarn dependencies..."
pushd "$install_dir"
ynh_use_nodejs
npm install -g npm
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --production --pure-lockfile
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn cache clean
popd
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..."
ynh_script_progression --message="Adding peertube configuration file..."
ynh_add_config --template="production.yaml" --destination="$install_dir/config/production.yaml"
chmod 400 "$install_dir/config/production.yaml"
@ -92,6 +92,14 @@ echo '{}' > "$install_dir/config/local-production.json"
chmod 600 "$install_dir/config/local-production.json"
chown $app:$app "$install_dir/config/local-production.json"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP server listening on localhost"
#=================================================
# INSTALL LDAP PLUGIN
#=================================================
@ -103,14 +111,6 @@ pushd "$install_dir"
echo "$admin_pass" | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run reset-password -- -u root
popd
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP server listening on localhost"
#=================================================
# END OF SCRIPT
#=================================================