@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Move Facebook setup checks to post-install

Summary: Technically we should have these for all the OAuth providers but I don't think anyone really has trouble with them and it can probably be done generically after T1536. Preserve the functionality, at least.

Test Plan: Broke my config, verified warnings appeared.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2228

Differential Revision: https://secure.phabricator.com/D4506

+39 -39
+2
src/__phutil_library_map__.php
··· 1205 1205 'PhabricatorSetupCheck' => 'applications/config/check/PhabricatorSetupCheck.php', 1206 1206 'PhabricatorSetupCheckAPC' => 'applications/config/check/PhabricatorSetupCheckAPC.php', 1207 1207 'PhabricatorSetupCheckExtraConfig' => 'applications/config/check/PhabricatorSetupCheckExtraConfig.php', 1208 + 'PhabricatorSetupCheckFacebook' => 'applications/config/check/PhabricatorSetupCheckFacebook.php', 1208 1209 'PhabricatorSetupCheckGD' => 'applications/config/check/PhabricatorSetupCheckGD.php', 1209 1210 'PhabricatorSetupCheckInvalidConfig' => 'applications/config/check/PhabricatorSetupCheckInvalidConfig.php', 1210 1211 'PhabricatorSetupCheckMail' => 'applications/config/check/PhabricatorSetupCheckMail.php', ··· 2557 2558 'PhabricatorSettingsPanelSearchPreferences' => 'PhabricatorSettingsPanel', 2558 2559 'PhabricatorSetupCheckAPC' => 'PhabricatorSetupCheck', 2559 2560 'PhabricatorSetupCheckExtraConfig' => 'PhabricatorSetupCheck', 2561 + 'PhabricatorSetupCheckFacebook' => 'PhabricatorSetupCheck', 2560 2562 'PhabricatorSetupCheckGD' => 'PhabricatorSetupCheck', 2561 2563 'PhabricatorSetupCheckInvalidConfig' => 'PhabricatorSetupCheck', 2562 2564 'PhabricatorSetupCheckMail' => 'PhabricatorSetupCheck',
+37
src/applications/config/check/PhabricatorSetupCheckFacebook.php
··· 1 + <?php 2 + 3 + final class PhabricatorSetupCheckFacebook extends PhabricatorSetupCheck { 4 + 5 + protected function executeChecks() { 6 + $fb_auth = PhabricatorEnv::getEnvConfig('facebook.auth-enabled'); 7 + if (!$fb_auth) { 8 + return; 9 + } 10 + 11 + if (!PhabricatorEnv::getEnvConfig('facebook.application-id')) { 12 + $message = pht( 13 + 'You have enabled Facebook authentication, but have not provided a '. 14 + 'Facebook Application ID. Provide one or disable Facebook '. 15 + 'authentication.'); 16 + 17 + $this->newIssue('config.facebook.application-id') 18 + ->setName(pht("Facebook Application ID Not Set")) 19 + ->setMessage($message) 20 + ->addPhabricatorConfig('facebook.auth-enabled') 21 + ->addPhabricatorConfig('facebook.application-id'); 22 + } 23 + 24 + if (!PhabricatorEnv::getEnvConfig('facebook.application-secret')) { 25 + $message = pht( 26 + 'You have enabled Facebook authentication, but have not provided a '. 27 + 'Facebook Application Secret. Provide one or disable Facebook '. 28 + 'authentication.'); 29 + 30 + $this->newIssue('config.facebook.application-secret') 31 + ->setName(pht("Facebook Application Secret Not Set")) 32 + ->setMessage($message) 33 + ->addPhabricatorConfig('facebook.auth-enabled') 34 + ->addPhabricatorConfig('facebook.application-secret'); 35 + } 36 + } 37 + }
-39
src/infrastructure/PhabricatorSetup.php
··· 360 360 361 361 self::write("[OKAY] Basic configuration OKAY\n"); 362 362 363 - 364 - self::writeHeader('FACEBOOK INTEGRATION'); 365 - $fb_auth = PhabricatorEnv::getEnvConfig('facebook.auth-enabled'); 366 - if (!$fb_auth) { 367 - self::write(" skip 'facebook.auth-enabled' not enabled.\n"); 368 - } else { 369 - self::write(" okay 'facebook.auth-enabled' is enabled.\n"); 370 - $app_id = PhabricatorEnv::getEnvConfig('facebook.application-id'); 371 - $app_secret = PhabricatorEnv::getEnvConfig('facebook.application-secret'); 372 - 373 - if (!$app_id) { 374 - self::writeFailure(); 375 - self::write( 376 - "Setup failure! 'facebook.auth-enabled' is true but there is no ". 377 - "setting for 'facebook.application-id'.\n"); 378 - return; 379 - } else { 380 - self::write(" okay 'facebook.application-id' is set.\n"); 381 - } 382 - 383 - if (!$app_secret) { 384 - self::writeFailure(); 385 - self::write( 386 - "Setup failure! 'facebook.auth-enabled' is true but there is no ". 387 - "setting for 'facebook.application-secret'."); 388 - return; 389 - } else { 390 - self::write(" okay 'facebook.application-secret is set.\n"); 391 - } 392 - 393 - self::write("[OKAY] Facebook integration OKAY\n"); 394 - } 395 - 396 363 self::writeHeader("MySQL DATABASE & STORAGE CONFIGURATION"); 397 364 398 365 $conf = PhabricatorEnv::newObjectFromConfig('mysql.configuration-provider'); ··· 494 461 495 462 // This, uh, makes it look cool. -_- 496 463 usleep(20000); 497 - } 498 - 499 - private static function writeNote($note) { 500 - $note = "*** NOTE: ".wordwrap($note, 75, "\n", true); 501 - $note = "\n".str_replace("\n", "\n ", $note)."\n\n"; 502 - self::write($note); 503 464 } 504 465 505 466 public static function writeHeader($header) {