Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15370150
D11422.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
8 KB
Referenced Files
None
Subscribers
None
D11422.diff
View Options
diff --git a/resources/sql/autopatches/20150119.aphlictadmin.php b/resources/sql/autopatches/20150119.aphlictadmin.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20150119.aphlictadmin.php
@@ -0,0 +1,24 @@
+<?php
+
+$old_key = 'notification.server-uri';
+$new_key = 'notification.admin-uri';
+
+echo "Migrating '{$old_key}' to '{$new_key}'...\n";
+
+if (PhabricatorEnv::getEnvConfig($new_key)) {
+ echo "Skipping migration, new data is already set.\n";
+ return;
+}
+
+$old = PhabricatorEnv::getEnvConfigIfExists($old_key);
+if (!$old) {
+ echo "Skipping migration, old data does not exist.\n";
+ return;
+}
+
+PhabricatorConfigEntry::loadConfigEntry($new_key)
+ ->setIsDeleted(0)
+ ->setValue($old)
+ ->save();
+
+echo "Done.\n";
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
@@ -33,13 +33,22 @@
$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 Aphlict 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 = id(new PhutilURI($uri))
->setPath('/status/');
@@ -38,11 +38,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%s",
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
Details
Attached
Mime Type
text/plain
Expires
Mar 13 2025, 9:22 AM (6 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7614178
Default Alt Text
D11422.diff (8 KB)
Attached To
Mode
D11422: Clarify Aphlict settings
Attached
Detach File
Event Timeline
Log In to Comment