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

Allow editing hosting policies via command line

Summary:
Exposes the serve-over-http and serve-over-ssh options for a repository
to the `bin/repository edit` endpoint.

Test Plan: Ran `bin/repository` with the new options over several hundred repos

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, chasemp, 20after4, epriestley

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

+35 -1
+35 -1
src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
··· 7 7 $this 8 8 ->setName('edit') 9 9 ->setExamples('**edit** --as __username__ __repository__ ...') 10 - ->setSynopsis(pht('Edit __repository__, named by callsign.')) 10 + ->setSynopsis( 11 + pht( 12 + 'Edit __repository__, named by callsign '. 13 + '(will eventually be deprecated by Conduit).')) 11 14 ->setArguments( 12 15 array( 13 16 array( ··· 23 26 'name' => 'local-path', 24 27 'param' => 'path', 25 28 'help' => pht('Edit the local path.'), 29 + ), 30 + array( 31 + 'name' => 'serve-http', 32 + 'param' => 'string', 33 + 'help' => pht('Edit the http serving policy.'), 34 + ), 35 + array( 36 + 'name' => 'serve-ssh', 37 + 'param' => 'string', 38 + 'help' => pht('Edit the ssh serving policy.'), 26 39 ), 27 40 )); 28 41 } ··· 68 81 $xactions = array(); 69 82 70 83 $type_local_path = PhabricatorRepositoryTransaction::TYPE_LOCAL_PATH; 84 + $type_protocol_http = 85 + PhabricatorRepositoryTransaction::TYPE_PROTOCOL_HTTP; 86 + $type_protocol_ssh = PhabricatorRepositoryTransaction::TYPE_PROTOCOL_SSH; 87 + $allowed_serve_modes = array( 88 + PhabricatorRepository::SERVE_OFF, 89 + PhabricatorRepository::SERVE_READONLY, 90 + PhabricatorRepository::SERVE_READWRITE, 91 + ); 71 92 72 93 if ($args->getArg('local-path')) { 73 94 $xactions[] = id(new PhabricatorRepositoryTransaction()) 74 95 ->setTransactionType($type_local_path) 75 96 ->setNewValue($args->getArg('local-path')); 76 97 } 98 + $serve_http = $args->getArg('serve-http'); 99 + if ($serve_http && in_array($serve_http, $allowed_serve_modes)) { 100 + $xactions[] = id(new PhabricatorRepositoryTransaction()) 101 + ->setTransactionType($type_protocol_http) 102 + ->setNewValue($serve_http); 103 + } 104 + $serve_ssh = $args->getArg('serve-ssh'); 105 + if ($serve_ssh && in_array($serve_ssh, $allowed_serve_modes)) { 106 + $xactions[] = id(new PhabricatorRepositoryTransaction()) 107 + ->setTransactionType($type_protocol_ssh) 108 + ->setNewValue($serve_ssh); 109 + } 110 + 77 111 78 112 if (!$xactions) { 79 113 throw new PhutilArgumentUsageException(