From e4c990b819e81e6dc5d279097b2b6602bc8b6466 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 6 Apr 2021 15:51:17 +0200 Subject: [PATCH] Fix --- README.md | 4 ++-- conf/config.json | 2 +- scripts/install | 34 +++++++++++++++++++++------------- scripts/upgrade | 1 + 4 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 scripts/upgrade diff --git a/README.md b/README.md index 3e50bfe..f1b6575 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ Can the app be used by multiple users? #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nodebb%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/nodebb/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nodebb%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nodebb/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nodebb.svg)](https://ci-apps.yunohost.org/ci/apps/nodebb/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nodebb.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nodebb/) ## Limitations diff --git a/conf/config.json b/conf/config.json index 0b07df1..ac8881f 100644 --- a/conf/config.json +++ b/conf/config.json @@ -1,8 +1,8 @@ { "url": "https://__DOMAIN__", "secret": "__SECRET__", - "database": "postgres", "port": "__PORT__", + "database": "postgres", "postgres": { "host": "127.0.0.1", "port": "5432", diff --git a/scripts/install b/scripts/install index d3617e2..3ee0f3c 100644 --- a/scripts/install +++ b/scripts/install @@ -51,7 +51,7 @@ ynh_app_setting_set --app=$app --key=$secret --value="$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=4567) @@ -60,7 +60,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --time --weight=1 +ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies @@ -70,7 +70,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a PostgreSQL database..." --time --weight=1 +ynh_script_progression --message="Creating a PostgreSQL database..." --weight=9 db_name=$(ynh_sanitize_dbid --db_name=$app) ynh_app_setting_set --app=$app --key=db_name --value=$db_name @@ -80,7 +80,7 @@ ynh_psql_setup_db --db_user=$db_name --db_name=$db_name #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --time --weight=1 +ynh_script_progression --message="Configuring system user..." --weight=3 # Create a system user ynh_system_user_create --username=$app @@ -105,7 +105,7 @@ ynh_use_logrotate #================================================= # 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 @@ -114,7 +114,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --time --weight=1 +ynh_script_progression --message="Configuring NGINX web server..." --weight=3 # Create a dedicated NGINX config ynh_add_nginx_config @@ -122,7 +122,7 @@ ynh_add_nginx_config #================================================= # Add Systemd service #================================================= -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" #ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" @@ -157,9 +157,9 @@ popd # START NodeBB IN BACKGROUND #================================================= -cat /etc/systemd/system/$app.service -systemctl daemon-reload -systemctl enable $app.service +# cat /etc/systemd/system/$app.service +# systemctl daemon-reload +# systemctl enable $app.service #================================================= # INTEGRATE SERVICE IN YUNOHOST @@ -171,9 +171,9 @@ yunohost service add $app --description="A short description of the app" --log=" #================================================= # START ETHERPAD IN BACKGROUND #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=restart --log_path="/var/log/$app/$app.log" #================================================= # SETUP SSOWAT @@ -189,8 +189,10 @@ fi #================================================= # RELOAD NGINX #================================================= +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload -systemctl reload nginx #================================================= # SEND A README FOR THE ADMIN @@ -205,4 +207,10 @@ $mail_content If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/nodebb_ynh" +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Installation of $app completed" --last + ynh_send_readme_to_admin "$message" diff --git a/scripts/upgrade b/scripts/upgrade new file mode 100644 index 0000000..2e3f5db --- /dev/null +++ b/scripts/upgrade @@ -0,0 +1 @@ +#https://docs.nodebb.org/configuring/upgrade/ \ No newline at end of file