From 91d02ea9d567250573aff91fe20435baaf7d4d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 Jan 2024 19:51:30 +0100 Subject: [PATCH] cleaning --- doc/POST_INSTALL.md | 2 +- doc/POST_INSTALL_fr.md | 2 +- doc/POST_UPGRADE.md | 2 +- doc/POST_UPGRADE_fr.md | 2 +- manifest.toml | 3 --- scripts/install | 5 +++-- scripts/upgrade | 6 ------ 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 116807d..064af63 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,6 +1,6 @@ - __APP__ can now be accessed at [https://__DOMAIN____PATH__](https://__DOMAIN____PATH__) - The admin username is: root -- The admin password is: __PASSWORD__ +- The admin password is: __ADMIN_PASS__ To make PeerTube Live available, you also need to make the TCP port __PORT_RTMP__ available from internet (For example, opening the port on your ISP box if it's not automatically done). diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md index 26755c0..3d3ecec 100644 --- a/doc/POST_INSTALL_fr.md +++ b/doc/POST_INSTALL_fr.md @@ -1,6 +1,6 @@ - __APP__ est désormais accessible sur [https://__DOMAIN____PATH__](https://__DOMAIN____PATH__) - Le nom d'utilisateur administrateur est : root -- Le mot de passe administrateur est : __PASSWORD__ +- Le mot de passe administrateur est : __ADMIN_PASS__ Pour rendre PeerTube Live disponible, vous devez également rendre le port TCP __PORT_RTMP__ disponible depuis internet (par exemple, ouvrir le port sur votre box FAI si ce n'est pas fait automatiquement). diff --git a/doc/POST_UPGRADE.md b/doc/POST_UPGRADE.md index 3b6880b..1f1bf2a 100644 --- a/doc/POST_UPGRADE.md +++ b/doc/POST_UPGRADE.md @@ -1,3 +1,3 @@ - __APP__ can now be accessed at [https://__DOMAIN____PATH__](https://__DOMAIN____PATH__) - The admin username is: root -- The admin password is: __PASSWORD__ +- The admin password is: __ADMIN_PASS__ diff --git a/doc/POST_UPGRADE_fr.md b/doc/POST_UPGRADE_fr.md index 7b7e26c..21ba152 100644 --- a/doc/POST_UPGRADE_fr.md +++ b/doc/POST_UPGRADE_fr.md @@ -1,3 +1,3 @@ - __APP__ est désormais accessible sur [https://__DOMAIN____PATH__](https://__DOMAIN____PATH__) - Le nom d'utilisateur administrateur est : root -- Le mot de passe administrateur est : __PASSWORD__ +- Le mot de passe administrateur est : __ADMIN_PASS__ diff --git a/manifest.toml b/manifest.toml index 2b6dc55..42dc771 100644 --- a/manifest.toml +++ b/manifest.toml @@ -40,9 +40,6 @@ ram.runtime = "1G" [install.admin] type = "user" - [install.password] - type = "password" - [resources] [resources.sources.main] url = "https://github.com/Chocobozzz/PeerTube/releases/download/v6.0.2/peertube-v6.0.2.tar.xz" diff --git a/scripts/install b/scripts/install index 0a5e8e8..a8aee62 100644 --- a/scripts/install +++ b/scripts/install @@ -14,6 +14,7 @@ source /usr/share/yunohost/helpers #================================================= admin_mail=$(ynh_user_get_info --username=$admin --key="mail") +admin_pass=$(ynh_string_random --length=24) secrets_peertube=$(ynh_string_random --length=24) redis_db=$(ynh_redis_get_free_db) @@ -21,7 +22,7 @@ redis_db=$(ynh_redis_get_free_db) # STORE SETTINGS FROM MANIFEST #================================================= -ynh_app_setting_set --app=$app --key=password --value=$password +ynh_app_setting_set --app=$app --key=admin_pass --value=$admin_pass ynh_app_setting_set --app=$app --key=secrets_peertube --value=$secrets_peertube ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" @@ -112,7 +113,7 @@ ynh_script_progression --message="Installing $app plugin and password..." pushd "$install_dir" ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-auth-ldap ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-livechat - echo "$password" | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run reset-password -- -u root + echo "$admin_pass" | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run reset-password -- -u root popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 1cc1331..f0e5be2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,11 +27,6 @@ if [ -z "${redis_db:-}" ]; then ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" fi -if [ -z "${password:-}" ]; then - password=$(ynh_string_random --length=24) - ynh_app_setting_set --app=$app --key=password --value=$password -fi - if [ -z "${secrets_peertube:-}" ]; then ynh_print_info --message="Generating and storing PeerTube secrets..." secrets_peertube=$(ynh_string_random --length=24) @@ -152,7 +147,6 @@ pushd "$install_dir" ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-auth-ldap ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run plugin:install -- --npm-name peertube-plugin-livechat ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run create-move-video-storage-job -- --to-file-system --all-videos - echo "$password" | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run reset-password -- -u root popd #=================================================