From 07bc1188dc149e05b61e0d93ecf3ef1c26dc8690 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Thu, 20 Sep 2018 16:15:38 +0100 Subject: Add S3 photo storage backend --- docs/customising/config.md | 197 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 191 insertions(+), 6 deletions(-) (limited to 'docs/customising') diff --git a/docs/customising/config.md b/docs/customising/config.md index 9f48bad7e..e0761cb8e 100644 --- a/docs/customising/config.md +++ b/docs/customising/config.md @@ -55,10 +55,23 @@ The following are all the configuration settings that you can change in `conf/ge * BASE_URL * SECURE_PROXY_SSL_HEADER -* UPLOAD_DIR * GEO_CACHE * ADMIN_BASE_URL +### Photo storage + +* PHOTO_STORAGE_BACKEND +* PHOTO_STORAGE_OPTIONS + * For local filesystem storage: + * UPLOAD_DIR + * For Amazon S3 storage: + * BUCKET + * ACCESS_KEY + * SECRET_KEY + * PREFIX + * CREATE_BUCKET + * REGION + ### Emailing * EMAIL_DOMAIN @@ -404,18 +417,16 @@ LANGUAGES:
- UPLOAD_DIR & GEO_CACHE
- The file locations for uploaded photos and cached geocoding results. - Normally you don't need to change these settings from the examples. + The file location for cached geocoding results. + Normally you don't need to change this setting from the example.

Example:

  • - UPLOAD_DIR: '../upload/'
    GEO_CACHE: '../cache/'
  • @@ -1118,5 +1129,179 @@ ALLOWED_COBRANDS:
- + +
+ PHOTO_STORAGE_BACKEND +
+
+ The storage backend to use for uploaded photos. +

+ Possible choices are FileSystem or S3. + By default, FixMyStreet will use FileSystem. +

+

+ The chosen backend can be configured via the + PHOTO_STORAGE_OPTIONS + setting, see below. +

+
+ +
+ PHOTO_STORAGE_OPTIONS +
+
+

+ Contains backend-specific configuration options for photo storage. +

+

+ For the FileSystem backend, the following apply: +

+ +

+ For the S3 backend, the following apply: +

+ +
+ +
+ UPLOAD_DIR +
+
+

+ The file location for uploaded photos. + Normally you don't need to change this setting from the example. +

+

+ Only applies when PHOTO_STORAGE_BACKEND is FileSystem. +

+
+

Example:

+
    +
  • +
    +PHOTO_STORAGE_OPTIONS:
    +  UPLOAD_DIR: '../upload/'
    +          
    +
  • +
+
+
+ +
+ BUCKET +
+
+

+ The name of the S3 bucket to store photos in. +

+

+ Required when PHOTO_STORAGE_BACKEND is S3. +

+
+

Example:

+
    +
  • +
    +PHOTO_STORAGE_OPTIONS:
    +  BUCKET: 'fixmystreet-photos'
    +          
    +
  • +
+
+
+ +
+ ACCESS_KEY & + SECRET_KEY +
+
+

+ The AWS access & secret keys to use when connecting to S3. + You should use a role with minimal privileges to manage objects in a specific S3 bucket, not your root keys. +

+

+ Required when PHOTO_STORAGE_BACKEND is S3. +

+
+

Example:

+
    +
  • +
    +PHOTO_STORAGE_OPTIONS:
    +  ACCESS_KEY: 'AKIAMYSUPERCOOLKEY'
    +  SECRET_KEY: '12345/AbCdEFgHIJ98765'
    +          
    +
  • +
+
+
+ +
+ PREFIX +
+
+

+ An optional directory prefix to prepended to S3 filenames. Useful if, for example, you are using a bucket shared between other projects or FixMyStreet instances. +

+

+ Optional. Only applies when PHOTO_STORAGE_BACKEND is S3. +

+
+

Example:

+
    +
  • +
    +PHOTO_STORAGE_OPTIONS:
    +  PREFIX: '/fixmystreet_photos/'
    +          
    +
  • +
+
+
+ +
+ CREATE_BUCKET +
+
+

+ Set to 1 (or true) if FixMyStreet should create the S3 bucket specified in BUCKET if it doesn't already exist. +

+

+ Optional. Only applies when PHOTO_STORAGE_BACKEND is S3. +

+
+ +
+ REGION +
+
+

+ The AWS region to create the S3 bucket in. +

+

+ Optional. Only applies when CREATE_BUCKET is enabled. +

+
+

Example:

+
    +
  • +
    +PHOTO_STORAGE_OPTIONS:
    +  CREATE_BUCKET: 1
    +  REGION: 'eu-west-2'
    +          
    +
  • +
+
+
+ -- cgit v1.2.3