Extension:SecurePoll/ar

Category:GPL licensed extensions/ar
الدليل المرجعي لامتدادات ميدياويكي
SecurePoll
حالة الإصدار مستقرCategory:Stable extensions/ar
تنفيذ صفحة خاصة Category:Special page extensions/ar
بيان يسمح بإجراء الانتخابات والإستطلاعات والإستبانات
المؤلف/المؤلفون Tim Starlingنقاش
آخر إصدار 3.0.0 (تحديثات مستمرة)
سياسة التوافق تصدر اللقطات البرمجية مع ميدياويكي. الإصدار الرئيسي لا يتوافق مع الإصدارات السابقة.
MediaWiki 1.25+Category:Extensions with manual MediaWiki version/ar
تغييرات قاعدة البيانات نعم
جداول securepoll_entity
securepoll_msgs
securepoll_properties
securepoll_elections
securepoll_questions
securepoll_options
securepoll_voters
securepoll_votes
securepoll_strike
securepoll_lists
securepoll_cookie_match
ترخيص رخصة جنو العمومية 2.0 أو ما بعدها
التنزيل Category:Extensions in Wikimedia version control/ar
  • $wgSecurePollTempDir
  • $wgSecurePollEditOtherWikis
  • $wgSecurePollUseLogging
  • $wgSecurePollKeepPrivateInfoDays
  • $wgSecurePollCreateRemoteScriptPath
  • $wgSecurePollCreateWikiGroups
  • $wgSecurePollUseMediaWikiNamespace
  • $wgSecurePollMostActiveWikisThreshold
  • $wgSecurePollUseNamespace
  • $wgSecurePollExcludedWikis
  • $wgSecurePollCreateWikiGroupDir
  • $wgSecurePollShowErrorDetail
  • securepoll-create-poll
  • securepoll-edit-poll
  • securepoll-view-voter-pii
ترجم الامتداد SecurePoll لو كان متوفرا على translatewiki.net
المسائل المهام المفتوحة · الإبلاغ عن عطل تقني
Category:All extensions/ar

امتداد SecurePoll هو امتداد خاص للانتخابات والاستطلاعات والإستبانات. يستخدم لانتخابات مجلس مؤسسة ويكيميديا ولانتخابات لجنة التحكيم، وسبق استخدامه للتصويت على انتقال ترخيص ويكيميديا وأشياء أخرى.

لقطات شاشة

التثبيت

  • نزّل الملف/الملفات وضعها في دليل يحمل اسم ‎SecurePoll داخل مجلد ‎extensions/‎ لديك.
    يجب على مطوري البرمجيات والمساهمين بالكود البرمجي تثبيت الامتداد من غت بدلا من ذلك، مستخدمين:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SecurePoll
    
  • أضف الكود التالي في الجزء الأسفل من ملف LocalSettings.php :
    wfLoadExtension( 'SecurePoll' );
    
  • شغل نص التحديث البرمجي الذي سوف ينشئ تلقائيا جداول قاعدة البيانات الضرورية التي يحتاج إليها الامتداد.
  • Yes تم التنفيذ – اذهب إلى Special:Version على موقع الويكي لديك كي تتحقق من أن الامتداد قد ثبت بنجاح.

In addition, you will need to add some user groups and user rights to your LocalSettings.php file. Here is one way to do it, which gives a new group called electionadmin the power to do everything in SecurePoll (create polls, edit polls, see voter IP addresses):

$wgGroupPermissions['electionadmin']['securepoll-create-poll'] = true;
$wgGroupPermissions['electionadmin']['securepoll-edit-poll'] = true;
$wgGroupPermissions['electionadmin']['securepoll-view-voter-pii'] = true;

Once this group is created, a bureaucrat can add someone to the group using Special:UserRights. Then that person can visit Special:SecurePoll to view polls, create polls, edit polls, tally polls, etc.

Each poll's data is compartmentalized. You can have 100 electionadmins, but if you only add one electionadmin to a particular poll, only that one electionadmin will be able to edit that particular poll or see user IPs. If an electionadmin is removed from a poll, they will lose access to it.

securepoll-view-voter-pii is used for "scrutineering" a poll, which involves looking at a list of voter IPs, user agents, and X-Forwarded-For headers to look for cheating (secret duplicate votes by sockpuppets). Because this involves looking at voter IP addresses and other sensitive, personal, de-anonymizing data, it is a sensitive user right, so only trusted users should be assigned to the electionadmin group.

It is possible to split securepoll-view-voter-pii into a separate group. You can use a config such as the one below to create a group called scrutineer that contains the securepoll-view-voter-pii right, separating it from the electionadmin group:

$wgGroupPermissions['electionadmin']['securepoll-create-poll'] = true;
$wgGroupPermissions['electionadmin']['securepoll-edit-poll'] = true;

$wgGroupPermissions['scrutineer']['securepoll-create-poll'] = true;
$wgGroupPermissions['scrutineer']['securepoll-edit-poll'] = true;
$wgGroupPermissions['scrutineer']['securepoll-view-voter-pii'] = true;

A user also needs to be added to the poll (and hence have the securepoll-edit-poll right) in order to view PII - securepoll-view-voter-pii by itself has no effect.

الاستخدام

إنشاء استطلاع جديد

هناك طريقتان لإنشاء استطلاع جديد: إعداد ملف XML يدوياً واستيراده، أو استخدام واجهة إنشاء استطلاعات الرأي في Special:SecurePoll.

يدويًا

لإنشاء استطلاع رأي يدوياً، يتطلب أن:

  1. تكتب ملف XML
  2. تستورده باستخدام الأمر import.php من واجهة الأوامر command-line

في مجلد الاختبار يمكنك العثور على أربع ملفات كأمثلة:

  • 3way-test.xml
  • approval-test.xml
  • radio-range.xml
  • schulze-test.xml info

لاستيراد استطلاع، قم بتشغيل ما يلي من مجلد cli:

extensions/SecurePoll/maintenance$ php importElectionConfiguration.php ../tests/phpunit/data/3way-test.xml

لاستيراد استطلاع رأي باستخدام docker، قم بتشغيل ما يلي من مجلد cli:

docker-compose exec mediawiki php extensions/SecurePoll/maintenance/importElectionConfiguration.php extensions/SecurePoll/tests/phpunit/data/3way-test.xml

من خلال واجهة الويب

يمكن للمستخدم الذي يمتلك صلاحية الـ securepoll-create-poll إنشاء استطلاع جديد عن طريق الرابط الموجود في أسفل Special:SecurePoll.

لإعداد استطلاع جديد، املأ الحقول الإلزامية في نموذج الإعداد. قد تكون هناك حاجة إلى الحرص في الحقول التالية:

  • عند إضافة مديري الاستطلاع، يُسمح فقط لأعضاء مجموعة electionadmin. إذا تم تعيين $wgSecurePollUseLogging إلى true، فسيتم تسجيله كلما أُضيف إداري إلى أو أُزيل من استطلاع. يمكن مشاهدة السجلات في Special:SecurePollLog.
  • لإنشاء استطلاع رأي مُشفَّر، اختر زر طريقة التشفير. إذا اخترت GnuPG، قم بتوليد مفتاح تشفير (عام) ومفتاح فك تشفير (خاص). أدخل مفتاح التشفير في نموذج الإنشاء، واحفظ المفتاح الخاص آمنا في مكان ما (ليس على الويب) (ستحتاج إليه للفرز، بمجرد انتهاء الانتخابات). يمكن رؤية [$1 مثال مفصل].

الآن طالع Special:SecurePoll وسوف ترى استطلاع الرأي الخاص بك.

تعديل استطلاع موجود

لتعديل استطلاع، يجب أن تكون مديرًا لهذا الاستطلاع المعين. من Special:SecurePoll، انقر على رابط تحرير الاستطلاع الذي تريد تحريره.

قبل أن تبدأ الانتخابات، يمكن تحرير أي شيء عن الانتخاب. بعد بدء الانتخابات، لا يمكن تحرير بعض الحقول بعد الآن.

