Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /var/www/html/mediawiki/LocalSettings.php:
- <?php
- # Protect against web entry
- if ( !defined( 'MEDIAWIKI' ) ) {
- exit;
- }
- $wgSitename = "Unethical";
- $wgScriptPath = "/mediawiki";
- $wgScriptExtension = ".php";
- $wgArticlePath = "/wiki/$1";
- ## The protocol and server name to use in fully-qualified URLs
- $wgServer = "https://unethical.me";
- ## The URL path to static resources (images, scripts, etc.)
- $wgResourceBasePath = $wgScriptPath;
- ## The URL path to the logo. Make sure you change this from the default,
- ## or else you'll overwrite your logo when you upgrade!
- $wgLogo = "https://unethical.me/resources/images/logos/UnethicalWikiLogo.png";
- ## UPO means: this is also a user preference option
- $wgEnableEmail = true;
- $wgEnableUserEmail = true; # UPO
- $wgEmergencyContact = "apache@unethical.me";
- $wgPasswordSender = "apache@unethical.me";
- $wgEnotifUserTalk = true; # UPO
- $wgEnotifWatchlist = true; # UPO
- $wgEmailAuthentication = true;
- ## Database settings
- $wgDBtype = "mysql";
- $wgDBserver = "localhost";
- $wgDBname = "unethical_wiki";
- $wgDBuser = "root";
- $wgDBpassword = ""; // This was set. Trust me.
- # MySQL specific settings
- $wgDBprefix = "taven";
- # MySQL table options to use during installation or update
- $wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
- # Experimental charset support for MySQL 5.0.
- $wgDBmysql5 = false;
- ## Shared memory settings
- $wgMainCacheType = CACHE_NONE;
- $wgMemCachedServers = [];
- ## To enable image uploads, make sure the 'images' directory
- ## is writable, then set this to true:
- $wgEnableUploads = true;
- $wgGenerateThumbnailOnParse = false;
- $wgUseImageMagick = true;
- $wgImageMagickConvertCommand = "/usr/bin/convert";
- # InstantCommons allows wiki to use images from https://commons.wikimedia.org
- $wgUseInstantCommons = true;
- # Periodically send a pingback to https://www.mediawiki.org/ with basic data
- # about this MediaWiki instance. The Wikimedia Foundation shares this data
- # with MediaWiki developers to help guide future development efforts.
- $wgPingback = true;
- ## If you use ImageMagick (or any other shell command) on a
- ## Linux server, this will need to be set to the name of an
- ## available UTF-8 locale
- $wgShellLocale = "C.UTF-8";
- ## Set $wgCacheDirectory to a writable directory on the web server
- ## to make your wiki go slightly faster. The directory should not
- ## be publically accessible from the web.
- #$wgCacheDirectory = "$IP/cache";
- # Site language code, should be one of the list in ./languages/data/Names.php
- $wgLanguageCode = "en";
- $wgSecretKey = ""; // Sorry, but you're not getting my key.
- # Changing this will log out all existing sessions.
- $wgAuthenticationTokenVersion = "1";
- # Site upgrade key. Must be set to a string (default provided) to turn on the
- # web installer while LocalSettings.php is in place
- $wgUpgradeKey = ""; // Ugh! So many keys to omit.
- ## For attaching licensing metadata to pages, and displaying an
- ## appropriate copyright notice / icon. GNU Free Documentation
- ## License and Creative Commons licenses are supported so far.
- $wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
- $wgRightsUrl = "https://creativecommons.org/licenses/by-sa/4.0/";
- $wgRightsText = "Creative Commons Attribution-ShareAlike";
- $wgRightsIcon = "$wgResourceBasePath/resources/assets/licenses/cc-by-sa.png";
- # Path to the GNU diff3 utility. Used for conflict resolution.
- $wgDiff3 = "/usr/bin/diff3";
- ## Default skin: you can change the default skin. Use the internal symbolic
- ## names, ie 'vector', 'monobook':
- $wgDefaultSkin = "vector";
- # Enabled skins.
- # The following skins were automatically enabled:
- wfLoadSkin( 'Vector' );
- # Enabled extensions. Most of the extensions are enabled by adding
- # wfLoadExtensions('ExtensionName');
- # to LocalSettings.php. Check specific extension documentation for more details.
- # The following extensions were automatically enabled:
- wfLoadExtension( 'Cite' );
- wfLoadExtension( 'CiteThisPage' );
- wfLoadExtension( 'ConfirmEdit' );
- wfLoadExtension( 'Gadgets' );
- wfLoadExtension( 'ImageMap' );
- wfLoadExtension( 'InputBox' );
- wfLoadExtension( 'Interwiki' );
- wfLoadExtension( 'LocalisationUpdate' );
- wfLoadExtension( 'Nuke' );
- wfLoadExtension( 'ParserFunctions' );
- wfLoadExtension( 'PdfHandler' );
- wfLoadExtension( 'Poem' );
- wfLoadExtension( 'Renameuser' );
- wfLoadExtension( 'SpamBlacklist' );
- wfLoadExtension( 'SyntaxHighlight_GeSHi' );
- wfLoadExtension( 'TitleBlacklist' );
- wfLoadExtension( 'WikiEditor' );
- # End of automatically generated settings.
- # Add more configuration options below.
- # MobileFrontEnd Extension
- wfLoadExtension( 'MobileFrontend' );
- wfLoadSkin( 'MinervaNeue' );
- $wgMFAutodetectMobileView = true;
- $wgMFDefaultSkinClass = "SkinMinerva";
- # Visual Editor
- wfLoadExtension( 'VisualEditor' );
- $wgDefaultUserOptions['visualeditor-enable'] = 1;
- $wgVirtualRestConfig['modules']['parsoid'] = array(
- // URL to the Parsoid instance
- // Use port 8142 if you use the Debian package
- 'url' => 'https://unethical.me:8001'
- );
- $wgVirtualRestConfig['modules']['restbase'] = [
- 'url' => "http://unethical.me:7231",
- 'domain' => '{domain}',
- 'parsoidCompat' => false
- ];
- $wgVisualEditorFullRestbaseURL = 'http://unethical.me:7231/{domain}/';
- # Custom CSS
- $wgUseSiteCss = true;
- $wgAllowSiteCSSOnRestrictedPages = true;
- ~/parsoid/config.yaml
- # This is a sample configuration file
- #
- # Copy this file to config.yaml and edit that file to fit your needs.
- #
- # 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.
- # The number of http workers (as opposed to `cpu_workers` below)
- #num_workers: 1
- worker_heartbeat_timeout: 300000
- logging:
- level: info
- #metrics:
- # type: log
- services:
- - module: 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://unethical.me/mediawiki/api.php'
- # The "domain" is used for communication with Visual Editor
- # and RESTBase. It defaults to the hostname portion of
- # the `uri` property above, but you can manually set it
- # to an arbitrary string. It must match the "domain" set
- # in $wgVirtualRestConfig.
- #domain: 'unethical.me' # 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'
- # See below, defaults to true.
- strictSSL: false
- # Enable using compute workers to parse requests.
- #useWorker: true
- # The number of workers in the pool spawned by each http worker to
- # call out for parsing. Defaults to:
- # ceil(number of cpus / `num_workers`) + 1
- #cpu_workers: 1
- # 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: 8000
- #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
- # Note that this can also be applied per wiki in the mwApis above
- 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'
- ~/parsoid/localsettings.js:
- /*
- * This old / unusual way to configure Parsoid.
- *
- * You'll probably want to start in config.example.yaml
- * and only end up here if you need some sort of backwards compatibility
- * or to support non-static configuration.
- */
- 'use strict';
- exports.setup = function(parsoidConfig) {
- // Do something dynamic with `parsoidConfig` like,
- parsoidConfig.setMwApi({
- uri: 'https://unethical.me/wiki/api.php'
- });
- parsoidConfig.loggerBackend = {
- name: ':Logger.bunyan/BunyanLogger',
- options: {
- name: 'parsoid',
- streams: [
- { stream: process.stdout, level: 'debug' }
- ]
- }};
- };
- ~/restbase/config.yaml
- # RESTBase config for small wiki installs
- #
- # - sqlite backend
- # - parsoid at http://localhost:8142
- # - wiki at http://localhost/w/api.php
- #
- # Quick setup:
- # - npm install
- # If you see errors about sqlite, you might have to `apt-get install
- # libsqlite3-dev`.
- # - cp config.example.yaml config.yaml
- # - double-check and possibly modify lines marked with XXX, then start restbase with
- #
- # node server
- #
- # - If all went well, http://localhost:7231/localhost/v1/page/html/Main_Page
- # should show your wiki's [[Main Page]].
- services:
- - name: restbase
- module: hyperswitch
- conf:
- port: 7231
- salt: secret
- default_page_size: 125
- user_agent: RESTBase
- ui_name: RESTBase
- ui_url: https://www.mediawiki.org/mediawiki/RESTBase
- ui_title: RESTBase docs
- spec:
- x-request-filters:
- - path: lib/security_response_header_filter.js
- x-sub-request-filters:
- - type: default
- name: http
- options:
- allow:
- - pattern: https://unethical.me/mediawiki/api.php
- forward_headers: true
- - pattern: https://unethical.me:8001
- forward_headers: true
- - pattern: /^https?:\/\//
- paths:
- /{domain:unethical.me}:
- x-modules:
- - path: projects/example.yaml
- options:
- action:
- # XXX Check API URL!
- apiUriTemplate: https://unethical.me/mediawiki/api.php
- # XXX Check the base RESTBase URI
- baseUriTemplate: "{{'https://{domain}:7231/{domain}/v1'}}"
- parsoid:
- # XXX Check Parsoid URL!
- host: https://unethical.me:8001
- table:
- backend: sqlite
- dbname: db.sqlite3
- pool_idle_timeout: 20000
- retry_delay: 250
- retry_limit: 10
- show_sql: true
- mobileapps:
- host: http://appservice.wmflabs.org
- purged_cache_control: s-maxage=0, max-age=86400
- purged_cache_control_client_cache: s-maxage=0, max-age=300
- # Finally, a standard service-runner config.
- info:
- name: restbase
- logging:
- name: restbase
- level: info
- Parsoid with RESTbase running in the background. Waited 20 seconds and clicked on 'Edit' in the main wiki page which is also public. No change observed. There are also no logs anywhere for parsoid after doing "find / --maxdepth 1000 --name *parsoid.log* ".
- taven@unethical:~/parsoid$ node bin/server.js
- {"name":"parsoid","hostname":"unethical.me","pid":22499,"level":30,"levelPath":"info/service-runner","msg":"master(22499) initializing 4 workers","time":"2018-02-25T05:00:46.115Z","v":0}
- {"name":"lib/index.js","hostname":"unethical.me","pid":22509,"level":30,"levelPath":"info","msg":"loading ...","time":"2018-02-25T05:00:49.336Z","v":0}
- Domain should be unique in ParsoidConfig#setMwApi calls: unethical.me
- (It doesn't have to be an actual domain, just a unique string.)
- {"name":"lib/index.js","hostname":"unethical.me","pid":22509,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2018-02-25T05:00:49.527Z","v":0}
- {"name":"lib/index.js","hostname":"unethical.me","pid":22551,"level":30,"levelPath":"info","msg":"loading ...","time":"2018-02-25T05:00:52.700Z","v":0}
- Domain should be unique in ParsoidConfig#setMwApi calls: unethical.me
- (It doesn't have to be an actual domain, just a unique string.)
- {"name":"lib/index.js","hostname":"unethical.me","pid":22551,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2018-02-25T05:00:52.889Z","v":0}
- {"name":"lib/index.js","hostname":"unethical.me","pid":22561,"level":30,"levelPath":"info","msg":"loading ...","time":"2018-02-25T05:00:56.050Z","v":0}
- Domain should be unique in ParsoidConfig#setMwApi calls: unethical.me
- (It doesn't have to be an actual domain, just a unique string.)
- {"name":"lib/index.js","hostname":"unethical.me","pid":22561,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2018-02-25T05:00:56.232Z","v":0}
- {"name":"lib/index.js","hostname":"unethical.me","pid":22571,"level":30,"levelPath":"info","msg":"loading ...","time":"2018-02-25T05:00:59.414Z","v":0}
- Domain should be unique in ParsoidConfig#setMwApi calls: unethical.me
- (It doesn't have to be an actual domain, just a unique string.)
- {"name":"lib/index.js","hostname":"unethical.me","pid":22571,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2018-02-25T05:00:59.598Z","v":0}
- {"name":"parsoid","hostname":"unethical.me","pid":22499,"level":40,"levelPath":"warn/service-runner","msg":"startup finished","time":"2018-02-25T05:00:59.601Z","v":0}
- ^C{"name":"parsoid","hostname":"unethical.me","pid":22499,"level":30,"levelPath":"info/service-runner/master","msg":"master shutting down, killing workers","time":"2018-02-25T05:01:38.976Z","v":0}
- {"name":"parsoid","hostname":"unethical.me","pid":22499,"level":30,"levelPath":"info/service-runner/master","msg":"Exiting master","time":"2018-02-25T05:01:38.992Z","v":0}
- RESTbase run with Parsoid running in the background. The the Edit button any publically editable page is clicked The progress bar gets stuck 25% of the way. Then halts for 10 seconds and proceeds to 75% as before. It never completes.
- taven@unethical:~/restbase$ node server.js
- {"name":"restbase","hostname":"unethical.me","pid":23278,"level":30,"levelPath":"info/service-runner","msg":"master(23278) initializing 4 workers","time":"2018-02-25T05:06:31.763Z","v":0}
- {"name":"restbase","hostname":"unethical.me","pid":23288,"level":40,"levelPath":"warn/startup","msg":"listening on *:7231","time":"2018-02-25T05:06:34.707Z","v":0}
- {"name":"restbase","hostname":"unethical.me","pid":23298,"level":40,"levelPath":"warn/startup","msg":"listening on *:7231","time":"2018-02-25T05:06:37.724Z","v":0}
- {"name":"restbase","hostname":"unethical.me","pid":23308,"level":40,"levelPath":"warn/startup","msg":"listening on *:7231","time":"2018-02-25T05:06:40.662Z","v":0}
- {"name":"restbase","hostname":"unethical.me","pid":23320,"level":40,"levelPath":"warn/startup","msg":"listening on *:7231","time":"2018-02-25T05:06:43.625Z","v":0}
- {"name":"restbase","hostname":"unethical.me","pid":23278,"level":40,"levelPath":"warn/service-runner","msg":"startup finished","time":"2018-02-25T05:06:43.631Z","v":0}
- ^C{"name":"restbase","hostname":"unethical.me","pid":23278,"level":30,"levelPath":"info/service-runner/master","msg":"master shutting down, killing workers","time":"2018-02-25T05:07:37.896Z","v":0}
- {"name":"restbase","hostname":"unethical.me","pid":23278,"level":30,"levelPath":"info/service-runner/master","msg":"Exiting master","time":"2018-02-25T05:07:37.916Z","v":0}
- Netstat:
- taven@unethical:~/restbase$ sudo netstat -tupln
- [sudo] password for taven:
- Active Internet connections (only servers)
- Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
- tcp 0 0 127.0.1.1:8001 0.0.0.0:* LISTEN 1558/stunnel4
- tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1329/mysqld
- tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 17994/sendmail: MTA
- tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1487/sshd
- tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 17994/sendmail: MTA
- tcp6 0 0 :::7231 :::* LISTEN 24317/server.js
- tcp6 0 0 :::8000 :::* LISTEN 23123/server.js
- tcp6 0 0 :::80 :::* LISTEN 3920/apache2
- tcp6 0 0 :::22 :::* LISTEN 1487/sshd
- tcp6 0 0 :::443 :::* LISTEN 3920/apache2
- udp 0 0 0.0.0.0:57757 0.0.0.0:* 24405/node
- udp 0 0 0.0.0.0:51651 0.0.0.0:* 23190/node
- udp 0 0 0.0.0.0:46545 0.0.0.0:* 24405/node
- udp 0 0 0.0.0.0:60914 0.0.0.0:* 23254/node
- udp 0 0 0.0.0.0:53867 0.0.0.0:* 24442/node
- udp 0 0 0.0.0.0:44014 0.0.0.0:* 23210/node
- udp 0 0 0.0.0.0:39979 0.0.0.0:* 24385/node
- udp 0 0 0.0.0.0:33835 0.0.0.0:* 23264/node
- udp 0 0 0.0.0.0:68 0.0.0.0:* 1503/dhclient
- udp 0 0 10.10.32.75:123 0.0.0.0:* 1609/ntpd
- udp 0 0 127.0.0.1:123 0.0.0.0:* 1609/ntpd
- udp 0 0 0.0.0.0:123 0.0.0.0:* 1609/ntpd
- udp 0 0 0.0.0.0:44386 0.0.0.0:* 24385/node
- udp 0 0 0.0.0.0:49533 0.0.0.0:* 24442/node
- udp6 0 0 fe80::dc19:88ff:fe0:123 :::* 1609/ntpd
- udp6 0 0 ::1:123 :::* 1609/ntpd
- udp6 0 0 :::123 :::* 1609/ntpd
- UFW Status:
- taven@unethical:~/restbase$ sudo ufw status verbose
- Status: active
- Logging: on (low)
- Default: deny (incoming), allow (outgoing), disabled (routed)
- New profiles: skip
- To Action From
- -- ------ ----
- 22 ALLOW IN Anywhere
- 3306 ALLOW IN Anywhere
- 443 ALLOW IN Anywhere
- 21/tcp ALLOW IN Anywhere
- 115/tcp ALLOW IN Anywhere
- 8000 ALLOW IN Anywhere
- 8001 ALLOW IN Anywhere
- 80 ALLOW IN Anywhere
- 25 ALLOW IN Anywhere
- 587 ALLOW IN Anywhere
- 7231 ALLOW IN Anywhere
- 22 (v6) ALLOW IN Anywhere (v6)
- 3306 (v6) ALLOW IN Anywhere (v6)
- 443 (v6) ALLOW IN Anywhere (v6)
- 21/tcp (v6) ALLOW IN Anywhere (v6)
- 115/tcp (v6) ALLOW IN Anywhere (v6)
- 8000 (v6) ALLOW IN Anywhere (v6)
- 8001 (v6) ALLOW IN Anywhere (v6)
- 80 (v6) ALLOW IN Anywhere (v6)
- 25 (v6) ALLOW IN Anywhere (v6)
- 587 (v6) ALLOW IN Anywhere (v6)
- 7231 (v6) ALLOW IN Anywhere (v6)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement