From 1be91cc2dd1568cd756bc64f2e7e4d7657573c85 Mon Sep 17 00:00:00 2001 From: Boudewijn Date: Mon, 3 Mar 2025 15:15:31 +0100 Subject: [PATCH] Revised method for user injection: artisan tinker --- manifest.toml | 20 ++++++++++---------- scripts/install | 8 +++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/manifest.toml b/manifest.toml index 484b298..5616fc0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -46,16 +46,16 @@ ram.runtime = "100M" default = "all_users" # for now no credentials configured, make it install first -# [install.user] -# help.en = "The name of the user" -# type = "string" -# [install.email] -# help.en = "The email address used for logging in to the application" -# type = "email" -# [install.password] -# help.en = "Use the help field to add an information for the admin about this question." -# help.fr = "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." -# type = "password" + [install.user] + help.en = "The name of the user" + type = "string" + [install.email] + help.en = "The email address used for logging in to the application" + type = "email" + [install.password] + help.en = "Use the help field to add an information for the admin about this question." + help.fr = "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." + type = "password" [resources] # See the packaging documentation for the full set diff --git a/scripts/install b/scripts/install index 5c63074..8be155e 100755 --- a/scripts/install +++ b/scripts/install @@ -94,6 +94,8 @@ ynh_composer_exec install --no-dev #================================================= ynh_script_progression "configuring $app..." +# Generate a random alfanumeric string as API token +token = $(tr -dc A-Za-z0-9 '$user', 'email' => '$email' , 'password' => bcrypt ('$password'), 'api_token' => '$token']); " | php artisan tinker popd -# Try to push create user into artisan tinker - # copy/paste from lychee install, for what it's worth... # file was touched by artisan, rehash it