Changeset View
Changeset View
Standalone View
Standalone View
src/docs/user/configuration/notifications.diviner
Show All 20 Lines | |||||
This document describes the process in detail. | This document describes the process in detail. | ||||
= Running the Aphlict Server = | = Running the Aphlict Server = | ||||
Phabricator implements realtime notifications using a Node.js server called | Phabricator implements realtime notifications using a Node.js server called | ||||
"Aphlict". To run it: | "Aphlict". To run it: | ||||
- Install node.js. | - Install node.js. | ||||
- Run `bin/aphlict start` (this script must be run as root). | - Run `bin/aphlict start`. | ||||
The server must be able to listen on port **843** and port **22280** for Aphlict | The server must be able to listen on port **22280** for Aphlict to work. You | ||||
to work. You can change the latter port in the `notification.client-uri` config, | can change this port in the `notification.client-uri` config. In particular, if | ||||
but port 843 is used by Flash and can not be changed. In particular, if you're | you're running in EC2, you need to unblock both of these ports in the server's | ||||
joshuaspence: There's only one port now. | |||||
running in EC2, you need to unblock both of these ports in the server's security | security group configuration. | ||||
group configuration. | |||||
You may want to adjust these settings: | You may want to adjust these settings: | ||||
- `notification.client-uri` Externally-facing host and port that browsers will | - `notification.client-uri` Externally-facing host and port that browsers will | ||||
connect to in order to listen for notifications. | connect to in order to listen for notifications. | ||||
- `notification.server-uri` Internally-facing host and port that Phabricator | - `notification.server-uri` Internally-facing host and port that Phabricator | ||||
will connect to in order to publish notifications. | will connect to in order to publish notifications. | ||||
- `notification.log` Log file location for the server. | - `notification.log` Log file location for the server. | ||||
- `notification.user` Non-root user to drop permissions to after binding to | |||||
privileged ports. | |||||
- `notification.pid` Pidfile location used to stop any running server when | - `notification.pid` Pidfile location used to stop any running server when | ||||
aphlict is restarted. | aphlict is restarted. | ||||
In most cases, the defaults are appropriate, except that you should set | |||||
`notification.user` to some valid system user so Aphlict isn't running as root. | |||||
== Verifying Server Status == | == Verifying Server Status == | ||||
Access `/notification/status/` to verify the server is operational. You should | Access `/notification/status/` to verify the server is operational. You should | ||||
see a table showing stats like "uptime" and connection/message counts if the | see a table showing stats like "uptime" and connection/message counts if the | ||||
server is working. If it isn't working, you should see an error. | server is working. If it isn't working, you should see an error. | ||||
== Testing the Server == | == Testing the Server == | ||||
The easiest way to test the server is to have two users login and comment on | The easiest way to test the server is to have two users login and comment on | ||||
the same Maniphest Task or Differential Revision. They should receive in-browser | the same Maniphest Task or Differential Revision. They should receive in-browser | ||||
notifications about the other user's activity. | notifications about the other user's activity. | ||||
NOTE: This is cumbersome. There will be better testing tools at some point. | NOTE: This is cumbersome. There will be better testing tools at some point. | ||||
== Debugging Server Problems == | == Debugging Server Problems == | ||||
You can run `aphlict` in the foreground to get output to your console: | You can run `aphlict` in the foreground to get output to your console: | ||||
phabricator/ $ sudo ./bin/aphlict debug | phabricator/ $ ./bin/aphlict debug | ||||
You can run `support/aphlict/client/aphlict_test_client.php` to connect to the | You can run `support/aphlict/client/aphlict_test_client.php` to connect to the | ||||
Aphlict server from the command line. Messages the client receives will be | Aphlict server from the command line. Messages the client receives will be | ||||
printed to stdout. | printed to stdout. | ||||
You can set `notification.debug` in your configuration to get additional | You can set `notification.debug` in your configuration to get additional | ||||
output in your browser. | output in your browser. | ||||
The server also generates a log, by default in `/var/log/aphlict.log`. You can | The server also generates a log, by default in `/var/log/aphlict.log`. You can | ||||
change this location by changing `notification.log` in your configuration. The | change this location by changing `notification.log` in your configuration. The | ||||
log may contain information useful in resolving issues. | log may contain information useful in resolving issues. |
There's only one port now.