Extension:SecurePoll/he
התוסף SecurePoll הוא הרחבה לדף מיוחד לבחירות, סקרים והצבעות אחרות. הוא משמש בעיקר לבחירות לדירקטוריון קרן ויקימדיה ולבחירות לוועדות בוררות, ושימש בין היתר להצבעת המעבר לרישיון ויקימדיה.
צילומי מסך
- עמוד ראשי המציג רשימה של הצבעות מאובטחות.
- עמוד של הצבעה מאובטחת עם טקסט תיאורי.
- יומן מנהל של הצבעה מאובטחת
- יומן מצביע של הצבעה מאובטחת
התקנה
- Download and move the extracted
SecurePoll
folder to yourextensions/
directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SecurePoll
- Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'SecurePoll' );
- Run the update script which will automatically create the necessary database tables that this extension needs.
בוצע – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
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 וייבוא שלו, או השתמשות בממשק המשתמש במיוחד:הצבעה מאובטחת.
ידני
כדי ליצור הצבעה מאובטחת באופן ידני, יש צורך לעשות את הדברים הבאים:
- לכתוב קובץ XML
- לייבא אותו באמצעות פקודת הממשק
import.php
בתיקיית הבדיקות תוכלו למצוא ארבעה קבצים לדוגמה:
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 כאן].
לאחר כל זה, ניתן לראות את ההצבעה המאובטחת במיוחד:הצבעה מאובטחת.
עריכה של הצבעה מאובטחת קיימת
רק מנהלי הצבעות מאובטחות יכולים לערוך שדות של הצבעות מאובטחות קיימות. בשביל לבצע זאת, הם יכולים לבצע זאת דרך "עריכה" במיוחד:הצבעה מאובטחת.
לפני כל תחילת הצבעה מאובטחת, ניתן יהיה לערוך כל דבר בנוגע להצבעה המאובטחת. במידה וההצבעה המאובטחת מתקיימת, לא ניתן יהיה לשנות חלק מהשדות.
עריכה של ההגדרות לבעלי זכויות הצבעה בהצבעה מאובטחת קיימת
רק מנהלי הצבעות מאובטחות יכולים לערוך את ההגדרות לבעלי זכויות ההצבעה בהצבעה מאובטחת קיימת. בשביל לבצע זאת, הם יכולים לבצע זאת דרך "זכות הצבעה" במיוחד:הצבעה מאובטחת.
תרגום הצבעה מאובטחת קיימת
רק מנהלי הצבעות מאובטחות יכולים לתרגם הצבעות מאובטחות לשפות אחרות. בשביל לבצע זאת, הם יכולים לבצע זאת דרך "תרגום" במיוחד:הצבעה מאובטחת.
צפיית רשימת מצביעים
כל אחד יכול לראות את רשימת המצביעים של כל הצבעה מאובטחת, אלא אם תכונות השקיפות של הסקר הושבתו כאשר הסקר נוצר.
מנהלי הצבעות מאובטחות יכולים לראות רשימת המצביעים, יחד עם מידע פרטי משתמשים שעשויים לסייע בזיהוי בוחרים כפולים (למשל כתובות IP, מידע על סוכן משתמש, קובצי Cookie משותפים).
במידה ו-$wgSecurePollUseLogging
יוגדר כ-true
, מנהלי ההצבעות המאובטחות יוכלו לקבל מידע פרטי משתמשים. את היומנים האלו ניתן לראות במיוחד:הצבעה מאובטחת.
מפעילי מערכת רשאים למחוק כל הצבעת משתמש מאובטחת שלפי דעתם מהווה כפילות למשתמש אחר (בובת קש, טרול וכו').
ספירת הקולות
רק מנהלי הצבעות מאובטחות יכולים לחשב את תוצאות ההצבעה המאובטחת. בשביל לבצע זאת, הם יכולים לבצע זאת דרך "חישוב תוצאות" במיוחד:הצבעה מאובטחת.
במידה ותוצאות ההצבעה חושבה בעבר, זה יוצג בכל מקרה בדף. במידה ולא או אם ברצונך לבצע ספירה חוזרת, קיים טופס לתחילת ספירה חוזרת.
- אם הסקר אינו מוצפן, לחיצה על "חישוב תוצאות" תהיה אפשרית באופן מיידי.
- אם ההצבעה המאובטחת מוצפנת, ייתכן ויהיה צריך להזין מידע נוסף. לדוגמה, אם ההצבעה המאובטחת משתמשת ב-GnuPG, יש להזין את מפתח הפענוח הפרטי וללחוץ על "חישוב תוצאות". אם להצבעה המאובטחת מוצפנת יש קולות רבים, ייתכן שייקח זמן רב עד שיחושבו התוצאות. ייתכן כי תצטרכו לבדוק שוב מאוחר יותר לקבלת התוצאות הסופיות.
לאחר כל זה, ניתן לראות את ההצבעה המאובטחת במיוחד:הצבעה מאובטחת.
שיטת הקול הנייד
למידע נוסף על כך, ניתן למצוא על כך כאן.
כנ"ל לגבי יישום אלגוריתם כללי.
כברירת מחדל, המכסה היא + .000000001. המכסה היא הערך המינימלי של הקולות כדי להבטיח מושב.
1. הגדירו את המכסה. 2. הגדירו את ההצבעות לפי שיטת שולצה. 3. הכריזו על המועמדים שעברו את המכסה. 4. העבירו קולות עודפים ממועמדים נבחרים אל מועמדים אחרים. 5. חזרו על שלבים 3 ו-4 עד שלא ייבחרו מועמדים חדשים (תחת מערכות מסוימות, בשלב זה ניתן יהיה להעביר הצבעות בשלב זה למנצחים או למפסידים קודמים; זה עשוי להשפיע על התוצאה). אם כל המושבים אוישו, אזי התהליך הסתיים. אחרת: 6. הסרו מועמד אחד או יותר, בדרך כלל המועמד הנמוך ביותר או כל המועמדים שהקולות המשולבים שלהם פחותים מהקולות של המועמד הנמוך ביותר שנותר. 7. העבירו קולות עודפים ממועמדים מודחים אל מועמדים אחרים. 8. חזרו על שלבים 3–7 עד שכל המושבים אוישו.
המכסה בהצבעות מאובטחות אלו מוגדרת כמכסת ירידה.
floor( no. votes / (no. seats + 1) ) + 1
השיטה להעברת קולות ממועמדים נבחרים או מודחים תהיה בשיטת Meek:
JobRunner
- ניתן לעבד את תוצאות ההצבעה באמצעות JobRunner. יש להקפיד ליצור JobRunner עבור משימה זו או לבצע את המשימה באופן ידני.
- ניתן לעבד את תוצאות ההצבעה גם על ידי הפעלת סקריפט באופן ידני:
כדי לעבד את תוצאות ההצבעה, יש לבצע את הפעולות הבאות מתיקיית cli:
extensions/SecurePoll/maintenance/tallyElection.php
כדי לעבד את תוצאות ההצבעה באמצעות MediaWiki-Docker, יש לבצע את הפעולות הבאות מתיקיית cli:
docker-compose exec mediawiki php extensions/SecurePoll/maintenance/tallyElection.php
יצירת הצבעות מאובטחות בשיטת הקול הנייד
- הצבעות מאובטחות בשיטת הקול הנייד ניתן לבצע מ-
extensions/SecurePoll/cli
. - כדי ליצור הצבעות מאובטחות בשיטת הקול הנייד, יש לבצע את הפעולות הבאות מתיקיית cli:
extensions/SecurePoll/maintenance/generateTestElection.php
- הצבעות מאובטחות בשיטת הקול הנייד מאפשר יצירת פיגומים שמהם ניתן לספור קולות.
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_key
s: 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:
|
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). |
תיעוד
הצבעה מאובטחת
לתיעוד הכללי של התוסף, ניתן למצוא כאן.
עדכונים
לעדכונים בתוסף, ניתן למצוא כאן.
הסבר על תוצאות שיטת הקול הנייד
להסבר על תוצאות שיטת הקול הנייד, ניתן למצוא כאן.
See also
![]() | This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |
![]() | This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |