1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fittrackee_ynh.git synced 2024-09-03 18:36:16 +02:00

Merge pull request #21 from YunoHost-Apps/testing

This commit is contained in:
oufmilo 2023-02-10 00:57:43 +01:00 committed by GitHub
commit 729dcf88d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 47 additions and 84 deletions

View file

@ -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:
```

View file

@ -18,7 +18,7 @@ Si vous navez 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 :
```

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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:
```

View file

@ -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 :
```

View file

@ -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"
},
{

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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
#=================================================