2006-10-19 16:55:07 +02:00
|
|
|
<?php
|
2010-10-04 23:00:20 +02:00
|
|
|
define('CAMPCASTER_VERSION', '1.6.0-alpha');
|
|
|
|
define('CAMPCASTER_COPYRIGHT_DATE', '2010');
|
|
|
|
|
|
|
|
// These are the default values for the config.
|
2006-12-16 07:36:22 +01:00
|
|
|
global $CC_CONFIG;
|
2006-10-19 16:55:07 +02:00
|
|
|
|
2010-10-04 23:00:20 +02:00
|
|
|
// Note that these values can be overridden by the user config file,
|
|
|
|
// located in ~/.campcaster/storageServer.conf.php
|
|
|
|
// To disable this, set this variable to false.
|
2010-10-11 17:22:04 +02:00
|
|
|
//define('ALLOW_CONF_OVERRIDE', false);
|
2010-10-04 23:00:20 +02:00
|
|
|
|
2006-12-16 07:36:22 +01:00
|
|
|
$CC_CONFIG = array(
|
2010-10-04 23:00:20 +02:00
|
|
|
// Database config
|
2006-10-19 16:55:07 +02:00
|
|
|
'dsn' => array(
|
2010-10-11 17:22:04 +02:00
|
|
|
'username' => 'campcaster',
|
|
|
|
'password' => 'campcaster',
|
2006-10-19 16:55:07 +02:00
|
|
|
'hostspec' => 'localhost',
|
|
|
|
'phptype' => 'pgsql',
|
2010-10-11 17:22:04 +02:00
|
|
|
'database' => 'campcaster',
|
2006-10-19 16:55:07 +02:00
|
|
|
),
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// Name of the web server user
|
2010-10-01 23:39:23 +02:00
|
|
|
'webServerUser' => 'www-data',
|
|
|
|
|
2010-10-04 23:00:20 +02:00
|
|
|
// prefix for table names in the database
|
|
|
|
'tblNamePrefix' => 'cc_',
|
|
|
|
|
|
|
|
// main directory for storing binary media files
|
|
|
|
'storageDir' => dirname(__FILE__).'/stor',
|
|
|
|
|
|
|
|
// directory for temporary files
|
|
|
|
'bufferDir' => dirname(__FILE__).'/stor/buffer',
|
|
|
|
|
|
|
|
// directory for incomplete transferred files
|
|
|
|
'transDir' => dirname(__FILE__).'/trans',
|
|
|
|
|
|
|
|
// directory for symlinks to accessed files
|
|
|
|
'accessDir' => dirname(__FILE__).'/access',
|
|
|
|
'cronDir' => dirname(__FILE__).'/backend/cron',
|
|
|
|
|
|
|
|
/* ================================================ storage configuration */
|
2010-10-01 23:39:23 +02:00
|
|
|
"rootDir" => dirname(__FILE__),
|
|
|
|
"smartyTemplate" => dirname(__FILE__)."/htmlUI/templates",
|
|
|
|
"smartyTemplateCompiled" => dirname(__FILE__)."/htmlUI/templates_c",
|
2010-10-04 23:00:20 +02:00
|
|
|
'pearPath' => dirname(__FILE__).'/3rd_party/php/pear',
|
2010-10-01 23:39:23 +02:00
|
|
|
|
2010-10-04 23:00:20 +02:00
|
|
|
// secret token cookie name
|
2006-11-21 17:20:37 +01:00
|
|
|
'authCookieName'=> 'campcaster_session_id',
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// name of admin group
|
2010-09-10 20:37:02 +02:00
|
|
|
//'AdminsGr' => 'Admins',
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// name of station preferences group
|
2010-09-10 21:49:35 +02:00
|
|
|
'StationPrefsGr'=> 'StationPrefs',
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// name of 'all users' group
|
2010-09-10 20:37:02 +02:00
|
|
|
//'AllGr' => 'All',
|
2006-10-19 16:55:07 +02:00
|
|
|
'TrashName' => 'trash_',
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// enable/disable validator
|
2006-10-19 16:55:07 +02:00
|
|
|
'validate' => TRUE,
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// enable/disable safe delete (move to trash)
|
2006-10-19 16:55:07 +02:00
|
|
|
'useTrash' => TRUE,
|
|
|
|
|
|
|
|
/* ==================================================== URL configuration */
|
2010-10-04 23:00:20 +02:00
|
|
|
// path-URL-part of storageServer base dir
|
|
|
|
'storageUrlPath' => '/campcaster/backend',
|
|
|
|
|
|
|
|
// XMLRPC server script address relative to storageUrlPath
|
|
|
|
'storageXMLRPC' => 'xmlrpc/xrLocStor.php',
|
|
|
|
|
|
|
|
// host and port of storageServer
|
|
|
|
'storageUrlHost' => 'localhost',
|
2006-10-19 16:55:07 +02:00
|
|
|
'storageUrlPort' => 80,
|
|
|
|
|
2010-10-04 23:00:20 +02:00
|
|
|
/* ================================================ remote link configuration */
|
|
|
|
// path-URL-part of remote server base dir
|
2010-09-30 22:59:38 +02:00
|
|
|
'archiveUrlPath' => '/campcaster/backend',
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// XMLRPC server script address relative to archiveUrlPath
|
2010-09-07 22:15:05 +02:00
|
|
|
'archiveXMLRPC' => 'xmlrpc/xrLocStor.php',
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// host and port of archiveServer
|
2006-10-19 16:55:07 +02:00
|
|
|
'archiveUrlHost' => 'localhost',
|
2010-09-10 20:37:02 +02:00
|
|
|
// 'archiveUrlHost' => '192.168.30.166',
|
2006-10-19 16:55:07 +02:00
|
|
|
'archiveUrlPort' => 80,
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// account info for login to archive
|
2006-10-19 16:55:07 +02:00
|
|
|
'archiveAccountLogin' => 'root',
|
|
|
|
'archiveAccountPass' => 'q',
|
|
|
|
|
|
|
|
/* ============================================== scheduler configuration */
|
2010-10-11 17:22:04 +02:00
|
|
|
'schedulerUrlPath' => '',
|
|
|
|
'schedulerXMLRPC' => 'RC2',
|
|
|
|
'schedulerUrlHost' => 'localhost',
|
|
|
|
'schedulerUrlPort' => 3344,
|
|
|
|
'schedulerPass' => 'change_me',
|
2006-10-19 16:55:07 +02:00
|
|
|
|
|
|
|
/* ==================================== aplication-specific configuration */
|
|
|
|
'objtypes' => array(
|
2010-09-03 22:49:28 +02:00
|
|
|
'Storage' => array(/*'Folder',*/ 'File' /*, 'Replica'*/),
|
2006-10-19 16:55:07 +02:00
|
|
|
'File' => array(),
|
|
|
|
'audioclip' => array(),
|
|
|
|
'playlist' => array(),
|
2010-09-03 22:49:28 +02:00
|
|
|
// 'Replica' => array(),
|
2006-10-19 16:55:07 +02:00
|
|
|
),
|
|
|
|
'allowedActions'=> array(
|
|
|
|
'File' => array('editPrivs', 'write', 'read'),
|
|
|
|
'audioclip' => array('editPrivs', 'write', 'read'),
|
|
|
|
'playlist' => array('editPrivs', 'write', 'read'),
|
2010-09-03 22:49:28 +02:00
|
|
|
// 'Replica' => array('editPrivs', 'write', 'read'),
|
|
|
|
// '_class' => array('editPrivs', 'write', 'read'),
|
2006-10-19 16:55:07 +02:00
|
|
|
),
|
|
|
|
'allActions' => array(
|
2010-09-03 22:49:28 +02:00
|
|
|
'editPrivs', 'write', 'read', /*'classes',*/ 'subjects'
|
2006-10-19 16:55:07 +02:00
|
|
|
),
|
|
|
|
|
|
|
|
/* ============================================== auxiliary configuration */
|
|
|
|
'tmpRootPass' => 'q',
|
|
|
|
|
|
|
|
/* =================================================== cron configuration */
|
2006-11-30 05:37:16 +01:00
|
|
|
'cronUserName' => 'www-data',
|
2006-10-19 16:55:07 +02:00
|
|
|
# 'lockfile' => dirname(__FILE__).'/cron/cron.lock',
|
2010-09-30 22:59:38 +02:00
|
|
|
'lockfile' => dirname(__FILE__).'/stor/buffer/cron.lock',
|
2006-10-19 16:55:07 +02:00
|
|
|
'cronfile' => dirname(__FILE__).'/cron/croncall.php',
|
|
|
|
'paramdir' => dirname(__FILE__).'/cron/params',
|
2010-09-10 20:37:02 +02:00
|
|
|
'systemPrefId' => "0", // ID for system prefs in prefs table
|
2006-10-19 16:55:07 +02:00
|
|
|
);
|
2006-12-16 07:36:22 +01:00
|
|
|
|
|
|
|
// Add database table names
|
2010-09-17 22:46:17 +02:00
|
|
|
$CC_CONFIG['playListTable'] = $CC_CONFIG['tblNamePrefix'].'playlist';
|
|
|
|
$CC_CONFIG['playListContentsTable'] = $CC_CONFIG['tblNamePrefix'].'playlistcontents';
|
2006-12-16 07:36:22 +01:00
|
|
|
$CC_CONFIG['filesTable'] = $CC_CONFIG['tblNamePrefix'].'files';
|
|
|
|
$CC_CONFIG['accessTable'] = $CC_CONFIG['tblNamePrefix'].'access';
|
|
|
|
$CC_CONFIG['permTable'] = $CC_CONFIG['tblNamePrefix'].'perms';
|
|
|
|
$CC_CONFIG['sessTable'] = $CC_CONFIG['tblNamePrefix'].'sess';
|
|
|
|
$CC_CONFIG['subjTable'] = $CC_CONFIG['tblNamePrefix'].'subjs';
|
|
|
|
$CC_CONFIG['smembTable'] = $CC_CONFIG['tblNamePrefix'].'smemb';
|
|
|
|
$CC_CONFIG['transTable'] = $CC_CONFIG['tblNamePrefix'].'trans';
|
|
|
|
$CC_CONFIG['prefTable'] = $CC_CONFIG['tblNamePrefix'].'pref';
|
2010-09-28 19:25:03 +02:00
|
|
|
//$CC_CONFIG['playlogTable'] = $CC_CONFIG['tblNamePrefix'].'playlog';
|
2010-09-10 20:37:02 +02:00
|
|
|
$CC_CONFIG['scheduleTable'] = $CC_CONFIG['tblNamePrefix'].'schedule';
|
|
|
|
$CC_CONFIG['backupTable'] = $CC_CONFIG['tblNamePrefix'].'backup';
|
2010-09-29 22:39:00 +02:00
|
|
|
$CC_CONFIG['playListTimeView'] = $CC_CONFIG['tblNamePrefix'].'playlisttimes';
|
2010-09-14 16:18:53 +02:00
|
|
|
|
2010-09-17 22:46:17 +02:00
|
|
|
$CC_CONFIG['playListSequence'] = $CC_CONFIG['playListTable'].'_id';
|
2010-09-14 16:18:53 +02:00
|
|
|
$CC_CONFIG['filesSequence'] = $CC_CONFIG['filesTable'].'_id';
|
|
|
|
$CC_CONFIG['transSequence'] = $CC_CONFIG['transTable'].'_id';
|
|
|
|
$CC_CONFIG['prefSequence'] = $CC_CONFIG['prefTable'].'_id';
|
|
|
|
$CC_CONFIG['permSequence'] = $CC_CONFIG['permTable'].'_id';
|
|
|
|
$CC_CONFIG['subjSequence'] = $CC_CONFIG['subjTable'].'_id';
|
|
|
|
$CC_CONFIG['smembSequence'] = $CC_CONFIG['smembTable'].'_id';
|
2006-12-16 07:36:22 +01:00
|
|
|
|
2010-10-04 23:00:20 +02:00
|
|
|
// system users/groups - cannot be deleted
|
2006-12-16 07:36:22 +01:00
|
|
|
$CC_CONFIG['sysSubjs'] = array(
|
2010-09-10 21:49:35 +02:00
|
|
|
'root', /*$CC_CONFIG['AdminsGr'],*/ /*$CC_CONFIG['AllGr'],*/ $CC_CONFIG['StationPrefsGr']
|
2006-10-19 16:55:07 +02:00
|
|
|
);
|
2010-10-04 23:00:20 +02:00
|
|
|
|
|
|
|
// Add PEAR to the PHP path
|
2010-09-10 20:37:02 +02:00
|
|
|
$old_include_path = get_include_path();
|
|
|
|
set_include_path('.'.PATH_SEPARATOR.$CC_CONFIG['pearPath'].PATH_SEPARATOR.$old_include_path);
|
2006-10-19 16:55:07 +02:00
|
|
|
|
2010-10-11 17:22:04 +02:00
|
|
|
//if (ALLOW_CONF_OVERRIDE) {
|
|
|
|
// // See if a ~/.campcaster/storageServer.conf.php exists, and
|
|
|
|
// // overwrite the settings from there if any
|
|
|
|
// $this_file = null;
|
|
|
|
// if (isset($_SERVER["SCRIPT_FILENAME"])) {
|
|
|
|
// $this_file = $_SERVER["SCRIPT_FILENAME"];
|
|
|
|
// } elseif(isset($argv[0])) {
|
|
|
|
// $this_file = $argv[0];
|
|
|
|
// }
|
|
|
|
// if (!is_null($this_file)) {
|
|
|
|
// $fileowner_id = fileowner($this_file);
|
|
|
|
// $fileowner_array = posix_getpwuid($fileowner_id);
|
|
|
|
// $fileowner_homedir = $fileowner_array['dir'];
|
|
|
|
// $fileowner_name = $fileowner_array['name'];
|
|
|
|
// $home_conf = $fileowner_homedir . '/.campcaster/storageServer.conf.php';
|
|
|
|
// if (file_exists($home_conf)) {
|
|
|
|
// $default_config = $CC_CONFIG;
|
|
|
|
// $developer_name = $fileowner_name;
|
|
|
|
// include($home_conf);
|
|
|
|
// $user_config = $CC_CONFIG;
|
|
|
|
// $CC_CONFIG = $user_config + $default_config;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
2006-10-19 16:55:07 +02:00
|
|
|
|
2010-10-01 23:39:23 +02:00
|
|
|
// Check that all the required directories exist.
|
2010-10-04 23:00:20 +02:00
|
|
|
//foreach (array('storageDir', 'bufferDir', 'transDir', 'accessDir', 'cronDir') as $d) {
|
|
|
|
// $test = file_exists($CC_CONFIG[$d]);
|
|
|
|
// if ( $test === FALSE ) {
|
|
|
|
// echo " * Error: directory {$CC_CONFIG[$d]} is missing.\n";
|
|
|
|
// echo " * Please run the install script again.\n";
|
|
|
|
// exit(1);
|
|
|
|
// } else {
|
|
|
|
// $rp = realpath($CC_CONFIG[$d]);
|
|
|
|
// }
|
|
|
|
// $CC_CONFIG[$d] = $rp;
|
|
|
|
//}
|
2006-11-24 01:53:45 +01:00
|
|
|
|
2010-10-01 23:39:23 +02:00
|
|
|
// Check that htmlUI/templates_c has the right permissions
|
2010-10-04 23:00:20 +02:00
|
|
|
//$ss=@stat($CC_CONFIG["smartyTemplateCompiled"]);
|
|
|
|
//$groupOwner = (function_exists('posix_getgrgid'))?@posix_getgrgid($ss['gid']):'';
|
|
|
|
//if (!empty($groupOwner) && ($groupOwner["name"] != $CC_CONFIG["webServerUser"])) {
|
|
|
|
// echo " * Error: Your directory permissions for {$CC_CONFIG['smartyTemplateCompiled']} are not set correctly.<br>\n";
|
|
|
|
// echo " * The group perms need to be set to the web server user, in this case '{$CC_CONFIG['webServerUser']}'.<br>\n";
|
|
|
|
// exit(1);
|
|
|
|
//}
|
|
|
|
//$fileperms=@fileperms($CC_CONFIG["smartyTemplateCompiled"]);
|
|
|
|
//if (!($fileperms & 0x0400)) {
|
|
|
|
// echo " * Error: Sticky bit not set for {$CC_CONFIG['smartyTemplateCompiled']}.<br>\n";
|
|
|
|
// exit(1);
|
|
|
|
//}
|
2010-10-01 22:18:37 +02:00
|
|
|
?>
|