first commit
This commit is contained in:
commit
788cf3e917
47 changed files with 2007 additions and 0 deletions
32
app/ConfigFilesViewer.php
Normal file
32
app/ConfigFilesViewer.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue