From b1b8f5f11a6b74c09490235b30d1b31a54909437 Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Fri, 10 Jul 2020 09:16:53 +0300 Subject: [PATCH] docs and descriptions for s3 settings --- config/description.exs | 32 ++++++++++++++++++++++++++++---- docs/configuration/cheatsheet.md | 25 ++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/config/description.exs b/config/description.exs index 03b84bfc8..f461feb04 100644 --- a/config/description.exs +++ b/config/description.exs @@ -2579,8 +2579,7 @@ config :pleroma, :config_description, [ %{ key: :enabled, type: :boolean, - description: "Enables new users admin digest email when `true`", - suggestions: [false] + description: "Enables new users admin digest email when `true`" } ] }, @@ -3444,8 +3443,7 @@ config :pleroma, :config_description, [ key: :strict, type: :boolean, description: - "Enables strict input validation (useful in development, not recommended in production)", - suggestions: [false] + "Enables strict input validation (useful in development, not recommended in production)" } ] }, @@ -3461,5 +3459,31 @@ config :pleroma, :config_description, [ description: "Allow/disallow displaying and getting instances favicons" } ] + }, + %{ + group: :ex_aws, + key: :s3, + type: :group, + descriptions: "S3 service related settings", + children: [ + %{ + key: :access_key_id, + type: :string, + description: "S3 access key ID", + suggestions: ["AKIAQ8UKHTGIYN7DMWWJ"] + }, + %{ + key: :secret_access_key, + type: :string, + description: "Secret access key", + suggestions: ["JFGt+fgH1UQ7vLUQjpW+WvjTdV/UNzVxcwn7DkaeFKtBS5LvoXvIiME4NQBsT6ZZ"] + }, + %{ + key: :host, + type: :string, + description: "S3 host", + suggestions: ["s3.eu-central-1.amazonaws.com"] + } + ] } ] diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md index d775534b6..1a0603892 100644 --- a/docs/configuration/cheatsheet.md +++ b/docs/configuration/cheatsheet.md @@ -476,7 +476,6 @@ For each pool, the options are: * `:timeout` - timeout while `gun` will wait for response * `:max_overflow` - additional workers if pool is under load - ## Captcha ### Pleroma.Captcha @@ -494,7 +493,7 @@ A built-in captcha provider. Enabled by default. #### Pleroma.Captcha.Kocaptcha Kocaptcha is a very simple captcha service with a single API endpoint, -the source code is here: https://github.com/koto-bank/kocaptcha. The default endpoint +the source code is here: [kocaptcha](https://github.com/koto-bank/kocaptcha). The default endpoint `https://captcha.kotobank.ch` is hosted by the developer. * `endpoint`: the Kocaptcha endpoint to use. @@ -502,6 +501,7 @@ the source code is here: https://github.com/koto-bank/kocaptcha. The default end ## Uploads ### Pleroma.Upload + * `uploader`: Which one of the [uploaders](#uploaders) to use. * `filters`: List of [upload filters](#upload-filters) to use. * `link_name`: When enabled Pleroma will add a `name` parameter to the url of the upload, for example `https://instance.tld/media/corndog.png?name=corndog.png`. This is needed to provide the correct filename in Content-Disposition headers when using filters like `Pleroma.Upload.Filter.Dedupe` @@ -514,10 +514,15 @@ the source code is here: https://github.com/koto-bank/kocaptcha. The default end `strip_exif` has been replaced by `Pleroma.Upload.Filter.Mogrify`. ### Uploaders + #### Pleroma.Uploaders.Local + * `uploads`: Which directory to store the user-uploads in, relative to pleroma’s working directory. #### Pleroma.Uploaders.S3 + +Don't forget to configure [Ex AWS S3](#ex-aws-s3-settings) + * `bucket`: S3 bucket name. * `bucket_namespace`: S3 bucket namespace. * `public_endpoint`: S3 endpoint that the user finally accesses(ex. "https://s3.dualstack.ap-northeast-1.amazonaws.com") @@ -526,6 +531,20 @@ For example, when using CDN to S3 virtual host format, set "". At this time, write CNAME to CDN in public_endpoint. * `streaming_enabled`: Enable streaming uploads, when enabled the file will be sent to the server in chunks as it's being read. This may be unsupported by some providers, try disabling this if you have upload problems. +#### Ex AWS S3 settings + +* `access_key_id`: Access key ID +* `secret_access_key`: Secret access key +* `host`: S3 host + +Example: + +```elixir +config :ex_aws, :s3, + access_key_id: "xxxxxxxxxx", + secret_access_key: "yyyyyyyyyy", + host: "s3.eu-central-1.amazonaws.com" +``` ### Upload filters @@ -983,7 +1002,7 @@ Restrict access for unauthenticated users to timelines (public and federated), u * `local` * `remote` -Note: setting `restrict_unauthenticated/timelines/local` to `true` has no practical sense if `restrict_unauthenticated/timelines/federated` is set to `false` (since local public activities will still be delivered to unauthenticated users as part of federated timeline). +Note: setting `restrict_unauthenticated/timelines/local` to `true` has no practical sense if `restrict_unauthenticated/timelines/federated` is set to `false` (since local public activities will still be delivered to unauthenticated users as part of federated timeline). ## Pleroma.Web.ApiSpec.CastAndValidate