From c51d650e3f5f94eb6d76a22f87e75512002688de Mon Sep 17 00:00:00 2001
From: Martin Krizek
Date: Thu, 5 Nov 2015 14:33:32 +0000
Subject: [PATCH] phabricator: use custom login plugin (stg)
---
roles/phabricator/tasks/main.yml | 6 ++++++
.../templates/CustomLoginHandler.php.j2 | 19 +++++++++++++++++++
roles/phabricator/templates/local.json.j2 | 2 ++
3 files changed, 27 insertions(+)
create mode 100644 roles/phabricator/templates/CustomLoginHandler.php.j2
diff --git a/roles/phabricator/tasks/main.yml b/roles/phabricator/tasks/main.yml
index 7f9bad766a..9cbec67bb7 100644
--- a/roles/phabricator/tasks/main.yml
+++ b/roles/phabricator/tasks/main.yml
@@ -93,6 +93,12 @@
notify:
- restart phd
+- name: copy phabricator custom login plugin
+ when: deployment_type == 'qa-stg'
+ template: src=CustomLoginHandler.php.j2 dest={{ phabroot }}/phabricator/src/extensions/CustomLoginHandler.php owner=apache group=apache mode=0644
+ notify:
+ - restart phd
+
# this isn't well supported upstream right now, disabling
#- name: generate chatbot config
# template: src=chatbot-config.json.j2 dest={{ phabroot }}/phabricator/resources/chatbot/config.json owner=apache group=apache mode=0644
diff --git a/roles/phabricator/templates/CustomLoginHandler.php.j2 b/roles/phabricator/templates/CustomLoginHandler.php.j2
new file mode 100644
index 0000000000..44b0585c0f
--- /dev/null
+++ b/roles/phabricator/templates/CustomLoginHandler.php.j2
@@ -0,0 +1,19 @@
+Logging in to Fedora QA Devel Phabricator
+
+ This phabricator instance is only setup for authentication with the Fedora Accounts System. If you have previously logged in to this instance, click o n the 'Login or Register' button to log in again. If you are new to this system, please follow the follow
+ ing guidelines:
+
+ - When you login with Persona, make sure to use your fasusername@fedoraproject.org email alias (replacing 'fasusername' with your FAS user)
+ - When creating a phabricator user account, please match the account name with your FAS username for less confusion on everyone elses' part
+ - If you have any questions, come find us in #fedora-qa on Freenode or on the Fedora QA Devel mailing list.
+
+
");
+ }
+}
diff --git a/roles/phabricator/templates/local.json.j2 b/roles/phabricator/templates/local.json.j2
index 33c8e00069..70caa75986 100644
--- a/roles/phabricator/templates/local.json.j2
+++ b/roles/phabricator/templates/local.json.j2
@@ -25,6 +25,7 @@
"metamta.mail-adapter" : "{{ "PhabricatorMailImplementationPHPMailerAdapter" if phabricator_mail_enabled else "PhabricatorMailImplementationTestAdapter"}}",
"phpmailer.smtp-host" : "bastion.phx2.fedoraproject.org",
"auth.email-domains" : ["fedoraproject.org"],
+{% if deployment_type == 'qadevel-prod' %}
"auth.login-message" : "Logging in to Fedora QA Devel Phabricator
This phabricator instance is only setup for authentication with the Fedora Accounts System. If you have previously logged in to this instance, click on the 'Login or Register' button to log in again. If you are new to this system, please follow the follow
@@ -35,6 +36,7 @@ ing guidelines:
If you have any questions, come find us in #fedora-qa on Freenode or on the Fedora QA Devel mailing list.
",
+{% endif %}
"phabricator.uninstalled-applications" : {
"PhabricatorApplicationPhame" : true,
"PhabricatorApplicationDiviner" : true,