mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-17 10:11:10 +01:00
Make conduit-uri info easier to be copied into arcrc
Summary: add the conduit URI and the username together with the arc certificate to the setting page. Test Plan: run arc diff to make sure it still works after copying the generated test into the .arcrc file. Reviewed By: epriestley Reviewers: epriestley CC: epriestley Differential Revision: 73
This commit is contained in:
parent
ab2b83ce14
commit
6aa006b903
4 changed files with 32 additions and 8 deletions
|
@ -171,18 +171,43 @@ class PhabricatorUserSettingsController extends PhabricatorPeopleController {
|
||||||
$notice = null;
|
$notice = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$host = PhabricatorEnv::getEnvConfig('phabricator.base-uri') . 'api/';
|
||||||
|
$conduit_setting = sprintf(
|
||||||
|
' %s: {'."\n".
|
||||||
|
' "user" : %s,'."\n".
|
||||||
|
' "cert" : %s'."\n".
|
||||||
|
' }'."\n",
|
||||||
|
json_encode($host),
|
||||||
|
json_encode($user->getUserName()),
|
||||||
|
json_encode($user->getConduitCertificate()));
|
||||||
|
|
||||||
$cert_form = new AphrontFormView();
|
$cert_form = new AphrontFormView();
|
||||||
$cert_form
|
$cert_form
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->appendChild(
|
->appendChild(
|
||||||
'<p class="aphront-form-instructions">Copy and paste this certificate '.
|
'<p class="aphront-form-instructions">Copy and paste the host info '.
|
||||||
'into your <tt>~/.arcrc</tt> in the "hosts" section to enable '.
|
'including the certificate into your <tt>~/.arcrc</tt> in the "hosts" '.
|
||||||
'Arcanist to authenticate against this host.</p>')
|
'session to enable Arcanist to authenticate against this host.</p>')
|
||||||
|
->appendChild(
|
||||||
|
id(new AphrontFormMarkupControl())
|
||||||
|
->setControlStyle('white-space: pre; font-family: monospace')
|
||||||
|
->setValue(
|
||||||
|
'{'."\n".
|
||||||
|
' ...'."\n".
|
||||||
|
' "hosts" : {'."\n"))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextAreaControl())
|
id(new AphrontFormTextAreaControl())
|
||||||
->setLabel('Certificate')
|
->setLabel('Credentials')
|
||||||
->setHeight(AphrontFormTextAreaControl::HEIGHT_SHORT)
|
->setHeight(AphrontFormTextAreaControl::HEIGHT_SHORT)
|
||||||
->setValue($user->getConduitCertificate()));
|
->setControlStyle('font-family: monospace')
|
||||||
|
->setValue($conduit_setting))
|
||||||
|
->appendChild(
|
||||||
|
id(new AphrontFormStaticControl())
|
||||||
|
->setControlStyle('white-space: pre; font-family: monospace')
|
||||||
|
->setValue(
|
||||||
|
' }'."\n".
|
||||||
|
' ...'."\n".
|
||||||
|
'}'));
|
||||||
|
|
||||||
$cert = new AphrontPanelView();
|
$cert = new AphrontPanelView();
|
||||||
$cert->setHeader('Arcanist Certificate');
|
$cert->setHeader('Arcanist Certificate');
|
||||||
|
|
|
@ -24,7 +24,6 @@ phutil_require_module('phabricator', 'view/form/control/markup');
|
||||||
phutil_require_module('phabricator', 'view/form/control/static');
|
phutil_require_module('phabricator', 'view/form/control/static');
|
||||||
phutil_require_module('phabricator', 'view/form/control/submit');
|
phutil_require_module('phabricator', 'view/form/control/submit');
|
||||||
phutil_require_module('phabricator', 'view/form/control/text');
|
phutil_require_module('phabricator', 'view/form/control/text');
|
||||||
phutil_require_module('phabricator', 'view/form/control/textarea');
|
|
||||||
phutil_require_module('phabricator', 'view/form/error');
|
phutil_require_module('phabricator', 'view/form/error');
|
||||||
phutil_require_module('phabricator', 'view/layout/panel');
|
phutil_require_module('phabricator', 'view/layout/panel');
|
||||||
phutil_require_module('phabricator', 'view/layout/sidenav');
|
phutil_require_module('phabricator', 'view/layout/sidenav');
|
||||||
|
|
|
@ -22,5 +22,4 @@ To retrieve the certificate for a Phabricator host:
|
||||||
- Login to Phabricator.
|
- Login to Phabricator.
|
||||||
- Go to Settings > Arcanist Certificate.
|
- Go to Settings > Arcanist Certificate.
|
||||||
|
|
||||||
Copy the certificate into the "cert" field, and specify your username in the
|
Copy the host info including the certificate into the "hosts" section.
|
||||||
"user" field.
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ class AphrontFormTextAreaControl extends AphrontFormControl {
|
||||||
'name' => $this->getName(),
|
'name' => $this->getName(),
|
||||||
'disabled' => $this->getDisabled() ? 'disabled' : null,
|
'disabled' => $this->getDisabled() ? 'disabled' : null,
|
||||||
'class' => $height_class,
|
'class' => $height_class,
|
||||||
|
'style' => $this->getControlStyle(),
|
||||||
'id' => $this->getID(),
|
'id' => $this->getID(),
|
||||||
),
|
),
|
||||||
phutil_escape_html($this->getValue()));
|
phutil_escape_html($this->getValue()));
|
||||||
|
|
Loading…
Reference in a new issue