Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shroomok/mediawiki-discordauth
This MediaWiki extension allows users from specified Discord server access to your wiki
https://github.com/shroomok/mediawiki-discordauth
discord mediawiki php
Last synced: 25 days ago
JSON representation
This MediaWiki extension allows users from specified Discord server access to your wiki
- Host: GitHub
- URL: https://github.com/shroomok/mediawiki-discordauth
- Owner: shroomok
- Created: 2023-01-14T09:40:01.000Z (almost 2 years ago)
- Default Branch: v1
- Last Pushed: 2023-10-16T13:44:46.000Z (about 1 year ago)
- Last Synced: 2023-10-17T15:53:56.365Z (about 1 year ago)
- Topics: discord, mediawiki, php
- Language: PHP
- Homepage: https://shroomok.com
- Size: 29.3 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mediawiki-DiscordAuth
This MediaWiki extension allows users with predefined roles from specified Discord server access to your wiki.Purpose: give access to some users of [Shroomok Discord Community](https://discord.com/invite/ngKhQDmymD) to publish articles on https://shroomok.com
## Dependencies
* [mediawiki-extensions-PluggableAuth](https://github.com/wikimedia/mediawiki-extensions-PluggableAuth)
* [mediawiki-extensions-WSOAuth](https://github.com/wikimedia/mediawiki-extensions-WSOAuth)
* [Discord Provider for OAuth 2.0 Client](https://github.com/wohali/oauth2-discord-new)
* [RestCord - Discord API](https://github.com/restcord/restcord)## Create composer.local.json before installation
This extension has a dependency on particular version of one package which can be installed only from github.Thats why you need to edit (or create) a composer.local.json at the root of your wiki folder
### Composer.local.json
```json
{
"extra": {
"merge-plugin": {
"include": [
"extensions/DiscordAuth/composer.json"
]
}
}
}
```## Installation
```
cd /extensions
git clone [email protected]:wikimedia/mediawiki-extensions-PluggableAuth.git PluggableAuth
git clone [email protected]:wikimedia/mediawiki-extensions-WSOAuth.git WSOAuth
git clone [email protected]:shroomok/mediawiki-DiscordAuth.git DiscordAuth
cd
composer update
php maintenance/update.php
```### LocalSettings.php minimal setup
```phpwfLoadExtension( 'PluggableAuth' );
wfLoadExtension( 'WSOAuth' );
wfLoadExtension( 'DiscordAuth' );$wgOAuthCustomAuthProviders = ['discord' => \DiscordAuth\AuthenticationProvider\DiscordAuth::class];
$wgPluggableAuth_EnableLocalLogin = true;
$wgPluggableAuth_Config['discordauth'] = [
'plugin' => 'WSOAuth',
'data' => [
'type' => 'discord',
'uri' => 'https://discord.com/oauth2/authorize',
'clientId' => '',
'clientSecret' => '',
'redirectUri' => 'https:///index.php?title=Special:PluggableAuthLogin'
],
'buttonLabelMessage' => 'discordauth-login-button-label'
];$wgDiscordAuthBotToken = '';
$wgDiscordGuildId = ; // you can copy this within Discord app interface
$wgDiscordApprovedRoles = ['']; // users only with the specified roles will be able to login```
### LocalSettings.php If you want to have a custom NS for Discord users and change Main Page layout to simplify ux
```php
$wgDiscordNS = ['id' => , 'alias' => ''];
$wgDiscordToRegisterNS = true;
$wgDiscordShowUserContributionsOnMainPage = true;
```### [Discord Documentation](https://discord.com/developers/docs/intro)