مرشح الصور في Discourse

يستخدم هذا الإضافة واجهة برمجة تطبيقات Google Cloud Vision لتقييد تحميل الصور الصريحة على المنتدى. فهو يغطي جميع الصور المرفوعة، بما في ذلك الصور الشخصية والشعارات وما إلى ذلك.

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

يمكن ضبط الحدود المقبولة عبر إعدادات الموقع.


الإعداد

الخطوات:

  1. أنشئ حساب خدمة على Google Cloud Create service accounts  |  Identity and Access Management (IAM)  |  Google Cloud Documentation
    ستقوم Google بتحميل ملف JSON. احتفظ بمحتوياته بأمان.

  2. الصق هذه الأسطر في أسفل قسم env في ملف app.yml الخاص بك

     GOOGLE_ACCOUNT_TYPE: 'service_account'
     GOOGLE_CLIENT_ID: 'client-id-from-json-file'
     GOOGLE_CLIENT_EMAIL: "service-account-email-address"
     GOOGLE_PRIVATE_KEY:  instructions below
    
  • كيفية إعداد معامل GOOGLE_PRIVATE_KEY؟

    • الصق المفتاح الموجود في ملف JSON في محرر الأكواد.
    • استخدم البحث والاستبدال واستبدل \\n بـ \\\\n
    • انسخ النتيجة والصقها في ملف app.yml أمام GOOGLE_PRIVATE_KEY محاطة بعلامتي اقتباس مفردتين ' ' .
  1. الآن اتبع الخطوات العادية لتثبيت الإضافة.

إعدادات الإضافة

if_adult_max_acceptable: الحد الأقصى المقبول لمستوى فئة adult
if_spoof_max_acceptable: الحد الأقصى المقبول لمستوى فئة spoof
if_medical_max_acceptable: الحد الأقصى المقبول لمستوى فئة medical
if_violence_max_acceptable: الحد الأقصى المقبول لمستوى فئة violence
if_racy_max_acceptable: الحد الأقصى المقبول لمستوى فئة racy

يمكنك قراءة المزيد عن هذه المعايير وواجهة برمجة التطبيقات نفسها بالتفصيل هنا. Detect explicit content (SafeSearch)  |  Cloud Vision API  |  Google Cloud Documentation

\u003ca href="https://github.com/paviliondev/discourse-image-filter\" target="_blank"\u003e:page_facing_up: احصل على الكود\u003c/a\u003e

\u003ca href="Pavilion" target="_blank"\u003e:raising_hand_woman: اطلب ميزة\u003c/a\u003e

\u003ca href="Pavilion" target="_blank"\u003e:bug: أبلغ عن خطأ\u003c/a\u003e

ملاحظات التطوير

للاستخدام في بيئة تطوير على نظام macOS، أضف هذا السطر إلى ملف .bash_profile الخاص بك
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

ضائع؟

شكرًا لـ @Terrapop على رعاية الإضافة.

22 إعجابًا

@riking

I made this PR FIX: erroneous condition which would cause an error if ever satisfied by fzngagan · Pull Request #10605 · discourse/discourse · GitHub because I realized that the upload error popup wouldn’t display if there’s was a rails side exception while uploading avatars/logos. It works well while uploading from composer. I thought it would be a nice upstream change to incorporate.

6 إعجابات

Thanks for the ping, missed the Github notification.

5 إعجابات

Thanks a lot for the merge. It helps discourse and my plugin both.

4 إعجابات

Great, thanks for your help @fzngagan making this possible, was a pleasure working with you.

For all communities that have child-safe COPPA requirements or want to stay safe in terms of Adsense, or simply don’t want to have gore or nude images anywhere this plugin is a must-have.

7 إعجابات

@Razcle
قد يكون هذا من قبيل ما يهمك

شكرًا لك يا فايزان! كنت أفكر في إنشاء شيء يركز أكثر على فهم اللغة وقابل للتخصيص. هل لديك أي خبرة في ذلك؟

ر

3 إعجابات

@jahan_gagan قد يكون لديه شيء ليقوله حول معالجة اللغات الطبيعية (NLP).

إعجابَين (2)

لقد جربت مجموعة بيانات stackoverflow لـ توقع الوسوم، ثم حاولت استخدام نفس الكود مع مجموعة بيانات discourse، لكن بسبب قلة حجم البيانات في discourse، لم يعمل هذا الكود هنا.

إعجابَين (2)

