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

First go at Files settings.

Summary:
Based on @epriestley's https://secure.phabricator.com/differential/diff/9186/
plus others that seemed like they belong here.

Test Plan: Saw the new settings show up in the web interface.

Reviewers: epriestley, btrahan, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

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

authored by

Ricky Elrod and committed by
epriestley
9470ab05 0c6e5f86

+127
+2
src/__phutil_library_map__.php
··· 843 843 'PhabricatorFileTransformController' => 'applications/files/controller/PhabricatorFileTransformController.php', 844 844 'PhabricatorFileUploadController' => 'applications/files/controller/PhabricatorFileUploadController.php', 845 845 'PhabricatorFileUploadException' => 'applications/files/exception/PhabricatorFileUploadException.php', 846 + 'PhabricatorFilesConfigOptions' => 'applications/files/config/PhabricatorFilesConfigOptions.php', 846 847 'PhabricatorFilesManagementEnginesWorkflow' => 'applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php', 847 848 'PhabricatorFilesManagementMetadataWorkflow' => 'applications/files/management/PhabricatorFilesManagementMetadataWorkflow.php', 848 849 'PhabricatorFilesManagementMigrateWorkflow' => 'applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php', ··· 2205 2206 'PhabricatorFileTransformController' => 'PhabricatorFileController', 2206 2207 'PhabricatorFileUploadController' => 'PhabricatorFileController', 2207 2208 'PhabricatorFileUploadException' => 'Exception', 2209 + 'PhabricatorFilesConfigOptions' => 'PhabricatorApplicationConfigOptions', 2208 2210 'PhabricatorFilesManagementEnginesWorkflow' => 'PhabricatorFilesManagementWorkflow', 2209 2211 'PhabricatorFilesManagementMetadataWorkflow' => 'PhabricatorFilesManagementWorkflow', 2210 2212 'PhabricatorFilesManagementMigrateWorkflow' => 'PhabricatorFilesManagementWorkflow',
+125
src/applications/files/config/PhabricatorFilesConfigOptions.php
··· 1 + <?php 2 + 3 + final class PhabricatorFilesConfigOptions 4 + extends PhabricatorApplicationConfigOptions { 5 + 6 + public function getName() { 7 + return pht("Files"); 8 + } 9 + 10 + public function getDescription() { 11 + return pht("Configure files and file storage."); 12 + } 13 + 14 + public function getOptions() { 15 + 16 + $viewable_default = array( 17 + 'image/jpeg' => 'image/jpeg', 18 + 'image/jpg' => 'image/jpg', 19 + 'image/png' => 'image/png', 20 + 'image/gif' => 'image/gif', 21 + 'text/plain' => 'text/plain; charset=utf-8', 22 + 'text/x-diff' => 'text/plain; charset=utf-8', 23 + 24 + // ".ico" favicon files, which have mime type diversity. See: 25 + // http://en.wikipedia.org/wiki/ICO_(file_format)#MIME_type 26 + 'image/x-ico' => 'image/x-icon', 27 + 'image/x-icon' => 'image/x-icon', 28 + 'image/vnd.microsoft.icon' => 'image/x-icon', 29 + ); 30 + 31 + $image_default = array( 32 + 'image/jpeg' => true, 33 + 'image/jpg' => true, 34 + 'image/png' => true, 35 + 'image/gif' => true, 36 + 'image/x-ico' => true, 37 + 'image/x-icon' => true, 38 + 'image/vnd.microsoft.icon' => true, 39 + ); 40 + 41 + return array( 42 + $this->newOption('files.viewable-mime-types', 'wild', $viewable_default) 43 + ->setSummary( 44 + pht('Configure which MIME types are viewable in the browser.')) 45 + ->setDescription( 46 + pht( 47 + 'Configure which uploaded file types may be viewed directly '. 48 + 'in the browser. Other file types will be downloaded instead '. 49 + 'of displayed. This is mainly a usability consideration, since '. 50 + 'browsers tend to freak out when viewing enormous binary files.'. 51 + "\n\n". 52 + 'The keys in this map are vieweable MIME types; the values are '. 53 + 'the MIME type sthey are delivered as when they are viewed in '. 54 + 'the browser.')), 55 + $this->newOption('files.image-mime-types', 'wild', $image_default) 56 + ->setSummary(pht('Configure which MIME types are images.')) 57 + ->setDescription( 58 + pht( 59 + 'List of MIME types which can be used as the `src` for an '. 60 + '`<img />` tag.')), 61 + $this->newOption('storage.mysql-engine.max-size', 'int', 1000000) 62 + ->setSummary( 63 + pht( 64 + 'Configure the largest file which will be put into the MySQL '. 65 + 'storage engine.')), 66 + $this->newOption('storage.local-disk.path', 'string', null) 67 + ->setSummary(pht('Local storage disk path.')) 68 + ->setDescription( 69 + pht( 70 + "Phabricator provides a local disk storage engine, which just ". 71 + "writes files to some directory on local disk. The webserver ". 72 + "must have read/write permissions on this directory. This is ". 73 + "straightforward and suitable for most installs, but will not ". 74 + "scale past one web frontend unless the path is actually an NFS ". 75 + "mount, since you'll end up with some of the files written to ". 76 + "each web frontend and no way for them to share. To use the ". 77 + "local disk storage engine, specify the path to a directory ". 78 + "here. To disable it, specify null.")), 79 + $this->newOption('storage.s3.bucket', 'string', null) 80 + ->setSummary(pht('Amazon S3 bucket.')) 81 + ->setDescription( 82 + pht( 83 + "Set this to a valid Amazon S3 bucket to store files there. You ". 84 + "must also configure S3 access keys in the 'Amazon Web Services' ". 85 + "group.")), 86 + $this->newOption( 87 + 'storage.engine-selector', 88 + 'class', 89 + 'PhabricatorDefaultFileStorageEngineSelector') 90 + ->setBaseClass('PhabricatorFileStorageEngineSelector') 91 + ->setSummary(pht('Storage engine selector.')) 92 + ->setDescription( 93 + pht( 94 + "Phabricator uses a storage engine selector to choose which ". 95 + "storage engine to use when writing file data. If you add new ". 96 + "storage engines or want to provide very custom rules (e.g., ". 97 + "write images to one storage engine and other files to a ". 98 + "different one), you can provide an alternate implementation ". 99 + "here. The default engine will use choose MySQL, Local Disk, and ". 100 + "S3, in that order, if they have valid configurations above and ". 101 + "a file fits within configured limits.")), 102 + $this->newOption('storage.upload-size-limit', 'string', null) 103 + ->setSummary( 104 + pht('Limit to users in interfaces which allow uploading.')) 105 + ->setDescription( 106 + pht( 107 + "Set the size of the largest file a user may upload. This is ". 108 + "used to render text like 'Maximum file size: 10MB' on ". 109 + "interfaces where users can upload files, and files larger than ". 110 + "this size will be rejected. \n\n". 111 + "Specify this limit in bytes, or using a 'K', 'M', or 'G' ". 112 + "suffix.\n\n". 113 + "NOTE: Setting this to a large size is **NOT** sufficient to ". 114 + "allow users to upload large files. You must also configure a ". 115 + "number of other settings. To configure file upload limits, ". 116 + "consult the article 'Configuring File Upload Limits' in the ". 117 + "documentation. Once you've configured some limit across all ". 118 + "levels of the server, you can set this limit to an appropriate ". 119 + "value and the UI will then reflect the actual configured ". 120 + "limit.")) 121 + ->addExample('10M', pht("Valid setting.")), 122 + ); 123 + } 124 + 125 + }