feat: move storage path setting to configuration file
- change default storage path to /srv/libretime - remove music dirs table - use /tmp for testing storage - storage dir should always have a trailing slash
This commit is contained in:
parent
b3ff2defc4
commit
f7bb6e7592
48 changed files with 464 additions and 4701 deletions
|
@ -29,9 +29,6 @@ return [
|
|||
'BaseCcMountName' => 'airtime/om/BaseCcMountName.php',
|
||||
'BaseCcMountNamePeer' => 'airtime/om/BaseCcMountNamePeer.php',
|
||||
'BaseCcMountNameQuery' => 'airtime/om/BaseCcMountNameQuery.php',
|
||||
'BaseCcMusicDirs' => 'airtime/om/BaseCcMusicDirs.php',
|
||||
'BaseCcMusicDirsPeer' => 'airtime/om/BaseCcMusicDirsPeer.php',
|
||||
'BaseCcMusicDirsQuery' => 'airtime/om/BaseCcMusicDirsQuery.php',
|
||||
'BaseCcPerms' => 'airtime/om/BaseCcPerms.php',
|
||||
'BaseCcPermsPeer' => 'airtime/om/BaseCcPermsPeer.php',
|
||||
'BaseCcPermsQuery' => 'airtime/om/BaseCcPermsQuery.php',
|
||||
|
@ -158,10 +155,6 @@ return [
|
|||
'CcMountNamePeer' => 'airtime/CcMountNamePeer.php',
|
||||
'CcMountNameQuery' => 'airtime/CcMountNameQuery.php',
|
||||
'CcMountNameTableMap' => 'airtime/map/CcMountNameTableMap.php',
|
||||
'CcMusicDirs' => 'airtime/CcMusicDirs.php',
|
||||
'CcMusicDirsPeer' => 'airtime/CcMusicDirsPeer.php',
|
||||
'CcMusicDirsQuery' => 'airtime/CcMusicDirsQuery.php',
|
||||
'CcMusicDirsTableMap' => 'airtime/map/CcMusicDirsTableMap.php',
|
||||
'CcPerms' => 'airtime/CcPerms.php',
|
||||
'CcPermsPeer' => 'airtime/CcPermsPeer.php',
|
||||
'CcPermsQuery' => 'airtime/CcPermsQuery.php',
|
||||
|
|
|
@ -76,7 +76,17 @@ class Config
|
|||
|
||||
// Storage
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
$CC_CONFIG['current_backend'] = $values['current_backend']['storage_backend'] ?? 'file';
|
||||
$CC_CONFIG['storagePath'] = $values['storage']['path'] ?? '/srv/libretime';
|
||||
if (!is_dir($CC_CONFIG['storagePath'])) {
|
||||
echo "the configured storage.path '{$CC_CONFIG['storagePath']}' does not exists!";
|
||||
|
||||
exit;
|
||||
}
|
||||
if (!is_writable($CC_CONFIG['storagePath'])) {
|
||||
echo "the configured storage.path '{$CC_CONFIG['storagePath']}' is not writable!";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
// Facebook (DEPRECATED)
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -146,4 +156,9 @@ class Config
|
|||
|
||||
return in_array(strtolower($value), ['yes', 'true']);
|
||||
}
|
||||
|
||||
public static function getStoragePath()
|
||||
{
|
||||
return rtrim(self::getConfig()['storagePath'], '/') . '/';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue