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

Add a setup issue to warn about an unconfigured upload limit

Summary:
Ref T3354. There's no way for us to test most of the config options which actually affect this limit, so the Phabricator config is basically a canary value to indicate "the administrator hasn't configured anything yet".

Raise a setup issue if it isn't set. There's a trail to get here from Files, but we've de-emphasized the old-school upload form so it's hard to unearth.

Emphasize the warning that you need to read the documentation and configure like 30 other things to make this work.

Test Plan: Cleared my config, verified I got the issue, read it, set my config, issue went away.

Reviewers: jamesr, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3354

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

+21 -6
+15
src/applications/config/check/PhabricatorSetupCheckStorage.php
··· 3 3 final class PhabricatorSetupCheckStorage extends PhabricatorSetupCheck { 4 4 5 5 protected function executeChecks() { 6 + $upload_limit = PhabricatorEnv::getEnvConfig('storage.upload-size-limit'); 7 + if (!$upload_limit) { 8 + $message = pht( 9 + 'The Phabricator file upload limit is not configured. You may only '. 10 + 'be able to upload very small files until you configure it, because '. 11 + 'some PHP default limits are very low (as low as 2MB).'); 12 + 13 + $this 14 + ->newIssue('config.storage.upload-size-limit') 15 + ->setShortName(pht('Upload Limit')) 16 + ->setName(pht('Upload Limit Not Yet Configured')) 17 + ->setMessage($message) 18 + ->addPhabricatorConfig('storage.upload-size-limit'); 19 + } 20 + 6 21 $local_path = PhabricatorEnv::getEnvConfig('storage.local-disk.path'); 7 22 if (!$local_path) { 8 23 return;
+6 -6
src/applications/files/config/PhabricatorFilesConfigOptions.php
··· 143 143 "used to render text like 'Maximum file size: 10MB' on ". 144 144 "interfaces where users can upload files, and files larger than ". 145 145 "this size will be rejected. \n\n". 146 - "Specify this limit in bytes, or using a 'K', 'M', or 'G' ". 147 - "suffix.\n\n". 148 - "NOTE: Setting this to a large size is **NOT** sufficient to ". 146 + "NOTE: **Setting this to a large size is NOT sufficient to ". 149 147 "allow users to upload large files. You must also configure a ". 150 - "number of other settings. To configure file upload limits, ". 148 + "number of other settings.** To configure file upload limits, ". 151 149 "consult the article 'Configuring File Upload Limits' in the ". 152 150 "documentation. Once you've configured some limit across all ". 153 151 "levels of the server, you can set this limit to an appropriate ". 154 152 "value and the UI will then reflect the actual configured ". 155 - "limit.")) 156 - ->addExample('10M', pht("Valid setting.")), 153 + "limit.\n\n". 154 + "Specify this limit in bytes, or using a 'K', 'M', or 'G' ". 155 + "suffix.")) 156 + ->addExample('10M', pht("Allow Uploads 10MB or Smaller")), 157 157 $this->newOption('files.enable-imagemagick', 'bool', false) 158 158 ->setBoolOptions( 159 159 array(