From c3fbb6e66be7f7f526752efc7701f35f6cdbf6dd Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Mon, 14 Jan 2013 17:49:32 -0800 Subject: [PATCH] Feed options. Test Plan: Looked at them. Reviewers: epriestley, chad, btrahan Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2255 Differential Revision: https://secure.phabricator.com/D4434 --- src/__phutil_library_map__.php | 2 + .../config/PhabricatorFeedConfigOptions.php | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/applications/feed/config/PhabricatorFeedConfigOptions.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 60717934a4..5f3dfb12b0 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -805,6 +805,7 @@ phutil_register_library_map(array( 'PhabricatorFactSpec' => 'applications/fact/spec/PhabricatorFactSpec.php', 'PhabricatorFactUpdateIterator' => 'applications/fact/extract/PhabricatorFactUpdateIterator.php', 'PhabricatorFeedBuilder' => 'applications/feed/builder/PhabricatorFeedBuilder.php', + 'PhabricatorFeedConfigOptions' => 'applications/feed/config/PhabricatorFeedConfigOptions.php', 'PhabricatorFeedConstants' => 'applications/feed/constants/PhabricatorFeedConstants.php', 'PhabricatorFeedController' => 'applications/feed/controller/PhabricatorFeedController.php', 'PhabricatorFeedDAO' => 'applications/feed/storage/PhabricatorFeedDAO.php', @@ -2170,6 +2171,7 @@ phutil_register_library_map(array( 'PhabricatorFactRaw' => 'PhabricatorFactDAO', 'PhabricatorFactSimpleSpec' => 'PhabricatorFactSpec', 'PhabricatorFactUpdateIterator' => 'PhutilBufferedIterator', + 'PhabricatorFeedConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorFeedController' => 'PhabricatorController', 'PhabricatorFeedDAO' => 'PhabricatorLiskDAO', 'PhabricatorFeedMainController' => 'PhabricatorFeedController', diff --git a/src/applications/feed/config/PhabricatorFeedConfigOptions.php b/src/applications/feed/config/PhabricatorFeedConfigOptions.php new file mode 100644 index 0000000000..4361bc2ed1 --- /dev/null +++ b/src/applications/feed/config/PhabricatorFeedConfigOptions.php @@ -0,0 +1,47 @@ +newOption('feed.public', 'bool', false) + ->setBoolOptions( + array( + pht('Allow anyone to view the feed'), + pht('Require authentication'), + )) + ->setSummary(pht('Should the feed be public?')) + ->setDescription( + pht( + "If you set this to true, you can embed Phabricator activity ". + "feeds in other pages using iframes. These feeds are completely ". + "public, and a login is not required to view them! This is ". + "intended for things like open source projects that want to ". + "expose an activity feed on the project homepage.\n\n". + "NOTE: You must also set `policy.allow-public` to true for this ". + "setting to work properly.")), + $this->newOption('feed.http-hooks', 'list', array()) + ->setSummary(pht('POST notifications of feed events.')) + ->setDescription( + pht( + "If you set this to a list of http URIs, when a feed story is ". + "published a task will be created for each uri that posts the ". + "story data to the uri. Daemons automagically retry failures 100 ". + "times, waiting \$fail_count * 60s between each subsequent ". + "failure. Be sure to keep the daemon console (/daemon/) open ". + "while developing and testing your end points.\n\n". + "NOTE: URIs are not validated, the URI must return http status ". + "200 within 30 seconds, and no permission checks are performed.")), + ); + } + +}