From e34b4bbd907e96ec3f7578440773223476c7a014 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 13 Dec 2017 05:35:56 -0800 Subject: [PATCH] Move the Git LFS gate to dedicated (non-prototype) config Summary: See PHI131. Ref T7789. Although this probably isn't 100% complete, there don't seem to be any actual, known, practical blocking issues remaining (everything is either heresay or not reproducible). Test Plan: Tried to push LFS locally, got blocked with a helpful message. Enabled setting, tried to push LFS locally, got a successful push. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T7789 Differential Revision: https://secure.phabricator.com/D18825 --- .../config/PhabricatorDiffusionConfigOptions.php | 15 ++++++++++++++- .../repository/storage/PhabricatorRepository.php | 3 +-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php index 50f761eabc..d15fb678d5 100644 --- a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php +++ b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php @@ -101,7 +101,7 @@ final class PhabricatorDiffusionConfigOptions ->setBoolOptions( array( pht('Allow HTTP Basic Auth'), - pht('Disable HTTP Basic Auth'), + pht('Disallow HTTP Basic Auth'), )) ->setSummary(pht('Enable HTTP Basic Auth for repositories.')) ->setDescription( @@ -115,6 +115,19 @@ final class PhabricatorDiffusionConfigOptions "barrier to attackers than SSH does.\n\n". "Consider using SSH for authenticated access to repositories ". "instead of HTTP.")), + $this->newOption('diffusion.allow-git-lfs', 'bool', false) + ->setBoolOptions( + array( + pht('Allow Git LFS'), + pht('Disallow Git LFS'), + )) + ->setLocked(true) + ->setSummary(pht('Allow Git Large File Storage (LFS).')) + ->setDescription( + pht( + 'Phabricator supports Git LFS, a Git extension for storing large '. + 'files alongside a repository. Activate this setting to allow '. + 'the extension to store file data in Phabricator.')), $this->newOption('diffusion.ssh-user', 'string', null) ->setLocked(true) ->setSummary(pht('Login username for SSH connections to repositories.')) diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php index 713ed92270..702bb42780 100644 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -1627,8 +1627,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO return false; } - // TODO: Unprototype this feature. - if (!PhabricatorEnv::getEnvConfig('phabricator.show-prototypes')) { + if (!PhabricatorEnv::getEnvConfig('diffusion.allow-git-lfs')) { return false; }