تثبيت الإضافات على موقع مستضاف ذاتيًا

:warning: تفترض هذه الإرشادات أن لديك تثبيت قياسي مستضاف ذاتيًا. نحن ندعم فقط طريقة التثبيت القياسية هنا، لذا تفترض هذه التعليمات أن لديك تثبيتًا قياسيًا.

:warning: تنطبق هذه الإرشادات فقط على مثيلات Discourse المستضافة ذاتيًا. إذا كنت تستخدم خدمة استضافة مُدارة، فإن المكونات الإضافية المتاحة يتم التحكم فيها بواسطة مزود الاستضافة الخاص بك. على سبيل المثال، على الاستضافة الخاصة بنا، تتوفر هذه المكونات الإضافية المحددة حسب مستوى الاستضافة.

:information_source: اعتبارًا من منتصف عام 2025، تم تجميع العديد من المكونات الإضافية الرسمية الشائعة في نواة Discourse. لم تعد هذه المكونات الإضافية (بما في ذلك Solved و Data Explorer و AI و Assign و Reactions والعديد من المكونات الأخرى) بحاجة إلى التثبيت بشكل منفصل — فهي تأتي مع Discourse ويمكن تمكينها عبر إعدادات الموقع. إذا حاولت إعادة البناء مع وجود مكون إضافي مجمع لا يزال في ملف app.yml الخاص بك، فسترى رسالة HINT تخبرك بإزالته. هذا الدليل مخصص للمكونات الإضافية التي ليست مجمعة مع النواة.

في هذا البرنامج التعليمي، سنقوم بتثبيت المكون الإضافي Discourse Shared Edits.

يتطلب هذا البرنامج التعليمي فهم كيفية استخدام مستودعات GitHub، وتحديداً كيفية الحصول على أو نسخ عنوان URL لاستنساخ git وكيفية تعديل ملفات YAML (`.yml`) باستخدام nano عبر الطرفية، وتحديداً كيفية الحفظ والخروج في nano. تتبع ملفات YAML بشدة المسافات البادئة، لذا تأكد من احترامها عند النسخ واللصق وتعديل ملف `.yml` الضروري لمثيل Discourse الخاص بك. استخدم دائمًا المسافات كمسافات بادئة في ملفات .yml، وليس علامات الجدولة.

  • انسخ عنوان URL لاستنساخ git الخاص بالمكون الإضافي من GitHub.

  • قم بالوصول إلى ملف `app.yml` الخاص بالحاوية (الموجود في ` /var/discourse/containers/`)

    cd /var/discourse
    nano containers/app.yml
    
  • أضف عنوان URL لمستودع المكون الإضافي إلى ملف `app.yml` الخاص بالحاوية الخاصة بك:

    hooks:
      after_code:
        - exec:
            cd: $home/plugins
            cmd:
              - git clone https://github.com/discourse/docker_manager.git
              - git clone https://github.com/discourse/discourse-shared-edits.git
    

    أضف عنوان URL لاستنساخ git الخاص بالمكون الإضافي مباشرة أسفل السطر الذي يحتوي على `git clone https://github.com/discourse/docker_manager.git\`)

    اتبع التنسيق الحالي لسطر `docker_manager.git`. إذا كان يحتوي على `sudo -E -u discourse`، فقم بتضمين هذا البادئة في السطر الجديد أيضًا.

  • أعد بناء الحاوية:

    cd /var/discourse
    ./launcher rebuild app
    

    هذا كل شيء، لقد قمت بتثبيت المكون الإضافي Discourse Shared Edits بنجاح على مثيل Discourse الخاص بك!


إذا كان المكون الإضافي الخاص بك مستضافًا في مستودع خاص

يجب عليك استخدام رمز OAuth:

باستخدام رمز OAuth، يمكنك تثبيت المكون الإضافي الخاص بك بنفس طريقة المستودع العام، ولا تحتاج إلى إنشاء مفتاح SSH.

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
              - git clone https://<token>@github.com/owner/repo.git

ننصح بشدة باستخدام رموز OAuth للمكونات الإضافية في المستودعات الخاصة. ومع ذلك، إذا لم تتمكن من ذلك، فراجع أدناه.

خطوات التثبيت الخاص بمفتاح SSH
  • بافتراض أن مستودع git الخاص بك مستضاف على GitHub، تحتاج إلى إضافة مفتاح SSH العام الخاص بمستخدم الخادم الخاص بك إلى مفاتيح النشر في مستودع GitHub (https://github.com/SecretOrg/secret-plugin/settings/keys).

  • قم بتعديل ملف `app.yml` كما هو موضح في المثال أدناه:

run:
  - exec: echo "Beginning of custom commands"
  
  - exec: cd /var/www/discourse && sudo -u discourse bundle install --deployment --without test --without development
  - exec: echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /user/.ssh/config
  - file:
      path: /user/.ssh/id_rsa
      chmod: 600
      contents: |
        -----BEGIN RSA PRIVATE KEY-----
        MIIEogIBAAKCAQEArCQG213utzqE5YVjTVF5exGRCkE9OuM7LCp/FOuPdoHrFUXk
           .... إلخ ....
        -----END RSA PRIVATE KEY-----
  - file:
      path: /user/.ssh/id_rsa.pub
      chmod: 600
      contents: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tj .... إلخ .... user@discourse
  - exec: cd $home/plugins && git clone git@github.com:SecretOrg/secret-plugin.git
  - exec: cd $home && sudo -E -u discourse bundle exec rake db:migrate
  - exec: cd $home && rm -fr tmp/cache
  - exec: cd $home &&  sudo -E -u discourse bundle exec rake assets:precompile
  - exec: rm /user/.ssh/id_rsa
  - exec: rm /user/.ssh/id_rsa.pub

  - exec: echo "End of custom commands"
  • أعد بناء الحاوية:
cd /var/discourse
./launcher rebuild app

يجب تثبيت المكون الإضافي الخاص بك على مثيل Discourse الخاص بك.

كيفية إلغاء تثبيت مكون إضافي

لإزالة مكون إضافي، ما عليك سوى إزالة سطر `- git clone https://github.com/…` من ملف `app.yml` الخاص بك وإعادة بناء موقعك عبر

