يشرح هذا الدليل كيفية تسجيل الدخول مرة أخرى إلى Discourse كمسؤول عندما تكون قد أُغلِق عليك الوصول.
مستوى المستخدم المطلوب: مسؤول
إذا قمت بحبس نفسك خارج مثيل Discourse الخاص بك بسبب تكوين Discourse Connect (SSO) غير صالح، أضف /u/admin-login إلى نهاية عنوان URL الأساسي لمنتدىك:
https://discourse.example.com/u/admin-login
سيأخذك هذا إلى صفحة تسجيل دخول المسؤول:
أدخل عنوان بريدك الإلكتروني كمسؤول وانقر على إرسال البريد الإلكتروني (Send Email) . يوجد أيضًا مربع اختيار الوضع الآمن (Safe Mode ) ، والذي عند تفعيله، سيعطّل جميع السمات والإضافات عند تسجيل الدخول — وهو أمر مفيد إذا كانت سمة أو إضافة معطوبة تسبب مشاكل.
سيتم إرسال بريد إلكتروني إليك يحتوي على رابط تسجيل دخول يتجاوز Discourse Connect ووضع القراءة فقط، مما يسمح لك بتسجيل الدخول حسب الحاجة.
إذا كان لديك المصادقة الثنائية ممكّنة، فستظل بحاجة إلى إدخال رمز المصادقة الخاص بك.
طريقة بديلة تتطلب الوصول إلى الطرفية
تعطيل Discourse Connect
cd /var/discourse
./launcher enter app
rails c
irb > SiteSetting.enable_discourse_connect = false
irb > SiteSetting.enable_local_logins = true
irb > exit
exit
تعطيل وضع القراءة فقط
cd /var/discourse
./launcher enter app
rails c
irb > Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)
irb > exit
exit
18 إعجابًا
nory
14 يناير 2023، 8:39م
6
مرحباً، لا يمكنني الوصول إلى المنتدى الخاص بي.
لقد قمت بتمكين وضع القراءة فقط ولكن الآن لا يمكنني الوصول إلى المسؤول.
عندما أذهب إلى “/u/admin-login” وأدخل البريد الإلكتروني الخاص بالمسؤول، أتلقى هذا الخطأ:
“{"errors":["الموقع في وضع القراءة فقط. التفاعلات معطلة."],"error_type":"read_only"} ”
وأيضًا عبر الوصول إلى وحدة التحكم لا يعمل
كيف يمكنني حل هذه المشكلة؟
شكراً مقدماً
إعجابَين (2)
أعتقد أنه يمكنك تشغيل هذا في وحدة تحكم Rails لإيقافه:
Moin
13 يونيو 2025، 6:37ص
10
[اقتباس=“Discourse, post:1, topic:89605”]
ووضع القراءة فقط، مما يسمح لك بتسجيل الدخول حسب الحاجة.
[/اقتباس]
هل هذا صحيح؟ عندما أدخل بريدي الإلكتروني وأنقر على
أرى:
الموقع في وضع القراءة فقط. التفاعلات معطلة.
ولم يتم إرسال أي بريد إلكتروني.
3 إعجابات
شكراً على التقرير @Moin ، هذا يجب أن يصلحه (مرة واحدة وإلى الأبد )
main ← fix-readonly-take-2
opened 03:33PM - 08 Jul 25 UTC
The reasons for these changes is https://meta.discourse.org/t/-/89605 broke and … admins were not able to log back in if they had previously enabled the "read only" mode.
Thus ensued a deep dive into how all the "read only" modes worked, which was made difficult due to the lack of tests.
The "cornerstone" of this PR is the `read_only_mixin.rb` file which was improved to be able to differentiate between the "readonly" mode and the "staff writes only" mode.
I then made use of the `allow_in_readonly_mode` and `allow_in_staff_writes_only_mode` method to **explicitely** list all the actions that should work in those modes.
I also added the "readonly" mixin to the `WebhooksController` since it doesn't inherit from the `ApplicationController`.
I improved the security of the `/u/admin-login` endpoint by always sending the same message no matter if we found or not an admin account with the provided email address.
I added two system specs:
1. for ensuring that admins can log in via /u/admin-lgoin and then clicking the link in the email they received while the site is in readonly mode.
2. for ensuring the "staff writes only mode" is _actually_ tested by ensuring a moderator can log in and create a topic while the site is in that mode.
Plenty of specs were updated to ensure 100% converage of the various "read only" modes.
5 إعجابات
مفيد جداً!
هذه المشاركة أصلحت مشكلتي
إعجابَين (2)