From 9a936b5bf3e99d1969201d4eefd698aa791f8c16 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 3 Jan 2013 09:29:19 -0800 Subject: [PATCH] Move notification configuration into PHP Summary: Bring notification settings to PHP. Test Plan: Viewed notification settings in /config/. Reviewers: codeblock, btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2255 Differential Revision: https://secure.phabricator.com/D4337 --- src/__phutil_library_map__.php | 2 + .../PhabricatorNotificationConfigOptions.php | 59 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 src/applications/config/option/PhabricatorNotificationConfigOptions.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index a87b077aa6..2af565705e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -942,6 +942,7 @@ phutil_register_library_map(array( 'PhabricatorMySQLFileStorageEngine' => 'applications/files/engine/PhabricatorMySQLFileStorageEngine.php', 'PhabricatorNotificationBuilder' => 'applications/notification/builder/PhabricatorNotificationBuilder.php', 'PhabricatorNotificationClearController' => 'applications/notification/controller/PhabricatorNotificationClearController.php', + 'PhabricatorNotificationConfigOptions' => 'applications/config/option/PhabricatorNotificationConfigOptions.php', 'PhabricatorNotificationController' => 'applications/notification/controller/PhabricatorNotificationController.php', 'PhabricatorNotificationIndividualController' => 'applications/notification/controller/PhabricatorNotificationIndividualController.php', 'PhabricatorNotificationListController' => 'applications/notification/controller/PhabricatorNotificationListController.php', @@ -2267,6 +2268,7 @@ phutil_register_library_map(array( 'PhabricatorMySQLConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorMySQLFileStorageEngine' => 'PhabricatorFileStorageEngine', 'PhabricatorNotificationClearController' => 'PhabricatorNotificationController', + 'PhabricatorNotificationConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorNotificationController' => 'PhabricatorController', 'PhabricatorNotificationIndividualController' => 'PhabricatorNotificationController', 'PhabricatorNotificationListController' => 'PhabricatorNotificationController', diff --git a/src/applications/config/option/PhabricatorNotificationConfigOptions.php b/src/applications/config/option/PhabricatorNotificationConfigOptions.php new file mode 100644 index 0000000000..028651a6aa --- /dev/null +++ b/src/applications/config/option/PhabricatorNotificationConfigOptions.php @@ -0,0 +1,59 @@ +newOption('notification.enabled', 'bool', false) + ->setOptions( + array( + pht("Disable Real-Time Notifications"), + pht("Enable Real-Time Notifications"), + )) + ->setSummary(pht('Enable real-time notifications.')) + ->setDescription( + pht( + "Enable real-time notifications. You must also run a Node.js ". + "based notification server for this to work. Consult the ". + "documentation in 'Notifications User Guide: Setup and ". + "Configuration' for instructions.")), + $this->newOption( + 'notification.client-uri', + 'string', + 'http://localhost:22280') + ->setDescription(pht('Location of the client server.')), + $this->newOption( + 'notification.server-uri', + 'string', + 'http://localhost:22281') + ->setDescription(pht('Location of the notification receiver server.')), + $this->newOption('notification.user', 'string', null) + ->setSummary(pht('Drop permissions to a less-privileged user.')) + ->setDescription( + pht( + "The notifcation server must be started as root so it can bind ". + "to privileged ports, but if you specify a system user here it ". + "will drop permissions to that user after binding to the ports ". + "it needs.")), + $this->newOption('notification.log', 'string', '/var/log/aphlict.log') + ->setDescription(pht('Location of the server log file.')), + $this->newOption( + 'notification.pidfile', + 'string', + '/var/run/aphlict.pid') + ->setDescription(pht('Location of the server PID file.')), + $this->newOption('notification.debug', 'bool', false) + ->setDescription(pht('Enable debug output in the browser.')), + ); + } + +} -- 2.51.2