cd /var/discourse
./launcher rebuild app
173 إعجابًا
Discourse Slackdoor Plugin
How to create a new plugins?
Site maintenance mode during rebuilds?
Discourse Version 1.2
Embed Etherpad Lite pads into Discourse
Solved Button Plugin
Discourse Shared Edits
LDAP Setup for Discourse
About the Plugin category
Formatting toolbar
Wild Apricot login plugin
Can Plugins Be Added To Basic Docker Install
Discourse Mark Plugin
Quick Messages Plugin
Daemonite Material Theme
Installing Plugins with Git
News Plugin :newspaper:
How do i install plugins after doing a fork?
Installing new plugins
Tickets Plugin :tickets:
"Onebox Assistant", crawl for those previews reliably!
Does this software allow admin to put Adsense ads in?
LDAP Auth Missing from Plugins
Topic Ratings Plugin
Install plugins in your non-Docker development environment
Discourse BBCode
Admin Statistics Report
Watching Categories based on on group in discourse
How do you add plugins?
Generating lots of Invite Tokens
How to ad banners?
Bump Reset plugin - Annotated to help new devs
Projects management plugin
Category Page Plugin
Discourse Category Home :house:
User feedback plugin
Discord-rolesync plugin
Update private plugin without rebuilding the application
Application Files after Digital Ocean Setup
Discourse Code Review
Discourse Poison Fountain
Custom Trust Level
Discourse Doc Categories
Fatal: Not a git repository (or any parent up to mount point /discourse)
Fatal: Not a git repository (or any parent up to mount point /discourse)
How to add a Leaderboard link to the hamburger menu?
I need someone who can install a voting plugin
Custom Wizard Plugin :mage:
Introducing Font Awesome 5 and SVG icons
Click To Edit
Legal Compliance Plugin
Triggering account creation/login on external service when a user logs in on discourse
Community Network Visualisation
ListenBrainz
Subscription Plugin not working (Error)
Discourse-a2a-bbcode
Error using discourse-oauth2-basic plugin with NeonCRM
Question Answer Plugin
How might we better structure #howto?
How might we better structure #howto?
Discourse Posthog Plugin
Cannot install new plugins: structure needs cleaning
Slow Discourse Rebuild on a VM with slow disks
Calendar Core - Needs any special theme?
Discourse Notifier
Discourse CommonMark text highlighting?
Mumble -- VOIP Plugin for Discourse
Advice on Installing Plugins
Smallcaps formatting
Cannot install plugin - nothing happens
What else do I need to take care of when self hosting?
Humanmark for Discourse - Hardware-Backed Humanity Verification
Topic Ratings Plugin
Verifiable Credentials Plugin
Install Discourse for development using Docker
Installing discourse-math.git
Discourse Image Filter
Discourse Linkify Google Sheets
Discourse Voting missing table on postgresql
Discourse Signatures
Discourse BBCode Color
Discourse Post Sorting Customizer
Unikname Connect plugin
Discourse Video Upload Plugin with YouTube and Vimeo
Quoting not working
User profile by ID instead of username
"Onebox Assistant", crawl for those previews reliably!
Error after update failed today: [rake themes:update assets:precompile]
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return
Votes don't Merge when we combine posts
Discourse Video Inline
Discourse User Feedback
LDAP Setup for Discourse
I need someone who can install a voting plugin
Availability of OpenID Connect in hosted plans
Codebytes Plugin
Multiple Users posting under same User or Group name?
What makes a successful volunteer Discourse sysadmin?
Not able to install any Discourse plugins
How to install the lazy-yt plugin
Issue With Sitemap
Discourse Private Replies
Google One Tap Login/Signup
Landing Pages Blog :small_airplane:
Search Thumbnails
Group Invitation Plugin
Discourse Mailgun Routes
Word Cloud plugin
Geo Blocking plugin
Post folding
Signed Google Cloud CDN URLs
Google Groups Link Plugin
Discourse LinkedIn Authentication
Discourse VK Authentication (vkontakte)
Discourse OneDrive Picker
Discourse BCC
Discourse Prometheus
Discourse Dictionary Plugin :ab:
Category Restrictor plugin
Dumbcourse – Old-browser friendly UI at /dumb (D-pad + small screens)
Slack Bot Construction Kit :robot:
Discourse Authorship Plugin
Discourse Livestream
Locked out from WinSCP and can't Install Plugins!
Create custom Automations
Affiliate link functions - rewrite
🤖 Discourse llms.txt Generator Plugin
Editing a table whose some rows don't start with a pipe duplicate these rows
How to: discourse-sitemap is deprecated and merged into Discourse's core. Please remove it from your app.yml file.?
How to update plugins manually from the command line?
Introducing Discourse Chat (BETA)
Landing Pages Blog :small_airplane:
Discourse Restricted Replies
Discourse Yearly Review
Discourse Saved Searches
Discourse Intercom (Advanced)
Discourse Salesforce
Sign-In with Ethereum plugin
Discourse GitHub Verification
Discourse Algolia Search
Discourse Characters Required
Discourse No Bump
Discourse Teambuild
Installing Plugins in Discourse 101 for super-super dummies
Discourse Tooltips
Discourse Steam Login
Should I update my app.yml file?
Discourse Reach and Rights
Not enough space to rebuild
Landing Pages Plugin :small_airplane:
Configure OneLogin's SAML for Discourse
Plugin to Post Anonymous Thread via PN or give anonymous Feedback
Migrate a phpBB3 forum to Discourse
Discourse Codeberg Login
Mentionables
Discourse hosting on Linode?
Can I use the Subscriptions plugin on my own server?
Embed comments from Discourse in your single page app
Discourse Confused About the Number of Posts in a Topic?
How to show Full Name in Embeds
Restrict users to post certain words per category
Microsoft Graph Mail Poller
Allow-pm-to-staff
Snapblocks
Discourse AI Topic Summary :robot:
Animated Avatar
Discourse Who's Online
Discourse Google Perspective API
Discourse Newsletter Integration
Discourse Docs
Gitcoin Passport Plugin
Discourse Math Editor
Rebuilding the container is constantly failing after following the standard instructions on plugin install
ActivityPub Plugin
Modal Window
Silenced Avatar Flair
Discourse Staff Alias
Discourse GCS Helper
Topic List Previews (TLP)
Discourse Another SMTP
Can more than one post be selected as the solution?
Can more than one post be selected as the solution?
I need help on installing a plugin
Discourse Follow
Custom Topic Button (group)
Discourse FontAwesome Pro
Discourse Zoom
Rocket.Chat SSO + embed plugin
Discourse blog (article and comments)
Stop Forum Spam Plugin
Email Extension
NFT avatar
Discourse Mingle
How can I install my own plugin written in Ruby?
Discourse MusicBrainz Onebox
Custom Topic Button
No editor preview while editing after upgrading to 3.x
Better-Anonymous
Error during upgrading from Beta 3.1.x to latest
Signatures plugin not in the /admin/plugins page
Category Moderators Enhancer
Are plugins free using the open-source, self-host option?
Monero Subscriptions Plugin
:cn: Discourse Math 插件
Discourse Signatures
Discourse Audio Message
Discourse Jira
Randomized Banner
🏆 Discourse Rich JSON-LD Microdata Plugin
Private Topics Plugin
Install discourse doc plugin from Git is failed
Discourse Restrict PMs to certain Groups
Discourse Chatbot :robot:
🖼️ Topic Gallery
Data Explorer Tutorial - Part 1 - Writing Your First Query
Option for scheduled replies
Discourse Disable Browser History Experiment
Publish Direct Messages
Discourse Authentication Validations
Discourse Provide Full Name in Mentions
Disable Email Verification for Discourse Plugin
Discourse send PDF inline
Discourse Anonymous Post
Indisposable Email - block disposable email domains
Discourse-embed-bilibili(在discourse中插入哔哩哔哩视频)
Set user registration IP address API endpoint
Trading Buttons
Installing discourse follow plugin in development (boot_dev) setup — no app.yml file
Locations Plugin :earth_africa:
User Response Times
Contact Form
Babble Chat
Discourse mail daily summary plugin
Discourse Preset Topic Composer
Discourse Custom Topic Lists
Highest-Post Excerpts in Topic List
What to Expect When Rebuilding Discourse
Discourse Points Mall (Check-in, Shop, Orders, Makeup Cards, Ledger)
Seen lots of threads asking if Discourse is free when self hosted but nothing about the plugins
Rebuilding Forum (Restoring back-up works, rebuilding does not)
Discourse Surveys
Login Helper Plugin
Can't install reaction plugin
Error when installing Advertising
Globally replace translations
Discourse Retort
Discourse Translator
Discourse Category Experts
Discourse Chat Bridge (Telegram)
Trading Buttons
Discourse Disorder
Discourse AI plugin with self hosted discourse site
Hubot Adapter for Discourse
Discourse No Bump
CJK Formatter Plugin
Self-hosting Index
SCIM Plugin
Journal Plugin
Problem installing docs
How to install and configure AI features step by step
Discourse Encrypt (deprecated)
Discourse Open Graph
Turbowarp plugin
Discourse Workflow
Question about Docker Manager?
Moderation API Plugin
Discourse OpenID Connect (OIDC)
Dark Visitors
Discourse Dynamic Groups
Custom Summary Gist
Created as Default Sort Order
Topic List Previews (TLP)
Allow Title-Only Onebox
How to install the plugin on bitnami's repository
Discourse BBCode Tabs Plugin
Unable to rebuild app - failed with exit code 1
📞 diskuz Call – Voice and video calls inside Discourse (P2P, no external apps)
I broke my site while updating it
I broke my site while updating it
Collections
Can Discourse ship frequent Docker images that do not need to be bootstrapped?
Push notifications for iPhone and Android apps
Highest-Post Excerpts in Topic List
Automation script: Move topic on close
Error installing theme from Github
Discourse Amazon SNS notifications
Best practices of keeping track of feature requests
Contact Form
No Bump First Post Plugin
How to Install Discourse Plugins Hosted in Private Repositories Using SSH Key?
How to Install Discourse Plugins Hosted in Private Repositories Using SSH Key?
How to Install Discourse Plugins Hosted in Private Repositories Using SSH Key?
National Flags (fork)
What's yall's work-flow like?
Discourse Suggested Edits
VK ID OAuth 2.1 Authentication for Discourse
🔐 Yandex ID OAuth2 Authentication for Discourse
Discourse Daily Challenges
Discourse Bilibili Onebox
Discourse Member Application
Time Registration plugin
Category Event Policy
Calendar RSVP Posts
Topic List Previews (TLP)
ReplyGif
Discourse User Location
什么时候可以在管理后台直接安装插件?
Gitee 码云登录插件
Upgrading Mathjax to version 4
Updates no longer in the Admin UI?
Tag Intersection Navigator
How to make a discourse forum look like forum.glamour.de
[Solved] Admin-upgrade page not showing up
Synchronizer-base for any backup provider
"Your Docker installation is not using a supported storage driver."
Formatting issues adding plugins to app.yml
Solution icon does not show in posts
Fixing problems with rebuild app
Auto Bookmarks plugin
Force specific users through moderation
Homepage Filter plugin
Discourse Group User Status
Voice recording plugin
How to hook up JWT Single Sign On to Discourse
Should all plugins be cloned as the `discourse` user?
How I can add plugin to my discourse
OAuth2 integration with Drupal
Discord Sync: sync a Discourse forum with a Discord server
No option appears to choose better answer
Discourse Avatar name_first_letter
Auto-suspend inactive users
Algolia plugin indexation
Telegram Notifications Plugin (discourse-telegram-notifications)
Trying to install plugin (But not working)
How to break 99k char limit?
How to edit plugins code?
I want to install a plugin for development, what should I do?
News Plugin :newspaper:
Azure Blob Storage Plugin
./launcher rebuild app error './launcher: No such file or directory'
Discourse Wikilinks Plugin
SSO for College Account
Should all plugins be cloned as the `discourse` user?
Developing Discourse Plugins - Part 6 - Add acceptance tests
Favorites - select your favorite categories
Why do I need a block storage?
Plugin for Preventing Malicious Linking
Discourse Fingerprint - Browser Fingerprinting Plugin
Solved Reminders Plugin
Sidebar with categories
Merge Users Plugin
Events Plugin :calendar:
Unable to find /plugins dir
Pwned Passwords Validator
Launcher rebuild app does nothing
Business plugins and install on-premise
Private repo on Github
Discourse Dice Roller (RogerBW)
Any options for over-riding the username restrictions?
Collude - a collaborative text editor for Discourse
Can I access Discourse forum Database to use for PowerBI reporting?

عذرًا على سؤالي الغبي، ولكن كيف أعرف ما إذا كان يجب تضمين sudo -E -u discourse أم لا في عبارة git clone؟

3 إعجابات

كيف يبدو سطر docker_manager الخاص بك؟

4 إعجابات

لم يكن لدى الإدخالات الأخرى في ملف app.yml الخاص بي جزء sudo لذلك حذفته وقد نجح الأمر حتى الآن

5 إعجابات
- exec: echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /user/.ssh/config

يبدو أن هذه الطريقة لم تعد تعمل.

sh: 1: cannot create /user/.ssh/config: Directory nonexistent

مع مستودع GIT الخاص بي المستضاف ذاتيًا، أود حقًا استخدام مفاتيح SSH.

3 إعجابات

لا تحتاج إلى مفتاح ssh في الحاوية، فقط احذف هذا:

إعجاب واحد (1)

عذرًا، لا أعتقد أنني أتابع..

المستودع الخاص بي يمكن الوصول إليه عبر ssh. كيف يمكنني استنساخ إضافة بدون مفتاح SSH؟

إعجاب واحد (1)

أوه. ربما أكون مخطئًا. إذن ربما تحتاج إلى إنشاء هذا الدليل بالأذونات الصحيحة م

إعجاب واحد (1)

المربك هو أن جزءًا من الأوامر في الأمثلة يجب تشغيله كـ root وجزء كمستخدم discourse. لا يبدو أن هذا متسق للغاية.

  - exec: cd $home/plugins && git clone git@github.com:SecretOrg/secret-plugin.git

على عكس

  - exec: cd $home && sudo -E -u discourse bundle exec rake db:migrate

سأقوم ببعض البحث في shell الحاوية قيد التشغيل.

تثبيت هذه الإضافة معقد بعض الشيء. سيكون من الرائع لو أمكن جعله مثل تثبيت سمة.

إعجابَين (2)

سيقوم Dashboard.literatecomputing.com بتثبيت الإضافات ببضع نقرات. يمكنك استخدامه مجانًا عن طريق الانضمام إلى مجموعة التجربة المجانية.

4 إعجابات

@Discourse، إذا كنت ترغب في تحديث الدليل، فإليك الرمز الذي يعمل:

لاستخدام مفاتيح SSH الخاصة بك للوصول إلى مستودع خاص، اتبع الخطوات التالية:

  1. ضع مفتاح SSH الخاص في /var/discourse/shared/standalone/identity/id_rsa (أو موقع آخر يمكن للحاوية الوصول إليه؛ إذا اخترت موقعًا مختلفًا، فتذكر تحديث المسار في القالب أدناه وفقًا لذلك).

  2. استخدم القالب التالي لإضافة المكونات الإضافية الخاصة بك:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          # تعيين الوصول إلى المستودع الخاص
          - chown $(whoami) /shared/identity/id_rsa && chmod 600 /shared/identity/id_rsa
          - git config --global core.sshCommand "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i /shared/identity/id_rsa"

          # المكونات الإضافية الخاصة بي
          - git clone git@example.com:repo/private-discourse-plugin.git

          # إلغاء تعيين الوصول
          - git config --global --unset core.sshCommand
5 إعجابات

شكرا لك على شيء لا أحتاجه، لكنني أعيش ببساطة أصلية.

هل تريد شرح سبب استخدام مثالك؟ هل هذا بسبب:

استخدم مفاتيح SSH الخاصة بك للوصول إلى مستودع خاص

إعجاب واحد (1)

لماذا لا تستخدم رمزًا مميزًا في عنوان URL؟

إعجاب واحد (1)

حسنًا، لدينا أدوات لحل هذا اللغز :winking_face_with_tongue:

فهم فائدة مقتطفات تكوين الحاوية AI

Jagster:

لماذا قد يرغب شخص ما في استخدام هذا المقتطف في container/app.ym

gpt-4o:

للإجابة على سؤالك بفعالية، أحتاج إلى فهم السياق المحيط بالمقتطف المحدد في container/app.yml. هل يمكنك تقديم المزيد من التفاصيل أو المقتطف الفعلي الذي تشير إليه؟ بهذه الطريقة، يمكنني أن أقدم لك شرحًا دقيقًا ومفيدًا.

Jagster:

آسف، لكنني كنت بحاجة إلى هذا الملحق.

هذا هو المقتطف:

“”"

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          # Set private repo access
          - chown $(whoami) /shared/identity/id_rsa && chmod 600 /shared/identity/id_rsa
          - git config --global core.sshCommand "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i /shared/identity/id_rsa"

          # My private plugins
          - git clone git@example.com:repo/private-discourse-plugin.git

          # Unset access
          - git config --global --unset core.sshCommand

