From 8c3c6b3992350744bdeae531fd5928f4a898bd7f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 4 Dec 2023 19:42:20 +0100 Subject: [PATCH] Unecesary complex stuff just to hash the password --- manifest.toml | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 31f7515..b97af41 100644 --- a/manifest.toml +++ b/manifest.toml @@ -53,7 +53,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "mariadb-server, php8.2-mbstring, php8.2-bcmath, php8.2-iconv, php8.2-xml, php8.2-gd, php8.2-curl, php8.2-mysqli" + packages = "mariadb-server, php8.2-mbstring, php8.2-bcmath, php8.2-iconv, php8.2-xml, php8.2-gd, php8.2-curl, php8.2-mysqli, python3-bcrypt" [resources.database] type = "mysql" diff --git a/scripts/install b/scripts/install index 01f4a6e..96a9489 100644 --- a/scripts/install +++ b/scripts/install @@ -42,7 +42,7 @@ ynh_add_nginx_config ynh_script_progression --message="Filling the database..." version=$(ynh_app_upstream_version) -bcrypt_mdp="$(php $install_dir/mdphash.php $password)" +bcrypt_mdp=$(python3 -c 'import bcrypt, sys; print(bcrypt.hashpw(sys.stdin.read().strip().encode(), bcrypt.gensalt(rounds=10)).decode())' <<< "$password") timezone="$(cat /etc/timezone)" time="$(date +%s)"