@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.

Fix excessively severe CSP URI error during first-time setup

Summary:
See D19394. Currently, during first-time setup before you configure "phabricator.base-uri", we may attempt to generate a setup page, try to generate a CSP header for it, and fail to access the environmental config. This causes a too-severe error page ("configure phabricator.base-uri") instead of preflight guidance (like "can't connect to MySQL").

Instead, treat this more like "security.alternate-file-domain" and just bail on CSP if we can't fetch it.

Test Plan: On a fresh (non-explodey laptop) install with critical setup errors (no MySQL installed yet), loaded Phabricator. Before: error about phabricator.base-uri. After: more helpful guidance about installing/configuring MySQL.

Reviewers: amckinley, avivey

Reviewed By: amckinley

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

+1 -2
+1 -2
src/aphront/response/AphrontResponse.php
··· 113 113 114 114 try { 115 115 $cdn = PhabricatorEnv::getEnvConfig('security.alternate-file-domain'); 116 + $base_uri = PhabricatorEnv::getURI('/'); 116 117 } catch (Exception $ex) { 117 118 return null; 118 119 } ··· 124 125 // If an alternate file domain is not configured and the user is viewing 125 126 // a Phame blog on a custom domain or some other custom site, we'll still 126 127 // serve resources from the main site. Include the main site explicitly. 127 - 128 - $base_uri = PhabricatorEnv::getURI('/'); 129 128 $base_uri = $this->newContentSecurityPolicySource($base_uri); 130 129 131 130 $default = "'self' {$base_uri}";