إعداد مُوفِّر تخزين كائنات متوافق مع S3 لعمليات الرفع

:information_source: يغطي هذا الموضوع كيفية تكوين بعض مزودي تخزين الكائنات المتوافقين مع S3 (نسخ S3). راجع Set up file and image uploads to S3 لمزيد من التفاصيل حول تكوين Amazon AWS S3، الذي يُدعم رسميًا ويُستخدم داخليًا بواسطة Discourse لخدمات الاستضافة الخاصة بنا.

المزود اسم الخدمة يعمل مع Discourse؟
Amazon AWS S3 نعم
Digital Ocean Spaces نعم
Linode Object Storage نعم
Google Cloud Storage نعم
Scaleway Object Storage نعم
Vultr Object Storage نعم
BackBlaze Cloud Storage نعم*
استضافة ذاتية MinIO نعم
Azure Blob Storage Flexify.IO نعم
Oracle Cloud Object Storage لا [1]
Wasabi Object Storage ربما
Cloudflare R2 نعم
Contabo Object Storage لا

إذا نجحت في تشغيل خدمة مختلفة، يرجى إضافتها إلى هذه الويكي.

التكوين

لتخزين الأصول الثابتة لـ Discourse في تخزين الكائنات الخاص بك، أضف هذا التكوين في ملف app.yml الخاص بك تحت قسم hooks:

  after_assets_precompile:
    - exec:
        cd: $home
        cmd:
          - sudo -E -u discourse bundle exec rake s3:upload_assets
          - sudo -E -u discourse bundle exec rake s3:expire_missing_assets

عند استخدام تخزين الكائنات، ستحتاج أيضًا إلى شبكة توصيل محتوى (CDN) لتقديم ما يتم تخزينه في الـ bucket. استخدمت StackPath CDN في اختباراتي، وبصرف النظر عن الحاجة إلى تعيين Dynamic Caching By Header: Accept-Encoding في تكوينها، فإنها تعمل بشكل جيد.

DISCOURSE_CDN_URL هي شبكة توصيل محتوى تشير إلى اسم النطاق الخاص بـ Discourse وتقوم بتخزين الطلبات. ستُستخدم بشكل رئيسي للأصول القابلة للسحب: CSS وأصول السمات الأخرى.

DISCOURSE_S3_CDN_URL هي شبكة توصيل محتوى تشير إلى bucket تخزين الكائنات الخاص بك وتقوم بتخزين الطلبات. ستُستخدم بشكل رئيسي للأصول القابلة للرفع: JS والصور وuploads المستخدمين.

نوصي بأن تكون هذه مختلفة وأن يقوم المسؤولون بتعيين كلاهما.

عدم استخدام شبكة توصيل محتوى (أو إدخال عنوان URL للـ bucket كعنوان URL لشبكة التوصيل) من المرجح أن يسبب مشاكل وغير مدعوم.

في الأمثلة التالية، https://falcoland-files-cdn.falco.dev هي شبكة توصيل محتوى مُعدة لتقديم الملفات الموجودة تحت الـ bucket. تم تعيين اسم الـ bucket إلى falcoland-files في أمثلتي.

يُوصى بتكوين هذه الإعدادات في متغيرات البيئة في ملف app.yml الخاص بك لأن هذا هو الطريقة التي تفعلها CDCK في بنيتها التحتية، لذا فهي مُختبرة جيدًا. أيضًا، تتم مهمة رفع الأصول بعد تجميع الأصول، وهو ما يحدث أثناء إعادة البناء. إذا كنت تريد تشغيل Discourse يعمل بشكل صحيح مع تخزين الكائنات منذ البداية، فيجب عليك تعيين متغيرات البيئة بحيث يتم رفع الأصول قبل بدء الموقع.

اختر مزود الخدمة من القائمة أدناه وأضف هذه الإعدادات إلى قسم env في ملف app.yml الخاص بك، مع تعديل القيم وفقًا لذلك:

AWS S3

ما ندعمه رسميًا ونستخدمه داخليًا. عرض CDN الخاص بهم Cloudfront يعمل أيضًا لتقديم ملفات الـ bucket. راجع Set up file and image uploads to S3 لمعرفة كيفية تكوين الأذونات بشكل صحيح.

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: us-west-1
  DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
  DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
  DISCOURSE_S3_CDN_URL: https://falcoland-files-cdn.falco.dev
  DISCOURSE_S3_BUCKET: falcoland-files
  DISCOURSE_S3_BACKUP_BUCKET: falcoland-files/backups
  DISCOURSE_BACKUP_LOCATION: s3

Digital Ocean Spaces

