forked from Git/send_ynh
		
	
							
								
								
									
										1
									
								
								doc/PRE_UPGRADE.d/3.4.23~ynh3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								doc/PRE_UPGRADE.d/3.4.23~ynh3
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
Now with the `3.4.23~ynh3` version, the Send package supports download link sharing even if the app is protected by the YunoHost login page.
 | 
			
		||||
@@ -52,8 +52,16 @@ ram.runtime = "50M"
 | 
			
		||||
 | 
			
		||||
    [resources.permissions]
 | 
			
		||||
    main.url = "/"
 | 
			
		||||
    main.additional_urls = ["/api/upload"]
 | 
			
		||||
    
 | 
			
		||||
    api.url = "/api"
 | 
			
		||||
    api.allowed = "visitors"
 | 
			
		||||
    api.auth_header =false
 | 
			
		||||
    api.auth_header = false
 | 
			
		||||
    api.show_tile = false
 | 
			
		||||
    api.protected = true
 | 
			
		||||
    
 | 
			
		||||
    download.url = "/download"
 | 
			
		||||
    download.allowed = "visitors"
 | 
			
		||||
    download.auth_header = false
 | 
			
		||||
    download.show_tile = false
 | 
			
		||||
    download.additional_urls = [ "re:^__DOMAIN__/.*.css$", "re:^__DOMAIN__/.*.js$", "re:^__DOMAIN__/.*.svg$", "re:^__DOMAIN__/.*.woff2$", "re:^__DOMAIN__/favicon.*.png$" ]
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
 | 
			
		||||
#=================================================
 | 
			
		||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
 | 
			
		||||
 | 
			
		||||
ynh_systemd_action --service_name=$app --action="stop"
 | 
			
		||||
ynh_systemd_action --service_name="$app" --action="stop"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# MODIFY URL IN NGINX CONF
 | 
			
		||||
@@ -36,7 +36,7 @@ domain=$new_domain
 | 
			
		||||
ynh_add_config --template="../conf/config.js" --destination="$install_dir/server/config.js"
 | 
			
		||||
 | 
			
		||||
chmod 400 "$install_dir/server/config.js"
 | 
			
		||||
chown $app:$app "$install_dir/server/config.js"
 | 
			
		||||
chown "$app:$app" "$install_dir/server/config.js"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# GENERIC FINALISATION
 | 
			
		||||
@@ -46,7 +46,7 @@ chown $app:$app "$install_dir/server/config.js"
 | 
			
		||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
 | 
			
		||||
 | 
			
		||||
# Start a systemd service
 | 
			
		||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
 | 
			
		||||
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# END OF SCRIPT
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
 | 
			
		||||
#=================================================
 | 
			
		||||
ynh_script_progression --message="Installing dependencies..." --weight=20
 | 
			
		||||
 | 
			
		||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
 | 
			
		||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# CREATE A REDIS DATABASE
 | 
			
		||||
@@ -34,7 +34,7 @@ ynh_script_progression --message="Setting up source files..." --weight=2
 | 
			
		||||
ynh_setup_source --dest_dir="$install_dir"
 | 
			
		||||
 | 
			
		||||
chmod -R o-rwx "$install_dir"
 | 
			
		||||
chown -R $app:www-data "$install_dir"
 | 
			
		||||
chown -R "$app:www-data" "$install_dir"
 | 
			
		||||
chmod +x "$install_dir/server/bin/prod.js"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
@@ -49,7 +49,7 @@ env_path="$PATH"
 | 
			
		||||
# Create a dedicated systemd config
 | 
			
		||||
ynh_add_systemd_config
 | 
			
		||||
 | 
			
		||||
yunohost service add $app --description="Simple, private file sharing" --log="/var/log/$app/$app.log"
 | 
			
		||||
yunohost service add "$app" --description="Simple, private file sharing" --log="/var/log/$app/$app.log"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# ADD A CONFIGURATION
 | 
			
		||||
@@ -59,7 +59,7 @@ ynh_script_progression --message="Adding a configuration file..." --weight=2
 | 
			
		||||
ynh_add_config --template="config.js" --destination="$install_dir/server/config.js"
 | 
			
		||||
 | 
			
		||||
chmod 400 "$install_dir/server/config.js"
 | 
			
		||||
chown $app: "$install_dir/server/config.js"
 | 
			
		||||
chown "$app:" "$install_dir/server/config.js"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# SPECIFIC SETUP
 | 
			
		||||
@@ -70,8 +70,8 @@ ynh_script_progression --message="Building app... (this will take some time and
 | 
			
		||||
 | 
			
		||||
pushd "$install_dir"
 | 
			
		||||
	ynh_use_nodejs
 | 
			
		||||
	ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install
 | 
			
		||||
	ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build
 | 
			
		||||
	ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" install
 | 
			
		||||
	ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" run build
 | 
			
		||||
popd
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
@@ -80,7 +80,7 @@ popd
 | 
			
		||||
ynh_script_progression --message="Starting a systemd service..." --weight=2
 | 
			
		||||
 | 
			
		||||
# Start a systemd service
 | 
			
		||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
 | 
			
		||||
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# END OF SCRIPT
 | 
			
		||||
 
 | 
			
		||||
