mirror of
https://github.com/YunoHost-Apps/flarum_ynh.git
synced 2024-09-03 18:36:24 +02:00
Removing api key creation and adding password length requirement
This commit is contained in:
parent
3358b98729
commit
3de168d103
2 changed files with 7 additions and 13 deletions
|
@ -61,11 +61,11 @@
|
|||
"name": "adminpass",
|
||||
"type": "password",
|
||||
"ask": {
|
||||
"en": "Put your password",
|
||||
"fr": "Insérez votre mot de passe",
|
||||
"de": "Einfügen eure Passwort"
|
||||
"en": "Put your password (8 characters minimum)",
|
||||
"fr": "Insérez votre mot de passe (8 caractères minimum)",
|
||||
"de": "Einfügen eure Passwort (mindestens 8 Zeichen)"
|
||||
},
|
||||
"example": "******",
|
||||
"example": "********",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
|
|
|
@ -22,7 +22,8 @@ admin=$YNH_APP_ARG_ADMIN
|
|||
adminpass=$YNH_APP_ARG_ADMINPASS
|
||||
title=$YNH_APP_ARG_TITLE
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
final_path=/var/www/$app
|
||||
www_path=/var/www
|
||||
final_path=$www_path/$app
|
||||
|
||||
# Source YunoHost helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
|
@ -75,8 +76,7 @@ fi
|
|||
### Install flarum
|
||||
cwd=$(pwd)
|
||||
sudo su - www-data -s /bin/bash -c "mkdir -p $tmp/$app && cd $tmp/$app && php -d memory_limit=-1 /usr/local/bin/composer create-project flarum/flarum . --stability=beta"
|
||||
sudo mkdir $final_path
|
||||
sudo cp -Rfv $tmp/$app $final_path/
|
||||
sudo cp -Rf $tmp/$app $www_path/
|
||||
sudo chown -R www-data:www-data $final_path
|
||||
cd $cwd
|
||||
sudo rm -rf $tmp
|
||||
|
@ -131,10 +131,4 @@ sed -i "s@YNH_FORUM_TITLE@$title@g" ../sources/configuration.yml
|
|||
sudo cp ../sources/configuration.yml $final_path
|
||||
sudo su - www-data -s /bin/bash -c "cd $final_path && php -d memory_limit=-1 flarum install -f configuration.yml"
|
||||
sudo rm $final_path/configuration.yml
|
||||
|
||||
# Generate and add root token for user creation and deletion
|
||||
roottoken=$(ynh_string_random 40)
|
||||
rootsql="INSERT INTO api_keys VALUES ('"$roottoken"')"
|
||||
ynh_mysql_execute_as_root "$rootsql" $dbname
|
||||
ynh_app_setting_set "$app" root_token "$roottoken"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue