Last active
January 7, 2018 13:17
-
-
Save onokatio/0af244a85429b86908f38bdcedfbbc85 to your computer and use it in GitHub Desktop.
Mediawikiにビジュアルエディタを導入する ref: https://qiita.com/onokatio/items/5bbfb3ad268c803b2b63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| allow: | |
| - pattern: http://localhost/wiki/api.php | |
| (略) | |
| - pattern: http://localhost:8000 | |
| (略) | |
| paths: | |
| /{domain:localhost}: | |
| action: | |
| # XXX Check API URL! | |
| apiUriTemplate: http://localhost/wiki/api.php | |
| (略) | |
| parsoid: | |
| # XXX Check Parsoid URL! localhost is the default configuration | |
| host: http://localhost:8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cd extensions | |
| $ wget https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_30-61f161a.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ tar xvf ./Visu..(略)..tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo systemctl status parsoid | |
| ● parsoid.service - Mediawiki Parsoid web service on node.js | |
| Loaded: loaded (/etc/systemd/system/parsoid.service; disabled) | |
| Active: active (running) since Sun 2018-01-07 15:49:07 JST; 52s ago | |
| Docs: http://www.mediawiki.org/wiki/Parsoid | |
| Main PID: 11048 (node) | |
| CGroup: /system.slice/parsoid.service | |
| └─11105 /usr/bin/nodejs /path/to/parsoid/node_modules/service-runner/service-runner.js | |
| Jan 07 15:49:10 rpi3 node[11048]: {"name":"parsoid","hostname":"localhost","pid":11048,"level":30,"levelPath":"info/service-runner","msg":"master(11048) initializing 4 workers","time":"2018-01-07T06:49:10.607Z","v":0} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ git clone https://github.com/wikimedia/restbase.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ npm install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cp config.example.yaml config.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo systemctl daemon-reload | |
| $ sudo systemctl start parsoid | |
| $ sudo systemctl status parsoid | |
| $ sudo systemctl enable parsoid #自動起動の設定 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cd parsoid | |
| $ npm install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cp config.example.yaml config.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo systemctl daemon-reload | |
| $ sudo systemctl start parsoid | |
| $ sudo systemctl status parsoid | |
| $ sudo systemctl enable parsoid #自動起動の設定 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wfLoadExtension( 'VisualEditor' ); | |
| $wgDefaultUserOptions['visualeditor-enable'] = 1; | |
| $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor"; | |
| $wgHiddenPrefs[] = 'visualeditor-enable'; | |
| $wgDefaultUserOptions['visualeditor-enable-experimental'] = 1; | |
| $wgVisualEditorAvailableNamespaces = [ | |
| NS_MAIN => true, | |
| NS_USER => true, | |
| 102 => true, | |
| "_merge_strategy" => "array_plus" | |
| ]; | |
| $wgVirtualRestConfig['modules']['parsoid'] = array( | |
| 'url' => 'http://localhost:8000', | |
| 'domain' => 'localhost', | |
| 'prefix' => 'localhost' | |
| ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PORT=8000 | |
| NODE_PATH=/path/to/parsoid/node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=Mediawiki Parsoid web service on node.js | |
| Documentation=http://www.mediawiki.org/wiki/Parsoid | |
| Wants=local-fs.target network.target | |
| After=local-fs.target network.target | |
| [Install] | |
| WantedBy=multi-user.target | |
| [Service] | |
| Type=simple | |
| User=www-data | |
| Group=www-data | |
| WorkingDirectory=/path/to/parsoid | |
| EnvironmentFile=-/path/to/parsoid/parsoid.env | |
| ExecStart=/usr/bin/nodejs /path/to/parsoid/bin/server.js | |
| KillMode=process | |
| Restart=on-success | |
| PrivateTmp=true | |
| StandardOutput=syslog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=Mediawiki RESTBase service | |
| Documentation=https://www.mediawiki.org/wiki/RESTBase | |
| Wants=local-fs.target network.target | |
| After=local-fs.target network.target | |
| [Install] | |
| WantedBy=multi-user.target | |
| [Service] | |
| Type=simple | |
| User=www-data | |
| Group=www-data | |
| WorkingDirectory=/path/to/restbase/node_modules | |
| ExecStart=/usr/bin/node /path/to/restbase/server.js | |
| KillMode=process | |
| Restart=on-success | |
| PrivateTmp=true | |
| StandardOutput=syslog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment