Dzahn has submitted this change and it was merged. Change subject: phab - configurable login message by auth type ......................................................................
phab - configurable login message by auth type depending on the type of login a phabricator instance allows to be used for auth (SUL account, LDAP account, both, maybe others in the future..), change which template is being used for the HTML of the login screen and change the links to proto-relative URLs as pointed out by greg-g, except that https://phabricator.org doesn't work. connecting... Change-Id: Iae4ab606563579973ad3731d0ebcf39d665634f9 --- M manifests/role/phabricator.pp M modules/phabricator/manifests/init.pp D modules/phabricator/templates/auth_log_message.erb A modules/phabricator/templates/auth_log_message_dual.erb A modules/phabricator/templates/auth_log_message_sul.erb 5 files changed, 31 insertions(+), 10 deletions(-) Approvals: Matanya: Looks good to me, but someone else must approve Gage: Looks good to me, but someone else must approve jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/manifests/role/phabricator.pp b/manifests/role/phabricator.pp index 134a076..9f3f548 100644 --- a/manifests/role/phabricator.pp +++ b/manifests/role/phabricator.pp @@ -16,6 +16,7 @@ lock_file => '/var/run/phab_repo_lock', mysql_admin_user => $::mysql_adminuser, mysql_admin_pass => $::mysql_adminpass, + auth_type => 'sul', settings => { 'darkconsole.enabled' => true, 'phabricator.base-uri' => 'https://legalpad.wikimedia.org', @@ -47,6 +48,7 @@ lock_file => '/var/run/phab_repo_lock', mysql_admin_user => $::mysql_adminuser, mysql_admin_pass => $::mysql_adminpass, + auth_type => 'dual', settings => { 'storage.upload-size-limit' => '10M', 'darkconsole.enabled' => false, @@ -90,6 +92,7 @@ class { '::phabricator': git_tag => $current_tag, lock_file => '/var/run/phab_repo_lock', + auth_type => 'dual', settings => { 'darkconsole.enabled' => true, 'phabricator.base-uri' => "http://${::hostname}.wmflabs.org", diff --git a/modules/phabricator/manifests/init.pp b/modules/phabricator/manifests/init.pp index d1813e9..57ebe81 100644 --- a/modules/phabricator/manifests/init.pp +++ b/modules/phabricator/manifests/init.pp @@ -62,6 +62,7 @@ $mysql_admin_user = '', $mysql_admin_pass = '', $serveradmin = '', + $auth_type = '', ) { #A combination of static and dynamic conf parameters must be merged @@ -71,7 +72,15 @@ #per stdlib merge the dynamic settings will take precendence for conflicts $phab_settings = merge($fixed_settings, $settings) - $phab_settings['auth.login-message'] = template('phabricator/auth_log_message.erb') + # depending on what type of auth we use (SUL,LDAP,both,others) we change + # which template we use for the login message + case $auth_type { + 'sul': { $auth_template = 'auth_log_message_sul.erb' } + 'dual': { $auth_template = 'auth_log_message_dual.erb'} + default: { fail ('please set an auth type for the login message') } + } + + $phab_settings['auth.login-message'] = template($auth_template) if empty(mysql_admin_user) { $storage_user = $phab_settings['mysql.user'] diff --git a/modules/phabricator/templates/auth_log_message.erb b/modules/phabricator/templates/auth_log_message.erb deleted file mode 100644 index e49e615..0000000 --- a/modules/phabricator/templates/auth_log_message.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div style='font-weight:bold;font-size:1.8em;text-align:center'> -This <a href="http://phabricator.org/">Phabricator</a> portal is managed by the -<a href="http://wikimediafoundation.org/wiki/Home">Wikimedia Foundation</a>. -</div> - -<p style='font-weight:bold;font-size:0.9em;text-align:center'> -You can use your <a href="http://meta.wikimedia.org/wiki/Help:Unified_login">unified Wikimedia account</a> or your <a href="https://wikitech.wikimedia.org/wiki/Help:Getting_Started#Create_a_User_Account">Labs/LDAP user</a> to login. -</p> - diff --git a/modules/phabricator/templates/auth_log_message_dual.erb b/modules/phabricator/templates/auth_log_message_dual.erb new file mode 100644 index 0000000..47d37c5 --- /dev/null +++ b/modules/phabricator/templates/auth_log_message_dual.erb @@ -0,0 +1,9 @@ +<div style='font-weight:bold;font-size:1.8em;text-align:center'> +This <a href="http://phabricator.org/">Phabricator</a> portal is managed by the +<a href="//wikimediafoundation.org/wiki/Home">Wikimedia Foundation</a>. +</div> + +<p style='font-weight:bold;font-size:0.9em;text-align:center'> +You can use your <a href="//meta.wikimedia.org/wiki/Help:Unified_login">unified Wikimedia account</a> or your <a href="//wikitech.wikimedia.org/wiki/Help:Getting_Started#Create_a_User_Account">Labs/LDAP user</a> to login. +</p> + diff --git a/modules/phabricator/templates/auth_log_message_sul.erb b/modules/phabricator/templates/auth_log_message_sul.erb new file mode 100644 index 0000000..32aa88e --- /dev/null +++ b/modules/phabricator/templates/auth_log_message_sul.erb @@ -0,0 +1,9 @@ +<div style='font-weight:bold;font-size:1.8em;text-align:center'> +This <a href="http://phabricator.org/">Phabricator</a> portal is managed by the +<a href="//wikimediafoundation.org/wiki/Home">Wikimedia Foundation</a>. +</div> + +<p style='font-weight:bold;font-size:0.9em;text-align:center'> +Please use your <a href="//meta.wikimedia.org/wiki/Help:Unified_login">unified Wikimedia account</a> to login. +</p> + -- To view, visit https://gerrit.wikimedia.org/r/148564 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iae4ab606563579973ad3731d0ebcf39d665634f9 Gerrit-PatchSet: 6 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn <[email protected]> Gerrit-Reviewer: Dzahn <[email protected]> Gerrit-Reviewer: Gage <[email protected]> Gerrit-Reviewer: Greg Grossmeier <[email protected]> Gerrit-Reviewer: Matanya <[email protected]> Gerrit-Reviewer: Rush <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
