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

Default "environment.append-paths" to include likely paths

Summary:
A few more of these issues have cropped up recently. Basically:

- Webservers often (by default, I guess?) have a different or nonexistent $PATH.
- Users have a hard time figuring this out, since it's not obvious that the webserver might have a different configuration than the CLI, and they can run "git" and such themselves fine, and they don't normally use SetEnv or similar in webserver config.

I've been pursuing one prong of attack here (better detection and more tailored errors); this is a second prong (try to just guess the configuration correctly).

In 99% of cases, the binaries in question are in one of these three places, so just make them the default appended paths. If users have wacky configs they can override the setting.

Test Plan: Viewed config locally.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+20 -4
+20 -4
src/applications/config/option/PhabricatorCoreConfigOptions.php
··· 12 12 } 13 13 14 14 public function getOptions() { 15 + if (phutil_is_windows()) { 16 + $paths = array(); 17 + } else { 18 + $paths = array( 19 + '/bin', 20 + '/usr/bin', 21 + '/usr/local/bin', 22 + ); 23 + } 24 + 25 + $path = getenv('PATH'); 26 + 15 27 return array( 16 28 $this->newOption('phabricator.base-uri', 'string', null) 17 29 ->setLocked(true) ··· 95 107 "and a call to 'Leap Into Action'. If you'd prefer more ". 96 108 "traditional UI strings like 'Submit', you can set this flag to ". 97 109 "disable most of the jokes and easter eggs.")), 98 - $this->newOption('environment.append-paths', 'list<string>', array()) 110 + $this->newOption('environment.append-paths', 'list<string>', $paths) 99 111 ->setSummary( 100 112 pht("These paths get appended to your \$PATH envrionment variable.")) 101 113 ->setDescription( 102 114 pht( 103 115 "Phabricator occasionally shells out to other binaries on the ". 104 - "server. An example of this is the \"pygmentize\" command, used ". 116 + "server. An example of this is the `pygmentize` command, used ". 105 117 "to syntax-highlight code written in languages other than PHP. ". 106 118 "By default, it is assumed that these binaries are in the \$PATH ". 107 119 "of the user running Phabricator (normally 'apache', 'httpd', or ". 108 120 "'nobody'). Here you can add extra directories to the \$PATH ". 109 121 "environment variable, for when these binaries are in ". 110 - "non-standard locations. Note that you can also put binaries in ". 111 - "`phabricator/support/bin`.")) 122 + "non-standard locations.\n\n". 123 + "Note that you can also put binaries in ". 124 + "`phabricator/support/bin/` (for example, by symlinking them).\n\n". 125 + "The current value of PATH after configuration is applied is:\n\n". 126 + " lang=text\n". 127 + " %s", $path)) 112 128 ->addExample('/usr/local/bin', pht('Add One Path')) 113 129 ->addExample("/usr/bin\n/usr/local/bin", pht('Add Multiple Paths')), 114 130 $this->newOption('tokenizer.ondemand', 'bool', false)