Page MenuHomePhabricator

Differentiate wikis per-path in addition of per-domain
Closed, ResolvedPublic

Description

MediaWikiFarm currently differentiates wikis because they have different domain names (or sub-domains). The proposed feature here is to differentiate wikis because they have different initial paths.

Example: two wikis http://example.org/wiki1 and http://example.org/wiki2

Original request on this topic.

Event Timeline

Seb35 triaged this task as Medium priority.Mar 25 2017, 6:23 PM

Why fix something thats not broken?

@Zppix: the idea here is that it should be possible to have multiple wikis installed on the same domain but in different subdirectories, something which isn't possible at the moment. So, nothing is broken at the moment, but this is an additional feature which, if it's not too hard to implement, would open MediaWikiFarm to more users and use cases.

@Seb35: thanks for considering this feature!

Change 344881 had a related patch set uploaded (by Seb35):
[mediawiki/extensions/MediaWikiFarm@master] [WIP] Support for farms given by subdirectories in addition of subdomains

https://gerrit.wikimedia.org/r/344881

I tagged the patch as "WIP" although it is quite finalised, I will recheck in some days if I think about other edge cases, you can comment and/or test if you want. (Note I wrote some quite extensive documentation in the subdirectory /docs.)

Change 344881 merged by jenkins-bot:
[mediawiki/extensions/MediaWikiFarm@master] Support for farms given by subdirectories in addition of subdomains

https://gerrit.wikimedia.org/r/344881

This is now merged and I created a new version (0.5.0). I will document more later, but it can be used as follows: in farms.yml (see documentation in docs/ subdirectory), selection of per-path wikis (example.org/wiki1, example.org/wiki10, and any example.org/wiki[number]) should be configured as such:

myfarm:
    
    server: 'example\.com/(?P<viki>wiki[0-9]+)'
    
    variables:
        
        - variable: 'viki'
          file: 'myfarm/wikis.yml'
    
    suffix: 'myfarm'
    wikiID: '$vikimyfarm'
    data: '/srv/data/myfarm/$viki'
    config:
      - file: 'myfarm/DefaultSettings.yml'
        key: 'default'
      - file: 'myfarm/InitialiseSettings.yml'
        key: '*'
      - file: 'myfarm/PrivateSettings.yml'
        key: '*'
      - file: 'myfarm/ExecSettings.php'
        executable: true