“”"

gpt-4o:

شكرًا لك على تقديم المقتطف. يُقصد تضمين مقتطف YAML هذا في ملف تكوين container/app.yml لمثيل Discourse. دعنا نفصل ما يفعله:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          # Set private repo access
          - chown $(whoami) /shared/identity/id_rsa && chmod 600 /shared/identity/id_rsa
          - git config --global core.sshCommand "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i /shared/identity/id_rsa"

          # My private plugins
          - git clone git@example.com:repo/private-discourse-plugin.git

          # Unset access
          - git config --global --unset core.sshCommand

شرح

  1. تعيين الدليل:

    cd: $home/plugins
    

    يغير هذا دليل العمل إلى المكان الذي توجد فيه المكونات الإضافية ($home/plugins).

  2. تعيين الوصول إلى المستودع الخاص:

    - chown $(whoami) /shared/identity/id_rsa && chmod 600 /shared/identity/id_rsa
    - git config --global core.sshCommand "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i /shared/identity/id_rsa"
    
    • يغير ملكية مفتاح SSH الخاص (id_rsa) إلى المستخدم الحالي ويضبط أذوناته على 600.
    • يقوم بتكوين Git لاستخدام أمر SSH مخصص يستخدم مفتاح SSH الخاص المحدد ويعطل التحقق الصارم من مفتاح المضيف.
  3. استنساخ المستودع الخاص:

    - git clone git@example.com:repo/private-discourse-plugin.git
    

    استنساخ مستودع Git خاص يحتوي على مكون إضافي لـ Discourse.

  4. إلغاء تعيين أمر SSH:

    - git config --global --unset core.sshCommand
    

    إعادة تعيين تكوين أمر SSH الخاص بـ Git إلى حالته الافتراضية.

