Merge branch 'develop' of https://github.com/Pterodactyl/Panel into develop
This commit is contained in:
commit
9621f923f5
2 changed files with 37 additions and 1 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
use Illuminate\Validation\Rules\NotIn;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $uuid
|
||||
|
@ -63,6 +65,20 @@ class Mount extends Model
|
|||
'user_mountable' => 'sometimes|boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
* Implement language verification by overriding Eloquence's gather
|
||||
* rules function.
|
||||
*/
|
||||
public static function getRules()
|
||||
{
|
||||
$rules = parent::getRules();
|
||||
|
||||
$rules['source'][] = new NotIn(Mount::$invalidSourcePaths);
|
||||
$rules['target'][] = new NotIn(Mount::$invalidTargetPaths);
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable timestamps on this model.
|
||||
*
|
||||
|
@ -70,6 +86,26 @@ class Mount extends Model
|
|||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Blacklisted source paths
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public static $invalidSourcePaths = [
|
||||
'/etc/pterodactyl',
|
||||
'/var/lib/pterodactyl/volumes',
|
||||
'/srv/daemon-data',
|
||||
];
|
||||
|
||||
/**
|
||||
* Blacklisted target paths
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public static $invalidTargetPaths = [
|
||||
'/home/container',
|
||||
];
|
||||
|
||||
/**
|
||||
* Returns all eggs that have this mount assigned.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue