From db9d17f072163a61e418bc638744442314a76ecd Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 10:24:15 +0700 Subject: [PATCH 01/68] Integration level in readme --- README.md | 3 +++ README_fr.md | 2 ++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 64af6fe..cb7bb62 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Outline wiki for Yunohost +[![Integration level](https://dash.yunohost.org/integration/outline.svg)](https://dash.yunohost.org/appci/app/outline) + + 110356468-26374600-7fef-11eb-9f6a-f2cc2c8c6590 # Important points to read before installation diff --git a/README_fr.md b/README_fr.md index d856bf9..739e0a4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,4 +1,6 @@ # Example app pour YunoHost +[![Integration level](https://dash.yunohost.org/integration/outline.svg)](https://dash.yunohost.org/appci/app/outline) + [![Niveau d'intégration](https://dash.yunohost.org/integration/example.svg)](https://dash.yunohost.org/appci/app/example) ![](https://ci-apps.yunohost.org/ci/badges/example.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/example.maintain.svg) [![Installer example avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=example) From 29cf324f52d1bf8945c08e4ef4ebd254be2e8da3 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 10:36:27 +0700 Subject: [PATCH 02/68] Update check_process --- check_process | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index b5dd0d2..291e739 100644 --- a/check_process +++ b/check_process @@ -1,12 +1,14 @@ ;; Test complet ; Manifest domain="domain.tld" - path="/path" - admin="john" + path="/" language="fr" is_public=1 password="1Strong-Password" port="666" + slack_key="slack" + slack_secret="secret" + minio_domain="minio.tld" ; Checks pkg_linter=1 setup_sub_dir=1 @@ -17,7 +19,7 @@ upgrade=1 #upgrade=1 from_commit=CommitHash backup_restore=1 - multi_instance=1 + multi_instance=0 change_url=1 ;;; Options Email= From 497912f9d52b7c43191e4e10e57886749564b4cd Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 21:38:06 +0700 Subject: [PATCH 03/68] Update install --- scripts/install | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/scripts/install b/scripts/install index edf00cb..4486b09 100755 --- a/scripts/install +++ b/scripts/install @@ -63,6 +63,7 @@ fi minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) +mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -72,8 +73,6 @@ ynh_script_progression --message="Validating installation parameters..." --time final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -mc_path=$final_path/mc - # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -153,31 +152,15 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# DOWNLOAD, CHECK AND UNPACK MINIO CLIENT -#================================================= -ynh_script_progression --message="Setting up MinIO client..." --time --weight=1 - -ynh_setup_source --dest_dir="$mc_path" --source_id=mc - -# FIXME: this should be managed by the core in the future -# Here, as a packager, you may have to tweak the ownerhsip/permissions -# such that the appropriate users (e.g. maybe www-data) can access -# files in some cases. -# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - -# this will be treated as a security issue. -chmod -R 750 "$mc_path" -chmod -R o-rwx "$mc_path" -chown -R $app:www-data "$mc_path" - #================================================= # SETUP MINIO BUCKET #================================================= ynh_script_progression --message="Setting up MinIO bucket for Outline..." --time --weight=1 -$mc_path/mc alias set minio "https://$minio_domain" $minio_id $minio_key -$mc_path/mc mb minio/outlinestorage --region "fr-ynh-1" -$mc_path/mc policy set public minio/outlinestorage +pushd "$mc_path" + ynh_exec_warn_less sudo -u minio ./mc mb minio/outlinestorage --region "fr-ynh-1" + ynh_exec_warn_less sudo -u minio ./mc policy set public minio/outlinestorage +popd #================================================= # NGINX CONFIGURATION From 041392453273b69e3f6a9c76b97c4834681ba96f Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 22:03:50 +0700 Subject: [PATCH 04/68] Backup start --- scripts/backup | 31 ++++++++++++------------------- scripts/install | 4 ++-- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/scripts/backup b/scripts/backup index f99225d..7153574 100755 --- a/scripts/backup +++ b/scripts/backup @@ -30,9 +30,16 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path_url) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +language_key=$(ynh_app_setting_get --app=$app --key=language_key) +slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) +slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret) + +minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) +minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) +minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) +mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -51,10 +58,10 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" #================================================= -# BACKUP THE DATA DIR +# BACKUP MINIO #================================================= -ynh_backup --src_path="$datadir" --is_big +sudo yunohost backup create --apps minio #================================================= # BACKUP THE NGINX CONFIGURATION @@ -62,12 +69,6 @@ ynh_backup --src_path="$datadir" --is_big ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - #================================================= # BACKUP FAIL2BAN CONFIGURATION #================================================= @@ -90,15 +91,7 @@ ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup --src_path="/etc/cron.d/$app" - -ynh_backup --src_path="/etc/$app/" - -#================================================= -# BACKUP THE MYSQL DATABASE +# BACKUP THE POSTGRE DATABASE #================================================= ynh_print_info --message="Backing up the MySQL database..." diff --git a/scripts/install b/scripts/install index 4486b09..579e35c 100755 --- a/scripts/install +++ b/scripts/install @@ -38,8 +38,8 @@ else echo "English" fi -secret_key=`openssl rand -hex 32` -utils_secret=`openssl rand -hex 32` +secret_key=$(ynh_string_random --length=32) +utils_secret=$(ynh_string_random --length=32) slack_key=$YNH_APP_ARG_SLACK_KEY slack_secret=$YNH_APP_ARG_SLACK_SECRET From b4afff1950052d214671828aa7421ee278ddf959 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 22:08:22 +0700 Subject: [PATCH 05/68] Update backup --- scripts/backup | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/backup b/scripts/backup index 7153574..3e162d2 100755 --- a/scripts/backup +++ b/scripts/backup @@ -35,6 +35,9 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret) +secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) +utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) + minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) @@ -91,14 +94,14 @@ ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= -# BACKUP THE POSTGRE DATABASE +# BACKUP THE POSTGRESQL DATABASE #================================================= -ynh_print_info --message="Backing up the MySQL database..." +ynh_print_info --message="Backing up the PostgreSQL database..." ### (However, things like MySQL dumps *do* take some time to run, though the ### copy of the generated dump to the archive still happens later) -ynh_mysql_dump_db --database="$db_name" > db.sql +ynh_psql_dump_db --database="$db_name" > db.sql #================================================= # END OF SCRIPT From 6b7cce740ac442314b572857eb718c4d25b5c28f Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 22:20:35 +0700 Subject: [PATCH 06/68] Update restore --- scripts/restore | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/restore b/scripts/restore index 0fc5c7d..7351504 100755 --- a/scripts/restore +++ b/scripts/restore @@ -28,11 +28,21 @@ ynh_script_progression --message="Loading installation settings..." --time --wei app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path_url) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name +language_key=$(ynh_app_setting_get --app=$app --key=language_key) +slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) +slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret) +secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) +utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) + + +minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) +minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) +minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) +mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -40,7 +50,7 @@ db_user=$db_name ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " + || ynh_die --message="There is already a directory: $final_path" #================================================= # STANDARD RESTORATION STEPS @@ -86,7 +96,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= -# RESTORE THE MYSQL DATABASE +# RESTORE THE POSTGRESQL DATABASE #================================================= ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 From 20437ad996460a965aa0d35e290abdc0f8ad6021 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 22:25:07 +0700 Subject: [PATCH 07/68] Update remove --- scripts/remove | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/scripts/remove b/scripts/remove index 7d34aad..4d4ddc7 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,11 +16,21 @@ ynh_script_progression --message="Loading installation settings..." --time --wei app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path_url) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +language_key=$(ynh_app_setting_get --app=$app --key=language_key) +slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) +slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret) +secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) +utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) + + +minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) +minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) +minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) +mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) #================================================= # STANDARD REMOVE @@ -76,6 +86,15 @@ ynh_script_progression --message="Removing app main directory..." --time --weigh # Remove the app directory securely ynh_secure_remove --file="$final_path" +#================================================= +# REMOVE MINIO BUCKET +#================================================= +ynh_script_progression --message="Removing Outline MinIO bucket..." --time --weight=1 + +pushd "$mc_path" + ynh_exec_warn_less sudo -u minio ./mc rb minio/outlinestorage +popd + #================================================= # REMOVE NGINX CONFIGURATION #================================================= From fbba75011726379acfe4757e89e9402976d8cddd Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 22:28:14 +0700 Subject: [PATCH 08/68] Update remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 4d4ddc7..ab6328f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -92,7 +92,7 @@ ynh_secure_remove --file="$final_path" ynh_script_progression --message="Removing Outline MinIO bucket..." --time --weight=1 pushd "$mc_path" - ynh_exec_warn_less sudo -u minio ./mc rb minio/outlinestorage + ynh_exec_warn_less sudo -u minio ./mc rb minio/outlinestorage --force popd #================================================= From c8bc14237c8f05b2ea160f30bdfc11593a4b33ac Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 22:38:32 +0700 Subject: [PATCH 09/68] Update upgrade --- scripts/upgrade | 54 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index cb3725a..bbea438 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,12 +16,21 @@ ynh_script_progression --message="Loading installation settings..." --time --wei app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -language=$(ynh_app_setting_get --app=$app --key=language) +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path_url) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +language_key=$(ynh_app_setting_get --app=$app --key=language_key) +slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) +slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret) +secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) +utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) + + +minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) +minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) +minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) +mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) #================================================= # CHECK VERSION @@ -97,15 +106,44 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version # Install Yarn ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" +#================================================= +# UPGRADE YARN DEPENDENCIES +#================================================= +ynh_script_progression --message="Building Yarn dependencies... This can be very long, be patient !" --time --weight=10 + +pushd "$final_path" + ynh_use_nodejs + ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --time --weight=5 + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --no-optional --frozen-lockfile + ynh_script_progression --message="Cleaning cache... " --time --weight=1 + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean + ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --time --weight=5 + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn build + ynh_script_progression --message="Fetching Yarn production dependencies... This can be very long, be patient !" --time --weight=5 + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production=true --frozen-lockfile + ynh_script_progression --message="Cleaning cache... " --time --weight=1 + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean +popd + #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --time --weight=1 +ynh_script_progression --message="Adding a configuration file..." --time --weight=1 -ynh_add_config --template="some_config_file" --destination="$final_path/some_config_file" +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" -chmod 400 "$final_path/some_config_file" -chown $app:$app "$final_path/some_config_file" +chmod 400 "$final_path/.env" +chown $app:$app "$final_path/.env" + +#================================================= +# RUN DB MIGRATION +#================================================= +ynh_script_progression --message="Running DB initial migration..." + +pushd "$final_path" + ynh_use_nodejs + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn db:migrate +popd #================================================= # SETUP SYSTEMD From 6d3b6e3d20b32d1139a5f64af1d9f75a836307c6 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 23:14:13 +0700 Subject: [PATCH 10/68] Remove & Restore --- scripts/remove | 2 +- scripts/restore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index ab6328f..7338e14 100755 --- a/scripts/remove +++ b/scripts/remove @@ -67,7 +67,7 @@ ynh_remove_logrotate ynh_script_progression --message="Removing the PostgreSQL database..." # Remove a database if it exists, along with the associated user -ynh_psql_remove_db --db_user=$db_user --db_name=$db_name +ynh_psql_remove_db --db_user=$db_name --db_name=$db_name #================================================= # REMOVE DEPENDENCIES diff --git a/scripts/restore b/scripts/restore index 7351504..4444e13 100755 --- a/scripts/restore +++ b/scripts/restore @@ -101,7 +101,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +ynh_psql_setup_db --db_user=$db_name --db_name=$db_name ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= From 0179def0af86a578747d4d3932e15b1acc12b86d Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 23:25:48 +0700 Subject: [PATCH 11/68] Update check_process --- check_process | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/check_process b/check_process index 291e739..b6d0b3b 100644 --- a/check_process +++ b/check_process @@ -11,16 +11,16 @@ minio_domain="minio.tld" ; Checks pkg_linter=1 - setup_sub_dir=1 - setup_root=1 + setup_sub_dir=0 + setup_root=0 setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 + setup_private=0 + setup_public=0 + upgrade=0 #upgrade=1 from_commit=CommitHash - backup_restore=1 + backup_restore=0 multi_instance=0 - change_url=1 + change_url=0 ;;; Options Email= Notification=none From 313907a6dd07061615499d9567d781d9b8b5e79b Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 23:30:22 +0700 Subject: [PATCH 12/68] Linter --- scripts/restore | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 4444e13..6d768ad 100755 --- a/scripts/restore +++ b/scripts/restore @@ -124,7 +124,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Outline server" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index bbea438..3df9f36 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -168,7 +168,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Outline server" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE From d0ac2c6a3beb5b0c1b2d038b61a1816701ce89e3 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 23:31:24 +0700 Subject: [PATCH 13/68] Linter --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index 3e162d2..77f496d 100755 --- a/scripts/backup +++ b/scripts/backup @@ -64,7 +64,7 @@ ynh_backup --src_path="$final_path" # BACKUP MINIO #================================================= -sudo yunohost backup create --apps minio +yunohost backup create --apps minio #================================================= # BACKUP THE NGINX CONFIGURATION From c232d48324b533a90a96fdd16067a08262c3ca65 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 23:33:31 +0700 Subject: [PATCH 14/68] Update check_process --- check_process | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_process b/check_process index b6d0b3b..3acd498 100644 --- a/check_process +++ b/check_process @@ -11,11 +11,11 @@ minio_domain="minio.tld" ; Checks pkg_linter=1 - setup_sub_dir=0 - setup_root=0 + setup_sub_dir=1 + setup_root=1 setup_nourl=0 - setup_private=0 - setup_public=0 + setup_private=1 + setup_public=1 upgrade=0 #upgrade=1 from_commit=CommitHash backup_restore=0 From 0385e30e68695d5643eac8d60d1deac79cfcfe54 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 23:38:32 +0700 Subject: [PATCH 15/68] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 3acd498..df8be15 100644 --- a/check_process +++ b/check_process @@ -8,7 +8,7 @@ port="666" slack_key="slack" slack_secret="secret" - minio_domain="minio.tld" + minio_domain="sub.domain.tld" ; Checks pkg_linter=1 setup_sub_dir=1 From 846a5980504e770cbb70378d14d1315e506613d1 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 11 Nov 2021 23:50:32 +0700 Subject: [PATCH 16/68] Update install --- scripts/install | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 579e35c..0eae598 100755 --- a/scripts/install +++ b/scripts/install @@ -38,8 +38,11 @@ else echo "English" fi -secret_key=$(ynh_string_random --length=32) -utils_secret=$(ynh_string_random --length=32) +#secret_key=$(ynh_string_random --length=64) +#utils_secret=$(ynh_string_random --length=64) + +secret_key=`openssl rand -hex 32` +utils_secret=`openssl rand -hex 32` slack_key=$YNH_APP_ARG_SLACK_KEY slack_secret=$YNH_APP_ARG_SLACK_SECRET From 4f7b6d0f2d7d8596d14e1c3ed7e4d694b52227ce Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 00:06:47 +0700 Subject: [PATCH 17/68] Personnal helper --- scripts/_common.sh | 4 ++++ scripts/install | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9c6dc0c..28612a7 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -13,6 +13,10 @@ NODEJS_VERSION=14 # PERSONAL HELPERS #================================================= +ynh_hex_32_random() { + echo "$(openssl rand -hex 32)" +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 0eae598..33ddbd5 100755 --- a/scripts/install +++ b/scripts/install @@ -38,11 +38,8 @@ else echo "English" fi -#secret_key=$(ynh_string_random --length=64) -#utils_secret=$(ynh_string_random --length=64) - -secret_key=`openssl rand -hex 32` -utils_secret=`openssl rand -hex 32` +secret_key=$(ynh_hex_32_random) +utils_secret=$(ynh_hex_32_random) slack_key=$YNH_APP_ARG_SLACK_KEY slack_secret=$YNH_APP_ARG_SLACK_SECRET From 47a7232d9d1e9bd65043d0f229b3985062e6f5b9 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 00:46:15 +0700 Subject: [PATCH 18/68] Update restore --- scripts/restore | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/restore b/scripts/restore index 6d768ad..df5aba0 100755 --- a/scripts/restore +++ b/scripts/restore @@ -104,6 +104,16 @@ ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_name --db_name=$db_name ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name +#================================================= +# RUN DB MIGRATION +#================================================= +ynh_script_progression --message="Running DB initial migration..." + +pushd "$final_path" + ynh_use_nodejs + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn db:migrate +popd + #================================================= # RESTORE SYSTEMD #================================================= From 12770b386981c4952f6b76ab0e102e923664e22c Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 01:14:18 +0700 Subject: [PATCH 19/68] db_pwd --- scripts/install | 2 +- scripts/restore | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index 33ddbd5..20bee21 100755 --- a/scripts/install +++ b/scripts/install @@ -134,7 +134,7 @@ ynh_script_progression --message="Creating a PostgreSQL database..." --time --we db_name=$(ynh_sanitize_dbid --db_name=$app) ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_name --db_name=$db_name +ynh_psql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$secret_key ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS unaccent;" --database=$db_name ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name diff --git a/scripts/restore b/scripts/restore index df5aba0..baa9c7f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -101,19 +101,9 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_name --db_name=$db_name +ynh_psql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$secret_key ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name -#================================================= -# RUN DB MIGRATION -#================================================= -ynh_script_progression --message="Running DB initial migration..." - -pushd "$final_path" - ynh_use_nodejs - ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn db:migrate -popd - #================================================= # RESTORE SYSTEMD #================================================= From dd57832c614c7106517b457a6caf0fbf7f68f87b Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 22:07:53 +0700 Subject: [PATCH 20/68] Update .gitignore --- sources/patches/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore index 783a4ae..d817da3 100644 --- a/sources/patches/.gitignore +++ b/sources/patches/.gitignore @@ -1,2 +1,3 @@ *~ *.sw[op] +*.js \ No newline at end of file From cc12078958b3bee555bf37b401ab846e9ac5a50c Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 22:23:02 +0700 Subject: [PATCH 21/68] Create app-01-email.patch --- sources/patches/app-01-email.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sources/patches/app-01-email.patch diff --git a/sources/patches/app-01-email.patch b/sources/patches/app-01-email.patch new file mode 100644 index 0000000..9014eef --- /dev/null +++ b/sources/patches/app-01-email.patch @@ -0,0 +1,14 @@ +diff --git a/server/mailer.js b/server/mailer.js +index eeedb5ac..d979bab7 100644 +--- a/server/mailer.js ++++ b/server/mailer.js +@@ -85,6 +85,7 @@ export class Mailer { + "SMTP_TLS_CIPHERS" in process.env + ? { ciphers: process.env.SMTP_TLS_CIPHERS } + : undefined, ++ ignoreTLS:true + }; + + if (process.env.SMTP_USERNAME) { +-- +2.18.0 \ No newline at end of file From 756cf9f850863b0be3fcf4ae99fa7a63e0632a1c Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 22:33:35 +0700 Subject: [PATCH 22/68] Create app-02-branding.patch --- sources/patches/app-02-branding.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/patches/app-02-branding.patch diff --git a/sources/patches/app-02-branding.patch b/sources/patches/app-02-branding.patch new file mode 100644 index 0000000..844bdbc --- /dev/null +++ b/sources/patches/app-02-branding.patch @@ -0,0 +1,16 @@ +diff --git a/app/scenes/Document/components/Document.js b/app/scenes/Document/components/Document.js +index 2c5bf69b..599bd4f6 100644 +--- a/app/scenes/Document/components/Document.js ++++ b/app/scenes/Document/components/Document.js +@@ -593,9 +593,6 @@ class DocumentScene extends React.Component { + + + +- {isShare && !isCustomDomain() && ( +- +- )} + {!isShare && ( + <> + +-- +2.18.0 From 2c4dd3dd632e6a1ad36cc6d46bf624be8ad43e34 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 22:38:16 +0700 Subject: [PATCH 23/68] Update app-02-branding.patch --- sources/patches/app-02-branding.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/patches/app-02-branding.patch b/sources/patches/app-02-branding.patch index 844bdbc..1204b85 100644 --- a/sources/patches/app-02-branding.patch +++ b/sources/patches/app-02-branding.patch @@ -13,4 +13,4 @@ index 2c5bf69b..599bd4f6 100644 <> -- -2.18.0 +2.18.0 \ No newline at end of file From 07f498a022c35af8ce4649c22dda8e130c79bdc7 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 22:45:40 +0700 Subject: [PATCH 24/68] Update app-02-branding.patch --- sources/patches/app-02-branding.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/patches/app-02-branding.patch b/sources/patches/app-02-branding.patch index 1204b85..32e2d6c 100644 --- a/sources/patches/app-02-branding.patch +++ b/sources/patches/app-02-branding.patch @@ -13,4 +13,5 @@ index 2c5bf69b..599bd4f6 100644 <> -- -2.18.0 \ No newline at end of file +2.18.0 + From 89ac817084007e84faa34c39431dfc39b1bdce04 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 22:48:43 +0700 Subject: [PATCH 25/68] Delete app-02-branding.patch --- sources/patches/app-02-branding.patch | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 sources/patches/app-02-branding.patch diff --git a/sources/patches/app-02-branding.patch b/sources/patches/app-02-branding.patch deleted file mode 100644 index 32e2d6c..0000000 --- a/sources/patches/app-02-branding.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/app/scenes/Document/components/Document.js b/app/scenes/Document/components/Document.js -index 2c5bf69b..599bd4f6 100644 ---- a/app/scenes/Document/components/Document.js -+++ b/app/scenes/Document/components/Document.js -@@ -593,9 +593,6 @@ class DocumentScene extends React.Component { - - - -- {isShare && !isCustomDomain() && ( -- -- )} - {!isShare && ( - <> - --- -2.18.0 - From 6c0a70438720311743f2a0f4e81c6998bfb124ba Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 23:20:30 +0700 Subject: [PATCH 26/68] Prompt for admin user --- manifest.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/manifest.json b/manifest.json index a4ab01b..8f3cab1 100644 --- a/manifest.json +++ b/manifest.json @@ -48,6 +48,15 @@ "choices": ["fr", "en"], "default": "en" }, + { + "name": "admin", + "type": "user", + "ask":{ + "en": "An email alias outline@domain.tld will be created for admin user", + "fr": "Un alias email outline@domain.tld seera créé pour l'admin" + + } + }, { "name": "slack_key", "type": "string", From b9f46f959333668c99146e1a67b50fdbc7319d1c Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 23:23:47 +0700 Subject: [PATCH 27/68] Updates --- conf/.env | 4 ++-- scripts/backup | 1 + scripts/remove | 1 + scripts/restore | 1 + scripts/upgrade | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/.env b/conf/.env index 96efe5e..c15d909 100644 --- a/conf/.env +++ b/conf/.env @@ -145,8 +145,8 @@ SMTP_USERNAME='' SMTP_PASSWORD='' SMTP_FROM_EMAIL='__APP__@__DOMAIN__' SMTP_REPLY_EMAIL='webmaster@__DOMAIN__' -SMTP_TLS_CIPHERS='' -SMTP_SECURE='true' +SMTP_TLS_CIPHERS= +SMTP_SECURE='false' # Custom logo that displays on the authentication screen, scaled to height: 60px # TEAM_LOGO=https://example.com/images/logo.png diff --git a/scripts/backup b/scripts/backup index 77f496d..b461eb8 100755 --- a/scripts/backup +++ b/scripts/backup @@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) +admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) diff --git a/scripts/remove b/scripts/remove index 7338e14..f95204c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) +admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) diff --git a/scripts/restore b/scripts/restore index baa9c7f..1661838 100755 --- a/scripts/restore +++ b/scripts/restore @@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) +admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) diff --git a/scripts/upgrade b/scripts/upgrade index 3df9f36..302e298 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) +admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) From b433cbf199346fb0ed1971304aabf006411a2d65 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 23:28:32 +0700 Subject: [PATCH 28/68] Updates --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 20bee21..118f97d 100755 --- a/scripts/install +++ b/scripts/install @@ -125,6 +125,7 @@ ynh_script_progression --message="Configuring system user..." --time --weight=1 # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" +yunohost user update $admin --add-mailalias $app@$domain #================================================= # CREATE A POSTGRESQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 302e298..716857e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,6 +69,7 @@ ynh_script_progression --message="Making sure dedicated system user exists..." - # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" +yunohost user update $admin --add-mailalias $app@$domain #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From 7bf24b6e607ceda8e8269a26422d717300623026 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 23:44:18 +0700 Subject: [PATCH 29/68] Updates --- scripts/backup | 14 ++++++++------ scripts/restore | 10 ++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/backup b/scripts/backup index b461eb8..ac9db26 100755 --- a/scripts/backup +++ b/scripts/backup @@ -55,18 +55,20 @@ ynh_print_info --message="Declaring files to be backed up..." ### creates and fill the archive with the files happens in the core after this ### script is called. Hence ynh_backups calls takes basically 0 seconds to run. +#================================================= +# BACKUP MINIO +#================================================= + +pushd "$mc_path" + ynh_exec_warn_less sudo -u minio ./mc mirror --remove --a minio/outlinestorage "$final_path/outlinestorage" +popd + #================================================= # BACKUP THE APP MAIN DIR #================================================= ynh_backup --src_path="$final_path" -#================================================= -# BACKUP MINIO -#================================================= - -yunohost backup create --apps minio - #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 1661838..7b56203 100755 --- a/scripts/restore +++ b/scripts/restore @@ -81,6 +81,16 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# RESTORE MINIO +#================================================= + +pushd "$mc_path" + ynh_exec_warn_less sudo -u minio ./mc mb minio/outlinestorage --region "fr-ynh-1" + ynh_exec_warn_less sudo -u minio ./mc policy set public minio/outlinestorage + ynh_exec_warn_less sudo -u minio ./mc cp --recursive "$final_path/outlinestorage" minio/outlinestorage +popd + #================================================= # SPECIFIC RESTORATION #================================================= From 13ae0bd195da04c3b975f82d68fbb2af40f0fde4 Mon Sep 17 00:00:00 2001 From: Limezy Date: Fri, 12 Nov 2021 23:48:20 +0700 Subject: [PATCH 30/68] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 118f97d..e5cde6f 100755 --- a/scripts/install +++ b/scripts/install @@ -44,6 +44,8 @@ utils_secret=$(ynh_hex_32_random) slack_key=$YNH_APP_ARG_SLACK_KEY slack_secret=$YNH_APP_ARG_SLACK_SECRET +admin=$YNH_APP_ARG_ADMIN + app=$YNH_APP_INSTANCE_NAME #================================================= From 347d34af40814874896950c9e521df1473681d82 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 01:02:29 +0700 Subject: [PATCH 31/68] Updates --- scripts/backup | 6 +++++- scripts/install | 1 - scripts/restore | 4 +++- scripts/upgrade | 1 - 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/backup b/scripts/backup index ac9db26..330ff50 100755 --- a/scripts/backup +++ b/scripts/backup @@ -60,9 +60,13 @@ ynh_print_info --message="Declaring files to be backed up..." #================================================= pushd "$mc_path" - ynh_exec_warn_less sudo -u minio ./mc mirror --remove --a minio/outlinestorage "$final_path/outlinestorage" + ynh_exec_warn_less sudo -u minio mkdir outlinestorage + ynh_exec_warn_less sudo -u minio ./mc mirror --remove --a minio/outlinestorage ./outlinestorage/ popd +mv "$mc_path/outlinestorage" "$final_path/outlinestorage" +chown -R outline:www-data "$final_path/outlinestorage" + #================================================= # BACKUP THE APP MAIN DIR #================================================= diff --git a/scripts/install b/scripts/install index e5cde6f..38dffb5 100755 --- a/scripts/install +++ b/scripts/install @@ -127,7 +127,6 @@ ynh_script_progression --message="Configuring system user..." --time --weight=1 # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" -yunohost user update $admin --add-mailalias $app@$domain #================================================= # CREATE A POSTGRESQL DATABASE diff --git a/scripts/restore b/scripts/restore index 7b56203..252a350 100755 --- a/scripts/restore +++ b/scripts/restore @@ -85,10 +85,12 @@ chown -R $app:www-data "$final_path" # RESTORE MINIO #================================================= +mv "$final_path/outlinestorage" "$mc_path/outlinestorage" +chown -R minio:www-data "$mc_path/outlinestorage" pushd "$mc_path" ynh_exec_warn_less sudo -u minio ./mc mb minio/outlinestorage --region "fr-ynh-1" ynh_exec_warn_less sudo -u minio ./mc policy set public minio/outlinestorage - ynh_exec_warn_less sudo -u minio ./mc cp --recursive "$final_path/outlinestorage" minio/outlinestorage + ynh_exec_warn_less sudo -u minio ./mc cp --recursive ./outlinestorage minio/outlinestorage popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 716857e..302e298 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,7 +69,6 @@ ynh_script_progression --message="Making sure dedicated system user exists..." - # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" -yunohost user update $admin --add-mailalias $app@$domain #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From 03e9028b81076db03bbfa44abae3de56c2c983da Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 01:20:22 +0700 Subject: [PATCH 32/68] Update restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 252a350..6426f90 100755 --- a/scripts/restore +++ b/scripts/restore @@ -90,7 +90,7 @@ chown -R minio:www-data "$mc_path/outlinestorage" pushd "$mc_path" ynh_exec_warn_less sudo -u minio ./mc mb minio/outlinestorage --region "fr-ynh-1" ynh_exec_warn_less sudo -u minio ./mc policy set public minio/outlinestorage - ynh_exec_warn_less sudo -u minio ./mc cp --recursive ./outlinestorage minio/outlinestorage + ynh_exec_warn_less sudo -u minio ./mc cp --recursive ./outlinestorage/* minio/outlinestorage popd #================================================= From 704e9b34bcc6644643e2a4f7aa3f743331ecc437 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 01:44:32 +0700 Subject: [PATCH 33/68] Update restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 6426f90..c3af727 100755 --- a/scripts/restore +++ b/scripts/restore @@ -90,7 +90,7 @@ chown -R minio:www-data "$mc_path/outlinestorage" pushd "$mc_path" ynh_exec_warn_less sudo -u minio ./mc mb minio/outlinestorage --region "fr-ynh-1" ynh_exec_warn_less sudo -u minio ./mc policy set public minio/outlinestorage - ynh_exec_warn_less sudo -u minio ./mc cp --recursive ./outlinestorage/* minio/outlinestorage + ynh_exec_warn_less sudo -u minio ./mc cp --recursive ./outlinestorage/ minio/outlinestorage popd #================================================= From 3df01bc77023dd82b408d4c734bb38ef3f462b8b Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 13:35:43 +0700 Subject: [PATCH 34/68] Update restore --- scripts/restore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index c3af727..28b832b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -90,8 +90,9 @@ chown -R minio:www-data "$mc_path/outlinestorage" pushd "$mc_path" ynh_exec_warn_less sudo -u minio ./mc mb minio/outlinestorage --region "fr-ynh-1" ynh_exec_warn_less sudo -u minio ./mc policy set public minio/outlinestorage - ynh_exec_warn_less sudo -u minio ./mc cp --recursive ./outlinestorage/ minio/outlinestorage + ynh_exec_warn_less sudo -u minio ./mc mirror --remove --a ./outlinestorage/ minio/outlinestorage popd +ynh_secure_remove --file="$mc_path/outlinestorage" #================================================= # SPECIFIC RESTORATION From d1692ba494ce76bfacbd87265c18f9dab28be29e Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 13:50:11 +0700 Subject: [PATCH 35/68] Updates --- scripts/backup | 9 +++++++++ scripts/restore | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/scripts/backup b/scripts/backup index 330ff50..225fcff 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,15 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# CHECK IF MINIO IS INSTALLED, IF NOT WARN USER +#================================================= +ynh_script_progression --message="Checking if MinIO is installed..." --time --weight=1 + +if ! yunohost app list | grep -q "id: minio"; then + echo "MinIO is not installed. Installing... " +fi + #================================================= # LOAD SETTINGS #================================================= diff --git a/scripts/restore b/scripts/restore index 28b832b..c287cdf 100755 --- a/scripts/restore +++ b/scripts/restore @@ -21,6 +21,15 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# CHECK IF MINIO IS INSTALLED, IF NOT WARN USER +#================================================= +ynh_script_progression --message="Checking if MinIO is installed..." --time --weight=1 + +if ! yunohost app list | grep -q "id: minio"; then + ynh_die --message="We can't restore because MinIO is not installed ! Please install MinIO first" +fi + #================================================= # LOAD SETTINGS #================================================= From 4d90b07b048dc2d7b082e12e5698a69934ecf08c Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 14:11:16 +0700 Subject: [PATCH 36/68] Update backup --- scripts/backup | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/scripts/backup b/scripts/backup index 225fcff..b0c2d19 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,15 +21,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK IF MINIO IS INSTALLED, IF NOT WARN USER -#================================================= -ynh_script_progression --message="Checking if MinIO is installed..." --time --weight=1 - -if ! yunohost app list | grep -q "id: minio"; then - echo "MinIO is not installed. Installing... " -fi - #================================================= # LOAD SETTINGS #================================================= @@ -70,7 +61,7 @@ ynh_print_info --message="Declaring files to be backed up..." pushd "$mc_path" ynh_exec_warn_less sudo -u minio mkdir outlinestorage - ynh_exec_warn_less sudo -u minio ./mc mirror --remove --a minio/outlinestorage ./outlinestorage/ + ynh_exec_warn_less sudo -u minio ./mc mirror --a minio/outlinestorage ./outlinestorage/ popd mv "$mc_path/outlinestorage" "$final_path/outlinestorage" From 3b473dcaa0dced0be12d8e5d27a1196dc6f1372f Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 14:32:14 +0700 Subject: [PATCH 37/68] Update restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index c287cdf..203e9ea 100755 --- a/scripts/restore +++ b/scripts/restore @@ -99,7 +99,7 @@ chown -R minio:www-data "$mc_path/outlinestorage" pushd "$mc_path" ynh_exec_warn_less sudo -u minio ./mc mb minio/outlinestorage --region "fr-ynh-1" ynh_exec_warn_less sudo -u minio ./mc policy set public minio/outlinestorage - ynh_exec_warn_less sudo -u minio ./mc mirror --remove --a ./outlinestorage/ minio/outlinestorage + ynh_exec_warn_less sudo -u minio ./mc mirror --a ./outlinestorage/ minio/outlinestorage popd ynh_secure_remove --file="$mc_path/outlinestorage" From 9b2708b9e73d48c3c3c78e8afd03dd8de1416c00 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 14:38:07 +0700 Subject: [PATCH 38/68] Update restore --- scripts/restore | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/restore b/scripts/restore index 203e9ea..c30c455 100755 --- a/scripts/restore +++ b/scripts/restore @@ -90,6 +90,16 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# UPDATING A CONFIGURATION +#================================================= +ynh_script_progression --message="Updating the configuration file..." --time --weight=1 + +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" + +chmod 400 "$final_path/.env" +chown $app:$app "$final_path/.env" + #================================================= # RESTORE MINIO #================================================= From 23f1c2202b6622b1d572f5118fe9fa8e9fbd2025 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 14:39:57 +0700 Subject: [PATCH 39/68] Update restore --- scripts/restore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/restore b/scripts/restore index c30c455..5b4a116 100755 --- a/scripts/restore +++ b/scripts/restore @@ -93,6 +93,8 @@ chown -R $app:www-data "$final_path" #================================================= # UPDATING A CONFIGURATION #================================================= + +ynh_secure_remove --file="$final_path/.env" ynh_script_progression --message="Updating the configuration file..." --time --weight=1 ynh_add_config --template="../conf/.env" --destination="$final_path/.env" From 935d35fa9b5551afe26a29b80e7b81812be0a3c3 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 14:45:34 +0700 Subject: [PATCH 40/68] Update source and shasum --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index 2eabc41..eb5e573 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/outline/outline/archive/refs/tags/v0.59.0.tar.gz -SOURCE_SUM=6a3caea9e5ec8dc9c2594cf4d1b43be305097604112c698b6bacad0883ba38f3 +SOURCE_URL=https://github.com/outline/outline/archive/refs/tags/v0.60.1.tar.gz +SOURCE_SUM=f47cb5ab67aff07382cd3470a94397855e12ff965732870af3665a0bc436c1c7 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From 3ae60a4487c83bbbb7a7486069179ef35315d07f Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 14:46:23 +0700 Subject: [PATCH 41/68] Update version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 8f3cab1..5b79e23 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "An open, extensible, wiki for your team built using React and Node.js.", "fr": "Un wiki open source et évolutif pour votre équipe, conçu avec React et Node.js" }, - "version": "59.0~ynh1", + "version": "v0.60.1~ynh1", "url": "www.getoutline.com", "upstream": { "license": "BSL 1.1", From d466100d40ed742e69840480e78e509ad826eb9d Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 15:51:37 +0700 Subject: [PATCH 42/68] Update restore --- scripts/restore | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/restore b/scripts/restore index 5b4a116..ca19406 100755 --- a/scripts/restore +++ b/scripts/restore @@ -90,18 +90,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# UPDATING A CONFIGURATION -#================================================= - -ynh_secure_remove --file="$final_path/.env" -ynh_script_progression --message="Updating the configuration file..." --time --weight=1 - -ynh_add_config --template="../conf/.env" --destination="$final_path/.env" - -chmod 400 "$final_path/.env" -chown $app:$app "$final_path/.env" - #================================================= # RESTORE MINIO #================================================= @@ -139,6 +127,18 @@ ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$secret_key ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name +#================================================= +# UPDATING A CONFIGURATION +#================================================= + +ynh_secure_remove --file="$final_path/.env" +ynh_script_progression --message="Updating the configuration file..." --time --weight=1 + +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" + +chmod 400 "$final_path/.env" +chown $app:$app "$final_path/.env" + #================================================= # RESTORE SYSTEMD #================================================= From 7eb4a062fbe10b8ea44406fde5ff77118d8a468a Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 15:55:19 +0700 Subject: [PATCH 43/68] Add port (again...) --- scripts/backup | 1 + scripts/restore | 1 + scripts/upgrade | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/backup b/scripts/backup index b0c2d19..97ebe19 100755 --- a/scripts/backup +++ b/scripts/backup @@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) +port=$(ynh_app_setting_get --app=$app --key=port) admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) diff --git a/scripts/restore b/scripts/restore index ca19406..3bc9eb7 100755 --- a/scripts/restore +++ b/scripts/restore @@ -40,6 +40,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) +port=$(ynh_app_setting_get --app=$app --key=port) admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) diff --git a/scripts/upgrade b/scripts/upgrade index 302e298..b1d1940 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) +port=$(ynh_app_setting_get --app=$app --key=port) admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) From f58a99e686bfb6b7113c48e5de8167ed6f970e80 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 15:57:02 +0700 Subject: [PATCH 44/68] Linter --- scripts/backup | 2 -- scripts/restore | 2 -- scripts/upgrade | 2 -- 3 files changed, 6 deletions(-) diff --git a/scripts/backup b/scripts/backup index 97ebe19..2226ce9 100755 --- a/scripts/backup +++ b/scripts/backup @@ -39,8 +39,6 @@ slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) - - minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) diff --git a/scripts/restore b/scripts/restore index 3bc9eb7..f10fb84 100755 --- a/scripts/restore +++ b/scripts/restore @@ -48,8 +48,6 @@ slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) - - minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) diff --git a/scripts/upgrade b/scripts/upgrade index b1d1940..0eda0ce 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,8 +27,6 @@ slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) - - minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) From 09a70348b602e36ad2817ba24dd3acdb938a5c49 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 15:57:53 +0700 Subject: [PATCH 45/68] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0eda0ce..fcca5f1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -101,7 +101,7 @@ ynh_script_progression --message="Upgrading dependencies..." --time --weight=1 ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies # Install Nodejs -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$NODEJS_VERSION # Install Yarn ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" From e5145907ca43c6f90a4e13a18b638e711951c9b6 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 13 Nov 2021 16:26:13 +0700 Subject: [PATCH 46/68] Update .env --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index c15d909..13c842b 100644 --- a/conf/.env +++ b/conf/.env @@ -18,7 +18,7 @@ UTILS_SECRET=__UTILS_SECRET__ # For production point these at your databases, in development the default # should work out of the box. -DATABASE_URL=postgres://__DB_NAME__:__DB_PWD__@localhost:5432/__DB_NAME__ +DATABASE_URL=postgres://__DB_NAME__:__SECRET_KEY__@localhost:5432/__DB_NAME__ # Uncomment this to disable SSL for connecting to Postgres PGSSLMODE=disable REDIS_URL=redis://localhost:6379 From d4f2917aa141e42eac05984d44b77b159cc73d61 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 14 Nov 2021 21:24:31 +0700 Subject: [PATCH 47/68] Update .env --- conf/.env | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/conf/.env b/conf/.env index 13c842b..fca1012 100644 --- a/conf/.env +++ b/conf/.env @@ -19,6 +19,7 @@ UTILS_SECRET=__UTILS_SECRET__ # For production point these at your databases, in development the default # should work out of the box. DATABASE_URL=postgres://__DB_NAME__:__SECRET_KEY__@localhost:5432/__DB_NAME__ +DATABASE_URL_TEST=postgres://user:pass@localhost:5532/outline-test # Uncomment this to disable SSL for connecting to Postgres PGSSLMODE=disable REDIS_URL=redis://localhost:6379 @@ -28,6 +29,10 @@ REDIS_URL=redis://localhost:6379 URL=https://__DOMAIN__ PORT=__PORT__ +# See [documentation](docs/SERVICES.md) on running a separate collaboration +# server, for normal operation this does not need to be set. +COLLABORATION_URL= + # To support uploading of images for avatars and document attachments an # s3-compatible storage must be provided. AWS S3 is recommended for redundency # however if you want to keep all file storage local an alternative such as @@ -84,11 +89,15 @@ OIDC_AUTH_URI= OIDC_TOKEN_URI= OIDC_USERINFO_URI= +# Specify which claims to derive user information from +# Supports any valid JSON path with the JWT payload +OIDC_USERNAME_CLAIM=preferred_username + # Display name for OIDC authentication -OIDC_DISPLAY_NAME=OpenID Connect +OIDC_DISPLAY_NAME=OpenID # Space separated auth scopes. -OIDC_SCOPES=openid profile email +OIDC_SCOPES="openid profile email" # –––––––––––––––– OPTIONAL –––––––––––––––– @@ -115,8 +124,8 @@ WEB_CONCURRENCY=1 # especially large Word documents with embedded imagery MAXIMUM_IMPORT_SIZE=5120000 -# You may enable or disable debugging categories to increase the noisiness of -# logs. The default is a good balance +# You can remove this line if your reverse proxy already logs incoming http +# requests and this ends up being duplicative DEBUG=cache,presenters,events,emails,mailer,utils,http,server,processors # Comma separated list of domains to be allowed to signin to the wiki. If not @@ -153,4 +162,4 @@ SMTP_SECURE='false' # The default interface language. See translate.getoutline.com for a list of # available language codes and their rough percentage translated. -DEFAULT_LANGUAGE=__LANGUAGE_KEY__ +DEFAULT_LANGUAGE=__LANGUAGE_KEY__ \ No newline at end of file From 5b468f3a3a88f9cade8e4d8eded7f0ac695c50c3 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 14 Nov 2021 22:48:34 +0700 Subject: [PATCH 48/68] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 38dffb5..03c3a64 100755 --- a/scripts/install +++ b/scripts/install @@ -88,6 +88,8 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key ynh_app_setting_set --app=$app --key=utils_secret --value=$utils_secret +ynh_app_setting_set --app=$app --key=slack_key --value=$slack_key +ynh_app_setting_set --app=$app --key=slack_secret --value=$slack_secret #================================================= # STANDARD MODIFICATIONS From e2043ccb082a33abe694551532e3e304186f03d4 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 14 Nov 2021 22:53:08 +0700 Subject: [PATCH 49/68] Update change_url --- scripts/change_url | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 99d31e3..d0c99a7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,7 +28,20 @@ ynh_script_progression --message="Loading installation settings..." --time --wei # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path_url) port=$(ynh_app_setting_get --app=$app --key=port) +admin=$(ynh_app_setting_get --app=$app --key=admin) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +language_key=$(ynh_app_setting_get --app=$app --key=language_key) +slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) +slack_secret=$(ynh_app_setting_get --app=$app --key=slack_secret) +secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) +utils_secret=$(ynh_app_setting_get --app=$app --key=utils_secret) +minio_domain=$(ynh_app_setting_get --app="minio" --key=domain) +minio_id=$(ynh_app_setting_get --app="minio" --key=minio_id) +minio_key=$(ynh_app_setting_get --app="minio" --key=minio_key) +mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP @@ -102,11 +115,17 @@ then fi #================================================= -# SPECIFIC MODIFICATIONS -#================================================= -# ... +# UPDATING A CONFIGURATION #================================================= +ynh_secure_remove --file="$final_path/.env" +ynh_script_progression --message="Updating the configuration file..." --time --weight=1 + +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" + +chmod 400 "$final_path/.env" +chown $app:$app "$final_path/.env" + #================================================= # GENERIC FINALISATION #================================================= From 65a97a76f48f466c15bca75c71a32d5d74faf86c Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 14 Nov 2021 23:30:46 +0700 Subject: [PATCH 50/68] Update manifest.json --- manifest.json | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/manifest.json b/manifest.json index 5b79e23..6829c30 100644 --- a/manifest.json +++ b/manifest.json @@ -49,13 +49,10 @@ "default": "en" }, { - "name": "admin", - "type": "user", - "ask":{ - "en": "An email alias outline@domain.tld will be created for admin user", - "fr": "Un alias email outline@domain.tld seera créé pour l'admin" - - } + "name": "path", + "type": "path", + "example": "/wiki", + "default": "/wiki" }, { "name": "slack_key", From 338979fed58aea199cc5ca118d7db2f0d292a28d Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 14 Nov 2021 23:33:38 +0700 Subject: [PATCH 51/68] Updates path_url --- conf/.env | 2 +- conf/nginx.conf | 2 +- scripts/install | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/.env b/conf/.env index fca1012..a2db8bf 100644 --- a/conf/.env +++ b/conf/.env @@ -26,7 +26,7 @@ REDIS_URL=redis://localhost:6379 # URL should point to the fully qualified, publicly accessible URL. If using a # proxy the port in URL and PORT may be different. -URL=https://__DOMAIN__ +URL=https://__DOMAIN__/__PATH__ PORT=__PORT__ # See [documentation](docs/SERVICES.md) on running a separate collaboration diff --git a/conf/nginx.conf b/conf/nginx.conf index 2967bbf..f34c768 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location / { +location __PATH__/ { # Force usage of https if ($scheme = http) { diff --git a/scripts/install b/scripts/install index 03c3a64..41618ef 100755 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url="/" #$YNH_APP_ARG_PATH +path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE From 09eaf66c470ada07ff58a3bda83ea7bc3d30db31 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 14 Nov 2021 23:37:40 +0700 Subject: [PATCH 52/68] admin remove --- scripts/backup | 1 - scripts/change_url | 1 - scripts/install | 2 -- scripts/remove | 1 - scripts/restore | 1 - scripts/upgrade | 1 - 6 files changed, 7 deletions(-) diff --git a/scripts/backup b/scripts/backup index 2226ce9..48657e3 100755 --- a/scripts/backup +++ b/scripts/backup @@ -32,7 +32,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) port=$(ynh_app_setting_get --app=$app --key=port) -admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) diff --git a/scripts/change_url b/scripts/change_url index d0c99a7..bdbb55d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -31,7 +31,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) port=$(ynh_app_setting_get --app=$app --key=port) -admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) diff --git a/scripts/install b/scripts/install index 41618ef..8603313 100755 --- a/scripts/install +++ b/scripts/install @@ -44,8 +44,6 @@ utils_secret=$(ynh_hex_32_random) slack_key=$YNH_APP_ARG_SLACK_KEY slack_secret=$YNH_APP_ARG_SLACK_SECRET -admin=$YNH_APP_ARG_ADMIN - app=$YNH_APP_INSTANCE_NAME #================================================= diff --git a/scripts/remove b/scripts/remove index f95204c..7338e14 100755 --- a/scripts/remove +++ b/scripts/remove @@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) -admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) diff --git a/scripts/restore b/scripts/restore index f10fb84..4866d64 100755 --- a/scripts/restore +++ b/scripts/restore @@ -41,7 +41,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) port=$(ynh_app_setting_get --app=$app --key=port) -admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) diff --git a/scripts/upgrade b/scripts/upgrade index fcca5f1..8199ce3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,7 +20,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path_url) port=$(ynh_app_setting_get --app=$app --key=port) -admin=$(ynh_app_setting_get --app=$app --key=admin) db_name=$(ynh_app_setting_get --app=$app --key=db_name) language_key=$(ynh_app_setting_get --app=$app --key=language_key) slack_key=$(ynh_app_setting_get --app=$app --key=slack_key) From 9349292e424d78d13b1822cdf7b346e63308d061 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 14 Nov 2021 23:42:30 +0700 Subject: [PATCH 53/68] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 6829c30..10412ae 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "An open, extensible, wiki for your team built using React and Node.js.", "fr": "Un wiki open source et évolutif pour votre équipe, conçu avec React et Node.js" }, - "version": "v0.60.1~ynh1", + "version": "0.60.1~ynh1", "url": "www.getoutline.com", "upstream": { "license": "BSL 1.1", From a159959c6448b289ef39860b64bdab2e588f9110 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 00:05:32 +0700 Subject: [PATCH 54/68] Path_url --- conf/.env | 2 +- conf/nginx.conf | 2 +- scripts/install | 19 ++++++------------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/conf/.env b/conf/.env index a2db8bf..6dd32c1 100644 --- a/conf/.env +++ b/conf/.env @@ -26,7 +26,7 @@ REDIS_URL=redis://localhost:6379 # URL should point to the fully qualified, publicly accessible URL. If using a # proxy the port in URL and PORT may be different. -URL=https://__DOMAIN__/__PATH__ +URL=https://__DOMAIN__/__PATH_URL__ PORT=__PORT__ # See [documentation](docs/SERVICES.md) on running a separate collaboration diff --git a/conf/nginx.conf b/conf/nginx.conf index f34c768..89158c2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location __PATH__/ { +location __PATH_URL__/ { # Force usage of https if ($scheme = http) { diff --git a/scripts/install b/scripts/install index 8603313..5b9f42c 100755 --- a/scripts/install +++ b/scripts/install @@ -68,7 +68,7 @@ mc_path=$(ynh_app_setting_get --app="minio" --key=mc_path) #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --time --weight=1 +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -79,7 +79,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --time --weight=1 +ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url @@ -94,7 +94,7 @@ ynh_app_setting_set --app=$app --key=slack_secret --value=$slack_secret #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --time --weight=1 +ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port port=$(ynh_find_port --port=2410) @@ -103,14 +103,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --time --weight=1 - -### SHOULD HAVE A CHECK FOR MINIO + INSTALLATION HERE -#if ! ynh_package_is_installed --package="minio" -#then -# yunohost tools update -# yunohost app install minio --force -#fi +ynh_script_progression --message="Installing dependencies..." --weight=1 # Install nodejs ynh_install_nodejs --nodejs_version=$NODEJS_VERSION @@ -123,7 +116,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --time --weight=1 +ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" @@ -131,7 +124,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE A POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Creating a PostgreSQL database..." --time --weight=1 +ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 db_name=$(ynh_sanitize_dbid --db_name=$app) ynh_app_setting_set --app=$app --key=db_name --value=$db_name From b4dbf1b6e1fd99950e8bba316fe36689c0b54b35 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 00:13:20 +0700 Subject: [PATCH 55/68] Update install --- scripts/install | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/scripts/install b/scripts/install index 5b9f42c..915343e 100755 --- a/scripts/install +++ b/scripts/install @@ -49,7 +49,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF MINIO IS INSTALLED, IF NOT INSTALL IT #================================================= -ynh_script_progression --message="Installing MinIO if needed..." --time --weight=1 +ynh_script_progression --message="Installing MinIO if needed..." --time --weight=18 if ! yunohost app list | grep -q "id: minio"; then echo "MinIO is not installed. Installing... " @@ -137,7 +137,7 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --datab #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --time --weight=1 +ynh_script_progression --message="Setting up source files..." --weight=2 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -150,7 +150,7 @@ chown -R $app:www-data "$final_path" #================================================= # SETUP MINIO BUCKET #================================================= -ynh_script_progression --message="Setting up MinIO bucket for Outline..." --time --weight=1 +ynh_script_progression --message="Setting up MinIO bucket for Outline..." --weight=1 pushd "$mc_path" ynh_exec_warn_less sudo -u minio ./mc mb minio/outlinestorage --region "fr-ynh-1" @@ -160,7 +160,7 @@ popd #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --time --weight=1 +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -169,26 +169,25 @@ ynh_add_nginx_config #================================================= # BUILD YARN DEPENDENCIES #================================================= -ynh_script_progression --message="Building Yarn dependencies... This can be very long, be patient !" --time --weight=10 pushd "$final_path" ynh_use_nodejs - ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --time --weight=5 + ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --no-optional --frozen-lockfile - ynh_script_progression --message="Cleaning cache... " --time --weight=1 + ynh_script_progression --message="Cleaning cache... " --weight=3 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean - ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --time --weight=5 + ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn build - ynh_script_progression --message="Fetching Yarn production dependencies... This can be very long, be patient !" --time --weight=5 + ynh_script_progression --message="Fetching Yarn production dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install --production=true --frozen-lockfile - ynh_script_progression --message="Cleaning cache... " --time --weight=1 + ynh_script_progression --message="Cleaning cache... " --weight=3 ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean popd #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --time --weight=1 +ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/.env" --destination="$final_path/.env" @@ -198,7 +197,7 @@ chown $app:$app "$final_path/.env" #================================================= # RUN DB MIGRATION #================================================= -ynh_script_progression --message="Running DB initial migration..." +ynh_script_progression --message="Running DB initial migration..." --weight=3 pushd "$final_path" ynh_use_nodejs @@ -208,7 +207,7 @@ popd #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --time --weight=1 +ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" @@ -220,7 +219,7 @@ ynh_add_systemd_config #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Configuring log rotation..." --time --weight=1 +ynh_script_progression --message="Configuring log rotation..." --weight=1 # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -228,14 +227,14 @@ ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Outline server" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" @@ -243,7 +242,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --time --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] @@ -254,7 +253,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -262,4 +261,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --time --last +ynh_script_progression --message="Installation of $app completed" --last From 9264f7738cdfe4bee595ea335b80b35c0224e7ad Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 00:28:30 +0700 Subject: [PATCH 56/68] Update .env --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 6dd32c1..421864f 100644 --- a/conf/.env +++ b/conf/.env @@ -26,7 +26,7 @@ REDIS_URL=redis://localhost:6379 # URL should point to the fully qualified, publicly accessible URL. If using a # proxy the port in URL and PORT may be different. -URL=https://__DOMAIN__/__PATH_URL__ +URL=https://__DOMAIN____PATH_URL__ PORT=__PORT__ # See [documentation](docs/SERVICES.md) on running a separate collaboration From b5706dbacdafbf5cb5133b0a9be7bd65afc1002e Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 01:05:41 +0700 Subject: [PATCH 57/68] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 89158c2..f34c768 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location __PATH_URL__/ { +location __PATH__/ { # Force usage of https if ($scheme = http) { From 8b050b92d31b1c8582cb76fdd3023f3f7c3e2766 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 08:30:12 +0700 Subject: [PATCH 58/68] Updates --- conf/.env | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/.env b/conf/.env index 421864f..f7d2c15 100644 --- a/conf/.env +++ b/conf/.env @@ -26,7 +26,7 @@ REDIS_URL=redis://localhost:6379 # URL should point to the fully qualified, publicly accessible URL. If using a # proxy the port in URL and PORT may be different. -URL=https://__DOMAIN____PATH_URL__ +URL=https://__DOMAIN____PATH__ PORT=__PORT__ # See [documentation](docs/SERVICES.md) on running a separate collaboration diff --git a/scripts/install b/scripts/install index 915343e..0ff91be 100755 --- a/scripts/install +++ b/scripts/install @@ -49,7 +49,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF MINIO IS INSTALLED, IF NOT INSTALL IT #================================================= -ynh_script_progression --message="Installing MinIO if needed..." --time --weight=18 +ynh_script_progression --message="Installing MinIO if needed..." --weight=18 if ! yunohost app list | grep -q "id: minio"; then echo "MinIO is not installed. Installing... " From f42aca08f3da7993ade75b6cb0e4025a48795d13 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 08:40:38 +0700 Subject: [PATCH 59/68] Create app-02-email2.patch --- sources/patches/app-02-email2.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sources/patches/app-02-email2.patch diff --git a/sources/patches/app-02-email2.patch b/sources/patches/app-02-email2.patch new file mode 100644 index 0000000..d5068b6 --- /dev/null +++ b/sources/patches/app-02-email2.patch @@ -0,0 +1,15 @@ +diff --git a/server/presenters/env.js b/server/presenters/env.js +index adf16ac9..54e009c8 100644 +--- a/server/presenters/env.js ++++ b/server/presenters/env.js +@@ -17,7 +17,7 @@ export default function present(env: Object): Object { + SLACK_APP_ID: env.SLACK_APP_ID, + MAXIMUM_IMPORT_SIZE: env.MAXIMUM_IMPORT_SIZE || 1024 * 1000 * 5, + SUBDOMAINS_ENABLED: env.SUBDOMAINS_ENABLED === "true", +- EMAIL_ENABLED: !!env.SMTP_USERNAME || env.NODE_ENV === "development", ++ EMAIL_ENABLED: !!env.SMTP_HOST || env.NODE_ENV === "development", + GOOGLE_ANALYTICS_ID: env.GOOGLE_ANALYTICS_ID, + RELEASE: env.SOURCE_COMMIT || env.SOURCE_VERSION || undefined, + }; +-- +2.18.0 \ No newline at end of file From e808510db8ef9871dc857e81cd536e5e2283bf0f Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 09:19:04 +0700 Subject: [PATCH 60/68] Remove path_url Giving up, seems not to be compatible with Outline anyway --- conf/.env | 2 +- conf/nginx.conf | 2 +- manifest.json | 6 ------ scripts/install | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/conf/.env b/conf/.env index f7d2c15..fca1012 100644 --- a/conf/.env +++ b/conf/.env @@ -26,7 +26,7 @@ REDIS_URL=redis://localhost:6379 # URL should point to the fully qualified, publicly accessible URL. If using a # proxy the port in URL and PORT may be different. -URL=https://__DOMAIN____PATH__ +URL=https://__DOMAIN__ PORT=__PORT__ # See [documentation](docs/SERVICES.md) on running a separate collaboration diff --git a/conf/nginx.conf b/conf/nginx.conf index f34c768..2967bbf 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location __PATH__/ { +location / { # Force usage of https if ($scheme = http) { diff --git a/manifest.json b/manifest.json index 10412ae..143b5e8 100644 --- a/manifest.json +++ b/manifest.json @@ -48,12 +48,6 @@ "choices": ["fr", "en"], "default": "en" }, - { - "name": "path", - "type": "path", - "example": "/wiki", - "default": "/wiki" - }, { "name": "slack_key", "type": "string", diff --git a/scripts/install b/scripts/install index 0ff91be..642b058 100755 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE From 0b7c006672c6eb0ea6174c884fcba5b824a7de31 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 09:23:37 +0700 Subject: [PATCH 61/68] Update change_url --- scripts/change_url | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index bdbb55d..3b0077b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -72,7 +72,7 @@ fi change_path=0 if [ "$old_path" != "$new_path" ] then - change_path=1 + ynh_die "Outline has to be installed on the root of a domain" fi #================================================= @@ -91,18 +91,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config -fi - # Change the domain for NGINX if [ $change_domain -eq 1 ] then From e9ec4cb71dd7b3f583b9002b75373bce38441606 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 09:47:03 +0700 Subject: [PATCH 62/68] Update change_url --- scripts/change_url | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 3b0077b..dbe016e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -113,6 +113,16 @@ ynh_add_config --template="../conf/.env" --destination="$final_path/.env" chmod 400 "$final_path/.env" chown $app:$app "$final_path/.env" +#================================================= +# RUN DB MIGRATION +#================================================= +ynh_script_progression --message="Running DB initial migration..." --weight=3 + +pushd "$final_path" + ynh_use_nodejs + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn db:migrate +popd + #================================================= # GENERIC FINALISATION #================================================= From e1cd0c5900f9fea40fa49c1ae017c68295482357 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 10:23:47 +0700 Subject: [PATCH 63/68] Create app-03-branding.patch --- sources/patches/app-03-branding.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/patches/app-03-branding.patch diff --git a/sources/patches/app-03-branding.patch b/sources/patches/app-03-branding.patch new file mode 100644 index 0000000..1204b85 --- /dev/null +++ b/sources/patches/app-03-branding.patch @@ -0,0 +1,16 @@ +diff --git a/app/scenes/Document/components/Document.js b/app/scenes/Document/components/Document.js +index 2c5bf69b..599bd4f6 100644 +--- a/app/scenes/Document/components/Document.js ++++ b/app/scenes/Document/components/Document.js +@@ -593,9 +593,6 @@ class DocumentScene extends React.Component { + + + +- {isShare && !isCustomDomain() && ( +- +- )} + {!isShare && ( + <> + +-- +2.18.0 \ No newline at end of file From 38ec1a8b7f8da712b2a98942ad874b2a9e38e444 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 10:26:29 +0700 Subject: [PATCH 64/68] Update change_url --- scripts/change_url | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index dbe016e..acb24bf 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -139,6 +139,12 @@ ynh_script_progression --message="Reloading NGINX web server..." --time --weight ynh_systemd_action --service_name=nginx --action=reload +#================================================= +# SLACK WARNING +#================================================= +ynh_print_info --message="Don't forget to add a new redirction url in your Slack app settings !" + + #================================================= # END OF SCRIPT #================================================= From 484a79463ade4c260a0fb366efa7f59be103cb2e Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 10:44:44 +0700 Subject: [PATCH 65/68] Update backup --- scripts/backup | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/backup b/scripts/backup index 48657e3..903d2b7 100755 --- a/scripts/backup +++ b/scripts/backup @@ -108,6 +108,12 @@ ynh_print_info --message="Backing up the PostgreSQL database..." ynh_psql_dump_db --database="$db_name" > db.sql +#================================================= +# REMOVE THE TEMP OUTLINESTORAGE +#================================================= + +ynh_secure_remove --file="$final_path/outlinestorage" + #================================================= # END OF SCRIPT #================================================= From 4fc78a355e07f7dc92ce5238bb9bcb5942df880f Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 10:55:59 +0700 Subject: [PATCH 66/68] Update change_url --- scripts/change_url | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index acb24bf..8abf6bb 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -105,6 +105,8 @@ fi # UPDATING A CONFIGURATION #================================================= +domain=$new_domain + ynh_secure_remove --file="$final_path/.env" ynh_script_progression --message="Updating the configuration file..." --time --weight=1 From 1c0aa3290ad2df45d28737a223ee220964cb9142 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 11:36:31 +0700 Subject: [PATCH 67/68] Update backup --- scripts/backup | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/backup b/scripts/backup index 903d2b7..48657e3 100755 --- a/scripts/backup +++ b/scripts/backup @@ -108,12 +108,6 @@ ynh_print_info --message="Backing up the PostgreSQL database..." ynh_psql_dump_db --database="$db_name" > db.sql -#================================================= -# REMOVE THE TEMP OUTLINESTORAGE -#================================================= - -ynh_secure_remove --file="$final_path/outlinestorage" - #================================================= # END OF SCRIPT #================================================= From fb7c4c1931c5b77a72aec95e61df6f55b653e051 Mon Sep 17 00:00:00 2001 From: Limezy Date: Mon, 15 Nov 2021 12:06:10 +0700 Subject: [PATCH 68/68] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 642b058..5ff4e54 100755 --- a/scripts/install +++ b/scripts/install @@ -88,6 +88,8 @@ ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key ynh_app_setting_set --app=$app --key=utils_secret --value=$utils_secret ynh_app_setting_set --app=$app --key=slack_key --value=$slack_key ynh_app_setting_set --app=$app --key=slack_secret --value=$slack_secret +ynh_app_setting_set --app=$app --key=language_key --value=$language_key + #================================================= # STANDARD MODIFICATIONS