From 48052c609fcecc87492911f16d68a9c9dd847562 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 28 Feb 2021 17:46:00 +0100 Subject: [PATCH] Docs: Add Azure, Filesystem, Imgur and S3 Signed-off-by: Philip Molares --- docs/content/media/azure.md | 21 +++++++++++++++++++++ docs/content/media/filesystem.md | 12 ++++++++++++ docs/content/media/imgur.md | 19 +++++++++++++++++++ docs/content/media/s3.md | 19 +++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 docs/content/media/azure.md create mode 100644 docs/content/media/filesystem.md create mode 100644 docs/content/media/imgur.md create mode 100644 docs/content/media/s3.md diff --git a/docs/content/media/azure.md b/docs/content/media/azure.md new file mode 100644 index 000000000..de946f8e7 --- /dev/null +++ b/docs/content/media/azure.md @@ -0,0 +1,21 @@ +# Azure Blob Storage + +You can use [Microsoft Azure Blob Storage](https://azure.microsoft.com/services/storage/blobs/) to handle your image uploads in HedgeDoc. + +All you need to do is to get the [connection string](https://docs.microsoft.com/azure/storage/common/storage-account-keys-manage) for your storage account and create a storage container with public access set to 'blob'. + +It's possible to create the container with the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli), using your connection string, with the following command: + +``` +az storage container create --name --public-access blob --connection-string "" +``` + +You can of course also create the container in the Azure portal if you prefer. + +Then you just add the following lines to your configuration: +(with the appropriate substitution for `` and `` of course) +``` +HD_MEDIA_BACKEND="azure" +HD_MEDIA_BACKEND_AZURE_CONNECTION_STRING="" +HD_MEDIA_BACKEND_AZURE_CONTAINER="" +``` diff --git a/docs/content/media/filesystem.md b/docs/content/media/filesystem.md new file mode 100644 index 000000000..a1f4e3308 --- /dev/null +++ b/docs/content/media/filesystem.md @@ -0,0 +1,12 @@ +# Filesystem + +You can use your local filesystem to handle your image uploads in HedgeDoc. + +You just add the following lines to your configuration: +(with the appropriate substitution for `` of course) +``` +HD_MEDIA_BACKEND="filesystem" +HD_MEDIA_BACKEND_FILESYSTEM_UPLOAD_PATH="" +``` + +Please make sure that the user that runs HedgeDoc is able to write to the uploads directory. diff --git a/docs/content/media/imgur.md b/docs/content/media/imgur.md new file mode 100644 index 000000000..daff73079 --- /dev/null +++ b/docs/content/media/imgur.md @@ -0,0 +1,19 @@ +# Imgur + +You can use [Imgur](https://imgur.com) to handle your image uploads in HedgeDoc. + +All you need for that is to register an application with Imgur and get a client id: + +1. Create an account on imgur.com and log in. +2. Go to +3. Fill out the form and choose "Anonymous usage without user authorization" as the authorization type. +4. Imgur will then show you your client id. + +Then you just add the following lines to your configuration: +(with the appropriate substitution for `` of course) +``` +HD_MEDIA_BACKEND="imgur" +HD_MEDIA_BACKEND_IMGUR_CLIENT_ID="" +``` + +All uploads are saved in the `media_uploads` database table and contain the deletion token ([see here](https://apidocs.imgur.com/#949d6cb0-5e55-45f7-8853-8c44a108399c)) in the column `backendData`. diff --git a/docs/content/media/s3.md b/docs/content/media/s3.md new file mode 100644 index 000000000..7918516b6 --- /dev/null +++ b/docs/content/media/s3.md @@ -0,0 +1,19 @@ +# S3-compatible + +You can use [Amazon S3](https://aws.amazon.com/s3/) or any other S3-compatible storage (like [MinIO](https://min.io) or [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/)) to handle your image uploads in HedgeDoc. + +Your S3 bucket must be configured to be writeable. + +You just add the following lines to your configuration: +(with the appropriate substitution for ``, ``, ``, and `` of course) +``` +HD_MEDIA_BACKEND="s3" +HD_MEDIA_BACKEND_S3_ACCESS_KEY="" +HD_MEDIA_BACKEND_S3_SECRET_KEY="" +HD_MEDIA_BACKEND_S3_BUCKET="" +HD_MEDIA_BACKEND_S3_ENDPOINT="" +``` + +If you use Amazon S3, `` should contain your [Amazon Region](https://docs.aws.amazon.com/general/latest/gr/s3.html). + +For example: If your Amazon Region is `us-east-2`, your endpoint `` should be `s3.us-east-2.amazonaws.com`.