متى ولماذا تستخدم هذا المقتطف

  1. المستودعات الخاصة: إذا كان لديك مستودع مكون إضافي خاص لـ Discourse غير متاح للجمهور ويتطلب مصادقة قائمة على مفتاح SSH.

  2. الأتمتة: يساعد هذا البرنامج النصي في أتمتة عملية إعداد الوصول إلى المستودع الخاص، واستنساخه، وضمان إعادة تعيين البيئة بعد ذلك. هذا مفيد لإعدادات النشر المستمر أو توفير الخادم الآلي.

  3. إدارة الأمان: يتعامل مع مفاتيح SSH بأمان (ضبط أذونات الملفات ثم إلغاء تعيين أمر SSH المخصص)، وهو أمر بالغ الأهمية للحفاظ على وضع الأمان أثناء عمليات النشر الآلية.

اعتبارات هامة

  • تأكد من إدارة مفتاح SSH الخاص بك (id_rsa) بشكل آمن وعدم تعرضه.
  • تحقق من تعيين الملكية والأذونات بشكل صحيح لسياسات الأمان الخاصة بك.

لمزيد من المعلومات التفصيلية والسياقات حول app.yml والخطافات في Discourse، يمكنك التحقق من وثائق Discourse ذات الصلة.

إذا كانت لديك أي أسئلة أخرى أو كنت بحاجة إلى تفاصيل إضافية حول التكوين، فلا تتردد في السؤال!

3 إعجابات

مرحباً! يبدو الأمر رائعاً! لكنني لا أعرف كيف يجب أن أتابع بعد الانضمام إلى مجموعة التجربة المجانية! من فضلك، @pfaffman، هل يمكنك مساعدتي؟ أنا أتطلع إلى تثبيت إضافة SAML. سيكون من الرائع اختبار Literate Computing لتثبيتها وتشغيلها!

شكراً!

إعجابَين (2)

مقتطف القالب الخاص بي مخصص للحالات التي لا تملك فيها أي وسيلة أخرى للوصول إلى مستودع Git بخلاف مفتاح SSH (على سبيل المثال، مع مستودع Git مستضاف ذاتيًا خلف SSH).

5 إعجابات

ما كان سيساعدني هو لو قالت هذه التعليمات شيئًا مثل، “يا غبي! لا تقم بتشغيل الأمر git clone من الواجهة. فقط أضف الأمر إلى ملف app.yml وفقًا للمثال، وتأكد من أن المسافات البادئة صحيحة، واحفظه، ثم قم بتشغيل أمر إعادة البناء.”

يمكن أن تكون هذه التعليمات أوضح أيضًا عندما تكون -E -u ضرورية ومتى لا تكون كذلك.

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

6 إعجابات

أنا لست خبيرًا، لذا تحمل معي…
بالأمس قمت بتثبيت Discourse والآن أحاول تثبيت إضافة.
هل أحتاج إلى تشغيل:
./launcher rebuild app

أم يمكنني فقط تشغيل:
./launcher destroy app
ثم
./launcher start app
؟

تشغيل ./launcher rebuild app يستغرق وقتًا طويلاً ويؤدي إلى توقف موقعي عن العمل أو يصبح بطيئًا جدًا.

إعادة البناء هي الطريقة الوحيدة لتثبيت الإضافات. تدمير وبدء الاستخدام فقط باستخدام التكوين القديم.

ولكن لا تدمير أي شيء قبل إعادة البناء. لأنه إذا فشل إعادة البناء يمكنك وضع القديم على الإنترنت باستخدام الأمر start.

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

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

إعجابَين (2)