@@ -16,10 +16,10 @@ source /usr/share/yunohost/helpers
 | 
			
		||||
#=================================================
 | 
			
		||||
 | 
			
		||||
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
 | 
			
		||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
 | 
			
		||||
if ynh_exec_warn_less yunohost service status "$app" >/dev/null
 | 
			
		||||
then
 | 
			
		||||
	ynh_script_progression --message="Removing $app service integration..." --weight=1
 | 
			
		||||
	yunohost service remove $app
 | 
			
		||||
	yunohost service remove "$app"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Remove the dedicated systemd config
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
 | 
			
		||||
ynh_restore_file --origin_path="$install_dir"
 | 
			
		||||
 | 
			
		||||
chmod -R o-rwx "$install_dir"
 | 
			
		||||
chown -R $app:www-data "$install_dir"
 | 
			
		||||
chown -R "$app:www-data" "$install_dir"
 | 
			
		||||
chmod +x "$install_dir/server/bin/prod.js"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
@@ -28,21 +28,21 @@ chmod +x "$install_dir/server/bin/prod.js"
 | 
			
		||||
#=================================================
 | 
			
		||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=7
 | 
			
		||||
 | 
			
		||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
 | 
			
		||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
 | 
			
		||||
 | 
			
		||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
 | 
			
		||||
 | 
			
		||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
 | 
			
		||||
systemctl enable $app.service --quiet
 | 
			
		||||
systemctl enable "$app.service" --quiet
 | 
			
		||||
 | 
			
		||||
yunohost service add $app --description="Simple, private file sharing" --log="/var/log/$app/$app.log"
 | 
			
		||||
yunohost service add "$app" --description="Simple, private file sharing" --log="/var/log/$app/$app.log"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# START SYSTEMD SERVICE
 | 
			
		||||
#=================================================
 | 
			
		||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
 | 
			
		||||
 | 
			
		||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
 | 
			
		||||
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
 | 
			
		||||
 | 
			
		||||
ynh_systemd_action --service_name=nginx --action=reload
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed)
 | 
			
		||||
#=================================================
 | 
			
		||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
 | 
			
		||||
 | 
			
		||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
 | 
			
		||||
ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# ENSURE DOWNWARD COMPATIBILITY
 | 
			
		||||
@@ -40,11 +40,11 @@ then
 | 
			
		||||
	ynh_script_progression --message="Upgrading source files..." --weight=10
 | 
			
		||||
 | 
			
		||||
	# Download, check integrity, uncompress and patch the source from app.src
 | 
			
		||||
	ynh_setup_source --dest_dir=$install_dir --keep="server/config.js"
 | 
			
		||||
	ynh_setup_source --dest_dir="$install_dir" --keep="server/config.js"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
chmod -R o-rwx "$install_dir"
 | 
			
		||||
chown -R $app:www-data "$install_dir"
 | 
			
		||||
chown -R "$app:www-data" "$install_dir"
 | 
			
		||||
chmod +x "$install_dir/server/bin/prod.js"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
@@ -52,7 +52,7 @@ chmod +x "$install_dir/server/bin/prod.js"
 | 
			
		||||
#=================================================
 | 
			
		||||
ynh_script_progression --message="Upgrading dependencies..." --weight=18
 | 
			
		||||
 | 
			
		||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
 | 
			
		||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# NGINX CONFIGURATION
 | 
			
		||||
@@ -66,7 +66,7 @@ env_path="$PATH"
 | 
			
		||||
# Create a dedicated systemd config
 | 
			
		||||
ynh_add_systemd_config
 | 
			
		||||
 | 
			
		||||
yunohost service add $app --description="Simple, private file sharing" --log="/var/log/$app/$app.log"
 | 
			
		||||
yunohost service add "$app" --description="Simple, private file sharing" --log="/var/log/$app/$app.log"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# UPDATE A CONFIG FILE
 | 
			
		||||
@@ -76,7 +76,7 @@ ynh_script_progression --message="Updating a configuration file..."
 | 
			
		||||
ynh_add_config --template="config.js" --destination="$install_dir/server/config.js"
 | 
			
		||||
 | 
			
		||||
chmod 400 "$install_dir/server/config.js"
 | 
			
		||||
chown $app: "$install_dir/server/config.js"
 | 
			
		||||
chown "$app:" "$install_dir/server/config.js"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# SPECIFIC UPGRADE
 | 
			
		||||
@@ -90,8 +90,8 @@ then
 | 
			
		||||
 | 
			
		||||
	pushd "$install_dir"
 | 
			
		||||
		ynh_use_nodejs
 | 
			
		||||
		ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install
 | 
			
		||||
		ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build
 | 
			
		||||
		ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" install
 | 
			
		||||
		ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" run build
 | 
			
		||||
	popd
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
@@ -100,7 +100,7 @@ fi
 | 
			
		||||
#=================================================
 | 
			
		||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
 | 
			
		||||
 | 
			
		||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
 | 
			
		||||
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
 | 
			
		||||
 | 
			
		||||
#=================================================
 | 
			
		||||
# END OF SCRIPT
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user