عرض DO جيد ويعمل خارج الصندوق. من المقبول تمكين تقييد سرد الملفات. المشكلة الوحيدة هي أن عرض CDN الخاص بهم معطل بشكل فظيع، لذا تحتاج إلى استخدام شبكة توصيل محتوى مختلفة للملفات. أيضًا، لا تحتاج إلى تثبيت قاعدة CORS، حيث يتم إعادة تثبيتها في كل إعادة بناء.

تكوين مثال:

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: whatever
  DISCOURSE_S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
  DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
  DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
  DISCOURSE_S3_CDN_URL: https://falcoland-files-cdn.falco.dev
  DISCOURSE_S3_BUCKET: falcoland-files
  DISCOURSE_S3_BACKUP_BUCKET: falcoland-files/backups
  DISCOURSE_BACKUP_LOCATION: s3
  DISCOURSE_S3_INSTALL_CORS_RULE: false 

Linode Object Storage

معلمة تكوين إضافية، HTTP_CONTINUE_TIMEOUT، مطلوبة لـ Linode.

تكوين مثال:

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: us-east-1
  DISCOURSE_S3_HTTP_CONTINUE_TIMEOUT: 0
  DISCOURSE_S3_ENDPOINT: https://us-east-1.linodeobjects.com
  DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
  DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
  DISCOURSE_S3_CDN_URL: https://falcoland-files-cdn.falco.dev
  DISCOURSE_S3_BUCKET: falcoland-files
  DISCOURSE_S3_BACKUP_BUCKET: falcoland-files/backup
  DISCOURSE_BACKUP_LOCATION: s3

Google Cloud Platform Storage

سرد الملفات معطل، لذا تحتاج إلى متغير بيئة إضافي لتخطي ذلك حتى تعمل الأصول. أيضًا، تخطي CORS وقم بتكوينه يدويًا.

:warning: نظرًا لأنه لا يمكنك سرد الملفات، فلن تتمكن من سرد النسخ الاحتياطية، وستفشل النسخ الاحتياطية التلقائية، لذا لا نوصي باستخدامه للنسخ الاحتياطية. ومع ذلك، يقترح البعض أنه إذا قمت بتغيير الدور من Storage Legacy Object Owner إلى Storage Legacy Bucket Owner، فإن النسخ الاحتياطية تعمل بشكل صحيح. راجع هذا الموضوع لمناقشة خاصة بـ Google Cloud.

هناك إضافة من طرف ثالث لتحسين التكامل على Discourse GCS Helper.

تكوين مثال:

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: us-east1
  DISCOURSE_S3_INSTALL_CORS_RULE: false
  FORCE_S3_UPLOADS: 1
  DISCOURSE_S3_ENDPOINT: https://storage.googleapis.com
  DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
  DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
  DISCOURSE_S3_CDN_URL: https://falcoland-files-cdn.falco.dev
  DISCOURSE_S3_BUCKET: falcoland-files
  #DISCOURSE_S3_BACKUP_BUCKET: falcoland-files/backup
  #DISCOURSE_BACKUP_LOCATION: s3

Scaleway Object Storage

عرض Scaleway جيد جدًا أيضًا، وكل شيء يعمل بشكل جيد في الغالب.

:warning: تدعم عمليات الرفع متعددة الأجزاء من Scaleway حدًا أقصى لـ 1,000 جزء. هذا لا يتطابق مع Amazon S3، الذي يدعم حدًا أقصى لـ 10,000 جزء. بالنسبة للمInstances الأكبر، سيسبب ذلك فشل النسخ الاحتياطية لـ Discourse، وقد تحتاج الرفع غير المكتمل إلى حذف يدوي قبل إجراء محاولات أخرى. بالنسبة للمInstances الصغيرة، لا توجد مشكلة. يبدو أن Scaleway منفتحة جدًا على التعليقات، لذا إذا كنت تريد تغيير هذا الحد، فيجب عليك الاتصال بهم.

لاحظ أنه لمعلمة DISCOURSE_S3_ENDPOINT، يستخدم Discourse نقطة نهاية المنطقة بأكملها: https://s3.{region}.scw.cloud. تأتي «نقطة نهاية الـ bucket» الموجودة في لوحة تحكم Scaleway على شكل https://{bucketName}.s3.{region}.scw.cloud. احذف نطاق البوابة الفرعية لمنع أخطاء الاتصال.

تكوين مثال:

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: fr-par
  DISCOURSE_S3_ENDPOINT: https://s3.fr-par.scw.cloud
  DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
  DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
  DISCOURSE_S3_CDN_URL: https://falcoland-files-cdn.falco.dev
  DISCOURSE_S3_BUCKET: falcoland-files
  DISCOURSE_S3_BACKUP_BUCKET: falcoland-files/backups
  DISCOURSE_BACKUP_LOCATION: s3

