MediaWiki extension that make MW using QCloud COS instead of local storage implementation
- Clone git repository
git clone https://github.com/RazeSoldier/MediaWiki-extension-QCloudStorage.git
or download snapshot tarball tomediawiki/extensions
directory - Install third-party dependencies:
composer install --no-dev
- Put
wfLoadExtension( 'QCloudStorage' );
to your LocalSettings.php.
Proper use of this extension must follow the configuration format below:
$wgFileBackends[] = [
'name' => 'qcloud',
'class' => \RazeSoldier\MWQCloudStorage\QCloudFileBackend::class,
'wikiId' => 'wiki',
'bucket' => 'image-123456', // Here is the name of the bucket to upload the file to, format: `<name>-<appid>`
'lockManager' => 'fsLockManager',
'viewpoint' => 'https://cdn.example.com', // Optional. This configuration can customize the domain of the file, usually set to CDN domain.
];
$wgQCloudAuth = [
'region' => 'ap-guangzhou', // The bucket region
'secretId' => 'XXX', // Account secretId
'secretKey' => 'XXX', // Account secretKey
];
// This will officially replace the original file storage implementation
$wgLocalFileRepo = [
'name' => 'local',
'class' => \RazeSoldier\MWQCloudStorage\QCloudRepo::class,
'backend' => 'qcloud',
];
- Make sure the configuration is correct
- Comment
$wgLocalFileRepo
array - Do migrate:
php maintenance\copyFileBackend.php --src local-backend --dst qcloud --containers local-public
- Uncomment
$wgLocalFileRepo
array
Note: Migration time depending on the size of your local file repository.
If you encounter any problems, please feel free to ask the Issues.