Using R2 Storage (Cloudflare) with the S3-Upload-Options

Hi Hedgedoc-Team

(My version of HedgeDoc is: 1.9.7)

I am using S3-Storage for image uploads and it works fine.

But would you consider integrating Cloudflares R2-Storage in the future. It’s cheaper, has a bigger free Tier (10gb, no egress costs) and is easier to set up than the aws iam console.

R2 Storage is compatible to the S3-API. It is possible to configure hedgedoc in a way, that it can upload to R2 (via the custom_endpoint), but you would need one more configurable path, because the custom endpoint on R2 ist not the public-url for receiving the object.
I am using this configuration:

  - CMD_S3_BUCKET=pad
  - CMD_S3_ACCESS_KEY_ID=abcde
  - CMD_S3_REGION=auto
  - CMD_S3_FOLDER=hedgedoc-upload

It uploads the images, but tries to receive them via
But Cloudflare makes them only publicly available via or you could set a custom url like

It would need another command (similiar to s3-bucket-use in the mastodon-configuration) for the configuration:


Thank you for hedgedoc!