Vultr Object Storage

معلمة تكوين إضافية، HTTP_CONTINUE_TIMEOUT، مطلوبة لـ Vultr.

تكوين مثال:

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: whatever
  DISCOURSE_S3_HTTP_CONTINUE_TIMEOUT: 0
  DISCOURSE_S3_ENDPOINT: https://ewr1.vultrobjects.com
  DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
  DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
  DISCOURSE_S3_CDN_URL: https://falcoland-files-cdn.falco.dev
  DISCOURSE_S3_BUCKET: falcoland-files
  DISCOURSE_S3_BACKUP_BUCKET: falcoland-files/backup
  DISCOURSE_BACKUP_LOCATION: s3

Backblaze B2 Cloud Storage

تحتاج إلى تخطي CORS وتكوينه يدويًا.

هناك تقارير عن أن «تنظيف الرفع اليتيم» لا يعمل بشكل صحيح مع BackBlaze. يجب عليك تغيير قواعد دورة الحياة لـ bucket الخاص بك حتى يعمل التنظيف اليتيم.

تكوين مثال:

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: "us-west-002"
  DISCOURSE_S3_INSTALL_CORS_RULE: false
  DISCOURSE_S3_CONFIGURE_TOMBSTONE_POLICY: false
  DISCOURSE_S3_ENDPOINT: https://s3.us-west-002.backblazeb2.com
  DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
  DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
  DISCOURSE_S3_CDN_URL: https://falcoland-files-cdn.falco.dev
  DISCOURSE_S3_BUCKET: falcoland-files
  DISCOURSE_S3_BACKUP_BUCKET: falcoland-files/backup
  DISCOURSE_BACKUP_LOCATION: s3

ملاحظة: أثناء الهجرة الأولية إلى B2، قد تصل إلى حد المعاملات اليومية المجانية من الفئة C وهو 2500. ستحتاج إلى إضافة طريقة دفع لإزالة القيود.

MinIO Storage Server

هناك بعض التحذيرات والمتطلبات التي تحتاج إلى التأكد من استيفائها قبل استخدام خادم تخزين MinIO كبديل لـ S3:

  1. لديك خادم MinIO مُعد بالكامل
  2. لديك دعم النطاقات مفعّل في تكوين MinIO، لعناوين URL للـ buckets القائمة على النطاقات. هذا شرط إعداد إلزامي لـ MinIO و Discourse، حيث لا يزال MinIO يدعم أنماط «المسار» القديمة لـ S3 التي لم تعد مدعومة في Discourse.
  3. لديك تكوين DNS مُعد بشكل صحيح لـ MinIO بحيث تحل النطاقات الفرعية للـ buckets بشكل صحيح إلى خادم MinIO، ويتم تكوين خادم MinIO بنطاق أساسي (في هذه الحالة، minio.example.com)
  4. الـ bucket discourse-data موجود على خادم MinIO وله سياسة «عامة» مُعدة عليه
  5. يشير عنوان URL لشبكة توصيل محتوى S3 إلى شبكة توصيل محتوى مُعدة بشكل صحيح تشير إلى الـ bucket وتقوم بتخزين الطلبات، كما ذُكر سابقًا في هذا المستند.
  6. تم تكوين شبكات التوصيل الخاصة بك لاستخدام رأس «Host» لعنوان URL الأساسي لـ S3 فعليًا - على سبيل المثال، discourse-data.minio.example.com عند جلب البيانات - وإلا فقد يسبب مشاكل CORB.

بافتراض استيفاء التحذيرات والمتطلبات المذكورة أعلاه، سيكون تكوين مثال شيئًا مثل هذا:

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: anything
  DISCOURSE_S3_ENDPOINT: https://minio.example.com
  DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
  DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
  DISCOURSE_S3_CDN_URL: https://discourse-data-cdn.example.com
  DISCOURSE_S3_BUCKET: discourse-data
  DISCOURSE_S3_BACKUP_BUCKET: discourse-backups
  DISCOURSE_BACKUP_LOCATION: s3
  DISCOURSE_S3_INSTALL_CORS_RULE: false

سيظل CORS مفعّلًا على MinIO حتى لو لم يتم تثبيت القاعدة بواسطة إعادة بناء التطبيق - على ما يبدو افتراضيًا، يتم تمكين CORS على جميع أفعال HTTP في MinIO، ولا يدعم MinIO BucketCORS (واجهة برمجة تطبيقات S3) نتيجة لذلك.

Azure Blob Storage مع Flexify.IO

Azure Blob Storage ليس خدمة متوافقة مع S3، لذا لا يمكن استخدامه مع Discourse. هناك إضافة، لكنها معطلة.

