From f8010caeb4499bdea244417c72a8f4d9e13c945e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Mon, 24 Dec 2018 16:25:32 +0100 Subject: [PATCH] add only_ldap option and upgrade to 1.6.0 --- manifest.json | 13 ++++++++++--- scripts/install | 7 +++++-- scripts/upgrade.d/upgrade.sh | 6 +++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index f5861eb..5a8da2f 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "Gitlab", "id": "gitlab", "packaging_format": 1, - "version": "1.5.3~ynh1", + "version": "1.6.0~ynh1", "description": { "en": "Gitlab for Yunohost.", "fr": "Gitlab pour YunoHost." @@ -59,9 +59,16 @@ "fr": "Est-ce une application publique ?" }, "default": true + }, + { + "name": "only_use_ldap", + "type": "boolean", + "ask": { + "en": "Use only Yunohost account to sign in?", + "fr": "Utiliser seulement les comptes Yunohost pour se connecter ?" + }, + "default": true } - - ] } } diff --git a/scripts/install b/scripts/install index ede2903..5b5ebf8 100644 --- a/scripts/install +++ b/scripts/install @@ -22,6 +22,7 @@ source ./_common.sh domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC +only_use_ldap=$YNH_APP_ARG_IS_PUBLIC admin=$YNH_APP_ARG_ADMIN #================================================= @@ -49,6 +50,7 @@ ynh_user_exists "$admin" \ ynh_app_setting_set $app admin $admin ynh_app_setting_set $app path_url $path_url ynh_app_setting_set $app is_public $is_public +ynh_app_setting_set $app only_use_ldap $only_use_ldap #================================================= # STANDARD MODIFICATIONS @@ -94,7 +96,7 @@ setup_source $architecture #================================================= # SPECIFIC SETUP #================================================= -# GETTING ADMIN INFO AND ADD AS A GITLAB USER +# GETTING ADMIN INFO AND ADD AS A GITLAB USER AND CONFIGURE SIGN IN SYSTEM #================================================= mailadmin=$(ynh_user_get_info $admin mail) @@ -104,7 +106,8 @@ echo "newuser = User.new({ \"email\"=>'$mailadmin', \"username\"=>'$admin', \"na newuser.admin = true newuser.confirmed_at = Time.now newuser.confirmation_token = nil -newuser.save" | sudo gitlab-rails console +newuser.save +ApplicationSetting.last.update_attributes(password_authentication_enabled_for_web: $only_use_ldap, signup_enabled: $only_use_ldap)" | sudo gitlab-rails console #================================================= # RESTART TO TAKE INTO ACCOUNT CHANGES diff --git a/scripts/upgrade.d/upgrade.sh b/scripts/upgrade.d/upgrade.sh index fb6ccf7..57396a8 100644 --- a/scripts/upgrade.d/upgrade.sh +++ b/scripts/upgrade.d/upgrade.sh @@ -1,5 +1,5 @@ -gitlab_version="11.5.3" +gitlab_version="11.6.0" -gitlab_x86_64_source_sha256="fdbea3e92eb1f613897659e99b20660d64524eaf5b1cd57a323cd6f61c573e7f" +gitlab_x86_64_source_sha256="040ac5917d71c45b3fbdeccbeaf2e7b3181fcce0ed9ca65ac68d3d15081b8b02" -gitlab_arm_source_sha256="81d37736442be80d687b52299604ef38bc4000b7545b241094b7f5a027c9fac4" \ No newline at end of file +gitlab_arm_source_sha256="18d385af2a59fb37c6282298ccb7bbbf091d8ff39fbcde581226e35d5f3792dc"