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

Give getAlmanacServiceURI() an "options" parameter to prepare for read-only devices

Summary:
Depends on D19355. Ref T10883. Ref T13120. Rather than adding a million parameters here, wrap the selector-parameters in an `$options`.

The next change adds a new "writable" option to support forcing selection of writable hosts.

Test Plan: Pulled and pushed via HTTP and SSH, viewed repositories via Diffusion.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13120, T10883

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

+26 -12
+5 -3
src/applications/diffusion/controller/DiffusionServeController.php
··· 431 431 432 432 $uri = $repository->getAlmanacServiceURI( 433 433 $viewer, 434 - $is_cluster_request, 435 434 array( 436 - 'http', 437 - 'https', 435 + 'neverProxy' => $is_cluster_request, 436 + 'protocols' => array( 437 + 'http', 438 + 'https', 439 + ), 438 440 )); 439 441 if ($uri) { 440 442 $future = $this->getRequest()->newClusterProxyFuture($uri);
+4 -2
src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
··· 151 151 $is_cluster_request = $this->getIsClusterRequest(); 152 152 $uri = $repository->getAlmanacServiceURI( 153 153 $viewer, 154 - $is_cluster_request, 155 154 array( 156 - 'ssh', 155 + 'neverProxy' => $is_cluster_request, 156 + 'protocols' => array( 157 + 'ssh', 158 + ), 157 159 )); 158 160 159 161 if ($uri) {
+17 -7
src/applications/repository/storage/PhabricatorRepository.php
··· 1897 1897 * services, returning raw URIs. 1898 1898 * 1899 1899 * @param PhabricatorUser Viewing user. 1900 - * @param bool `true` to throw if a remote URI would be returned. 1901 - * @param list<string> List of allowable protocols. 1900 + * @param map<string, wild> Constraints on selectable services. 1902 1901 * @return string|null URI, or `null` for local repositories. 1903 1902 */ 1904 1903 public function getAlmanacServiceURI( 1905 1904 PhabricatorUser $viewer, 1906 - $never_proxy, 1907 - array $protocols) { 1905 + array $options) { 1906 + 1907 + PhutilTypeSpec::checkMap( 1908 + $options, 1909 + array( 1910 + 'neverProxy' => 'bool', 1911 + 'protocols' => 'list<string>', 1912 + )); 1913 + 1914 + $never_proxy = $options['neverProxy']; 1915 + $protocols = $options['protocols']; 1908 1916 1909 1917 $cache_key = $this->getAlmanacServiceCacheKey(); 1910 1918 if (!$cache_key) { ··· 2077 2085 2078 2086 $uri = $this->getAlmanacServiceURI( 2079 2087 $viewer, 2080 - $never_proxy, 2081 2088 array( 2082 - 'http', 2083 - 'https', 2089 + 'neverProxy' => $never_proxy, 2090 + 'protocols' => array( 2091 + 'http', 2092 + 'https', 2093 + ), 2084 2094 )); 2085 2095 if ($uri === null) { 2086 2096 return null;