diff --git a/ALL_README.md b/ALL_README.md
new file mode 100644
index 0000000..a01b345
--- /dev/null
+++ b/ALL_README.md
@@ -0,0 +1,7 @@
+# All available README files by language
+
+- [Read the README in English](README.md)
+- [Irakurri README euskaraz](README_eu.md)
+- [Lire le README en français](README_fr.md)
+- [Le o README en galego](README_gl.md)
+- [阅读中文(简体)的 README](README_zh_Hans.md)
diff --git a/README.md b/README.md
index 2d09e98..7b9b7d2 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
@@ -9,16 +9,16 @@ It shall NOT be edited by hand.
[](https://install-app.yunohost.org/?app=joplin)
-*[Lire ce readme en français.](./README_fr.md)*
+*[Read this README in other languages.](./ALL_README.md)*
-> *This package allows you to install Joplin quickly and simply on a YunoHost server.
-If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
+> *This package allows you to install Joplin quickly and simply on a YunoHost server.*
+> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*
## Overview
Joplin is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor. The notes are in Markdown format.
-**Shipped version:** 2.13.8~ynh1
+**Shipped version:** 2.13.9~ynh1
## Screenshots
@@ -26,19 +26,19 @@ Joplin is a free, open source note taking and to-do application, which can handl
## Documentation and resources
-* Official app website:
-* Official admin documentation:
-* Upstream app code repository:
-* YunoHost Store:
-* Report a bug:
+- Official app website:
+- Official admin documentation:
+- Upstream app code repository:
+- YunoHost Store:
+- Report a bug:
## Developer info
-Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/joplin_ynh/tree/testing).
+Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/joplin_ynh/tree/testing).
-To try the testing branch, please proceed like that.
+To try the `testing` branch, please proceed like that:
-``` bash
+```bash
sudo yunohost app install https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
or
sudo yunohost app upgrade joplin -u https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
diff --git a/README_eu.md b/README_eu.md
new file mode 100644
index 0000000..1f12939
--- /dev/null
+++ b/README_eu.md
@@ -0,0 +1,47 @@
+
+
+# Joplin YunoHost-erako
+
+[](https://dash.yunohost.org/appci/app/joplin)  
+
+[](https://install-app.yunohost.org/?app=joplin)
+
+*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
+
+> *Pakete honek Joplin YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
+> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
+
+## Aurreikuspena
+
+Joplin is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor. The notes are in Markdown format.
+
+**Paketatutako bertsioa:** 2.13.9~ynh1
+
+## Pantaila-argazkiak
+
+
+
+## Dokumentazioa eta baliabideak
+
+- Aplikazioaren webgune ofiziala:
+- Administratzaileen dokumentazio ofiziala:
+- Jatorrizko aplikazioaren kode-gordailua:
+- YunoHost Denda:
+- Eman errore baten berri:
+
+## Garatzaileentzako informazioa
+
+Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/joplin_ynh/tree/testing).
+
+`testing` abarra probatzeko, ondorengoa egin:
+
+```bash
+sudo yunohost app install https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
+edo
+sudo yunohost app upgrade joplin -u https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
+```
+
+**Informazio gehiago aplikazioaren paketatzeari buruz:**
diff --git a/README_fr.md b/README_fr.md
index 222d092..8a0277a 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -1,6 +1,6 @@
# Joplin pour YunoHost
@@ -9,16 +9,16 @@ It shall NOT be edited by hand.
[](https://install-app.yunohost.org/?app=joplin)
-*[Read this readme in english.](./README.md)*
+*[Lire le README dans d'autres langues.](./ALL_README.md)*
-> *Ce package vous permet d’installer Joplin rapidement et simplement sur un serveur YunoHost.
-Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.*
+> *Ce package vous permet d’installer Joplin rapidement et simplement sur un serveur YunoHost.*
+> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.*
## Vue d’ensemble
Joplin est une application gratuite et open source de prise de notes et de tâches, qui peut gérer un grand nombre de notes organisées dans des cahiers. Les notes sont consultables, peuvent être copiées, étiquetées et modifiées directement depuis les applications ou depuis votre propre éditeur de texte. Les notes sont au format Markdown.
-**Version incluse :** 2.13.8~ynh1
+**Version incluse :** 2.13.9~ynh1
## Captures d’écran
@@ -26,22 +26,22 @@ Joplin est une application gratuite et open source de prise de notes et de tâch
## Documentations et ressources
-* Site officiel de l’app :
-* Documentation officielle de l’admin :
-* Dépôt de code officiel de l’app :
-* YunoHost Store:
-* Signaler un bug :
+- Site officiel de l’app :
+- Documentation officielle de l’admin :
+- Dépôt de code officiel de l’app :
+- YunoHost Store :
+- Signaler un bug :
## Informations pour les développeurs
-Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/joplin_ynh/tree/testing).
+Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/joplin_ynh/tree/testing).
-Pour essayer la branche testing, procédez comme suit.
+Pour essayer la branche `testing`, procédez comme suit :
-``` bash
+```bash
sudo yunohost app install https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
ou
sudo yunohost app upgrade joplin -u https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
```
-**Plus d’infos sur le packaging d’applications :**
\ No newline at end of file
+**Plus d’infos sur le packaging d’applications :**
diff --git a/README_gl.md b/README_gl.md
new file mode 100644
index 0000000..fa19118
--- /dev/null
+++ b/README_gl.md
@@ -0,0 +1,47 @@
+
+
+# Joplin para YunoHost
+
+[](https://dash.yunohost.org/appci/app/joplin)  
+
+[](https://install-app.yunohost.org/?app=joplin)
+
+*[Le este README en outros idiomas.](./ALL_README.md)*
+
+> *Este paquete permíteche instalar Joplin de xeito rápido e doado nun servidor YunoHost.*
+> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.*
+
+## Vista xeral
+
+Joplin is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor. The notes are in Markdown format.
+
+**Versión proporcionada:** 2.13.9~ynh1
+
+## Capturas de pantalla
+
+
+
+## Documentación e recursos
+
+- Web oficial da app:
+- Documentación oficial para admin:
+- Repositorio de orixe do código:
+- Tenda YunoHost:
+- Informar dun problema:
+
+## Info de desenvolvemento
+
+Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/joplin_ynh/tree/testing).
+
+Para probar a rama `testing`, procede deste xeito:
+
+```bash
+sudo yunohost app install https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
+ou
+sudo yunohost app upgrade joplin -u https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
+```
+
+**Máis info sobre o empaquetado da app:**
diff --git a/README_zh_Hans.md b/README_zh_Hans.md
new file mode 100644
index 0000000..8c4a8a6
--- /dev/null
+++ b/README_zh_Hans.md
@@ -0,0 +1,47 @@
+
+
+# YunoHost 的 Joplin
+
+[](https://dash.yunohost.org/appci/app/joplin)  
+
+[](https://install-app.yunohost.org/?app=joplin)
+
+*[阅读此 README 的其它语言版本。](./ALL_README.md)*
+
+> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Joplin。*
+> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。*
+
+## 概况
+
+Joplin is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor. The notes are in Markdown format.
+
+**分发版本:** 2.13.9~ynh1
+
+## 截图
+
+
+
+## 文档与资源
+
+- 官方应用网站:
+- 官方管理文档:
+- 上游应用代码库:
+- YunoHost 商店:
+- 报告 bug:
+
+## 开发者信息
+
+请向 [`testing` 分支](https://github.com/YunoHost-Apps/joplin_ynh/tree/testing) 发送拉取请求。
+
+如要尝试 `testing` 分支,请这样操作:
+
+```bash
+sudo yunohost app install https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
+或
+sudo yunohost app upgrade joplin -u https://github.com/YunoHost-Apps/joplin_ynh/tree/testing --debug
+```
+
+**有关应用打包的更多信息:**
diff --git a/conf/systemd.service b/conf/systemd.service
index b73e479..541af5e 100644
--- a/conf/systemd.service
+++ b/conf/systemd.service
@@ -7,14 +7,8 @@ Type=simple
User=__APP__
Group=__APP__
-Environment="APP_BASE_URL=https://__DOMAIN__"
-Environment="APP_PORT=__PORT__"
-Environment="DB_CLIENT=pg"
-Environment="POSTGRES_PASSWORD=__DB_PWD__"
-Environment="POSTGRES_DATABASE=__DB_NAME__"
-Environment="POSTGRES_USER=__DB_USER__"
-Environment="POSTGRES_PORT=5432"
-Environment="POSTGRES_HOST=localhost"
+Environment="__YNH_NODE_LOAD_PATH__"
+EnvironmentFile=__INSTALL_DIR__/.env
WorkingDirectory=__INSTALL_DIR__/
ExecStart=/usr/bin/yarn __INSTALL_DIR__/packages/server start
diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md
index 8601988..f3db3c7 100644
--- a/doc/POST_INSTALL.md
+++ b/doc/POST_INSTALL.md
@@ -1,4 +1,8 @@
-Default credentials:
+Now login to Joplin
+ - Url: https://__DOMAIN____PATH__
+ - Email: __ADMIN_MAIL__
+ - Password: __ADMIN_PASS__
-Email: admin@localhost
-Password: admin
\ No newline at end of file
+Then you may change the default password at this page: https://__DOMAIN____PATH__/admin/users
+
+Then download one of these Joplin apps and configure the synchronisation with your server: https://joplinapp.org/help/install/
diff --git a/manifest.toml b/manifest.toml
index 7b5d13b..223996d 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -7,7 +7,7 @@ name = "Joplin"
description.en = "Note taking and to-do application with synchronisation capabilities"
description.fr = "Application de prise de notes et de tâches avec capacités de synchronisation"
-version = "2.13.8~ynh1"
+version = "2.13.9~ynh1"
maintainers = ["eric_G"]
@@ -38,13 +38,16 @@ ram.runtime = "50M"
type = "group"
default = "visitors"
+ [install.admin]
+ type = "user"
+
[resources]
[resources.sources]
[resources.sources.main]
- url = "https://github.com/laurent22/joplin/archive/refs/tags/v2.13.8.tar.gz"
- sha256 = "4ea9ab601ba5d2edf6fb452638ba10404544e59ad05ff428db31764592ab012c"
+ url = "https://github.com/laurent22/joplin/archive/refs/tags/v2.14.20.tar.gz"
+ sha256 = "919e9300e66bc6c24a282cbf93c43c228cdfe3227bdb1eaa50fdadef4734901b"
autoupdate.strategy = "latest_github_tag"
[resources.system_user]
@@ -63,7 +66,7 @@ ram.runtime = "50M"
main.default = 22300
[resources.apt]
- packages = "postgresql, postgresql-client"
+ packages = "postgresql, postgresql-client, python3-bcrypt"
extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main"
extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg"
extras.yarn.packages = "yarn"
diff --git a/scripts/_common.sh b/scripts/_common.sh
index 9195d57..c661840 100644
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -10,6 +10,11 @@ nodejs_version=18
# PERSONAL HELPERS
#=================================================
+function bcrypt_password() {
+ echo -n "$1" | \
+ python3 -c "import bcrypt; import sys; print(bcrypt.hashpw(bytes(sys.stdin.read(), 'ascii'), bcrypt.gensalt(rounds=10)).decode('ascii'))"
+}
+
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
diff --git a/scripts/backup b/scripts/backup
index 59c90ce..f11e868 100755
--- a/scripts/backup
+++ b/scripts/backup
@@ -34,7 +34,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
-# BACKUP THE MYSQL DATABASE
+# BACKUP THE PostgreSQL DATABASE
#=================================================
ynh_print_info --message="Backing up the PostgreSQL database..."
diff --git a/scripts/change_url b/scripts/change_url
index ecb9a84..4f8a5e1 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -25,8 +25,12 @@ ynh_script_progression --message="Updating NGINX web server configuration..." --
ynh_change_url_nginx_config
+ynh_use_nodejs
+
ynh_add_systemd_config
+ynh_add_config --template=".env" --destination="$install_dir/.env"
+
#=================================================
# GENERIC FINALISATION
#=================================================
diff --git a/scripts/install b/scripts/install
index 2a06a84..4e03f33 100755
--- a/scripts/install
+++ b/scripts/install
@@ -9,6 +9,14 @@
source _common.sh
source /usr/share/yunohost/helpers
+admin_pass=$(ynh_string_random --length=24)
+admin_mail=$(ynh_user_get_info --username=$admin --key="mail")
+admin_name=$(ynh_user_get_info --username=$admin --key="fullname")
+
+# Store these values even if we don't need them, so they are printed in the post-install message
+ynh_app_setting_set --app=$app --key=admin_pass --value=$admin_pass
+ynh_app_setting_set --app=$app --key=admin_mail --value=$admin_mail
+
#=================================================
# INSTALL DEPENDENCIES
#=================================================
@@ -57,11 +65,12 @@ chown $app:$app "$install_dir/.env"
#=================================================
# INSTALL JOPLIN
#=================================================
-ynh_script_progression --message="Installing $app..." --weight=10
+ynh_script_progression --message="Building $app..." --weight=10
-pushd $install_dir
+pushd $install_dir/packages/server
ynh_use_nodejs
sudo -u $app env $ynh_node_load_PATH BUILD_SEQUENCIAL=1 yarn install --inline-builds
+ sudo -u $app env $ynh_node_load_PATH yarn build
sudo -u $app env $ynh_node_load_PATH yarn cache clean
ynh_secure_remove .yarn/berry
popd
@@ -74,7 +83,20 @@ popd
ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
-ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
+ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Starting services..."
+
+#=================================================
+# CHANGING DEFAULT ADMIN PASSWORD
+#=================================================
+ynh_script_progression --message="Changing default admin password..." --weight=1
+
+hashed_pwd=$(bcrypt_password "$admin_pass")
+
+ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" <<< "
+ UPDATE users
+ SET password='$hashed_pwd', email='$admin_mail', full_name='$admin_name'
+ WHERE email='admin@localhost'
+"
#=================================================
# END OF SCRIPT
diff --git a/scripts/restore b/scripts/restore
index e89b8f0..c9b4674 100755
--- a/scripts/restore
+++ b/scripts/restore
@@ -20,7 +20,7 @@ ynh_restore_file --origin_path="$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
-# RESTORE THE MYSQL DATABASE
+# RESTORE THE PostgreSQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
diff --git a/scripts/upgrade b/scripts/upgrade
index c95d7e8..57185a6 100755
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -42,6 +42,22 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=5
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
+#=================================================
+# BUILD
+#=================================================
+
+if [ "$upgrade_type" == "UPGRADE_APP" ]
+then
+ ynh_script_progression --message="Building $app..." --weight=10
+ pushd $install_dir/packages/server
+ ynh_use_nodejs
+ sudo -u $app env $ynh_node_load_PATH BUILD_SEQUENCIAL=1 yarn install --inline-builds
+ sudo -u $app env $ynh_node_load_PATH yarn build
+ sudo -u $app env $ynh_node_load_PATH yarn cache clean
+ ynh_secure_remove .yarn/berry
+ popd
+fi
+
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
diff --git a/tests.toml b/tests.toml
index 953b195..849f10a 100644
--- a/tests.toml
+++ b/tests.toml
@@ -7,3 +7,5 @@ test_format = 1.0
# ------------
# Tests to run
# ------------
+
+ exclude = ["install.subdir"]