diff --git a/README.md b/README.md
index 4517c41..eb9f079 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
A web based, real time, collaborative whiteboard application with rich media support
-**Shipped version:** 2021.08.10~ynh1
+**Shipped version:** 2022.05.09~ynh1
@@ -30,6 +30,8 @@ A web based, real time, collaborative whiteboard application with rich media sup
* The app can only be installed at the root of a domain
* There is no integration with YunoHost SSO
+* A email is send at the end of the installation with the Beta Invite Code
+
## Documentation and resources
* Official app website: https://spacedeck.com
diff --git a/README_fr.md b/README_fr.md
index c6f8a28..b131a43 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
A web based, real time, collaborative whiteboard application with rich media support
-**Version incluse :** 2021.08.10~ynh1
+**Version incluse :** 2022.05.09~ynh1
@@ -26,6 +26,8 @@ A web based, real time, collaborative whiteboard application with rich media sup
* The app can only be installed at the root of a domain
* There is no integration with YunoHost SSO
+* A email is send at the end of the installation with the Beta Invite Code
+
## Documentations et ressources
* Site officiel de l'app : https://spacedeck.com
diff --git a/check_process b/check_process
index 0b4078d..cf97ffd 100644
--- a/check_process
+++ b/check_process
@@ -18,7 +18,3 @@
;;; Options
Email=
Notification=none
-;;; Upgrade options
- ; commit=CommitHash
- name=Name and date of the commit.
- manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1&
diff --git a/conf/app.src b/conf/app.src
index c9d31d7..8fd3f61 100644
--- a/conf/app.src
+++ b/conf/app.src
@@ -1,7 +1,7 @@
-SOURCE_URL=https://github.com/spacedeck/spacedeck-open/archive/aacc3a8f1039834cc686674f3a2bac45d77a014b.zip
-SOURCE_SUM=F16843F2F7382C071058594463423397B4A7F7C4E86855923047B791F8B3B380
+SOURCE_URL=https://github.com/spacedeck/spacedeck-open/archive/1109537675cd83f87499a37d37ef6b7a6efcaa4d.tar.gz
+SOURCE_SUM=2abb471efb7343ee809cfe389e0d9c7a8c7359765d56d80725758b804a72d848
SOURCE_SUM_PRG=sha256sum
-SOURCE_FORMAT=zip
+SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
SOURCE_EXTRACT=true
diff --git a/conf/default.json b/conf/default.json
index 14e2038..369d8a8 100644
--- a/conf/default.json
+++ b/conf/default.json
@@ -1,39 +1,38 @@
{
- "team_name": "My Open Spacedeck",
- "contact_email": "webmaster@__DOMAIN__",
-
- "host": "localhost",
- "port": __PORT__,
- "endpoint": "https://__DOMAIN____PATH__",
- "invite_code": "__INVITE_SECRET__",
-
- "storage_dialect": "sqlite",
-
- "storage_host": "localhost",
- "storage_database": "spacedeck",
- "storage_username": "username",
- "storage_password": "password",
-
- "storage_local_path": "__DATADIR__/storage",
- "storage_local_db": "./database/database.sqlite",
- "storage_region": "eu-central-1",
- "storage_endpoint": "http://localhost:4572",
- "storage_bucket": "my_spacedeck_bucket",
- "storage_cdn": "/storage",
-
- "mongodb_host": "localhost",
- "redis_mock": true,
- "redis_host": "localhost",
+ "team_name": "YunoHost Spacedeck",
+ "contact_email": "webmaster@__DOMAIN__",
- "export_api_secret": "__API_SECRET__",
-
- "mail_provider": "smtp",
- "mail_smtp_host": "localhost",
- "mail_smtp_port": 587,
- "mail_smtp_secure": false,
- "mail_smtp_require_tls": false,
- "mail_smtp_user": "__APP__@__DOMAIN__",
- "mail_smtp_pass": "",
- "spacedeck": {}
- }
-
\ No newline at end of file
+ "host": "localhost",
+ "port": __PORT__,
+ "endpoint": "https://__DOMAIN____PATH__",
+ "invite_code": "__INVITE_SECRET__",
+
+ "storage_dialect": "sqlite",
+
+ "storage_host": "localhost",
+ "storage_database": "spacedeck",
+ "storage_username": "username",
+ "storage_password": "password",
+
+ "storage_local_path": "__DATADIR__/storage",
+ "storage_local_db": "./database/database.sqlite",
+ "storage_region": "eu-central-1",
+ "storage_endpoint": "http://localhost:4572",
+ "storage_bucket": "my_spacedeck_bucket",
+ "storage_cdn": "/storage",
+
+ "mongodb_host": "localhost",
+ "redis_mock": true,
+ "redis_host": "localhost",
+
+ "export_api_secret": "__API_SECRET__",
+
+ "mail_provider": "smtp",
+ "mail_smtp_host": "localhost",
+ "mail_smtp_port": 25,
+ "mail_smtp_secure": false,
+ "mail_smtp_require_tls": false,
+ "mail_smtp_user": "__APP__@__DOMAIN__",
+ "mail_smtp_pass": "",
+ "spacedeck": {}
+}
diff --git a/conf/msg_install b/conf/msg_install
new file mode 100644
index 0000000..e46ba80
--- /dev/null
+++ b/conf/msg_install
@@ -0,0 +1,7 @@
+__APP__ was successfully installed :)
+
+Please open your __APP__ domain: https://__DOMAIN____PATH_URL__signup to signup
+
+The Beta Invite Code is: __INVITE_SECRET__
+
+If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/spacedeck_ynh
diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md
index 14e4e59..d1b6e63 100644
--- a/doc/DISCLAIMER.md
+++ b/doc/DISCLAIMER.md
@@ -1,2 +1,3 @@
* The app can only be installed at the root of a domain
-* There is no integration with YunoHost SSO
\ No newline at end of file
+* There is no integration with YunoHost SSO
+* A email is send at the end of the installation with the Beta Invite Code
diff --git a/manifest.json b/manifest.json
index 5bf48e4..0cc7d2b 100644
--- a/manifest.json
+++ b/manifest.json
@@ -5,7 +5,7 @@
"description": {
"en": "A web based, real time, collaborative whiteboard application with rich media support"
},
- "version": "2021.08.10~ynh1",
+ "version": "2022.05.09~ynh1",
"url": "https://spacedeck.com",
"upstream": {
"license": "AGPL-3.0-only",
diff --git a/scripts/change_url b/scripts/change_url
index dd252b9..7c31186 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -47,6 +47,7 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
+ ynh_clean_check_starting
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
diff --git a/scripts/install b/scripts/install
index 2af999a..7c43d51 100755
--- a/scripts/install
+++ b/scripts/install
@@ -7,6 +7,7 @@
#=================================================
source _common.sh
+source ynh_send_readme_to_admin__2
source /usr/share/yunohost/helpers
#=================================================
@@ -65,7 +66,6 @@ ynh_app_setting_set --app=$app --key=port --value=$port
ynh_script_progression --message="Installing dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies
-
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
#=================================================
@@ -105,8 +105,7 @@ ynh_add_nginx_config
ynh_script_progression --message="Installing NodeJS dependencies..." --weight=1
pushd $final_path
- ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install
- ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error audit fix
+ ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install
popd
#=================================================
@@ -192,6 +191,14 @@ ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
+
+#=================================================
+# SEND A README FOR THE ADMIN
+#=================================================
+ynh_script_progression --message="Sending a readme for the admin..."
+
+ynh_send_readme_to_admin --app_message="msg_install"
+
#=================================================
# END OF SCRIPT
#=================================================
diff --git a/scripts/restore b/scripts/restore
index 5b1ccef..9302439 100755
--- a/scripts/restore
+++ b/scripts/restore
@@ -45,7 +45,7 @@ test ! -d $final_path \
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
-ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
+ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@@ -90,7 +90,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
-
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
#=================================================
diff --git a/scripts/upgrade b/scripts/upgrade
index 4d45d90..7e3aad2 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -105,7 +105,6 @@ ynh_add_nginx_config
ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies
-
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
#=================================================
@@ -117,7 +116,6 @@ ynh_script_progression --message="Installing NodeJS dependencies..." --weight=1
pushd $final_path
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install
- ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error audit fix
popd
#=================================================
diff --git a/scripts/ynh_send_readme_to_admin__2 b/scripts/ynh_send_readme_to_admin__2
new file mode 100644
index 0000000..6a0ba70
--- /dev/null
+++ b/scripts/ynh_send_readme_to_admin__2
@@ -0,0 +1,128 @@
+#!/bin/bash
+
+# Send an email to inform the administrator
+#
+# usage: ynh_send_readme_to_admin --app_message=app_message [--recipients=recipients] [--type=type]
+# | arg: -m --app_message= - The file with the content to send to the administrator.
+# | arg: -r, --recipients= - The recipients of this email. Use spaces to separate multiples recipients. - default: root
+# example: "root admin@domain"
+# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you
+# example: "root admin@domain user1 user2"
+# | arg: -t, --type= - Type of mail, could be 'backup', 'change_url', 'install', 'remove', 'restore', 'upgrade'
+#
+# Requires YunoHost version 4.1.0 or higher.
+ynh_send_readme_to_admin() {
+ # Declare an array to define the options of this helper.
+ declare -Ar args_array=( [m]=app_message= [r]=recipients= [t]=type= )
+ local app_message
+ local recipients
+ local type
+ # Manage arguments with getopts
+
+ ynh_handle_getopts_args "$@"
+ app_message="${app_message:-}"
+ recipients="${recipients:-root}"
+ type="${type:-install}"
+
+ # Get the value of admin_mail_html
+ admin_mail_html=$(ynh_app_setting_get $app admin_mail_html)
+ admin_mail_html="${admin_mail_html:-0}"
+
+ # Retrieve the email of users
+ find_mails () {
+ local list_mails="$1"
+ local mail
+ local recipients=" "
+ # Read each mail in argument
+ for mail in $list_mails
+ do
+ # Keep root or a real email address as it is
+ if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@"
+ then
+ recipients="$recipients $mail"
+ else
+ # But replace an user name without a domain after by its email
+ if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null)
+ then
+ recipients="$recipients $mail"
+ fi
+ fi
+ done
+ echo "$recipients"
+ }
+ recipients=$(find_mails "$recipients")
+
+ # Subject base
+ local mail_subject="☁️🆈🅽🅷☁️: \`$app\`"
+
+ # Adapt the subject according to the type of mail required.
+ if [ "$type" = "backup" ]; then
+ mail_subject="$mail_subject has just been backup."
+ elif [ "$type" = "change_url" ]; then
+ mail_subject="$mail_subject has just been moved to a new URL!"
+ elif [ "$type" = "remove" ]; then
+ mail_subject="$mail_subject has just been removed!"
+ elif [ "$type" = "restore" ]; then
+ mail_subject="$mail_subject has just been restored!"
+ elif [ "$type" = "upgrade" ]; then
+ mail_subject="$mail_subject has just been upgraded!"
+ else # install
+ mail_subject="$mail_subject has just been installed!"
+ fi
+
+ ynh_add_config --template="$app_message" --destination="../conf/msg_to_send"
+
+ ynh_delete_file_checksum --file="../conf/msg_to_send"
+ local mail_message="This is an automated message from your beloved YunoHost server.
+
+Specific information for the application $app.
+
+$(cat "../conf/msg_to_send")"
+
+ # Store the message into a file for further modifications.
+ echo "$mail_message" > mail_to_send
+
+ # If a html email is required. Apply html tags to the message.
+ if [ "$admin_mail_html" -eq 1 ]
+ then
+ # Insert 'br' tags at each ending of lines.
+ ynh_replace_string "$" "
" mail_to_send
+
+ # Insert starting HTML tags
+ sed --in-place '1s@^@\n\n