mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-11 17:32:41 +01:00
9b2ededd48
Summary: I have a patch which makes uploads all fancy and adds progress bars, but document the landscape first since it's quite complicated. Test Plan: Generated, read docs. Configured `storage.upload-size-limit` to various values. Reviewers: btrahan, vrana Reviewed By: vrana CC: aran Maniphest Tasks: T875 Differential Revision: https://secure.phabricator.com/D2381
90 lines
No EOL
3 KiB
Text
90 lines
No EOL
3 KiB
Text
@title Configuring File Storage
|
|
@group config
|
|
|
|
Setup how Phabricator will store files.
|
|
|
|
= Overview =
|
|
|
|
Phabricator allows users to upload files, and several applications use file
|
|
storage (for instance, Maniphest allows you to attach files to tasks). You can
|
|
configure several different storage systems:
|
|
|
|
- you can store data in MySQL: this is the easiest to set up, but doesn't
|
|
scale well;
|
|
- you can store data on local disk: this is also easy to set up but won't
|
|
scale to multiple web frontends without NFS;
|
|
- or you can build a custom storage engine.
|
|
|
|
By default, Phabricator is configured to store files up to 1MB in MySQL, and
|
|
reject files larger than 1MB. It is recommended you set up local disk storage
|
|
for files larger than 1MB. This should be sufficient for most installs. If you
|
|
have a larger install or more unique requirements, you may want to customize
|
|
this further.
|
|
|
|
For technical documentation (including instructions on building custom storage
|
|
engines) see @{article:File Storage Technical Documentation}.
|
|
|
|
You don't have to fully configure this immediately, the defaults are okay until
|
|
you need to upload larger files and it's relatively easy to port files between
|
|
storage engines later.
|
|
|
|
= Storage Engines =
|
|
|
|
Builtin storage engines and information on how to configure them.
|
|
|
|
== MySQL ==
|
|
|
|
- **Pros**: Fast, no setup required.
|
|
- **Cons**: Storing files in a database is a classic bad idea. Does not scale
|
|
well. Maximum file size is limited.
|
|
|
|
MySQL storage is configured by default, for files up to (just under) 1MB. You
|
|
can configure it with these keys:
|
|
|
|
- ##storage.mysql-engine.max-size##: Change the filesize limit. Note that
|
|
this must be smaller than 'max_allowed_packet' on the server. Set to 0
|
|
to disable.
|
|
|
|
For most installs, it is recommended you configure local disk storage below,
|
|
and then either leave this as is or disable it, depending on how upset you feel
|
|
about putting files in a database.
|
|
|
|
== Local Disk ==
|
|
|
|
- **Pros**: Very simple. Almost no setup required.
|
|
- **Cons**: Doesn't scale to multiple web frontends without NFS.
|
|
|
|
For most installs, it is **strongly recommended** that you configure local disk
|
|
storage. To do this, set the configuration key:
|
|
|
|
- ##storage.local-disk.path##: Set to some writable directory on local disk.
|
|
Make that directory. You're done.
|
|
|
|
== Amazon S3 ==
|
|
|
|
- **Pros**: Scales well.
|
|
- **Cons**: More complicated and expensive than other approaches.
|
|
|
|
To enable file storage in S3, set these key:
|
|
|
|
- ##amazon-s3.access-key## Your AWS access key.
|
|
- ##amazon-s3.secret-key## Your AWS secret key.
|
|
- ##storage.s3.bucket## S3 bucket name where files should be stored.
|
|
|
|
== Custom Engine ==
|
|
|
|
For details about writing a custom storage engine, see @{article:File Storage
|
|
Technical Documentation}.
|
|
|
|
= Testing Storage Engines =
|
|
|
|
You can test that things are correctly configured by going to the Files
|
|
application (##/file/##) and uploading files.
|
|
|
|
= Next Steps =
|
|
|
|
Continue by:
|
|
|
|
- configuring file size upload limits with
|
|
@{article:Configuring File Upload Limits}; or
|
|
- returning to the @{article:Configuration Guide}. |