إعلان عن دكتور Discourse

Following the example from Discourse-doctor 👩‍⚕️, I’ve created discourse-doctor, now included in discourse_docker. If you run ./discourse-doctor, you’ll see something like:

DISCOURSE DOCTOR Tue Jul 24 08:50:32 UTC 2018
OS: Linux twonames 4.4.0-130-generic #156-Ubuntu SMP Thu Jun 14 08:53:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


Found containers/app.yml

==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=twonames.ltcmp.net
SMTP_ADDRESS=mail.domain.com
DEVELOPER_EMAILS=REDACTED 
SMTP_PASSWORD=REDACTED 
SMTP_PORT=587
SMTP_USER_NAME=postmaster@cakeme.ltcmp.net
LETSENCRYPT_ACCOUNT_EMAIL=REDACTED 

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 18.05.0-ce, build f150324

DOCKER PROCESSES (docker ps -a)

CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS                    PORTS                                      NAMES
c75f29870c3b        local_discourse/app           "/sbin/boot"             5 days ago          Up 5 days                 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   app
adc8de3e5156        discourse/base:2.0.20180613   "/bin/bash -c 'cd /p…"   5 days ago          Exited (137) 5 days ago                                              quirky_zhukovsky


Discourse container app is running


==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git

No non-official plugins detected.

See https://github.com/discourse/discourse/blob/master/lib/plugin/metadata.rb for the official list.

========================================
Discourse version at twonames.ltcmp.net: Discourse 2.1.0.beta2 
Discourse version at localhost: Discourse 2.1.0.beta2 


==================== MEMORY INFORMATION ====================
OS: Linux
RAM (MB): 1016

              total        used        free      shared  buff/cache   available
Mem:            992         577          69          28         345         184
Swap:          2047         301        1746

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        25G   12G   13G  48% /

---------- Container Disk Space ----------
Filesystem      Size  Used Avail Use% Mounted on
overlay          25G   12G   13G  48% /
/dev/vda1        25G   12G   13G  48% /shared
/dev/vda1        25G   12G   13G  48% /var/log

==================== DISK INFORMATION ====================
Disk /dev/vda: 25 GiB, 26843545600 bytes, 52428800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 603625F3-7AE2-40CB-B05E-0BD7EA2D57E4

Device      Start      End  Sectors  Size Type
/dev/vda1  227328 52428766 52201439 24.9G Linux filesystem
/dev/vda14   2048    10239     8192    4M BIOS boot
/dev/vda15  10240   227327   217088  106M Microsoft basic data

Partition table entries are not in disk order.

==================== END DISK INFORMATION ====================

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Mail test skipped.

==================== DONE! ====================
The output of this program may be available at http://twonames.ltcmp.net/YzUwYjE5MzlmN2EyZTAz.txt
You should inspect that file carefully before sharing the URL.

You can examine the output of this script with 
LESS=-Ri less /tmp/discourse-debug.txt

BUT FIRST, make sure that you know the first three commands below!!!

Commands to know when viewing the file with the above command (called 'less'): 
q              -- quit
/error<ENTER>  -- search for the word 'error'
n              -- search for the next occurrence
g              -- go to the beginning of the file
f              -- go forward a page
b              -- go back a page
G              -- go to the end of the file

If the container isn’t running, discourse-doctor will attempt a rebuild and add the output of the build to the log file, which, if the container cranks up enough to have nginx, will be accessible via a URL, saving folks the trouble of uploading to something like pastebin. Passwords and email addresses are redacted by the script. Domain names are left intact, as there is rarely reason to hide your site given that it’s on the Internet already.

Right now, you have to know that discourse-doctor exists, but in the next few days, I’ll submit a PR to have launcher and discourse-setup recommend it.

Next Steps

  • have launcher recommend discourse-doctor
  • have discourse-setup recommend discourse-doctor
  • make the mail test rake task do some actual testing rather than just sending , like . . .
    – test connectivity to the port
    – does password work
    – SPF, DKIM, dmarc
    – tell them they can’t use gmail (should also add this to discourse-setup )
    – tell them what email address is in the from: line
  • have launcher disallow mixed case domain names
  • if rebuild rails, re-start old container – this is both trivial and huge, as I think few people know that if the rebulid fails you can just restart the container.
  • (tentative) do some kind of yml linting. It looks like launcher does some kind of yaml parsing in host_run . But part of me says “You break it. You bought it.”
  • consider handling files other than app.yml
  • have the doctor comment out plugins not from discourse github organization

If you have comments or suggestions, please let me know!

36 إعجابًا

Just ran this on a machine where the site was stopped. Was expecting a simple set of checks to be run and reported, was not expecting a rebuild with downloads to occur and the site to be started up. :grinning: Luckily I am only using the machine for learning at present so no harm. Maybe there should be a question asking the user if they want something that significant before proceeding.

The Doctor assumes that you want your site to be live. :wink:

Most of the checks that it does can be done only on a working installation.

3 إعجابات

Then I guess I need Discourse Autopsy.

9 إعجابات

هل تم إضافة هذا المطلب من قبل يا @pfaffman؟

أحاول تصحيح مشكلة عدم عمل Amazon SES، وهذه هي المخرجات من أداة discourse-doctor:

==================== اختبار البريد الإلكتروني ====================
لإجراء اختبار قوي، احصل على عنوان بريد من http://www.mail-tester.com/
أو أرسل ببساطة رسالة اختبار إلى نفسك.
عنوان البريد الإلكتروني للاختبار؟ (اكتب 'n' للتخطي) [rich@xxx.xxx]:
جاري إرسال البريد إلى rich@xxx.xxx...
رمز اختصار غير معروف: 'w' في -w
انظر 'docker exec --help'.

استبدال: SMTP_PASSWORD
استبدال: LETSENCRYPT_ACCOUNT_EMAIL
استبدال: DEVELOPER_EMAILS
استبدال: DISCOURSE_DB_PASSWORD
استبدال: جاري إرسال البريد إلى

==================== تم! ====================
هل ترغب في توفير نسخة عامة من هذا الملف؟ (Y/n)Y
رمز اختصار غير معروف: 'w' في -w
انظر 'docker exec --help'.
قد يكون مخرجات هذا البرنامج متاحًا على http://example.com/NTQyYTg2YzVjYzg1NTYx.txt
يجب عليك فحص هذا الملف بعناية قبل مشاركة الرابط.

يمكنك فحص مخرجات هذا السكربت باستخدام
LESS=-Ri less /tmp/discourse-debug.txt

لكن أولًا، تأكد من معرفتك للأوامر الثلاثة الأولى أدناه!!!

الأوامر التي يجب معرفتها عند عرض الملف بالأمر السابق (المسمى 'less'):
q              -- الخروج
/error<ENTER>  -- البحث عن كلمة 'error'
n              -- الانتقال إلى التكرار التالي
g              -- الانتقال إلى بداية الملف
f              -- الانتقال إلى الصفحة التالية
b              -- الرجوع إلى الصفحة السابقة
G              -- الانتقال إلى نهاية الملف

لم تصل أي رسالة بريد إلكتروني.

ولا أعرف السبب…

إما أن النسخة العامة من الملف لم يتم إنشاؤها، أو أنها غير متاحة، حيث أحصل ببساطة على خطأ ‘غير موجود’ عند زيارة الرابط.

يبدو أن الطريقة التي كان يعمل بها الرابط العام قد تعطلت. إنها نادرًا ما تُستخدم في الغالب. يجب حذفها.

اختبار SMTP يتحقق فقط من إمكانية الاتصال، لكنه لا يقوم بفحوصات DNS.

خطأ docker exec هذا يشير إلى وجود مشكلة هناك.

سأحاول إضافة ملاحظة حول عنوان الإرسال. لا يزال هذا مشكلة شائعة. يقوم Discourse بالإرسال من نطاق المنتدى الفرعي، وغالبًا ما يتوقع خادم البريد نطاق القمة (apex domain).

بخصوص مشكلة البريد الإلكتروني لديك، هل قمت بالاطلاع على استكشاف أخطاء البريد الإلكتروني في تثبيت Discourse جديد؟

إعجابَين (2)

بما أنه لا توجد معلومات تشخيصية في وحدة التحكم، كنت آمل أن يمنحني ملف .txt بعض التفاصيل.

لاحظت أيضًا أن عنوان URL للملف النصي هو http وليس https (وليس أن ذلك يغير شيئًا هنا على أي حال).

حسناً. ربما يعني خطأ Docker هذا أنه لم يعد يقوم بتشغيل اختبار SMTP على الإطلاق.

يجب عليك مراجعة دليل استكشاف الأخطاء وإصلاحها وتشغيل مهمة Rake التي تختبر SMTP.

سأفعل، شكراً على الردود.

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

بعد تشغيل سكريبت ./discourse-doctor، أجبت بنعم على سؤال “هل ترغب في تقديم نسخة عامة من هذا الملف؟” والآن أرى أن بيانات اعتماد البريد الإلكتروني (اسم المستخدم وكلمة المرور) مكشوفة.

أين وكيف يمكنني حذف السجلات/الملفات التي يولدها ./discourse-doctor بشكل دائم؟

همم. آسف على ذلك. أعتقد أن شيئًا ما قد تغير جعل دالة clean_up_log_file() لا تعمل بشكل صحيح بعد الآن، رغم أنني لست متأكدًا من السبب.

هل عنوان URL لمشاركة الملف يعمل حتى؟ أنا متأكد جدًا من أنه لم يكن يعمل آخر مرة تفقدت فيه.

يمكنك تشغيل rm /var/discourse/shared/standalone/public/*.txt. أو ابحث هناك عن الاسم الفعلي للملف واحذفه.

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

لقد حاولت العثور على الاسم الدقيق للملف (الاسم المستمد من عنوان URL) في الدليل الجذري. حذفت ملفين، لكن عنوان URL لا يزال يعرض معلومات السجل بالكامل. في النهاية، قررت إيقاف تشغيل الجهاز الافتراضي. على أي حال، كانت هذه تجربة مهمة بالنسبة لي: “كن حذرًا حقًا عندما تتعامل مع بيانات الاعتماد”

:wink:

إعجابَين (2)

نعم، أحصل على نفس خطأ Docker ولا توجد بريد إلكتروني

لم يعد تحت ../public/. تم العثور عليه تحت var/discourse/shared/standalone/log/var-log/*.txt

إذا تغير في المستقبل:
find -type f -name *.txt