From 25ff09c36628eeb3ce5f73c1787a0673ded5a3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 18 Mar 2023 20:59:29 +0100 Subject: [PATCH] fix --- conf/config.json | 3 ++- manifest.toml | 8 ++++++++ scripts/install | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/conf/config.json b/conf/config.json index 1a49c26..2aa83c5 100644 --- a/conf/config.json +++ b/conf/config.json @@ -1,4 +1,5 @@ { "canonicalHost": "__DOMAIN__", - "admin":[{"username":"__ADMIN__","password":"__PASSWORD__"}] + "admin":[{"username":"__ADMIN__", + "password":__PASSWORD_HASH__}] } diff --git a/manifest.toml b/manifest.toml index a197599..8c1ec1a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -72,6 +72,14 @@ ram.runtime = "50M" url = "https://github.com/jech/galene-ldap/archive/33b8a930372388b2b8b506d2564516fb3eaf895a.tar.gz" sha256 = "00247712e4e7944fed42026f056f48eb59a95cf476c3ff1cb6e24c54469ce070" + [resources.sources.generator] + amd64.url = "https://www.irif.fr/~jch/software/files/galene-password-generator-linux-amd64.gz" + amd64.sha256 = "a7fccbfa54c82e2e7ada0491364b41f5604ae85fe41b0501a592465e758f8cc4" + arm64.url = "https://www.irif.fr/~jch/software/files/galene-password-generator-linux-arm64.gz" + arm64.sha256 = "7e2e354438321b331f10779d700fc84ee3542f77b1142da9f90c8bbc7aa2680a" + in_subdir = false + rename = "galene-password-generator" + [resources.system_user] [resources.install_dir] diff --git a/scripts/install b/scripts/install index 305c4e6..0c3e4e5 100755 --- a/scripts/install +++ b/scripts/install @@ -45,6 +45,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir/build" ynh_setup_source --dest_dir="$install_dir/build_ldap" --source_id="ldap" +ynh_setup_source --dest_dir="$install_dir/build" --source_id="generator" mkdir -p "$install_dir/live/data" mkdir -p "$install_dir/live_ldap/data" @@ -53,6 +54,7 @@ ynh_replace_string --match_string="
Galène
" - chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/build/galene-password-generator" #================================================= # NGINX CONFIGURATION @@ -100,6 +102,8 @@ chown -R $app:www-data "$data_dir" #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 +password_hash=$(echo $install_dir/build/galene-password-generator $password) + # Configure Galène ynh_add_config --template="../conf/config.json" --destination="$install_dir/live/data/config.json" chmod 400 "$install_dir/live/data/config.json"