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

Diffusion - default hosting options on during repository creation

Summary: ...if pertinent environment variables are set that is... Fixes T4151. This is the last piece in making repository creation somewhat easier.

Test Plan: made a new repo and noted that http serving was on r/w and ssh serving was still off, as expected for my environment configuration

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T4151

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

+22
+22
src/applications/diffusion/controller/DiffusionRepositoryCreateController.php
··· 104 104 $type_local_path = PhabricatorRepositoryTransaction::TYPE_LOCAL_PATH; 105 105 $type_remote_uri = PhabricatorRepositoryTransaction::TYPE_REMOTE_URI; 106 106 $type_hosting = PhabricatorRepositoryTransaction::TYPE_HOSTING; 107 + $type_http = PhabricatorRepositoryTransaction::TYPE_PROTOCOL_HTTP; 108 + $type_ssh = PhabricatorRepositoryTransaction::TYPE_PROTOCOL_SSH; 107 109 $type_credential = PhabricatorRepositoryTransaction::TYPE_CREDENTIAL; 108 110 $type_view = PhabricatorTransactions::TYPE_VIEW_POLICY; 109 111 $type_edit = PhabricatorTransactions::TYPE_EDIT_POLICY; ··· 157 159 $xactions[] = id(clone $template) 158 160 ->setTransactionType($type_hosting) 159 161 ->setNewValue(true); 162 + $vcs = $form->getPage('vcs')->getControl('vcs')->getValue(); 163 + if ($vcs != PhabricatorRepositoryType::REPOSITORY_TYPE_SVN) { 164 + if (PhabricatorEnv::getEnvConfig('diffusion.allow-http-auth')) { 165 + $v_http_mode = PhabricatorRepository::SERVE_READWRITE; 166 + } else { 167 + $v_http_mode = PhabricatorRepository::SERVE_OFF; 168 + } 169 + $xactions[] = id(clone $template) 170 + ->setTransactionType($type_http) 171 + ->setNewValue($v_http_mode); 172 + } 173 + 174 + if (PhabricatorEnv::getEnvConfig('diffusion.ssh-user')) { 175 + $v_ssh_mode = PhabricatorRepository::SERVE_READWRITE; 176 + } else { 177 + $v_ssh_mode = PhabricatorRepository::SERVE_OFF; 178 + } 179 + $xactions[] = id(clone $template) 180 + ->setTransactionType($type_ssh) 181 + ->setNewValue($v_ssh_mode); 160 182 } 161 183 162 184 if ($is_auth) {