diff --git a/README.md b/README.md
index 7c0075d..1e38e8f 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,15 @@ 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',
+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:
+```
+*******************************************
+Use this code to create your admin account:
+c6c35779-af3a-4091-b330-c026610920d6
+*******************************************
+```
## Documentation and resources
* Official app website:
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 :
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/doc/DISCLAIMER.md b/doc/DISCLAIMER.md
index c9ae32d..d0d6c25 100644
--- a/doc/DISCLAIMER.md
+++ b/doc/DISCLAIMER.md
@@ -1 +1,11 @@
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',
+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:
+```
+*******************************************
+Use this code to create your admin account:
+c6c35779-af3a-4091-b330-c026610920d6
+*******************************************
+```
\ No newline at end of file
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
+*******************************************
+```
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"
},
{
diff --git a/scripts/_common.sh b/scripts/_common.sh
index 70d3579..2bccbe6 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 python3-venv libpq-dev"
#=================================================
# PERSONAL HELPERS
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/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
diff --git a/scripts/upgrade b/scripts/upgrade
index 599041c..f9d2ad2 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)
@@ -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
@@ -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
#=================================================