1
0
forked from Git/send_ynh

Merge pull request #27 from YunoHost-Apps/testing

Testing v3.4.23~ynh3
This commit is contained in:
OniriCorpe 2024-01-17 05:22:52 +01:00 committed by GitHub
commit 6526b33b12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 36 additions and 27 deletions

View 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.

View File

@ -52,8 +52,16 @@ ram.runtime = "50M"
[resources.permissions] [resources.permissions]
main.url = "/" main.url = "/"
main.additional_urls = ["/api/upload"]
api.url = "/api" api.url = "/api"
api.allowed = "visitors" api.allowed = "visitors"
api.auth_header =false api.auth_header = false
api.show_tile = false api.show_tile = false
api.protected = true 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$" ]

View File

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 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 # 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" ynh_add_config --template="../conf/config.js" --destination="$install_dir/server/config.js"
chmod 400 "$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 # GENERIC FINALISATION
@ -46,7 +46,7 @@ chown $app:$app "$install_dir/server/config.js"
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service # 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 # END OF SCRIPT

View File

@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=20 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 # 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" ynh_setup_source --dest_dir="$install_dir"
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"
chmod +x "$install_dir/server/bin/prod.js" chmod +x "$install_dir/server/bin/prod.js"
#================================================= #=================================================
@ -49,7 +49,7 @@ env_path="$PATH"
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_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 # 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" ynh_add_config --template="config.js" --destination="$install_dir/server/config.js"
chmod 400 "$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 # SPECIFIC SETUP
@ -70,8 +70,8 @@ ynh_script_progression --message="Building app... (this will take some time and
pushd "$install_dir" pushd "$install_dir"
ynh_use_nodejs 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" 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" run build
popd popd
#================================================= #=================================================
@ -80,7 +80,7 @@ popd
ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_script_progression --message="Starting a systemd service..." --weight=2
# Start a systemd service # 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 # END OF SCRIPT

View File

@ -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`) # 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 then
ynh_script_progression --message="Removing $app service integration..." --weight=1 ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove $app yunohost service remove "$app"
fi fi
# Remove the dedicated systemd config # Remove the dedicated systemd config

View File

@ -18,7 +18,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
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"
chmod +x "$install_dir/server/bin/prod.js" 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_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/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" 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 # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 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 ynh_systemd_action --service_name=nginx --action=reload

View File

@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 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 # ENSURE DOWNWARD COMPATIBILITY
@ -40,11 +40,11 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=10 ynh_script_progression --message="Upgrading source files..." --weight=10
# 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 --keep="server/config.js" ynh_setup_source --dest_dir="$install_dir" --keep="server/config.js"
fi fi
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"
chmod +x "$install_dir/server/bin/prod.js" 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_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 # NGINX CONFIGURATION
@ -66,7 +66,7 @@ env_path="$PATH"
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_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 # 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" ynh_add_config --template="config.js" --destination="$install_dir/server/config.js"
chmod 400 "$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 # SPECIFIC UPGRADE
@ -90,8 +90,8 @@ then
pushd "$install_dir" pushd "$install_dir"
ynh_use_nodejs 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" 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" run build
popd popd
fi fi
@ -100,7 +100,7 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 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 # END OF SCRIPT