mirror of
https://github.com/YunoHost-Apps/webtrees_ynh.git
synced 2024-09-03 18:26:37 +02:00
Fix
This commit is contained in:
parent
f36e34d3d2
commit
99441cd7cf
3 changed files with 17 additions and 41 deletions
|
@ -1,3 +1,3 @@
|
||||||
INSERT INTO `wt_user` (`user_id`, `user_name`, `real_name`, `email`, `password`) VALUES (NULL, '__USER_NAME__', '__NAME__', '__USER_EMAIL__', '__PASSWORD__');
|
INSERT INTO `wt_user` (`user_id`, `user_name`, `real_name`, `email`, `password`) VALUES (NULL, '__ADMIN__', '__ADMIN__', '__EMAIL__', '__PASSWORD__');
|
||||||
INSERT INTO `wt_user_setting` (`user_id`, `setting_name`, `setting_value`) VALUES ('1', 'canadmin', '1'), ('1', 'verified', '1'), ('1', 'verified_by_admin', '1');
|
INSERT INTO `wt_user_setting` (`user_id`, `setting_name`, `setting_value`) VALUES ('1', 'canadmin', '1'), ('1', 'verified', '1'), ('1', 'verified_by_admin', '1');
|
||||||
|
|
||||||
|
|
|
@ -41,34 +41,7 @@
|
||||||
"example": "/webtrees",
|
"example": "/webtrees",
|
||||||
"default": "/webtrees"
|
"default": "/webtrees"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "username",
|
|
||||||
"type": "string",
|
|
||||||
"ask": {
|
|
||||||
"en": "Choose an admin username (Not a LDAP User)",
|
|
||||||
"fr": "Choisissez un nom d'utilisateur pour l'administrateur de Webtrees (ne doit pas être un utilisateur YunoHost existant)"
|
|
||||||
},
|
|
||||||
"example": "john"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "string",
|
|
||||||
"ask": {
|
|
||||||
"en": "Name of the user (Not a LDAP User)",
|
|
||||||
"fr": "Nom de cet utilisateur"
|
|
||||||
},
|
|
||||||
"example": "john doe"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "email",
|
|
||||||
"type": "string",
|
|
||||||
"ask": {
|
|
||||||
"en": "Admin email (All the new registration will be sent on this email)",
|
|
||||||
"fr": "Adresse email de l'administrateur (Toutes les nouvelles inscriptions seront envoyées à cette adresse)"
|
|
||||||
},
|
|
||||||
"example": "admin@example.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"help": {
|
"help": {
|
||||||
|
@ -76,6 +49,14 @@
|
||||||
"fr": "Si cochée, Webtrees sera publique"
|
"fr": "Si cochée, Webtrees sera publique"
|
||||||
},
|
},
|
||||||
"default": true
|
"default": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "admin",
|
||||||
|
"type": "user"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "password",
|
||||||
|
"type": "password"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,11 +28,9 @@ ynh_abort_if_errors
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$YNH_APP_ARG_PATH
|
path_url=$YNH_APP_ARG_PATH
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
admin_username=$YNH_APP_ARG_USERNAME
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
admin_name=$YNH_APP_ARG_NAME
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
admin_email=$YNH_APP_ARG_EMAIL
|
|
||||||
password=$(ynh_string_random 24)
|
password=$(ynh_string_random 24)
|
||||||
admin_password=$(openssl passwd -1 -salt xyz $password)
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -54,6 +52,7 @@ ynh_script_progression --message="Storing installation settings..."
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||||
|
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
|
@ -121,13 +120,9 @@ ynh_add_config --template="../conf/config.ini.php" --destination="$final_path/da
|
||||||
# Load initial SQL into the new database
|
# Load initial SQL into the new database
|
||||||
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < "../conf/sql/webtrees.sql"
|
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < "../conf/sql/webtrees.sql"
|
||||||
|
|
||||||
# Replace variables in sql scripts
|
ynh_add_config --template="../conf/sql/admin.sql" --destination="/var/tmp/admin.sql"
|
||||||
ynh_replace_string --match_string="__USER_NAME__" --replace_string="$admin_username" --target_file="../conf/sql/admin.sql"
|
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < "/var/tmp/admin.sql"
|
||||||
ynh_replace_string --match_string="__NAME__" --replace_string="$admin_name" --target_file="../conf/sql/admin.sql"
|
ynh_secure_remove --file="/var/tmp/admin.sql"
|
||||||
ynh_replace_string --match_string="__USER_EMAIL__" --replace_string="$admin_email" --target_file="../conf/sql/admin.sql"
|
|
||||||
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$admin_password" --target_file="../conf/sql/admin.sql"
|
|
||||||
|
|
||||||
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < "../conf/sql/admin.sql"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
@ -157,7 +152,7 @@ echo "Webtrees was successfully installed :)
|
||||||
Please open https://$domain$path_url
|
Please open https://$domain$path_url
|
||||||
|
|
||||||
Your credentials for the admin panel are:
|
Your credentials for the admin panel are:
|
||||||
- admin username: $admin_username
|
- admin username: $admin
|
||||||
- admin password: $password
|
- admin password: $password
|
||||||
|
|
||||||
If you facing an issue or want to improve Webtrees, please open a new issue in this project: https://github.com/YunoHost-Apps/webtrees_ynh" > mail_to_send
|
If you facing an issue or want to improve Webtrees, please open a new issue in this project: https://github.com/YunoHost-Apps/webtrees_ynh" > mail_to_send
|
||||||
|
|
Loading…
Add table
Reference in a new issue