Page MenuHomePhabricator

D11422.id27440.diff
No OneTemporary

D11422.id27440.diff

diff --git a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
--- a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
+++ b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
@@ -140,8 +140,8 @@
$ssl_key = PhabricatorEnv::getEnvConfig('notification.ssl-key');
$ssl_cert = PhabricatorEnv::getEnvConfig('notification.ssl-cert');
- $server_uri = PhabricatorEnv::getEnvConfig('notification.server-uri');
- $server_uri = new PhutilURI($server_uri);
+ $admin_uri = PhabricatorEnv::getEnvConfig('notification.admin-uri');
+ $admin_uri = new PhutilURI($admin_uri);
$client_uri = PhabricatorEnv::getEnvConfig('notification.client-uri');
$client_uri = new PhutilURI($client_uri);
@@ -152,8 +152,8 @@
$server_argv[] = '--client-port='.coalesce(
$this->clientPort,
$client_uri->getPort());
- $server_argv[] = '--admin-port='.$server_uri->getPort();
- $server_argv[] = '--admin-host='.$server_uri->getDomain();
+ $server_argv[] = '--admin-port='.$admin_uri->getPort();
+ $server_argv[] = '--admin-host='.$admin_uri->getDomain();
if ($ssl_key) {
$server_argv[] = '--ssl-key='.$ssl_key;
diff --git a/src/applications/config/option/PhabricatorNotificationConfigOptions.php b/src/applications/config/option/PhabricatorNotificationConfigOptions.php
--- a/src/applications/config/option/PhabricatorNotificationConfigOptions.php
+++ b/src/applications/config/option/PhabricatorNotificationConfigOptions.php
@@ -29,13 +29,23 @@
$this->newOption(
'notification.client-uri',
'string',
- 'http://localhost:22280/')
- ->setDescription(pht('Location of the client server.')),
+ 'ws://localhost:22280/')
+ ->setDescription(
+ pht(
+ 'Location of the Aphlict client server. Specifying `%s` means '.
+ 'that the server can be accessed using the same hostname as '.
+ 'ordinary web requests. Note that the protocol is ignored (the '.
+ 'protocol will be `%s` for HTTP requests and `%s` for HTTPS).',
+ 'localhost',
+ 'ws',
+ 'wss')),
$this->newOption(
- 'notification.server-uri',
+ 'notification.admin-uri',
'string',
'http://localhost:22281/')
- ->setDescription(pht('Location of the notification receiver server.')),
+ ->setDescription(
+ pht(
+ 'Location of the notification admin server.')),
$this->newOption('notification.log', 'string', '/var/log/aphlict.log')
->setDescription(pht('Location of the server log file.')),
$this->newOption('notification.ssl-key', 'string', null)
diff --git a/src/applications/notification/client/PhabricatorNotificationClient.php b/src/applications/notification/client/PhabricatorNotificationClient.php
--- a/src/applications/notification/client/PhabricatorNotificationClient.php
+++ b/src/applications/notification/client/PhabricatorNotificationClient.php
@@ -5,7 +5,7 @@
const EXPECT_VERSION = 6;
public static function getServerStatus() {
- $uri = PhabricatorEnv::getEnvConfig('notification.server-uri');
+ $uri = PhabricatorEnv::getEnvConfig('notification.admin-uri');
$uri = new PhutilURI($uri);
$uri->setPath('/status/');
@@ -39,11 +39,11 @@
}
private static function postMessage(array $data) {
- $server_uri = PhabricatorEnv::getEnvConfig('notification.server-uri');
- $server_uri = id(new PhutilURI($server_uri))
+ $admin_uri = PhabricatorEnv::getEnvConfig('notification.admin-uri');
+ $admin_uri = id(new PhutilURI($admin_uri))
->setPath('/');
- id(new HTTPSFuture($server_uri, json_encode($data)))
+ id(new HTTPSFuture($admin_uri, json_encode($data)))
->setMethod('POST')
->setTimeout(1)
->resolvex();
diff --git a/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php b/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php
--- a/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php
+++ b/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php
@@ -30,11 +30,11 @@
$this->newIssue('aphlict.connect')
- ->setShortName(pht('Notification Server Down'))
- ->setName(pht('Unable to Connect to Notification Server'))
+ ->setShortName(pht('Notification Admin Server Down'))
+ ->setName(pht('Unable to Connect to Notification Admin Server'))
->setMessage($message)
->addRelatedPhabricatorConfig('notification.enabled')
- ->addRelatedPhabricatorConfig('notification.server-uri')
+ ->addRelatedPhabricatorConfig('notification.admin-uri')
->addCommand(
pht(
"(To start the server, run this command.)\n".
diff --git a/src/docs/user/configuration/notifications.diviner b/src/docs/user/configuration/notifications.diviner
--- a/src/docs/user/configuration/notifications.diviner
+++ b/src/docs/user/configuration/notifications.diviner
@@ -51,6 +51,31 @@
server.
+Configuring the Aphlict Server
+==============================
+NOTE: If your Phabricator install runs on a single machine and you are not
+proxying WebSocket connections through a reverse proxy then you should be able
+to leave most of the configuration options as their default values.
+
+`notification.client-uri` is the URI that will be used for WebSocket connections
+from the client browser. By default, it is set to `ws://localhost:22280`. This
+means that WebSocket connections will point to the same host that is serving
+web requests. If you are running a dedicated notifications host, you should
+instead set this to `ws://notify.example.com:22280`. You can choose a port
+other than 22280, but you should //not// use a privileged port which requires
+`sudo` (i.e. less than or equal to 1024). There is no reason for the Aphlict
+server to be run with `sudo`, and doing so may be considered a security issue.
+
+`notifications.admin-uri` is the URI that will be used for publishing
+notifications to the Aphlict Admin server. The publishing of notifications
+usually happens from the daemons (see @{article:Managing Daemons with phd}).
+The default value is `http://localhost:22281` and this only make sense for a
+Phabricator install running on a single host. If your Phabricator install spans
+multiple hosts, you should point this to whichever host is running the Aphlict
+server. As with `notification.client-uri`, you should //not// use a privileged
+port for `notifications.admin-uri`.
+
+
Running the Aphlict Server
==========================
@@ -75,13 +100,13 @@
You may also want to adjust these settings:
- - `notification.client-uri` Externally-facing host and port that browsers will
- connect to in order to listen for notifications.
- - `notification.server-uri` Internally-facing host and port that Phabricator
+ - `notification.client-uri`: Externally-facing host and port that browsers
+ will connect to in order to listen for notifications.
+ - `notification.admin-uri`: Internally-facing host and port that Phabricator
will connect to in order to publish notifications.
- - `notification.log` Log file location for the server.
- - `notification.pid` Pidfile location used to stop any running server when
- aphlict is restarted.
+ - `notification.log`: Log file location for the server.
+ - `notification.pid`: Pidfile location used to stop any running server when
+ Aphlict is restarted.
Verifying Server Status

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 21, 2:18 PM (3 d, 20 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7802344
Default Alt Text
D11422.id27440.diff (7 KB)

Event Timeline