تحديد مَن يمكنه التصويت في الاستطلاع

لتحرير مَن يمكنه التصويت في استطلاع، يجب أن تكون مديرًا لهذا الاستطلاع المعين. من Special:SecurePoll، انقر على رابط مؤهلات التصويت للإستطلاع Eligibility.

ترجمة استطلاع

لترجمة استطلاع، يجب أن تكون مديرًا لهذا الاستطلاع المعين. من Special:SecurePoll، انقر على رابط الترجمة للاستطلاع الذي تريد تحريره.

طالع قائمة المصوتين

يمكن لأي شخص رؤية قائمة الناخبين، ما لم يجري تعطيل ميزات الشفافية transparency عند إنشاء الاستطلاع.

يمكن لمديري استطلاع معين رؤية قائمة الناخبين، جنبا إلى جنب مع المعلومات الخاصة التي قد تُساعد على تحديد الناخبين المكررين (مثل عناوين IP، معلومات وكيل المستخدم، ملفات تعريف الارتباط المشتركة). إذا تم تعيين $wgSecurePollUseLogging إلى true، فسيجري تسجيل كلما قام مدير برؤية البيانات الخاصة. يمكن مُطالعة السجلات على Special:SecurePollLog.

يمكن للمديرين إلغاء أي تصويتات يرون أنها مكررة.

فرز الاستطلاع

لفرز استطلاع، يجب أن تكون مديرًا لهذا الاستطلاع المعين. Special:SecurePoll، انقر على رابط "فرز Tally" للحصول على الاستطلاع الذي تريد أن تفرزه.

إذا كان الاستطلاع قد جرى فرزه من قبل، فستظهر النتائج على الصفحة. إذا لم يكن، أو إذا كنت تريد إعادة الفرز، هناك نموذج لبدء فرز جديد.

  • إذا كانت الاستطلاع غير مشفر، انقر على زر الفرز.
  • إذا كانت الاستطلاع مشفر، قد تحتاج إلى إدخال مزيد من المعلومات. على سبيل المثال، إذا كنت تستخدم GnuPG، أدخل مفتاح فك تشفير (الخاص) وانقر على زر الفرز. إذا كان استطلاع الرأي المشفر به عدد كبير من الأصوات، قد يستغرق ذلك وقتا طويلاً للفرز. قد تحتاج إلى التحقق من النتائج لاحقاً.

الآن طالع $1 وسوف ترى استطلاع الرأي الخاص بك.

الفرز بطريقة الصوت القابل للانتقال (STV)

لمعلومات أكثر حول الصوت القابل للانتقال (STV) طالع ويكيبيديا.

تنفيذ الخوارزمية العامة (source).

الحصة Quota هي + .000000001. الحصة هي الحد الأدنى من الأصوات للحصول على مقعد.

1. احسب الحصة
2. تعيين الأصوات للمرشحين حسب التفضيلات الأولى
3. إعلان فوز جميع المرشحين الذين حصلوا على الحصة على الأقل.
4. نقل الأصوات الزائدة من الفائزين إلى المتوقعين
5. كرر الخطوات 3 و 4 حتى لا يجري انتخاب مرشحين جُدد.  (في بعض النظم، يمكن تحويل الأصوات في البداية في هذه الخطوة إلى الفائزين أو الخاسرين السابقين، وهذا قد يؤثر على النتيجة).
إذا كان لدى جميع المقاعد فائزون، فستكون العملية قد اكتملت. وإلا:
6. قم بإزالة مرشح واحد أو أكثر، عادةً إما المُرشح الأقل أو جميع المرشحين الذين تقل أصواتهم المشتركة عن أصوات أقل مرشح باقي.
7. نقل أصوات الخاسرين إلى المرشحين المتوقعين المتبقين
8. كرر 3-7 حتى تملأ جميع المقاعد

الحصة التي سنستخدمها (الخطوة 1) هي حصة الحذف Droop quota (source):

floor( no. votes / (no. seats + 1) ) + 1

