mirror of
https://github.com/YunoHost-Apps/gitlab_ynh.git
synced 2024-09-03 18:36:35 +02:00
#245 fix user creation (add organization), used gitlab-rails runner instead of console, which should crash if user is not created
This commit is contained in:
parent
566f566612
commit
405e48c88e
1 changed files with 6 additions and 7 deletions
|
@ -128,15 +128,14 @@ ynh_add_nginx_config client_max_body_size
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Creating an administrator user..." --weight=13
|
ynh_script_progression --message="Creating an administrator user..." --weight=13
|
||||||
|
|
||||||
mailadmin=$(ynh_user_get_info --username=$admin --key=mail)
|
mailAdmin=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
fullnameAdmin=$(ynh_user_get_info --username=$admin --key=fullname)
|
||||||
rdmPass=$(ynh_string_random --length=30)
|
rdmPass=$(ynh_string_random --length=30)
|
||||||
|
|
||||||
echo "newuser = User.new({ \"email\"=>'$mailadmin', \"username\"=>'$admin', \"name\"=>'$admin', \"password\"=>'$rdmPass'})
|
gitlab-rails runner "newuser = User.new(username: \"$admin\", email: \"$mailAdmin\", name: \"$fullnameAdmin\", password: \"$rdmPass\", admin: true, skip_confirmation: true);\
|
||||||
newuser.admin = true
|
newuser.assign_personal_namespace(Organizations::Organization.default_organization);\
|
||||||
newuser.confirmed_at = Time.now
|
newuser.save!;\
|
||||||
newuser.confirmation_token = nil
|
ApplicationSetting.last.update(password_authentication_enabled_for_web: $use_web_account, signup_enabled: $use_web_account);"
|
||||||
newuser.save!
|
|
||||||
ApplicationSetting.last.update(password_authentication_enabled_for_web: $use_web_account, signup_enabled: $use_web_account)" | gitlab-rails console
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECONFIGURE TO TAKE INTO ACCOUNT CHANGES
|
# RECONFIGURE TO TAKE INTO ACCOUNT CHANGES
|
||||||
|
|
Loading…
Reference in a new issue