first commit

This commit is contained in:
小喵 2022-07-11 19:56:44 +08:00
commit 788cf3e917
Signed by: mt
GPG key ID: 2BCF198BD3341FB3
47 changed files with 2007 additions and 0 deletions

32
app/ConfigFilesViewer.php Normal file
View file

@ -0,0 +1,32 @@
<?php
namespace MingTsay\Akanyan;
class ConfigFilesViewer extends FileViewer
{
protected static function directory(): string
{
return '/media/sdc/mt/minecraft-docker-image/data';
}
protected static function whitelist(): ?array
{
return [
'banned-ips.json',
'banned-players.json',
'ops.json',
'server.properties',
'usercache.json',
'whitelist.json',
];
}
public static function read($file): ?string
{
$content = parent::read($file);
if ($content !== null && $file === 'server.properties')
$content = preg_replace('/^(rcon\.password)=(.*)$/m', '$1=***hidden***', $content);
return $content;
}
}