وسيكون طريقة نقل الأصوات من المرشحين المنتخبين أو المحذوفين هي طريقة "ميك Meek":


الفرز بطريقة (JobRunner)

  • يمكن معالجة النتائج من خلال مهمة مجدولة Manual:Job queue. تأكد من إنشاء مهمة مجدولة لهذه المهمة أو تنفيذ المهمة يدويًا.
  • يمكن أيضًا معالجة النتائج عن طريق تنفيذ البرنامج النصي للنتائج يدويًا:

لتنفيذ عملية تعداد، قم بتشغيل الأمر التالي من مجلد سطر الأوامر الموجود في extensions/SecurePoll/cli:

extensions/SecurePoll/maintenance/tallyElection.php

لتنفيذ عملية إحصاء باستخدام MediaWiki-Docker، قم بتشغيل الأمر التالي من مجلد سطر الأوامر الموجود في extensions/SecurePoll/cli:

docker-compose exec mediawiki php extensions/SecurePoll/maintenance/tallyElection.php

إنشاء انتخابات اختبار (STV)

  • يمكن إنشاء انتخابات اختبار (STV) من مجلد سطر الأوامر الموجود في extensions/SecurePoll/cli:
  • لتوليد انتخاب اختبار، قم بتشغيل ما يلي من مجلد سطر الأوامر الموجود في extensions/SecurePoll/cli:
extensions/SecurePoll/maintenance/generateTestElection.php
  • توفر انتخابات الاختبار (STV) إطارًا يمكن من خلاله فرز الأصوات

Redirect polls

