Page MenuHomeDevCentral

D373.id893.diff
No OneTemporary

D373.id893.diff

diff --git a/Dockerfile b/Dockerfile
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,11 +9,17 @@
git clone https://github.com/phacility/libphutil.git && \
git clone https://github.com/phacility/phabricator.git && \
cd phabricator/support/aphlict/server/ && \
- npm install ws
+ npm install ws && \
+ groupadd -r app -g 433 && \
+ mkdir /home/app && \
+ useradd -u 431 -r -g app -d /home/app -s /sbin/nologin -c "Docker image user for server" app && \
+ touch /var/run/aphlict.pid /var/log/aphlict.log && \
+ chown app:app /home/app /var/run/aphlict.pid /var/log/aphlict.log
+
+COPY aphlict.custom.json /opt/phabricator/conf/aphlict/
EXPOSE 22280 22281
WORKDIR /opt/phabricator/support/aphlict/server
-CMD [ "node", "aphlict_server.js", "--admin-host=0.0.0.0" ]
-
-
+USER app
+CMD [ "node", "--max-old-space-size=256", "--", "aphlict_server.js", "--config=/opt/phabricator/conf/aphlict/aphlict.custom.json" ]
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -8,34 +8,40 @@
1. Pull the image: `docker pull nasqueron/aphlict`
2. Run the container: `docker run -dt -p 22280:22280 -p 22281:22281 nasqueron/aphlict`
-3. Configure your Phabricator instance at http://phabricator.domain.tld/config/group/notification/
-
-When you configure your instance, three parameters are necessary:
-
-* **notification.enabled:** true (Enable Real-Time Notifications)
-* **notification.client-uri:** http://<ip or host>:22280/
-* **notification.server-uri:** http://<ip or host>:22281/
-
+3. Configure your Phabricator instance at http://phabricator.domain.tld/config/edit/notification.servers
+
+When you configure your instance, use the following template:
+
+```lang=json
+[
+ {
+ "type": "client",
+ "host": "aphlict.yourdomain.tld",
+ "port": 22280,
+ "protocol": "http"
+ },
+ {
+ "type": "admin",
+ "host": "aphlict.yourdomain.tld",
+ "port": 22281,
+ "protocol": "http"
+ }
+]
+```
TLS termination
---------------
-Steps 1 and 2 as above.
-
-3. Follow the instructions of https://secure.phabricator.com/book/phabricator/article/notifications/#advanced-usage to configure your nginx. Note you can directly use proxy_pass http://localhost:22280/ and discard the upstream block.
-4. Configure your Phabricator instance at https://phabricator.domain.tld/config/group/notification/
+Add a certificate to your container, replace the protocol
+http by https in Phabricator config.
-When you configure your intance, three parameters are necessary, but only *client-uri* changes from the HTTP config:
-
-* notification.client-uri: https://phabricator.domain.tld/ws/
-
-The other two remains the same:
-
-* notification.server-uri: http://<ip or host>:22281/ *
-* notification.enabled: true (Enable Real-Time Notifications)
+Edit /opt/phabricator/conf/aphlict/aphlict.custom.json in your
+container, so ssl.key & ssl.cert certificates have the relevant paths.
Note
----
-You won't be able to access log or PID file, excepted if you add volumes
-and share them with your Phabricator instance (`-v ... --volumes-from=aphlict`).
+You can get the server log using `docker logs <your container name>`.
+
+To check the status of the server,
+use http://phabricator.domain.tld/config/cluster/notifications/
diff --git a/aphlict.custom.json b/aphlict.custom.json
new file mode 100644
--- /dev/null
+++ b/aphlict.custom.json
@@ -0,0 +1,24 @@
+{
+ "servers": [
+ {
+ "type": "client",
+ "port": 22280,
+ "listen": "0.0.0.0",
+ "ssl.key": null,
+ "ssl.cert": null
+ },
+ {
+ "type": "admin",
+ "port": 22281,
+ "listen": "0.0.0.0",
+ "ssl.key": null,
+ "ssl.cert": null
+ }
+ ],
+ "logs": [
+ {
+ "path": "/var/log/aphlict.log"
+ }
+ ],
+ "pidfile": "/var/run/aphlict.pid"
+}

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 01:34 (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2263496
Default Alt Text
D373.id893.diff (3 KB)

Event Timeline