•  
      request #27189 Install mediawiki on non standard database
    Infos
    #27189
    Manuel Vacelet (vaceletm)
    2024-04-24 10:37
    2022-06-20 14:49
    28734
    Details
    Install mediawiki on non standard database

    Dealing with calling the MW install script maintenance/install.php when the plugin is installed on the Tuleap side. It works well when I use a DB on the standard port. However I'm not sure how to manage cases where a non standard port is used or the MySQL is only reachable over TLS. It looks like the maintenance/install.php does not support this and I'm not sure how to automate the installation without it. I can generate the LocalSettings.php file for MW directly without the install script and create the DB myself but that does not seem to work:

    $ /opt/remi/php74/root/usr/bin/php /usr/share/mediawiki-tuleap-flavor/maintenance/install.php --confpath /etc/tuleap/plugins/mediawiki_standalone/ --pass azertyuiop123 TuleapFarmManagement tuleap_mediawikifarm_admin
    PHP 7.4.29 is installed.
    Warning: you have SQLite 3.7.17, which is lower than minimum required version 3.8.0. SQLite will be unavailable.
    Warning: Could not find APCu or WinCache. Object caching is not enabled.
    Found ImageMagick: /usr/bin/convert. Image thumbnailing will be enabled if you enable uploads.
    Git version control software not found. You can ignore this for now. Note Special:Version will not display commit hashes.
    Using server name "http://localhost".
    Warning: No --scriptpath specified, using default: /wiki.
    Using server URL "http://localhost/wiki".
    Warning: Your default directory for uploads (/usr/share/mediawiki-tuleap-flavor/images/) is not checked for vulnerability to arbitrary script execution during the CLI install.
    Using the PHP intl extension for Unicode normalization.
    The environment has been checked. You can install MediaWiki.
    Wikimedia\Services\ServiceDisabledException from line 412 of /usr/share/mediawiki-tuleap-flavor/vendor/wikimedia/services/src/ServiceContainer.php: Service disabled: DBLoadBalancer #0 /usr/share/mediawiki-tuleap-flavor/includes/MediaWikiServices.php(671): Wikimedia\Services\ServiceContainer->getService()
    #1 /usr/share/mediawiki-tuleap-flavor/extensions/TuleapWikiFarm/TuleapWikiFarm.Dispatcher.php(10): MediaWiki\MediaWikiServices->getDBLoadBalancer()
    #2 /usr/share/mediawiki-tuleap-flavor/extensions/TuleapWikiFarm/TuleapWikiFarm.setup.php(4): require_once('/usr/share/medi...')
    #3 /data/etc/tuleap/plugins/mediawiki_standalone/LocalSettings.php(146): require_once('/usr/share/medi...')
    #4 /usr/share/mediawiki-tuleap-flavor/includes/installer/Installer.php(661): require('/data/etc/tulea...')
    #5 /usr/share/mediawiki-tuleap-flavor/includes/installer/CliInstaller.php(202): Installer::getExistingLocalSettings()
    #6 /usr/share/mediawiki-tuleap-flavor/maintenance/install.php(140): CliInstaller->execute()
    #7 /usr/share/mediawiki-tuleap-flavor/maintenance/doMaintenance.php(107): CommandLineInstaller->execute()
    #8 /usr/share/mediawiki-tuleap-flavor/maintenance/install.php(201): require_once('/usr/share/medi...')
    #9 {main}
    

    Did I miss something or there is no way to automate this process?

    Mediawiki Standalone
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Robert Vogel (rvogel), Dejan Savuljesku (dsavuljesku)
    Stage
    Robert Vogel (rvogel)
    Closed
    2024-04-24
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Robert Vogel (rvogel)2022-07-18 17:26

    Only specific port. As far as I could see in the code there is no way to enable TLS/SSL on the DB connection at installation time. At least not in current LTS 1.35.

    User avatar
    Thomas Gerbet (tgerbet)2022-06-23 08:44

    Why do you specify --confpath /etc/tuleap/plugins/mediawiki_standalone/? This seems to be an odd path for the LocalSettings.php.

    It is not that odd because it makes sure backup procedure of existing Tuleap instances will catch it up. We could also move it in a folder under /var but fundamentally that does not change a lot of things. It works because /usr/share/mediawiki-tuleap-flavor/LocalSettings.php is a symlink targeting /etc/tuleap/plugins/mediawiki_standalone/LocalSettings.php.

    https://tuleap.net/plugins/git/tuleap/tuleap/stable?a=blob&hb=1655b79b7a232608aab6a2297b85de4202cc049d&h=1b659226f3d79960e8114020c64791b5cfba2a5d&f=plugins%2Fmediawiki_standalone%2Fadditional-packages%2Fmediawiki-tuleap-flavor.spec#L35

    Also, the stack-trace indicates that there was already a LocalSettings.php file, which shouldn't be the case at installation time.

    Yes, as said this an attempt to make it work by generating a LocalSettings.php file first and then trying to call the install script but indeed that does not work.

    Well, the CLI installer should be able to accept an argument like --dbserver databaseserverhostname:12345 that allows to specify the port. Apprarently the --dbport flag will only work with PostGreSQL (odd). But I have never used this.

    Good to know, thanks.

    An option would be to override the CLI installer class used by maintenance/install.php and provide a custom DatabaseInstaller object. We already do an override for the LocalSettingsGenerator.

    I'm guessing this is fine for us. I am a bit surprised this cannot be managed natively given that cloud providers have a tendency to require SSL/TLS by default (e.g. Azure Database).

    User avatar
    Robert Vogel (rvogel)2022-06-22 16:43

    Well, the CLI installer should be able to accept an argument like --dbserver databaseserverhostname:12345 that allows to specify the port. Apprarently the --dbport flag will only work with PostGreSQL (odd). But I have never used this.

    You may still be right, as MysqlInstaller::openConnection does not allow for any "flags". Such flags would be required in case of an SSL secured connection (PHP constant MYSQLI_CLIENT_SSL). Looks like the code does neither allow to provide this, nor calculates it implicitly.

    An option would be to override the CLI installer class used by maintenance/install.php and provide a custom DatabaseInstaller object. We already do an override for the LocalSettingsGenerator.

    Why do you specify --confpath /etc/tuleap/plugins/mediawiki_standalone/? This seems to be an odd path for the LocalSettings.php. Also, the stack-trace indicates that there was already a LocalSettings.php file, which shouldn't be the case at installation time.


    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes