diff --git a/README.md b/README.md index 1e38e8f..c71ae4f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # BookWyrm for YunoHost -[![Integration level](https://dash.yunohost.org/integration/bookwyrm.svg)](https://dash.yunohost.org/appci/app/bookwyrm) ![Working status](https://ci-apps.yunohost.org/ci/badges/bookwyrm.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/bookwyrm.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/bookwyrm.svg)](https://dash.yunohost.org/appci/app/bookwyrm) ![Working status](https://ci-apps.yunohost.org/ci/badges/bookwyrm.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/bookwyrm.maintain.svg) [![Install BookWyrm with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=bookwyrm) *[Lire ce readme en français.](./README_fr.md)* @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in BookWyrm is a social network for tracking your reading, talking about books, writing reviews, and discovering what to read next. -**Shipped version:** 0.5.3~ynh1 +**Shipped version:** 0.5.4~ynh1 **Demo:** https://joinbookwyrm.com/fr/ @@ -30,7 +30,7 @@ BookWyrm is a social network for tracking your reading, talking about books, wri 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/README_fr.md b/README_fr.md index 25b0cfe..0e6d9c6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # BookWyrm pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/bookwyrm.svg)](https://dash.yunohost.org/appci/app/bookwyrm) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/bookwyrm.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/bookwyrm.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/bookwyrm.svg)](https://dash.yunohost.org/appci/app/bookwyrm) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/bookwyrm.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/bookwyrm.maintain.svg) [![Installer BookWyrm avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=bookwyrm) *[Read this readme in english.](./README.md)* @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po BookWyrm est un réseau social pour garder la trace de vos lectures, parler de livres, écrire des critiques et découvrir quoi lire ensuite. -**Version incluse :** 0.5.3~ynh1 +**Version incluse :** 0.5.4~ynh1 **Démo :** https://joinbookwyrm.com/fr/ @@ -30,7 +30,7 @@ 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', +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 : ``` diff --git a/check_process b/check_process index 1a5eefe..0d5791b 100644 --- a/check_process +++ b/check_process @@ -12,10 +12,14 @@ setup_private=1 setup_public=1 upgrade=1 - #upgrade=1 from_commit=CommitHash + # 0.5.3ynh1 + upgrade=1 from_commit=2292d0d68f5ba9e48f4cbb6105db64b4da4eba74 backup_restore=1 multi_instance=0 change_url=0 ;;; Options Email=oufmilo@protonmail.com Notification=all +;;; Upgrade options + ; commit=2292d0d68f5ba9e48f4cbb6105db64b4da4eba74 + name=0.5.3~ynh1 \ No newline at end of file diff --git a/conf/.env.production b/conf/.env.production index a4abbd8..222eb53 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -15,7 +15,7 @@ DEFAULT_LANGUAGE="English" ## Leave unset to allow all hosts #ALLOWED_HOSTS="localhost,127.0.0.1,[::1]" -MEDIA_ROOT=images/ +MEDIA_ROOT=__FINALPATH__/images/ # Database configuration PGPORT=5432 diff --git a/conf/app.src b/conf/app.src index 649cbe2..0b8cbc3 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,7 +1,5 @@ -SOURCE_URL=https://github.com/bookwyrm-social/bookwyrm/archive/refs/tags/v0.5.3.tar.gz -SOURCE_SUM=41E263369BB3E0ED23AF6D6E112BD35EDE082BD5BECFE1BE9BBA152E47EE4E86 +SOURCE_URL=https://github.com/bookwyrm-social/bookwyrm/archive/refs/tags/v0.5.4.tar.gz +SOURCE_SUM=2dafdcf26de6c041611d16ed48b751cf8d4dfbee1f5cf4aa5975592bc080261d SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true +SOURCE_IN_SUBDIR=true \ No newline at end of file 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 : ``` diff --git a/manifest.json b/manifest.json index 8a43020..2e1a619 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Platform for social reading", "fr": "Plateforme de lecture sociale" }, - "version": "0.5.3~ynh1", + "version": "0.5.4~ynh1", "url": "https://github.com/bookwyrm-social/bookwyrm", "upstream": { "license": "AGPL-3.0-or-later", @@ -22,8 +22,8 @@ "requirements": { "yunohost": ">= 11.0.9" }, - "multi_instance": true, - "services": [ + "multi_instance": true, + "services": [ "nginx", "postgresql" ], @@ -33,7 +33,6 @@ "name": "domain", "type": "domain" }, - { "name": "is_public", "type": "boolean", @@ -46,7 +45,15 @@ "en": "Choose the application language", "fr": "Choisissez la langue de l'application" }, - "choices": ["de-de", "en-us", "es-es", "fr-fr", "it-it", "pt-pt", "zh-hans"], + "choices": [ + "de-de", + "en-us", + "es-es", + "fr-fr", + "it-it", + "pt-pt", + "zh-hans" + ], "default": "fr-fr" }, { diff --git a/scripts/backup b/scripts/backup index 9a45c9f..d66eaf1 100755 --- a/scripts/backup +++ b/scripts/backup @@ -31,7 +31,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) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -44,12 +43,6 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" -#================================================= -# BACKUP THE DATA DIR -#================================================= - -ynh_backup --src_path="$datadir" --is_big - #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index defe995..a994bb8 100755 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ ynh_psql_setup_db --db_user=$db_user --db_name=$db_name ynh_script_progression --message="Setting up source files..." --weight=1 ynh_app_setting_set --app=$app --key=final_path --value=$final_path - +# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" chmod 750 "$final_path" @@ -143,20 +143,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir - -mkdir -p $datadir - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - #================================================= # SETUP SYSTEMD #================================================= diff --git a/scripts/remove b/scripts/remove index 7eb1731..1101469 100644 --- a/scripts/remove +++ b/scripts/remove @@ -21,7 +21,6 @@ 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) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # STANDARD REMOVE @@ -76,17 +75,6 @@ ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" -#================================================= -# REMOVE DATA DIR -#================================================= - -# 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_secure_remove --file="$datadir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 06f5162..9ef1b92 100644 --- a/scripts/restore +++ b/scripts/restore @@ -34,7 +34,6 @@ 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) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -72,19 +71,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Restoring the data directory..." --weight=1 - -ynh_restore_file --origin_path="$datadir" --not_mandatory - -mkdir -p $datadir - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - #================================================= # SPECIFIC RESTORATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f9d2ad2..20361dd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,9 +21,6 @@ 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) port=$(ynh_app_setting_get --app=$app --key=port) admin_mail=$(ynh_user_get_info --username=$admin --key=username) @@ -59,6 +56,13 @@ ynh_systemd_action --action="stop" --service_name="${app}-beat" --log_path="syst ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped" ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped" +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE DEDICATED USER #================================================= @@ -83,22 +87,26 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" + #================================================= # CONFIGURE THEN INSTALL SCRIPT AND DEPENDENCIES #================================================= 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" - -set -a; source "$final_path/.env"; set +a - ynh_secure_remove --file="$final_path/venv" mkdir "$final_path/venv" python3 -m venv "$final_path/venv" $final_path/venv/bin/pip3 install -r "$final_path/requirements.txt" +#================================================= +# Update DATABASE +#================================================= +ynh_script_progression --message="Upgrading database..." --weight=1 + +$final_path/venv/bin/python3 "$final_path/manage.py" migrate +$final_path/venv/bin/python3 "$final_path/manage.py" collectstatic --no-input +$final_path/venv/bin/python3 "$final_path/manage.py" populate_streams + #================================================= # SET PERMISSIONS ON BOOKWYRM DIRECTORY #================================================= @@ -113,13 +121,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 - -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies - #================================================= # SETUP SYSTEMD #=================================================