Skip to content

Trustroots/mediawiki-nostr-auth

Repository files navigation

mediawiki nostr auth extension

This extension should enable people to log into mediawiki with their nostr identity.

Usage

On your wiki go to Special:NostrLogin

image

Go to Special:UserLogin

image

Login with Nostr.

installation

Go to the root of your MediaWiki setup.

Run:

cd extensions
git clone https://github.com/Trustroots/mediawiki-nostr-auth.git

Add the following to LocalSettings.php

wfLoadExtension( 'mediawiki-nostr-auth' );
$NostrLoginDomains = [
	   'trustroots.org'
];
# to set email after authenticating with nostr
$wgGroupPermissions['*']['editmyprivateinfo'] = true;
$wgGroupPermissions['*']['viewmyprivateinfo'] = true;

Install the PluggableAuth extension and the following to LocalSettings.php

wfLoadExtension( 'PluggableAuth' );
$wgPluggableAuth_EnableLocalLogin = true;

Install https://github.com/nostrver-se/nostr-php via composer on your Mediawiki.

path forward

  • We'll first try to get this to work on nomadwiki.org, which arose from the digital graveyard in October 2024.
  • Thoughts about the user flow: #5
  • When we have something that works we'll set it up on trashwiki.org
  • Finally set it up on hitchwiki.org, which is the most active wiki we run.
  • Promote logging into these wikis to trustroots users.

resources

inspiration

builing extensions

building pluggable auth extensions

building login

assumptions

  • browser extension (e.g Alby) used to sign Nostr events
  • no user with the same trustroots user name exists so far in the wiki

developing

This automates the recommended code checkers for PHP and JavaScript code in Wikimedia projects (see https://www.mediawiki.org/wiki/Continuous_integration/Entry_points). To take advantage of this automation.

  1. install nodejs, npm, and PHP composer
  2. change to the extension's directory
  3. npm install
  4. composer install

Once set up, running npm test and composer test will run automated code checks.

Funding

In August 2024 OpenSats granted Trustroots to work on nostroots https://opensats.org/blog/nostr-grants-august-2024#nostroots as the Trustroots ecosystem includes several MediaWikis we invested energy into this MediaWiki extension to tighten the bonds between nostroots and the Wikis.