Most plugins carry all the code they need and have a simple install. Those two you tried to use need to fetch gems (libraries) from the internet to able to function.
do you know where in the code those ruby gem fetches for plugins happen? I tried looking for it but haven’t found the right place yet.
I’m thinking maybe instead of using cached gems maybe it would be more elegant to run a rubygems mirror on the isolated host, i found a tutorial here and it looks like you can configure extra system-wide gem sources
نظام Discourse الداخلي لدينا يعمل بسعادة على نفس الإصدار القديم لفترة طويلة، لكننا نعتزم أخيرًا التخلي عن IE9، لذا فإن الترقية أصبحت متأخرة للغاية.
يمكنني تأكيد أن هذا الدليل لا يزال صالحًا مع أحدث إصدارات Discourse، حتى مع استخدام RHEL8 بدلاً من الإصدار 7 ![]()
أثناء التجريب، تمكّنتُ من إيجاد طريقة لجعل إضافتي discourse-prometheus و discourse-calendar تعملان في وضع عدم الاتصال أيضًا، رغم وجود التبعيات الإضافية. كانت الحيلة هي استخراج حزم Ruby من دليل الإضافات على خادم البناء، بالإضافة إلى تلك الموجودة في /var/www/discourse/vendor/bundle/ruby
docker run -it -v ~/local/rubygems.org:/local-rubygems local_discourse/app /bin/bash -c "cp -rv /var/www/discourse/vendor/bundle/ruby /local-rubygems"
docker run -it -v ~/local/rubygems.org/plugin-gems/discourse-calendar:/local-rubygems local_discourse/app /bin/bash -c "cp -rv /var/www/discourse/plugins/discourse-calendar/gems /local-rubygems"
docker run -it -v ~/local/rubygems.org/plugin-gems/discourse-prometheus:/local-rubygems local_discourse/app /bin/bash -c "cp -rv /var/www/discourse/plugins/discourse-prometheus/gems /local-rubygems"
ثم في الملف /templates/web.template.yml:
- exec:
cd: $home
hook: bundle_exec
cmd:
# نسخ ذاكرة التخزين المؤقت المحلية لـ Ruby
- cp -rv /local-rubygems.org/ruby/* $home/vendor/bundle/ruby/
- cp -rv /local-rubygems.org/plugin-gems/* $home/plugins/
- su discourse -c 'bundle install --local --deployment --retry 3 --jobs 4 --verbose --without test development'
بالمناسبة، يبدو أن موضوع المصادقة الموحدة (SSO) عبر Active Directory و IIS قد ضاع في مرحلة ما، لكن الكود لا يزال متاحًا على GitHub - laktak/discourse-sso: Single Sign On for Discourse with Active Directory · GitHub ولا يزال يعمل مع نظام DiscourseConnect SSO الذي تم تغيير اسمه مؤخرًا.
لقد جربت ترقية أخرى ويبدو أنه في مرحلة ما تمت إضافة قسم “yarn install” جديد إلى web.template.yml مما يؤدي إلى فشل داخل البيئة المعزولة.
- exec:
cd: $home
cmd:
- "[ ! -d 'node_modules' ] || su discourse -c 'yarn install --production && yarn cache list'"
عند مقارنة محتويات الحاوية القديمة والجديدة، يبدو أن هناك مجموعة من حزم yarn المخزنة مؤقتًا في /usr/local/share/.cache/yarn/v6 في الحاوية الجديدة، ولكن لا شيء في الحاوية القديمة. أفترض أن جميع حزم node.js المطلوبة كانت مدرجة في الصورة الأساسية، ولكن الآن يتم تحديثها أثناء إعادة البناء؟
سأقوم بتجربة نسخ ذاكرة التخزين المؤقت لـ yarn بنفس الطريقة التي تم بها نسخ ذاكرة التخزين المؤقت لـ ruby ، وأرى ما إذا كان بإمكاني جعل yarn يستخدم الحزم المخزنة مؤقتًا من صندوق البناء.