أسهل طريقة لعرض واجهة متوافقة مع S3 لـ Azure Blob Storage هي إضافة خادم Flexify.IO الذي يترجم بروتوكول Azure Storage إلى S3.

حتى كتابة هذه السطور، الخدمة مجانية على Azure، وتحتاج فقط إلى مستوى VM أساسي جدًا (رخيص) لبدء تشغيلها. ومع ذلك، يتطلب ذلك بعض الإعداد.

  1. في بوابة Azure، قم بإنشاء مورد جديد من نوع Flexify.IO - Amazon S3 API for Azure Blob Storage.
  2. للاستخدام الخفيف، يبدو أن تكوين VM الأدنى يعمل بشكل جيد. يمكنك قبول معظم تكوين الافتراضي. تذكر حفظ ملف مفتاح PEM عند إنشاء VM.
  3. تصفح إلى رابط Flexify.IO VM، وأدخل النظام. اتبع التعليمات عن طريق إعداد موفر بيانات Azure Blob Storage ونقطة نهاية S3 المُنشأة. تأكد من أن إعداد نقطة النهاية Public read access to all objects in virtual buckets هو true. انسخ عنوان URL ونقاط نهاية S3.
  4. اضغط على New Virtual Bucket وأنشئ bucket افتراضي. يمكن أن يكون نفس اسم حاوية Azure Blob Storage الخاصة بك، أو يمكن أن يكون اسمًا مختلفًا. قم بربط أي حاوية (حاويات) لدمجها في هذا الـ bucket الافتراضي. يُستخدم هذا الـ bucket الافتراضي لعرض bucket قابل للقراءة علنًا عبر S3.
  5. افتراضيًا، يقوم Flexify.IO بتثبيت شهادة SSL موقعة ذاتيًا، بينما تتطلب نقطة نهاية S3 HTTPS. قم بتسجيل الدخول SSH إلى VM باستخدام ملف المفتاح (اسم المستخدم هو افتراضيًا azureuser)، واستبدل الملفات التالية بالملفات الصحيحة:
  • /etc/flexify/ssl/cert.pem - استبدل بملف الشهادة (ترميز PEM)

  • /etc/flexify/ssl/key.pem - استبدل بملف المفتاح الخاص (ترميز PKCS#8 PEM، وهو الذي يبدأ بـ BEGIN PRIVATE KEY وليس BEGIN RSA PRIVATE KEY وهو PKCS#1)

    هذه الملفات هي root لذا ستحتاج إلى sudo لاستبدالها. من الأفضل التأكد من أن الملفات البديلة لها نفس الملكية والأذونات مثل الملفات الأصلية، وهو ما يعني root:root وإذن 600.

  1. افتراضيًا، ينشئ Flexify.IO خدمة S3 على مستوى الجذر مع عدة buckets. يتطلب Discourse دعم sub-domain للـ buckets. اذهب إلى: <your Flexify.IO VM IP>/flexify-io/manage/admin/engines/configs/1 والذي سيفتح صفحة تكوين مخفية!
  2. حدد نطاق S3 الأساسي (قل إنه s3.mydomain.com) في حقل Endpoint hostname، والذي يجب أن يكون فارغًا افتراضيًا. اضغط على Save لحفظ الإعداد.
  3. أعد تشغيل Flexify.IO VM في بوابة Azure.
  4. في DNS الخاص بك، قم بربط s3.mydomain.com و*.s3.mydomain.com بعنوان IP لـ Flexify.IO VM.
  5. في Discourse، قم بتعيين التالي في صفحة المسؤول (نعم، لا حاجة للإعدادات في app.yml):
use s3: true
s3 region: anything
s3 endpoint: https://s3.mydomain.com
s3 access key: myaccesskey
s3 secret assess key: mysecret key
s3 cdn url: https://<azure-blob-account>.blob.core.windows.net/<container>
s3 bucket: <virtual bucket>
s3 backup bucket: <backup bucket>  (أي حاوية ستفي بالغرض، حيث لا يتطلب وصول قراءة عام وسيقوم Flexify.IO بعرضها تلقائيًا)
backup location: s3

لا يُنصح باستخدام نفس الـ bucket للإنتاج والتمهيد. إذا قمت بذلك على أي حال، فاتخذ إجراءات للتأكد من أن موقع التمهيد الخاص بك لا يحذف أصول الإنتاج (قم بتعيين s3 disable cleanup كحد أدنى، وراقب حذفه لنسخ الإنتاج الاحتياطية).

Wasabi

حاول @pfaffman استخدام Wasabi للنسخ الاحتياطية، لكنه بدا أنه يفشل بشكل متقطع وصامت، تاركًا النسخ الاحتياطية على القرص الصلب وملء القرص في النهاية. لم يكن لدى Wasabi ولا meta أي أدلة، لذا لا أنصح به، على الرغم من أن تجربتك قد تختلف. @pfaffman متأكد الآن إلى حد كبير من أن هذه المشكلة كانت بسبب النسخ الاحتياطية وإعادة التشغيل التلقائي المجدولة في نفس الوقت somehow؛ كان يُستخدم فقط للنسخ الاحتياطية، لكنه بدا يعمل بشكل جيد. إذا أراد شخص ما تجربته والإبلاغ هنا، فيجب أن يعمل، على الأقل للنسخ الاحتياطية.

Oracle Cloud

لا يدعم Oracle Cloud الوصول إلى الـ buckets بنمط المضيف الافتراضي ولن يعمل

Cloudflare R2

لتكوين Cloudflare R2، ستحتاج إلى تكوين الإعدادات ذات الصلة في لوحة تحكم Cloudflare تحت R2 Object Storage.

اعتمادًا على احتياجاتك (uploads أو نسخ احتياطية أو كليهما)، هذه هي الإعدادات ذات الصلة لإدراجها في ملف app.yml الخاص بك أو في Admin-All site settings ابحث عن S3:

  DISCOURSE_ENABLE_S3_UPLOADS: true
  DISCOURSE_S3_REGION: auto
  DISCOURSE_S3_ENDPOINT: https://<your-account-id>.r2.cloudflarestorage.com
  DISCOURSE_S3_ACCESS_KEY_ID: "xxx"
  DISCOURSE_S3_SECRET_ACCESS_KEY: "xxx"
  DISCOURSE_S3_UPLOAD_BUCKET: your-upload-bucket-name
  DISCOURSE_S3_CDN_URL: https://uploads.yourdomain.com
# DISCOURSE_S3_USE_CDN_URL_FOR_ALL_UPLOADS: true

  DISCOURSE_ENABLE_DIRECT_S3_UPLOADS: true
  DISCOURSE_S3_USE_ACLS: false
  
  DISCOURSE_BACKUP_LOCATION: s3
  DISCOURSE_S3_BACKUP_BUCKET: your-backup-bucket-name

إذا كنت لا تريد تحرير ملف app.yml، يمكنك فعل ذلك في واجهة المستخدم الإدارية:

“Admin → All site settings” (ابحث عن S3):

  • Enable S3 uploads = true
  • Enable direct S3 uploads = true
  • S3 access key ID = "xxx"
  • S3 secret access key = "xxx"
  • S3 region = any
  • S3 upload bucket = your upload bucket name
  • S3 endpoint = https://<your-account-id>.r2.cloudflarestorage.com
  • S3 CDN URL = https://uploads.yourdomain.com
  • S3 use ACLs = false (تعطيل هذا!)
  • S3 backup bucket = your backup bucket name
  • Backup location = S3

ملاحظات:

  1. أذونات رمز API: لأن Discourse لديه مجموعة واحدة فقط من حقول الاعتماد، يجب أن يكون رمز API الذي تنشئه في Cloudflare لديه صلاحية الوصول إلى كل من bucket الرفع وbucket النسخ الاحتياطي. عند إنشاء الرمز الخاص بك، اختر إما «تطبيق على جميع الـ buckets» أو استخدم «تطبيق على buckets محددة» وتأكد من تحديد كليهما. أيضًا، تأكد من تحديد Object Read & Write عند إنشاء مفتاح API (الافتراضي هو Object Read only فقط).

  2. عند نسخ عنوان URL للنقطة النهائية من Cloudflare، قد يضيف اسم الـ bucket إلى عنوان URL - يجب عليك حذف اسم الـ bucket من نهاية السلسلة في ملف .yml الخاص بك إذا تم لصقه.

  3. قم بإلغاء التعليق عن # DISCOURSE_S3_USE_CDN_URL_FOR_ALL_UPLOADS: true إذا كنت تريد استخدام bucket رفع R2 الخاص بك لجميع الـ uploads، بما في ذلك ملفات PDF وZIP. (لاحظ أن هذا سيجعل جميع الملفات المرفوعة متاحة علنًا عبر رابط مباشر)

  4. إذا تم تمكين DISCOURSE_ENABLE_DIRECT_S3_UPLOADS (true)، فيجب عليك تعطيل DISCOURSE_S3_USE_ACLS (false). هذا لأن Cloudflare R2 يستخدم أذونات على مستوى الـ bucket؛ يجب أن يكون bucket الرفع الخاص بك عامًا ويجب أن يكون bucket النسخ الاحتياطي خاصًا. لـ Cloudflare R2 uploads، لا تحتاج إلى تكوين مهام rake لقواعد CORS أو كتابة IAM json، لأنك ستقوم بتكوينه في لوحة تحكم Cloudflare عند إعداد أذونات الـ bucket الخاص بك. يمنح رمز «Object Read & Write» من Cloudflare تلقائيًا أذونات الرفع متعدد الأجزاء، ولصق قاعدة CORS التالية مباشرة في إعدادات bucket الرفع R2 في لوحة تحكم Cloudflare تحت CORS Policy يحل محل الحاجة إلى مهمة rake.

[
  {
    "AllowedOrigins": [
      "https://forum.yourdomain.com"
    ],
    "AllowedMethods": [
      "GET",
      "PUT",
      "POST",
      "DELETE",
      "HEAD"
    ],
    "AllowedHeaders": [
      "*"
    ],
    "ExposeHeaders": [
      "ETag"
    ],
    "MaxAgeSeconds": 3000
  }
]

Contabo

حاول @tuxed الحصول على عمل Contabo Object Storage لـ S3 Compatible uploads. يبدو أنه عند الرفع، يضيف اسم المستودع كبادئة في عنوان URL ولم يتمكن من جعله يعمل.

الـ Uploads الآمنة

الـ Uploads الآمنة مدعومة فقط لـ AWS S3. إذا فشل rake uploads:migrate_to_s3 الخاص بك، فيجب عليك إدخال هذه الأوامر لحسابها أولاً ثم وضع علامة عليها على أنها غير آمنة تلك الـ uploads، بشرط أن تعرف أنها لا تحتاج إلى أن تكون آمنة، وفي هذه الحالة، ستحتاج إلى استخدام AWS S3.

./launcher enter app
rails c
Upload.where(secure: true).count
Upload.where(secure: true).update_all(secure:false)

  1. لا يدعم Oracle Cloud الوصول إلى الـ buckets بنمط المضيف الافتراضي ولن يعمل ↩︎

69 إعجابًا
Defining DISCOURSE_S3_CDN_URL links to assets in S3 CDN URL
Backblaze S3 issue: duplicated uploads after delete
Migrate from AWS to Digital Ocean with 2 containers, spaces and 2 CDNs
Using Scaleway s3-compatible object storage
Extend S3 configuration for other s3 API compatible cloud storage solutions
Set up BackBlaze S3 with BunnyCDN
Can not access backup page and related error when restoring using GCP Object Storage
Setting up backup and image uploads to Backblaze B2
Upload assets to S3 after in-browser upgrade
What are the right settings to use S3 bucket (with non-Amazon URL)?
Issues with changing File/Image upload location to S3 Server from local storage
Hosting Optimization with Digital Ocean
Hosting Optimization with Digital Ocean
Theme modifiers: A brief introduction
Configure automatic backups for Discourse
Problem with Backblaze for backup- Failed to list backups from S3: Signature validation failed
Move from BackBlaze B2 to Digital Ocean Spaces
Which free storage for many images? also to be used for thumbnails etc
Migrate from AWS to Digital Ocean with 2 containers, spaces and 2 CDNs
Restore Failure - S3 (compatible) backup
Restore Failure - S3 (compatible) backup
Digitalocean block storage VS amazon S3
Digitalocean block storage VS amazon S3
Custom emoji don't use CDN for S3 stored assets in a few pages
Admin upgrade page doesn't load with a CDN
Install Discourse for Production Environment on Windows Server
Running Discourse on Azure Web Sites vs. Azure VM?
How to turn off S3 storage?
Access Denied error message when trying to upload images
What are the right settings to use S3 bucket (with non-Amazon URL)?
REQ: Support S3 backup to a service like Backblaze
REQ: Support S3 backup to a service like Backblaze
Using Scaleway s3-compatible object storage
Overwrite meta og:image image source to use externally public loaded images on topics?
How to store uploads with multiple web_only servers?
Can not edit topics with picture with S3 backend
Finding UI generated backup and restoring site
Looking for doc to connect discourse with digital ocean spaces
Looking for doc to connect discourse with digital ocean spaces
Looking for doc to connect discourse with digital ocean spaces
403 Error with digital ocean cdn
Link to headers (anchor links)
NoMethodError downcase s3_bucket_name absolute_base_url
What should I enter in the S3 CDN settings if I don't have a CDN?
Backing up files in Object Storage
Minio: A header you provided implies S3 functionality that is not implemented
Configure automatic backups for Discourse
S3 OVH Object Storage
File directory system
Unable to backup or navigate to backups
Uploads to AWS S3 and Configured CDN
Migration to a Self-Hosted solution from Kubernetes
How to develop discourse in a team?
Images didn't load after configuring S3 uploads
Need Azure blob storage
Use Google Cloud Storage Instead of S3
Run Discourse as docker swarm service
Move discourse uploads to free space on server
Strange behavior with Digital Ocean Spaces/S3 and lots of duplicated CORS rules for `example.com`
Can't upload PDF to S3
"canned acl" error when uploading images
AWS S3 Object Ownership
What’s your server configurations?
How to debug S3 uploads
Problems with Patreon Login, Force HTTPS, and S3 CDN (three) Issues
Cron task to sync local backups to DigitalOcean Spaces
Cron task to sync local backups to DigitalOcean Spaces
Problems with Patreon Login, Force HTTPS, and S3 CDN (three) Issues
Help restoring - system hung at midnight
Help restoring - system hung at midnight
Image upload error: The bucket does not allow ACL's
Make s3_region a string value
How can I set s3_force_path to true?
Install Discourse on a residential internet with Cloudflare Tunnel
S3 assets folder, is a cleanup needed?
BunnyCDN storage for automatic backups
BunnyCDN storage for automatic backups
Move Uploads and Backups to DigitalOcean Block Storage
Required local storage for URL referenced images vs. uploaded images?
Is DO Spaces CDN still broken? Any workarounds?
Is DO Spaces CDN still broken? Any workarounds?
Is DO Spaces CDN still broken? Any workarounds?
Basic How-To for Using MinIO storage server run by you for your Discourse Instance
Minio instead of S3?
Configure automatic backups for Discourse
S3 image bandwidth costs are getting annoying
S3 image bandwidth costs are getting annoying
Support for ImgBB image upload service
Install Discourse on Amazon Web Services (AWS)
Account creation not working with discourse_encrypt
Cannot load any images “Uncaught (in promise) no-response: no-response”
Tips on Google Cloud S3
Enable a CDN for your Discourse
Invalid URL for markdown-it-bundle
Not using volumes (or automatically using S3) when hosting with Docker
Configuring automatic backups
I have a problem with my proxy status
Inline PDF Previews
My images are not working
Getting error 422 invalid argument when configure S3 upload with GCS
SSL_connect returned=1 errno=0 peeraddr=162.243.189.2:443 state=error: certificate verify failed (Hostname mismatch)
SSL_connect returned=1 errno=0 peeraddr=162.243.189.2:443 state=error: certificate verify failed (Hostname mismatch)
Strange behavior with Digital Ocean Spaces/S3 and lots of duplicated CORS rules for `example.com`
My install broke after updating, how can I fix it?
Uploads Subdomain For Cloudflare
[PAID] Configure an S3 compatible object storage provider for uploads
Hetzner deleted my account, my server and I was left with nothing. What to do?
SSL_connect returned=1 errno=0 peeraddr=162.243.189.2:443 state=error: certificate verify failed (Hostname mismatch)
SSL_connect returned=1 errno=0 peeraddr=162.243.189.2:443 state=error: certificate verify failed (Hostname mismatch)
SSL_connect returned=1 errno=0 peeraddr=162.243.189.2:443 state=error: certificate verify failed (Hostname mismatch)
SSL_connect returned=1 errno=0 peeraddr=162.243.189.2:443 state=error: certificate verify failed (Hostname mismatch)
SSL_connect returned=1 errno=0 peeraddr=162.243.189.2:443 state=error: certificate verify failed (Hostname mismatch)
Understanding Uploads, Images, and Attachments
S3, Assets & CDN Error
Capacity planning / Resource requirements
Migrate assets to s3 rake tasks
Best option for DB and file Storage
Forum rendered unusable
Forum rendered unusable
Configure automatic backups for Discourse
Migrate Discourse broke S3 images
Configure automatic backups for Discourse
Cloud storage and cdn
Migrating uploads from S3 to local
Another discourse offline "bootstrap failed with exit code 5"
Another discourse offline "bootstrap failed with exit code 5"
AI Plugin Build Error - 'bundle exec rake db:migrate' failed
Your Docker installation is not working correctly - no space left on device - safe to use ./launcher cleanup?
Uncaught SyntaxError: forum spins nonstop and never loads
Why is my upload limit 100mb?It's set to 500mb
Trouble with Google Bucket for backup
Did I overwrite my site settings with a cross-instance backup/restore?
S3 and Cloudfront - Setup Not Working
S3 and Cloudfront - Setup Not Working
Need tips on making my forum faster
What should be the server requirements
SSL_connect returned=1 errno=0 peeraddr=162.243.189.2:443 state=error: certificate verify failed (Hostname mismatch)
Why you should use Discourse internally for your company/team instead of Slack (4 years use case)
Make s3_region a string value
Decoupled Discourse Application - Managed Redis, Managed Postgres, and DIgital Ocean Volume with Discourse
S3 and Cloudfront - Setup Not Working
Cannot upload images in mobile discourse
Cloudflare R2: Navigating Setup and Handling Configuration Errors
Cloudflare R2: Navigating Setup and Handling Configuration Errors
Cloudflare R2: Navigating Setup and Handling Configuration Errors
S3 assets broken after moving forum
Colored loading dots because assets not uploaded
Backup request via FTP
Error when doing "bundle exec rake s3:upload_assets" - Could not locate Gemfile or .bundle/ directory
Separate S3 access keys for backups and uploads?
Secure Uploads
Topic List Previews (legacy)
Disk usage spike during backup, Discourse crashed hard :-(
Make s3_region a string value
Favicon setup: "To work correctly over a CDN it must be a png"
Change image folder to symlinked folder
Migrating uploads from S3 to local
S3 Upload Confusion: Dashboard vs. app.yml
Old installation failing upgrade
Where are Images and uploads stored?
Rebuild issue: [Cannot set dual-stack in combination with a custom endpoint.]
Problem updating data in the separate database
Backup Files Not Showing in Discourse Backend After Uploading to Cloudflare R2
Resizing images off server
Unable to setup S3 bucket
Discourse Stuck on Loading (Logs)
Discourse Stuck on Loading (Logs)
Unable to setup S3 bucket
Rebuild failure - skipping "after_assets_precompile" section of app.yml
How to add AWS Cloudfront as a Discourse CDN
Unable to setup S3 bucket
Configured s3, but i want asset to serve locally
Configured s3, but i want asset to serve locally
Set up BackBlaze S3 with BunnyCDN
Discourse s3 backup folder
SSO broken after rebuild with stable v3.3.3
How to Configure Cloudflare R2 for your Discourse Community
如何批量修改文件链接地址
Can't migrate uploads to S3
Backup discourse from the command line
Stuck and lost updating forum, problems with PG migration
Can't rebuild due to AWS SDK gem bump and new AWS Data Integrity Protections
Can't rebuild due to AWS SDK gem bump and new AWS Data Integrity Protections
S3 (not AWS) backups stopped working, presumably since an update
Troubleshooting S3 Uploads: Site hangs after rebuild, JS assets fail to load with net::ERR_... on both R2 and GCS
Inquiry About Discourse’s Support for Amazon S3 Storage
Setting up backup and image uploads to Backblaze B2
Inquiry About Discourse’s Support for Amazon S3 Storage
Inquiry About Discourse’s Support for Amazon S3 Storage
Cloudflare R2 Storage Issues
Hetzner S3 support
Can the /var/discourse and /var/lib/docker folders be on different volumes?
An AWS S3 Integration with Discourse Tutorial would be nice
Issues with AWS CDN and S3
Digital Ocean Spaces (S3) "unable to sign request without credentials set"
Issues with AWS CDN and S3
Digital Ocean Spaces (S3) "unable to sign request without credentials set"
Digital Ocean Spaces (S3) "unable to sign request without credentials set"
Digital Ocean Spaces (S3) "unable to sign request without credentials set"
Digital Ocean Spaces (S3) "unable to sign request without credentials set"
为啥我的七牛云s3附件上传成功后,论坛中无法加载出来?
Imgur upload built into the post buttons
Backup discourse from the command line
Is Scaleway a good option for object storage?
Blackblaze&Cloudflare: image uploading works, but not showing in post
SMF2 Conversion and Rake to S3 Help
Backing up your forum
What causes rake uploads:fix_relative_upload_links
Running 2 hosts behind haproxy fails with random 404s
Site Blank After Rebuild
Rebuild goes into a loop
Backblaze S3 issue: duplicated uploads after delete
Migrate_to_S3 Fails on Rebake
Downloads coming from S3 even with DISCOURSE_S3_CDN_URL set
Errors trying to use custom S3 storage
Moving from one S3 bucket to another
S3 image bandwidth costs are getting annoying
Basic How-To for Using MinIO storage server run by you for your Discourse Instance
SSL error - can't upload images
Digital Ocean Spaces don’t implement the AWS S3 API for the CORS rule
Extend S3 configuration for other S3 API compatible services
How to separate uploaded files to another server
Storing Images in the cloud
Migrate_to_S3 Fails on Rebake
Cannot rebake after setting up CDN
High Availability 3 Server setup
Enable hidden setting to include S3 uploads in the backups
S3 error, when updating to 2.9.0.beta1
Azure Blob Storage Plugin
How might we better structure #howto?
Migrating uploaded files from DO to S3
Discourse as a closed wiki
Using multiple containers - what needs to be shared?
Virus scanning of uploaded files
Imgur images broken
Admin role conflates server admin and board admin
Error in rebuilding using minio as object store
Use WebTorrent to load media objects