A redirect poll is a poll that shows up in the list of polls at Special:SecurePoll, but clicking on "vote" and other links will redirect the voter to a different wiki. This is useful if you do all of your votes on a central votewiki (in Wikimedia's case, https://vote.wikimedia.org).

Special:SecurePoll/create will show an additional drop-down list called "For wiki:"—allowing you to select "This wiki", "All wikis", or a different wiki in your wiki farm—if all of the following conditions are met:

  • You are using a wiki farm (multiple wikis using the same file system but different databases).
  • You haven't excluded all other wikis using $wgSecurePollExcludedWikis.
  • You have $wgCanonicalServer configured to have a period (use different subdomains) on each wiki.
  • You have $wgSecurePollEditOtherWikis = true; for your current wiki.

If you have a wiki in your wiki farm that doesn't have SecurePoll installed, be sure to add it to $wgSecurePollExcludedWikis to keep it out of the "For wiki:" list.

"For wiki" dropdown item selected What it does locally What it does on other wikis
This wiki Creates a local election Nothing
All wikis Creates a local election Creates "redirect polls" at every other wiki in the wiki farm
Picking a specific other wiki such as es.wikipedia.org Creates a local election Creates a "redirect poll" at the chosen wiki

Testing note: $wgCanonicalServer must contain domains with subdomains. So for example, http://localhost will not get the dropdown list to show up, but http://en.localhost will.

$wgConf->settings = [
   'wgCanonicalServer' => [
      'my_database' => 'http://en.localhost:8080',
      'secondwiki' => 'http://es.localhost:8080'
   ],

In the database, fields related to redirect polls include securepoll_elections.el_auth_type (can be local or mw-remote), and the following securepoll_properties.pr_keys: jump-id, jump-url, and main-wiki.

For developers

SQL tables

Note that configuring a poll to use encryption encrypts the securepoll_votes.vote_record field.

Table Field prefix Description Contains sensitive data?
securepoll_cookie_match cm_ Used on the vote details page to display the securepoll-cookie-dup-list message ("Cookie duplicate users"). Yes
securepoll_elections el_ List of elections, and some basic config data such as the name, creator, start date, end date, language, ballot type (e.g. approval), and tally type (e.g. plurality). Additional config data is pivoted and stored in securepoll_properties instead. No
securepoll_entity en_ Maps "one to many" with the securepoll_msg table. The "many" is because a securepoll_msg can be in multiple languages. Possible options for securepoll_entity.en_type are election, question, and option. No
securepoll_lists li_ Stores usernames manually added via the Voter Eligibility page. Users are added in the format userName@databaseName. There are 3 types of lists:
  • Eligibility list - The li_name value is [electionId]/list/need-list. These are folks who are allowed to vote if they meet the on-the-fly eligibility requirements such as X number of edits.
  • Overrride list - The li_name value is [electionId]/list/include-list. These are folks who are allowed to vote no matter what.
  • Exclude list - The li_name value is [electionId]/list/exclude-list. These are folks who are not allowed to vote no matter what.
No
securepoll_log spl_ If $wgSecurePollUseLogging is set to true, stores the log entries here. Yes. Special:SecurePollLog is private.
securepoll_msgs msg_ List of strings. For example, the poll name, the poll questions, and the poll answers. This is mapped to from other tables such as securepoll_options and securepoll_questions, and supports having the same entity in multiple languages (securepoll_msgs.msg_lang). No
securepoll_options op_ List of poll options for each question. Doesn't store the option text here, but rather maps it to the table securepoll_msgs. No
securepoll_properties pr_ Config data for each election. For example, who the election admins are, whether it's a redirect poll, whether to shuffle the options, whether to use encryption, list of tallies and their values (tally-result), etc.

Is also the config data for on-the-fly voter eligibility calculation. For example, voter minimum edit count and voter not-sitewide-blocked is stored here.

Partial. Rows with pr_key as gpg-encrypt-key, gpg-sign-key, openssl-encrypt-key, openssl-sign-key, tally-result, tally-result-time are private data.
securepoll_questions qu_ List of poll questions. Doesn't store the question text here, but rather maps it to the table securepoll_msgs. No
securepoll_strike st_ Which votes have been struck (crossed out, removed from the tally) by election admins. Includes a reason that they can type in. Yes. Only election admins can see the strike log from the UI.
securepoll_voters voter_ One row per voter per election. Voters are distinct and will not be duplicated in the same election. Contains data on the voter such as their user groups and whether they're blocked or not. Probably used to determine voter eligibility. voter_properties contains data such as wiki, blocked, sitewide blocked, central block count, central sitewide block count, edit count, bot, language, user groups, eligibility lists, and registration date. Partial. This is private for elections with transparency features disabled.
securepoll_votes vote_ One row per vote per election. Contains data on the voter such as IP address and user agent, and contains the actual vote in the vote_record column. The "most active wiki" that the voter chose, if enabled for this poll, is stored in vote_voter_domain. vote_current=0 means that this is a duplicate vote and has been discarded; this is re-calculated for all of the user's previous votes each time they submit a new vote. Yes. Contains voter PII such as IP addresses and user agents. Contains the vote itself and its timestamp (the vote date is public unless the voter list is turned off, the vote time is private).

التوثيق

التصويت الآمن SecurePoll

يمكن العثور على الوثائق العامة لـ SecurePoll في wikitech:SecurePoll.

تحسينات التصويت الآمن

تجد ملخص تحسينات التصويت الآمن في Anti-Harassment Tools/SecurePoll Improvements.

فهم نتائج نظام الصوت الواحد القابل للتحويل STV

تجد وثائق حول نتائج طريقة STV في Anti-Harassment Tools/SecurePoll Improvements/Understanding the STV result.

See also

Category:Extensions used on Wikimedia/ar#SecurePoll/ar Category:Poll extensions/ar
Category:All extensions/ar Category:CanonicalNamespaces extensions/ar Category:Extensions in Wikimedia version control/ar Category:Extensions included in Miraheze/ar Category:Extensions included in WikiForge/ar Category:Extensions used on Wikimedia/ar Category:Extensions with manual MediaWiki version/ar Category:GPL licensed extensions/ar Category:LoadExtensionSchemaUpdates extensions/ar Category:Poll extensions/ar Category:SpecialPage initList extensions/ar Category:Special page extensions/ar Category:Stable extensions/ar Category:TitleQuickPermissions extensions/ar Category:UserLogout extensions/ar