Difference between revisions of "User:Admin"
Jump to navigation
Jump to search
| Line 44: | Line 44: | ||
https://doc.wikimedia.org/mediawiki-core/master/php/classUser.html | https://doc.wikimedia.org/mediawiki-core/master/php/classUser.html | ||
https://www.mediawiki.org/wiki/Extension%3aAccessControl | https://www.mediawiki.org/wiki/Extension%3aAccessControl | ||
| + | |||
'''Force users to connect using HTTPS and turn on HSTS:''' | '''Force users to connect using HTTPS and turn on HSTS:''' | ||
| Line 53: | Line 54: | ||
RewriteCond %{SERVER_PORT} 80 | RewriteCond %{SERVER_PORT} 80 | ||
RewriteRule ^(.*)$ <nowiki>https://{replace with relevant URL}/$1</nowiki> [R=301,L] | RewriteRule ^(.*)$ <nowiki>https://{replace with relevant URL}/$1</nowiki> [R=301,L] | ||
| + | |||
'''MediaWiki notes:''' | '''MediaWiki notes:''' | ||
| Line 65: | Line 67: | ||
# Colons at the start of a line cause indents, more colons, more tab stops. | # Colons at the start of a line cause indents, more colons, more tab stops. | ||
</ol start> | </ol start> | ||
| + | |||
| + | Relevant links: | ||
| + | |||
| + | https://www.mediawiki.org/wiki/Help:Formatting | ||
| + | |||
'''How to generate a GPG public/private key pair to get SSH keys:''' | '''How to generate a GPG public/private key pair to get SSH keys:''' | ||
| Line 86: | Line 93: | ||
# | # | ||
</ol start> | </ol start> | ||
| + | |||
Relevant links: | Relevant links: | ||
| + | |||
https://www.dash.org/forum/threads/basic-guide-to-pgp-on-windows-pc-kleopatra-%E2%80%93-gpg4win.4086/ | https://www.dash.org/forum/threads/basic-guide-to-pgp-on-windows-pc-kleopatra-%E2%80%93-gpg4win.4086/ | ||
Revision as of 18:56, 28 July 2018
Administration Control Panel - [1]
Changes to block new user creation:
Need to edit: /home/wasteam8/public_html/mentor.wiki/LocalSettings.php
Add this to the bottom:
# Regulate user group permissions. $wgGroupPermissions['*']['createaccount'] = false; $wgGroupPermissions['user']['createaccount'] = false; $wgGroupPermissions['administrators']['createaccount'] = false;
Need to edit: /home/wasteam8/public_html/mentor.wiki/includes/specials/SpecialCreateAccount.php
Edit this function:
public function userCanExecute( User $user ) {
/**
* return $user->isAllowed( 'createaccount' );
*/
global $wgUser;
if ( $wgUser->isLoggedIn() ) {
return $user->isAllowed( 'createaccount' );
} else {
return false;
}
}
This will block non-logged-in users from viewing the content if the user group isn't configured in the LocalSettings.php. Can be used in other things as well.
Relevant Links:
https://lists.gt.net/wiki/mediawiki/126271 https://www.mediawiki.org/wiki/Manual:Special_pages#Constructor https://www.mediawiki.org/wiki/Manual:LocalSettings.php#User_rights https://www.mediawiki.org/wiki/Manual:User_rights#Example https://stackoverflow.com/questions/219135/how-do-i-create-my-own-custom-group-in-mediawiki https://www.mediawiki.org/wiki/Topic:Qji4lqoeaodggoft https://www.mediawiki.org/wiki/Topic:Pl8qrwn9l15vc0ex https://doc.wikimedia.org/mediawiki-core/master/php/classUser.html https://www.mediawiki.org/wiki/Extension%3aAccessControl
Force users to connect using HTTPS and turn on HSTS:
Create .htaccess files in the sub-folder of the website and put this text in the file:
Header set Strict-Transport-Security "max-age=300" env=HTTPS
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://{replace with relevant URL}/$1 [R=301,L]
MediaWiki notes:
- To make code blocks, indent the content with at least 1 space.
- To put URLs into code blocks without being acted upon use < nowiki > < /nowiki > tags (remove the spaces inside the symbols), this bypasses a MediaWiki throw back called magic links (community wants to end this function anyway).
- To make numbered lists, start the list with < ol start > < /ol start > tags (remove the spaces inside the symbols), then start each line with a hashtag.
- MediaWiki logos should be around 100 pixels wide and 150 pixels tall.
- MediaWiki logos go in the folder: /home/wasteam8/public_html/mentor.wiki/resources/assets
- Edit LocalSettings.php and change the $wgLogo variable to set the logo.
- Colons at the start of a line cause indents, more colons, more tab stops.
Relevant links:
https://www.mediawiki.org/wiki/Help:Formatting
How to generate a GPG public/private key pair to get SSH keys:
- For Windows download GPG4Win: https://gpg4win.org/download.html
- Don't panic when it asks for a donation, select PayPal and $0.
- During install select your language, usually English.
- Then uncheck the check boxes next to GPA and GpgOL.
- Accept the defaults till the installation closes.
- This will create a red dot in the notification area of your start menu with a small white tea cup on it.
- Double click the Kleopatra icon a dialog will open.
- Click the 'File' menu.
- Click 'New Key Pair'.
- Click 'Create a personal OpenPGP key pair'.
- Provide a name.
- Provide a valid e-mail.
- In advanced settings you can change the details of the keys, the defaults are RSA 2048bits.
- You can also set an expiration for these certificate.
- Set a passphrase that will be later be used like a password to use the keys you are generating.
Relevant links:
https://www.dash.org/forum/threads/basic-guide-to-pgp-on-windows-pc-kleopatra-%E2%80%93-gpg4win.4086/