ما هي النطاقات التي أحتاجها في حساب الخدمة الخاص بي؟ أحصل على رسالة “طلب نطاقات المصادقة غير كافٍ”.

هل يمكن أن يساعد هذا؟ يعمل بالكامل على جانب العميل

نموذج سمية النص

هذا الإضافة يتعلق بالصور، وليس بالنصوص.

بالنسبة للنصوص، يتوفر إضافة Google Perspective القائمة على محرك Jigsaw:

إعجابَين (2)

مرحباً :waving_hand: هل لا يزال هذا المكون الإضافي قابلاً للعمل؟ لقد رأيت للتو أن آخر تثبيت كان منذ حوالي 4 سنوات. شكراً :slightly_smiling_face:

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

لقد حاولت تثبيته على مثيل تجريبي ولكن يبدو أن هناك مشكلة في الجيم (gem). فشل إعادة البناء. آمل أن يكون قابلاً للإصلاح. :crossed_fingers: ربما تم إهمال هذه الجيمز (gems) ببساطة…

rake aborted!

Gem::LoadError: can't activate google-protobuf-3.13.0-x86_64-linux, already activated google-protobuf-4.27.3-x86_64-linux (Gem::LoadError)

/var/www/discourse/lib/plugin_gem.rb:25:in `load'

/var/www/discourse/lib/plugin/instance.rb:835:in `gem'

/var/www/discourse/plugins/discourse-image-filter/plugin.rb:12:in `activate!'

/var/www/discourse/lib/plugin/instance.rb:778:in `instance_eval'

/var/www/discourse/lib/plugin/instance.rb:778:in `activate!'

/var/www/discourse/lib/discourse.rb:348:in `block in activate_plugins!'

/var/www/discourse/lib/discourse.rb:345:in `each'

/var/www/discourse/lib/discourse.rb:345:in `activate_plugins!'

/var/www/discourse/config/application.rb:231:in `block in <class:Application>'

/var/www/discourse/lib/plugin.rb:6:in `initialization_guard'

/var/www/discourse/config/application.rb:231:in `<class:Application>'

/var/www/discourse/config/application.rb:75:in `<module:Discourse>'

/var/www/discourse/config/application.rb:74:in `<top (required)>'

/var/www/discourse/Rakefile:7:in `<top (required)>'

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'

/usr/local/bin/bundle:25:in `load'

/usr/local/bin/bundle:25:in `<main>'

(See full trace by running task with --trace)

I, [2024-08-02T16:48:02.872895 #1] INFO -- : gem install os -v 1.1.1 -i /var/www/discourse/plugins/discourse-image-filter/gems/3.3.3 --no-document --ignore-dependencies --no-user-install

Successfully installed os-1.1.1

1 gem installed

gem install google-protobuf -v 3.13.0 -i /var/www/discourse/plugins/discourse-image-filter/gems/3.3.3 --no-document --ignore-dependencies --no-user-install

Successfully installed google-protobuf-3.13.0-x86_64-linux

1 gem installed

I, [2024-08-02T16:48:02.886926 #1] INFO -- : Terminating async processes

I, [2024-08-02T16:48:02.888160 #1] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 36

I, [2024-08-02T16:48:02.888588 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 98

2024-08-02 16:48:02.888 UTC [36] LOG: received fast shutdown request

98:signal-handler (1722617282) Received SIGTERM scheduling shutdown...

2024-08-02 16:48:02.892 UTC [36] LOG: aborting any active transactions

98:M 02 Aug 2024 16:48:02.896 # User requested shutdown...

98:M 02 Aug 2024 16:48:02.897 * Saving the final RDB snapshot before exiting.

2024-08-02 16:48:02.906 UTC [36] LOG: background worker "logical replication launcher" (PID 51) exited with exit code 1

2024-08-02 16:48:02.909 UTC [46] LOG: shutting down

98:M 02 Aug 2024 16:48:02.939 * DB saved on disk

98:M 02 Aug 2024 16:48:02.939 # Redis is now ready to exit, bye bye...

2024-08-02 16:48:02.949 UTC [36] LOG: database system is shut down

FAILED

--------------------

Pups::ExecError: cd /var/www/discourse &amp;&amp; su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 571 exit 1>

Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'

exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}

bootstrap failed with exit code 1

** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

./discourse-doctor may help diagnose the problem.

9213a43b80e800c6f2b1d0adc0663ec82a483b860f0302b8ebabc8a3b2bb0619

لقد قمت بوضع علامة على هذا بـ broken.

إعجابَين (2)