Difference between revisions of "MediaWiki"
Jump to navigation
Jump to search
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | = side bar = | + | =side bar= |
https://www.wiki.chlamdb.ch/index.php?title=MediaWiki:Sidebar | https://www.wiki.chlamdb.ch/index.php?title=MediaWiki:Sidebar | ||
| − | = block access to non-logged users = | + | |
| + | == Setup VisualEditor == | ||
| + | <br /> | ||
| + | |||
| + | ==== Configuration files ==== | ||
| + | |||
| + | * /var/www/mediawiki/LocalSettings.phpLocalSettings.php | ||
| + | * /etc/mediawiki/parsoid/config.yaml | ||
| + | * added 8142 to AWS security group (not clear if necessary) | ||
| + | * opened firewall port 8142 (not clear if necessary) | ||
| + | |||
| + | === config.yaml === | ||
| + | |||
| + | <syntaxhighlight lang="yaml"> | ||
| + | # This is a sample configuration file | ||
| + | # | ||
| + | # Also see: | ||
| + | # - `npm start -- -h` for more information about passing config files via | ||
| + | # the commandline. | ||
| + | # - lib/config/ParsoidConfig.js for all the properties that you can configure | ||
| + | # here. Not all properties are documented here. | ||
| + | |||
| + | worker_heartbeat_timeout: 300000 | ||
| + | |||
| + | logging: | ||
| + | level: info | ||
| + | |||
| + | #metrics: | ||
| + | # type: log | ||
| + | |||
| + | services: | ||
| + | - module: ../src/lib/index.js | ||
| + | entrypoint: apiServiceWorker | ||
| + | conf: | ||
| + | # For backwards compatibility, and to continue to support non-static | ||
| + | # configs for the time being, optionally provide a path to a | ||
| + | # localsettings.js file. See localsettings.example.js | ||
| + | #localsettings: ./localsettings.js | ||
| + | |||
| + | # Set your own user-agent string | ||
| + | # Otherwise, defaults to: | ||
| + | # 'Parsoid/<current-version-defined-in-package.json>' | ||
| + | #userAgent: 'My-User-Agent-String' | ||
| + | |||
| + | # Configure Parsoid to point to your MediaWiki instances. | ||
| + | mwApis: | ||
| + | - # This is the only required parameter, | ||
| + | # the URL of you MediaWiki API endpoint. | ||
| + | uri: 'https://wiki.chlamdb.ch/api.php' | ||
| + | # The "domain" is used for communication with Visual Editor | ||
| + | # and RESTBase. It defaults to the hostname portion of | ||
| + | # the `uri` property below, but you can manually set it | ||
| + | # to an arbitrary string. | ||
| + | domain: 'localhost' # optional | ||
| + | # To specify a proxy (or proxy headers) specific to this prefix | ||
| + | # (which overrides defaultAPIProxyURI). Alternatively, set `proxy` | ||
| + | # to `null` to override and force no proxying when a default proxy | ||
| + | # has been set. | ||
| + | #proxy: | ||
| + | # uri: 'http://my.proxy:1234/' | ||
| + | # headers: # optional | ||
| + | # 'X-Forwarded-Proto': 'https' | ||
| + | |||
| + | # We pre-define wikipedias as 'enwiki', 'dewiki' etc. Similarly | ||
| + | # for other projects: 'enwiktionary', 'enwikiquote', 'enwikibooks', | ||
| + | # 'enwikivoyage' etc. | ||
| + | # The default for this is false. Uncomment the line below if you want | ||
| + | # to load WMF's config for wikipedias, etc. | ||
| + | #loadWMF: true | ||
| + | |||
| + | # A default proxy to connect to the API endpoints. | ||
| + | # Default: undefined (no proxying). | ||
| + | # Overridden by per-wiki proxy config in setMwApi. | ||
| + | #defaultAPIProxyURI: 'http://proxy.example.org:8080' | ||
| + | |||
| + | # Enable debug mode (prints extra debugging messages) | ||
| + | #debug: true | ||
| + | |||
| + | # Use the PHP preprocessor to expand templates via the MW API (default true) | ||
| + | #usePHPPreProcessor: false | ||
| + | |||
| + | # Use selective serialization (default false) | ||
| + | #useSelser: true | ||
| + | |||
| + | # Allow cross-domain requests to the API (default '*') | ||
| + | # Sets Access-Control-Allow-Origin header | ||
| + | # disable: | ||
| + | #allowCORS: false | ||
| + | # restrict: | ||
| + | #allowCORS: 'some.domain.org' | ||
| + | |||
| + | # Allow override of port/interface: | ||
| + | #serverPort: 8142 | ||
| + | #serverInterface: '127.0.0.1' | ||
| + | |||
| + | # Enable linting of some wikitext errors to the log | ||
| + | #linting: true | ||
| + | #linter: | ||
| + | # sendAPI: false # Send lint errors to MW API instead of to the log | ||
| + | # apiSampling: 10 # Sampling rate (1 / 10) | ||
| + | |||
| + | # Require SSL certificates to be valid (default true) | ||
| + | # Set to false when using self-signed SSL certificates | ||
| + | #strictSSL: false | ||
| + | |||
| + | # Use a different server for CSS style modules. | ||
| + | # Leaving it undefined (the default) will use the same URI as the MW API, | ||
| + | # changing api.php for load.php. | ||
| + | #modulesLoadURI: 'http://example.org/load.php' | ||
| + | </syntaxhighlight><br /> | ||
| + | |||
| + | === LocalSettings.php === | ||
| + | <br /><syntaxhighlight lang="php5"> | ||
| + | wfLoadExtension('VisualEditor'); | ||
| + | $wgDefaultUserOptions['visualeditor-enable'] = 1; | ||
| + | $wgVirtualRestConfig['modules']['parsoid'] = array( | ||
| + | // URL to the Parsoid instance - use port 8142 if you use the Debian package - the parameter 'URL' was first used but is now deprecated (string) | ||
| + | 'url' => 'http://chlamdb.ch:8142/', | ||
| + | // Parsoid "domain" (string, optional) - MediaWiki >= 1.26 | ||
| + | 'domain' => 'localhost', | ||
| + | // Parsoid "prefix" (string, optional) - deprecated since MediaWiki 1.26, use 'domain' | ||
| + | 'prefix' => 'localhost', | ||
| + | // Forward cookies in the case of private wikis (string or false, optional) | ||
| + | 'forwardCookies' => false, | ||
| + | // request timeout in seconds (integer or null, optional) | ||
| + | 'timeout' => null, | ||
| + | // Parsoid HTTP proxy (string or null, optional) | ||
| + | 'HTTPProxy' => null, | ||
| + | // whether to parse URL as if they were meant for RESTBase (boolean or null, optional) | ||
| + | 'restbaseCompat' => null, | ||
| + | ); | ||
| + | |||
| + | </syntaxhighlight> | ||
| + | |||
| + | =block access to non-logged users= | ||
Latest revision as of 22:40, 29 January 2019
side bar
https://www.wiki.chlamdb.ch/index.php?title=MediaWiki:Sidebar
Setup VisualEditor
Configuration files
- /var/www/mediawiki/LocalSettings.phpLocalSettings.php
- /etc/mediawiki/parsoid/config.yaml
- added 8142 to AWS security group (not clear if necessary)
- opened firewall port 8142 (not clear if necessary)
config.yaml
# This is a sample configuration file
#
# Also see:
# - `npm start -- -h` for more information about passing config files via
# the commandline.
# - lib/config/ParsoidConfig.js for all the properties that you can configure
# here. Not all properties are documented here.
worker_heartbeat_timeout: 300000
logging:
level: info
#metrics:
# type: log
services:
- module: ../src/lib/index.js
entrypoint: apiServiceWorker
conf:
# For backwards compatibility, and to continue to support non-static
# configs for the time being, optionally provide a path to a
# localsettings.js file. See localsettings.example.js
#localsettings: ./localsettings.js
# Set your own user-agent string
# Otherwise, defaults to:
# 'Parsoid/<current-version-defined-in-package.json>'
#userAgent: 'My-User-Agent-String'
# Configure Parsoid to point to your MediaWiki instances.
mwApis:
- # This is the only required parameter,
# the URL of you MediaWiki API endpoint.
uri: 'https://wiki.chlamdb.ch/api.php'
# The "domain" is used for communication with Visual Editor
# and RESTBase. It defaults to the hostname portion of
# the `uri` property below, but you can manually set it
# to an arbitrary string.
domain: 'localhost' # optional
# To specify a proxy (or proxy headers) specific to this prefix
# (which overrides defaultAPIProxyURI). Alternatively, set `proxy`
# to `null` to override and force no proxying when a default proxy
# has been set.
#proxy:
# uri: 'http://my.proxy:1234/'
# headers: # optional
# 'X-Forwarded-Proto': 'https'
# We pre-define wikipedias as 'enwiki', 'dewiki' etc. Similarly
# for other projects: 'enwiktionary', 'enwikiquote', 'enwikibooks',
# 'enwikivoyage' etc.
# The default for this is false. Uncomment the line below if you want
# to load WMF's config for wikipedias, etc.
#loadWMF: true
# A default proxy to connect to the API endpoints.
# Default: undefined (no proxying).
# Overridden by per-wiki proxy config in setMwApi.
#defaultAPIProxyURI: 'http://proxy.example.org:8080'
# Enable debug mode (prints extra debugging messages)
#debug: true
# Use the PHP preprocessor to expand templates via the MW API (default true)
#usePHPPreProcessor: false
# Use selective serialization (default false)
#useSelser: true
# Allow cross-domain requests to the API (default '*')
# Sets Access-Control-Allow-Origin header
# disable:
#allowCORS: false
# restrict:
#allowCORS: 'some.domain.org'
# Allow override of port/interface:
#serverPort: 8142
#serverInterface: '127.0.0.1'
# Enable linting of some wikitext errors to the log
#linting: true
#linter:
# sendAPI: false # Send lint errors to MW API instead of to the log
# apiSampling: 10 # Sampling rate (1 / 10)
# Require SSL certificates to be valid (default true)
# Set to false when using self-signed SSL certificates
#strictSSL: false
# Use a different server for CSS style modules.
# Leaving it undefined (the default) will use the same URI as the MW API,
# changing api.php for load.php.
#modulesLoadURI: 'http://example.org/load.php'
LocalSettings.php
wfLoadExtension('VisualEditor');
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgVirtualRestConfig['modules']['parsoid'] = array(
// URL to the Parsoid instance - use port 8142 if you use the Debian package - the parameter 'URL' was first used but is now deprecated (string)
'url' => 'http://chlamdb.ch:8142/',
// Parsoid "domain" (string, optional) - MediaWiki >= 1.26
'domain' => 'localhost',
// Parsoid "prefix" (string, optional) - deprecated since MediaWiki 1.26, use 'domain'
'prefix' => 'localhost',
// Forward cookies in the case of private wikis (string or false, optional)
'forwardCookies' => false,
// request timeout in seconds (integer or null, optional)
'timeout' => null,
// Parsoid HTTP proxy (string or null, optional)
'HTTPProxy' => null,
// whether to parse URL as if they were meant for RESTBase (boolean or null, optional)
'restbaseCompat' => null,
);