From 0398ad6191e539e7eca33b9ba00e4172a49a6551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:16:57 +0100 Subject: [PATCH 1/9] Update upgrade --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 599041c..6b56f59 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,9 +88,9 @@ chown -R $app:www-data "$final_path" #================================================= ynh_script_progression --message="Installing service script..." --weight=1 -ynh_add_config --template="../conf/.env.production" --destination="$final_path/.env" -chmod 600 $final_path/.env -chown $app:www-data "$final_path/.env" +#ynh_add_config --template="../conf/.env.production" --destination="$final_path/.env" +#chmod 600 $final_path/.env +#chown $app:www-data "$final_path/.env" set -a; source "$final_path/.env"; set +a From ff44240cf7400a84727ec5c90209f74fb03579f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:19:56 +0100 Subject: [PATCH 2/9] Update restore --- scripts/restore | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/scripts/restore b/scripts/restore index e8bd14c..06f5162 100644 --- a/scripts/restore +++ b/scripts/restore @@ -33,6 +33,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= @@ -52,18 +53,6 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# RESTORE THE POSTGRESQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 - -ynh_psql_test_if_first_run -db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_psql_execute_as_root --sql="ALTER USER $db_user CREATEDB;" -ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -104,10 +93,7 @@ chown -R $app:www-data "$datadir" ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies - -ynh_exec_warn_less -ynh_install_app_dependencies -$pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE POSTGRESQL DATABASE From 111b31e756b9dc25f08e14dc5dc7d99de4c54149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:22:02 +0100 Subject: [PATCH 3/9] Redis already installed --- scripts/_common.sh | 2 +- scripts/upgrade | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 70d3579..d247c7f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="redis redis-tools redis-server postgresql postgresql-contrib nginx python3-venv libpq-dev" +pkg_dependencies="postgresql postgresql-contrib nginx python3-venv libpq-dev" #================================================= # PERSONAL HELPERS diff --git a/scripts/upgrade b/scripts/upgrade index 6b56f59..f941db4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,9 +21,9 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) language=$(ynh_app_setting_get --app=$app --key=language) admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$(ynh_app_setting_get --app=$app --key=db_user) -db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +#db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#db_user=$(ynh_app_setting_get --app=$app --key=db_user) +#db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) port=$(ynh_app_setting_get --app=$app --key=port) admin_mail=$(ynh_user_get_info --username=$admin --key=username) From 6400b9a3e5e1259a904b00944f1a4e360178c00a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:22:18 +0100 Subject: [PATCH 4/9] So does NGINX --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index d247c7f..2bccbe6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="postgresql postgresql-contrib nginx python3-venv libpq-dev" +pkg_dependencies="postgresql postgresql-contrib python3-venv libpq-dev" #================================================= # PERSONAL HELPERS From 3422afb7da974277a50d26c9b6eb07f6c156728f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:27:54 +0100 Subject: [PATCH 5/9] Fix --- conf/.env.production | 2 +- scripts/install | 1 - scripts/remove | 12 ++++++------ scripts/upgrade | 6 ++++++ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 56bac8d..a4abbd8 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -1,7 +1,7 @@ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY="__KEY__" -# SECURITY WARNING: don 't run with debug turned on in production! +# SECURITY WARNING: don't run with debug turned on in production! DEBUG=false USE_HTTPS=true diff --git a/scripts/install b/scripts/install index 03b297e..defe995 100755 --- a/scripts/install +++ b/scripts/install @@ -40,7 +40,6 @@ key=$(ynh_string_random --length=32) #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 - final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" diff --git a/scripts/remove b/scripts/remove index 3f2e27b..7eb1731 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -39,7 +39,7 @@ fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 ynh_systemd_action --service_name="${app}-beat" --action="stop" --log_path="systemd" --line_match="Stopped $app" ynh_systemd_action --service_name="${app}-server" --action="stop" --log_path="systemd" --line_match="Stopped $app" @@ -55,7 +55,7 @@ ynh_secure_remove --file="/etc/systemd/system/$app.target" #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -71,7 +71,7 @@ ynh_psql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 +ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -83,14 +83,14 @@ ynh_secure_remove --file="$final_path" # Remove the data directory if --purge option is used if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then - ynh_script_progression --message="Removing app data directory..." --weight=1 + ynh_script_progression --message="Removing app data directory..." --weight=1 ynh_secure_remove --file="$datadir" fi #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/upgrade b/scripts/upgrade index f941db4..f9d2ad2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,6 +99,12 @@ mkdir "$final_path/venv" python3 -m venv "$final_path/venv" $final_path/venv/bin/pip3 install -r "$final_path/requirements.txt" +#================================================= +# SET PERMISSIONS ON BOOKWYRM DIRECTORY +#================================================= + +chown -R $app:www-data $final_path + #================================================= # NGINX CONFIGURATION #================================================= From 38d0c7fec4452d8cc7a922e538964515b1abeb7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:30:24 +0100 Subject: [PATCH 6/9] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index bf1e23f..8a43020 100644 --- a/manifest.json +++ b/manifest.json @@ -46,7 +46,7 @@ "en": "Choose the application language", "fr": "Choisissez la langue de l'application" }, - "choices": ["fr-fr", "en-us", "it-it", "pt-pt"], + "choices": ["de-de", "en-us", "es-es", "fr-fr", "it-it", "pt-pt", "zh-hans"], "default": "fr-fr" }, { From 5c95408014da0b2a6143b0d914b187dff4723636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:56:33 +0100 Subject: [PATCH 7/9] Update DISCLAIMER_fr.md --- doc/DISCLAIMER_fr.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index f03d87c..0986abb 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -1 +1,11 @@ Ce projet est encore jeune et n'est pas, pour le moment, très stable, faites preuve de prudence lors de son utilisation en production. + +Générez le code administrateur avec 'sudo -u bookwyrm /var/www/bookwyrm/venv/bin/python3 /var/www/bookwyrm/manage.py admin_code', +et copiez le code administrateur à utiliser lors de la création de votre compte administrateur. Vous pouvez obtenir votre code +à tout moment en réexécutant cette commande. Voici un exemple de sortie : +``` +******************************************* +Use this code to create your admin account: +c6c35779-af3a-4091-b330-c026610920d6 +******************************************* +``` From 850a3623ff12b6b0fc48fea6475df036bd2a06d9 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 18 Jan 2023 08:56:38 +0000 Subject: [PATCH 8/9] Auto-update README --- README_fr.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README_fr.md b/README_fr.md index 76aa7a7..25b0cfe 100644 --- a/README_fr.md +++ b/README_fr.md @@ -30,6 +30,16 @@ BookWyrm est un réseau social pour garder la trace de vos lectures, parler de l Ce projet est encore jeune et n'est pas, pour le moment, très stable, faites preuve de prudence lors de son utilisation en production. +Générez le code administrateur avec 'sudo -u bookwyrm /var/www/bookwyrm/venv/bin/python3 /var/www/bookwyrm/manage.py admin_code', +et copiez le code administrateur à utiliser lors de la création de votre compte administrateur. Vous pouvez obtenir votre code +à tout moment en réexécutant cette commande. Voici un exemple de sortie : +``` +******************************************* +Use this code to create your admin account: +c6c35779-af3a-4091-b330-c026610920d6 +******************************************* +``` + ## Documentations et ressources * Site officiel de l’app : From 4d73254f8ee12a339b9576446527f9a6d6668c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 19 Jan 2023 10:38:11 +0100 Subject: [PATCH 9/9] Fix formating --- doc/DISCLAIMER.md | 2 +- doc/DISCLAIMER_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index d0d6c25..d29e6a3 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,6 +1,6 @@ This project is still young and isn't, at the moment, very stable, so please proceed with caution when running in production. -Generate the admin code with 'sudo -u bookwyrm /var/www/bookwyrm/venv/bin/python3 /var/www/bookwyrm/manage.py admin_code', +Generate the admin code with `sudo -u bookwyrm /var/www/bookwyrm/venv/bin/python3 /var/www/bookwyrm/manage.py admin_code`, and copy the admin code to use when you create your admin account. You can get your code at any time by re-running that command. Here's an example output: ``` diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 0986abb..14042b6 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -1,6 +1,6 @@ Ce projet est encore jeune et n'est pas, pour le moment, très stable, faites preuve de prudence lors de son utilisation en production. -Générez le code administrateur avec 'sudo -u bookwyrm /var/www/bookwyrm/venv/bin/python3 /var/www/bookwyrm/manage.py admin_code', +Générez le code administrateur avec `sudo -u bookwyrm /var/www/bookwyrm/venv/bin/python3 /var/www/bookwyrm/manage.py admin_code`, et copiez le code administrateur à utiliser lors de la création de votre compte administrateur. Vous pouvez obtenir votre code à tout moment en réexécutant cette commande. Voici un exemple de sortie : ```