Merge branch 'master' of dev.sourcefabric.org:campcaster
This commit is contained in:
commit
53f49d987d
58
CREDITS
58
CREDITS
|
@ -43,44 +43,44 @@ generated radio station based in Basel, Switzerland powered by Campcaster. We ar
|
|||
very grateful for their contributions, and specifically to Thomas Gilgen, Dirk Claes,
|
||||
Rigzen Latshang and Fabiano Sidler.
|
||||
|
||||
Douglas Arellanes (douglas.arellanes@mdlf.org)
|
||||
Douglas Arellanes
|
||||
- Tester and user feedback
|
||||
|
||||
Robin Gareus (robin@64studio.com)
|
||||
Robin Gareus
|
||||
- Packaging
|
||||
|
||||
Ferenc Gerlits (fgerlits@campware.org)
|
||||
Ferenc Gerlits
|
||||
- Studio GUI
|
||||
|
||||
Sebastian Göbel (sebastian@campware.org)
|
||||
Sebastian Göbel
|
||||
- Web interface, storage server
|
||||
|
||||
Nebojsa Grujic (nebojsa@campware.org)
|
||||
Nebojsa Grujic
|
||||
- Scheduler, XML-RPC interface, Gstreamer plugins
|
||||
|
||||
Tomáš Hlava (th@red2head.com)
|
||||
Tomáš Hlava
|
||||
- Bug fixes
|
||||
|
||||
Sava Tatić (sava.tatic@mdlf.org)
|
||||
Sava Tatić
|
||||
- Manager
|
||||
|
||||
|
||||
Version 1.3.0 - "Dakar"
|
||||
-----------------------
|
||||
|
||||
Douglas Arellanes (douglas.arellanes@mdlf.org)
|
||||
Douglas Arellanes
|
||||
- Tester and user feedback
|
||||
|
||||
Ferenc Gerlits (fgerlits@campware.org)
|
||||
Ferenc Gerlits
|
||||
- Studio GUI, scheduler, packaging
|
||||
|
||||
Sebastian Göbel (sebastian@campware.org)
|
||||
Sebastian Göbel
|
||||
- Web interface
|
||||
|
||||
Tomáš Hlava (th@red2head.com)
|
||||
Tomáš Hlava
|
||||
- Bug fixes
|
||||
|
||||
Sava Tatić (sava.tatic@mdlf.org)
|
||||
Sava Tatić
|
||||
- Manager
|
||||
|
||||
|
||||
|
@ -88,19 +88,19 @@ Version 1.2.0 - "Kotor"
|
|||
-----------------------
|
||||
In alphabetical order:
|
||||
|
||||
Douglas Arellanes (Douglas.Arellanes@mdlf.org)
|
||||
Douglas Arellanes
|
||||
- Tester and user feedback
|
||||
Paul Baranowski (paul@paulbaranowski.org)
|
||||
Paul Baranowski
|
||||
- Project manager, HTML UI, storage server
|
||||
Ferenc Gerlits (fgerlits@campware.org)
|
||||
Ferenc Gerlits
|
||||
- Studio GUI, scheduler, packaging
|
||||
Tomáš Hlava (th@red2head.com)
|
||||
Tomáš Hlava
|
||||
- Bug fixes
|
||||
Robert Klajn (robert.klajn@gmail.com)
|
||||
Robert Klajn
|
||||
- Superuser feedback
|
||||
Mark Kretschmann (markey@web.de)
|
||||
Mark Kretschmann
|
||||
- Audio player
|
||||
Sava Tatić (sava.tatic@mdlf.org)
|
||||
Sava Tatić
|
||||
- Manager
|
||||
|
||||
|
||||
|
@ -108,19 +108,19 @@ Version 1.1.X - "Freetown"
|
|||
--------------------------
|
||||
In alphabetical order:
|
||||
|
||||
Douglas Arellanes (Douglas.Arellanes@mdlf.org)
|
||||
Douglas Arellanes
|
||||
- Tester and user feedback
|
||||
Paul Baranowski (paul@paulbaranowski.org)
|
||||
Paul Baranowski
|
||||
- Project manager, HTML UI, storage server, scheduler
|
||||
János Csikós (retired)
|
||||
János Csikós
|
||||
- HTML UI
|
||||
Ferenc Gerlits (fgerlits@campware.org)
|
||||
Ferenc Gerlits
|
||||
- Studio GUI, scheduler, packaging
|
||||
Tomáš Hlava (th@red2head.com)
|
||||
Tomáš Hlava
|
||||
- Storage server, network hub
|
||||
Mark Kretschmann (markey@web.de)
|
||||
Mark Kretschmann
|
||||
- Audio player
|
||||
Ákos Maróy (retired)
|
||||
Ákos Maróy
|
||||
- Architecture design, scheduler, audio player
|
||||
Sava Tatić
|
||||
- Manager
|
||||
|
@ -136,12 +136,12 @@ Department of Digital Design Colleen Macklin, assisted by Kunal Jain.
|
|||
|
||||
In alphabetical order:
|
||||
Douglas Arellanes
|
||||
Michael Aschauer <mash@re-p.org>
|
||||
Micz Flor (micz.flor@web.de)
|
||||
Michael Aschauer
|
||||
Micz Flor
|
||||
Ferenc Gerlits
|
||||
Sebastian Göbel
|
||||
Tomáš Hlava
|
||||
Nadine Kokot
|
||||
Ákos Maróy (darkeye@tyrell.hu)
|
||||
Ákos Maróy
|
||||
Sava Tatić
|
||||
Charles Truett
|
||||
|
|
6
INSTALL
6
INSTALL
|
@ -3,7 +3,7 @@
|
|||
Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
|
||||
This file is part of the Airtime project.
|
||||
http://campcaster.sourcefabric.org/
|
||||
http://airtime.sourcefabric.org/
|
||||
To report bugs, send an e-mail to contact@sourcefabric.org
|
||||
|
||||
Airtime is free software; you can redistribute it and/or modify
|
||||
|
@ -23,7 +23,7 @@
|
|||
--------------------------------------------------------------------------------
|
||||
|
||||
Please see this page for a typical user install:
|
||||
http://en.flossmanuals.net/Campcaster
|
||||
http://en.flossmanuals.net/Airtime
|
||||
|
||||
If you are a developer, see this page:
|
||||
http://wiki.sourcefabric.org/display/CC/Campcaster+Dev+Site
|
||||
http://wiki.sourcefabric.org/display/CC
|
||||
|
|
|
@ -7,13 +7,7 @@ global $CC_CONFIG;
|
|||
|
||||
$CC_CONFIG = array(
|
||||
// Database config
|
||||
'dsn' => array(
|
||||
'username' => 'airtime',
|
||||
'password' => 'airtime',
|
||||
'hostspec' => 'localhost',
|
||||
'phptype' => 'pgsql',
|
||||
'database' => 'airtime',
|
||||
),
|
||||
'dsn' => load_db_config(),
|
||||
|
||||
// Name of the web server user
|
||||
'webServerUser' => 'www-data',
|
||||
|
@ -171,6 +165,15 @@ set_include_path('.'.PATH_SEPARATOR.$CC_CONFIG['pearPath']
|
|||
// exit(1);
|
||||
//}
|
||||
//$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
function load_db_config(){
|
||||
$ini_array = parse_ini_file(dirname(__FILE__).'/../../build/database.conf', true);
|
||||
|
||||
return array(
|
||||
'username' => $ini_array['database']['dbuser'],
|
||||
'password' => $ini_array['database']['dbpass'],
|
||||
'hostspec' => $ini_array['database']['host'],
|
||||
'phptype' => 'pgsql',
|
||||
'database' => $ini_array['database']['dbname']);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[database]
|
||||
host = localhost
|
||||
dbname = airtime
|
||||
dbuser = airtime
|
||||
dbpass = airtime
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
"""
|
||||
The purpose of this script is to consolidate into one location where
|
||||
we need to update database host, dbname, username and password.
|
||||
|
||||
This script reads from database.conf.
|
||||
"""
|
||||
import os
|
||||
import ConfigParser
|
||||
import xml.dom.minidom
|
||||
from xml.dom.minidom import Node
|
||||
|
||||
#Read the universal values
|
||||
parser = ConfigParser.SafeConfigParser()
|
||||
parser.read('database.conf')
|
||||
section_names = parser.sections();
|
||||
items_in_section = parser.items(section_names[0])
|
||||
|
||||
|
||||
print "Updating ../application/configs/application.ini"
|
||||
host = 'resources.db.params.host'
|
||||
dbname = 'resources.db.params.dbname'
|
||||
username = 'resources.db.params.username'
|
||||
password = 'resources.db.params.password'
|
||||
|
||||
f = file('../application/configs/application.ini','r')
|
||||
file_lines = []
|
||||
|
||||
for line in f:
|
||||
if line[0:len(host)] == host:
|
||||
line= '%s = "%s"\n' % (host, parser.get('database', 'host'))
|
||||
elif line[0:len(dbname)] == dbname:
|
||||
line= '%s = "%s"\n' % (dbname, parser.get('database', 'dbname'))
|
||||
elif line[0:len(username)] == username:
|
||||
line= '%s = "%s"\n' % (username, parser.get('database', 'dbuser'))
|
||||
elif line[0:len(password)] == password:
|
||||
line= '%s = "%s"\n' % (password, parser.get('database', 'dbpass'))
|
||||
file_lines.append(line)
|
||||
f.close()
|
||||
|
||||
f = file('../application/configs/application.ini', 'w')
|
||||
f.writelines(file_lines)
|
||||
f.close()
|
||||
|
||||
|
||||
print "Updating ./build.properties"
|
||||
|
||||
f = file('build.properties', 'r')
|
||||
file_lines = []
|
||||
|
||||
db_url = 'propel.database.url'
|
||||
|
||||
for line in f:
|
||||
if line[0:len(db_url)] == db_url:
|
||||
line = '%s = pgsql:host=%s dbname=%s user=%s password=%s\n' % \
|
||||
(db_url, parser.get('database', 'host'), parser.get('database', 'dbname'), parser.get('database', 'dbuser'), \
|
||||
parser.get('database', 'dbpass'))
|
||||
file_lines.append(line)
|
||||
f.close()
|
||||
|
||||
f = file('build.properties', 'w')
|
||||
f.writelines(file_lines)
|
||||
f.close()
|
||||
|
||||
print "Updating ./runtime-conf.xml"
|
||||
|
||||
doc = xml.dom.minidom.parse('./runtime-conf.xml')
|
||||
|
||||
node = doc.getElementsByTagName("dsn")[0]
|
||||
node.firstChild.nodeValue = 'pgsql:host=%s;port=5432;dbname=%s;user=%s;password=%s' % (parser.get('database', 'host'), \
|
||||
parser.get('database', 'dbname'), parser.get('database', 'dbuser'), parser.get('database', 'dbpass'))
|
||||
|
||||
xml_file = open('runtime-conf.xml', "w")
|
||||
xml_file.writelines(doc.toxml('utf-8'))
|
||||
xml_file.close()
|
||||
|
||||
print 'Regenerating propel-config.php'
|
||||
os.system('../library/propel/generator/bin/propel-gen')
|
||||
|
|
@ -14,13 +14,13 @@ Setting Up Your VHOST
|
|||
The following is a sample VHOST you might want to consider for your project.
|
||||
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot "/home/naomiaro/campcaster-refactor/airtime/public"
|
||||
DocumentRoot "/home/naomiaro/airtime/public"
|
||||
ServerName airtime.local
|
||||
|
||||
# This should be omitted in the production environment
|
||||
SetEnv APPLICATION_ENV development
|
||||
|
||||
<Directory "/home/naomiaro/campcaster-refactor/airtime/public">
|
||||
<Directory "/home/naomiaro/airtime/public">
|
||||
Options Indexes MultiViews FollowSymLinks
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
|
|
|
@ -86,8 +86,8 @@
|
|||
local all postgres ident sameuser
|
||||
#
|
||||
# All IPv4 connections from localhost
|
||||
# The following line was inserted by the campcaster-station package installer
|
||||
# the original pg_hba.conf file is saved under pg_hba.conf.before-campcaster
|
||||
# The following line was inserted by the Airtime package installer
|
||||
# the original pg_hba.conf file is saved under pg_hba.conf.before-airtime
|
||||
host all all 127.0.0.1 255.255.255.255 password
|
||||
#host all all 127.0.0.1 255.255.255.255 ident sameuser
|
||||
#
|
||||
|
|
|
@ -1,443 +0,0 @@
|
|||
#!/bin/bash
|
||||
#-------------------------------------------------------------------------------
|
||||
# Copyright (c) 2010 Airtime O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://campcaster.sourcefabric.org/
|
||||
# To report bugs, send an e-mail to bugs@campware.org
|
||||
#
|
||||
# Airtime is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Airtime is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Airtime; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
# This script makes post-installation steps for the Campcaster Station.
|
||||
#
|
||||
# Invoke as:
|
||||
# ./bin/postInstallStation.sh
|
||||
#
|
||||
# To get usage help, try the -h option
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Determine directories, files
|
||||
#-------------------------------------------------------------------------------
|
||||
reldir=`dirname $0`/..
|
||||
basedir=`cd $reldir; pwd;`
|
||||
bindir=$basedir/bin
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Print the usage information for this script.
|
||||
#-------------------------------------------------------------------------------
|
||||
printUsage()
|
||||
{
|
||||
echo "Campcaster Station post-install script.";
|
||||
echo "parameters";
|
||||
echo "";
|
||||
echo " -d, --directory The installation directory, required.";
|
||||
echo " -D, --database The name of the Campcaster database.";
|
||||
echo " [default: Campcaster]";
|
||||
echo " -g, --apache-group The group the apache daemon runs as.";
|
||||
echo " [default: apache]";
|
||||
echo " -r, --www-root The root directory for web documents served";
|
||||
echo " by apache [default: /var/www]";
|
||||
echo " -s, --dbserver The name of the database server host.";
|
||||
echo " [default: localhost]";
|
||||
echo " -u, --dbuser The name of the database user to access the"
|
||||
echo " database. [default: campcaster]";
|
||||
echo " -w, --dbpassword The database user password.";
|
||||
echo " [default: campcaster]";
|
||||
echo " -p, --postgresql-dir The postgresql data directory, containing";
|
||||
echo " pg_hba.conf [default: /etc/postgresql]";
|
||||
echo " -i, --postgresql-init-script The name of the postgresql init";
|
||||
echo " script [default: /etc/init.d/postgresql]";
|
||||
echo " -h, --help Print this message and exit.";
|
||||
echo "";
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Process command line parameters
|
||||
#-------------------------------------------------------------------------------
|
||||
CMD=${0##*/}
|
||||
|
||||
opts=$(getopt -o d:D:g:hi:p:r:s:u:w: -l apache-group:,database:,dbserver:,dbuser:,dbpassword:,directory:,help,postgresql-dir:,postgresql-init-script:,www-root: -n $CMD -- "$@") || exit 1
|
||||
eval set -- "$opts"
|
||||
while true; do
|
||||
case "$1" in
|
||||
-d|--directory)
|
||||
installdir=$2;
|
||||
shift; shift;;
|
||||
-D|--database)
|
||||
database=$2;
|
||||
shift; shift;;
|
||||
-g|--apache-group)
|
||||
apache_group=$2;
|
||||
shift; shift;;
|
||||
-h|--help)
|
||||
printUsage;
|
||||
exit 0;;
|
||||
-i|--postgresql-init-script)
|
||||
postgresql_init_script=$2;
|
||||
shift; shift;;
|
||||
-p|--postgresql-dir)
|
||||
postgresql_dir=$2;
|
||||
shift; shift;;
|
||||
-r|--www-root)
|
||||
www_root=$2;
|
||||
shift; shift;;
|
||||
-s|--dbserver)
|
||||
dbserver=$2;
|
||||
shift; shift;;
|
||||
-u|--dbuser)
|
||||
dbuser=$2;
|
||||
shift; shift;;
|
||||
-w|--dbpassword)
|
||||
dbpassword=$2;
|
||||
shift; shift;;
|
||||
--)
|
||||
shift;
|
||||
break;;
|
||||
*)
|
||||
echo "Unrecognized option $1.";
|
||||
printUsage;
|
||||
exit 1;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "x$installdir" == "x" ]; then
|
||||
echo "Required parameter install directory not specified.";
|
||||
printUsage;
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ "x$dbserver" == "x" ]; then
|
||||
dbserver=localhost;
|
||||
fi
|
||||
|
||||
if [ "x$database" == "x" ]; then
|
||||
database=Campcaster;
|
||||
fi
|
||||
|
||||
if [ "x$dbuser" == "x" ]; then
|
||||
dbuser=campcaster;
|
||||
fi
|
||||
|
||||
if [ "x$dbpassword" == "x" ]; then
|
||||
dbpassword=campcaster;
|
||||
fi
|
||||
|
||||
if [ "x$apache_group" == "x" ]; then
|
||||
apache_group=apache;
|
||||
fi
|
||||
|
||||
if [ "x$postgresql_dir" == "x" ]; then
|
||||
postgresql_dir=/etc/postgresql;
|
||||
fi
|
||||
|
||||
if [ "x$postgresql_init_script" == "x" ]; then
|
||||
postgresql_init_script=/etc/init.d/postgresql;
|
||||
fi
|
||||
|
||||
if [ "x$www_root" == "x" ]; then
|
||||
www_root=/var/www;
|
||||
fi
|
||||
|
||||
echo "Making post-install steps for Campcaster Station.";
|
||||
echo "";
|
||||
echo "Using the following installation parameters:";
|
||||
echo "";
|
||||
echo " installation directory: $installdir";
|
||||
echo " database server: $dbserver";
|
||||
echo " database: $database";
|
||||
echo " database user: $dbuser";
|
||||
echo " database user password: $dbpassword";
|
||||
echo " apache daemon group: $apache_group";
|
||||
echo " apache document root: $www_root";
|
||||
echo " postgresql data directory: $postgresql_dir";
|
||||
echo " postgresql init script: $postgresql_init_script";
|
||||
echo ""
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# The details of installation
|
||||
#-------------------------------------------------------------------------------
|
||||
ls_dbserver=$dbserver
|
||||
ls_dbuser=$dbuser
|
||||
ls_dbpassword=$dbpassword
|
||||
ls_database=$database
|
||||
|
||||
postgres_user=postgres
|
||||
|
||||
install_bin=$installdir/bin
|
||||
install_etc=$installdir/etc
|
||||
install_lib=$installdir/lib
|
||||
install_usr=$installdir/usr
|
||||
install_var=$installdir/var
|
||||
install_var_ls=$install_var/Campcaster
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Function to check for the existence of an executable on the PATH
|
||||
#
|
||||
# @param $1 the name of the exectuable
|
||||
# @return 0 if the executable exists on the PATH, non-0 otherwise
|
||||
#-------------------------------------------------------------------------------
|
||||
check_exe() {
|
||||
if [ -x "`which $1 2> /dev/null`" ]; then
|
||||
echo "Executable $1 found...";
|
||||
return 0;
|
||||
else
|
||||
echo "Executable $1 not found...";
|
||||
return 1;
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Check to see if this script is being run as root
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ `whoami` != "root" ]; then
|
||||
echo "Please run this script as root.";
|
||||
exit ;
|
||||
fi
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Check for required tools
|
||||
#-------------------------------------------------------------------------------
|
||||
echo "Checking for required tools..."
|
||||
|
||||
check_exe "sed" || exit 1;
|
||||
check_exe "psql" || exit 1;
|
||||
check_exe "php" || exit 1;
|
||||
check_exe "odbcinst" || exit 1;
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Check for the apache group to be a real group
|
||||
#-------------------------------------------------------------------------------
|
||||
group_tmp_file=/tmp/ls_group_check.$$
|
||||
touch $group_tmp_file
|
||||
test_result=`chgrp $apache_group $group_tmp_file 2> /dev/null`
|
||||
if [ $? != 0 ]; then
|
||||
rm -f $group_tmp_file;
|
||||
echo "Unable to use apache deamon group $apache_group.";
|
||||
echo "Please check if $apache_group is a correct user group.";
|
||||
exit 1;
|
||||
fi
|
||||
rm -f $group_tmp_file;
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Install the new pg_hba.conf file
|
||||
#-------------------------------------------------------------------------------
|
||||
echo "Modifying postgresql access permissions...";
|
||||
|
||||
pg_config_dir=$postgresql_dir
|
||||
pg_config_file=pg_hba.conf
|
||||
pg_config_file_saved=pg_hba.conf.before-campcaster
|
||||
|
||||
if [ -f $pg_config_dir/$pg_config_file ] ; then
|
||||
mv -f $pg_config_dir/$pg_config_file $pg_config_dir/$pg_config_file_saved ;
|
||||
fi
|
||||
cp $install_etc/$pg_config_file $pg_config_dir/$pg_config_file
|
||||
chown root:$postgres_user $pg_config_dir/$pg_config_file
|
||||
|
||||
# don't use restart for the init script, as it might return prematurely
|
||||
# and in the later call to psql we wouldn't be able to connect
|
||||
${postgresql_init_script} stop
|
||||
${postgresql_init_script} start
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Create the necessary database user and database itself
|
||||
#-------------------------------------------------------------------------------
|
||||
${install_bin}/createDatabase.sh --database=${ls_database} \
|
||||
--dbuser=${ls_dbuser} \
|
||||
--dbpassword=${ls_dbpassword} \
|
||||
--dbserver=${ls_dbserver}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Create the ODBC data source and driver
|
||||
#-------------------------------------------------------------------------------
|
||||
${install_bin}/createOdbcDataSource.sh --database=${ls_database} \
|
||||
--dbserver=${ls_dbserver}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Check whether the storage server directory has been replaced with a mount
|
||||
# point for an NFS share.
|
||||
#-------------------------------------------------------------------------------
|
||||
storagedir=$installdir/var/storageServer
|
||||
storage_is_local=yes
|
||||
if [ "`mount | grep -o \"on $storagedir \"`" = "on $storagedir " ]; then
|
||||
storage_is_local=no
|
||||
fi
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Setup directory permissions
|
||||
#-------------------------------------------------------------------------------
|
||||
echo "Setting up directory permissions..."
|
||||
|
||||
if [ "$storage_is_local" = "yes" ]; then
|
||||
chgrp $apache_group $install_var_ls/storageServer/var/stor
|
||||
chgrp $apache_group $install_var_ls/storageServer/var/access
|
||||
chgrp $apache_group $install_var_ls/storageServer/var/trans
|
||||
chgrp $apache_group $install_var_ls/storageServer/var/stor/buffer
|
||||
|
||||
chmod g+sw $install_var_ls/storageServer/var/stor
|
||||
chmod g+sw $install_var_ls/storageServer/var/access
|
||||
chmod g+sw $install_var_ls/storageServer/var/trans
|
||||
chmod g+sw $install_var_ls/storageServer/var/stor/buffer
|
||||
fi
|
||||
|
||||
chgrp $apache_group $install_var_ls/htmlUI/var/templates_c
|
||||
chgrp $apache_group $install_var_ls/htmlUI/var/html/img
|
||||
|
||||
chmod g+sw $install_var_ls/htmlUI/var/templates_c
|
||||
chmod g+sw $install_var_ls/htmlUI/var/html/img
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Configuring Apache
|
||||
#-------------------------------------------------------------------------------
|
||||
echo "Configuring apache ..."
|
||||
CONFFILE=90_php_campcaster.conf
|
||||
AP_DDIR_FOUND=no
|
||||
for APACHE_DDIR in \
|
||||
/etc/apache/conf.d /etc/apache2/conf.d /etc/apache2/conf/modules.d \
|
||||
/etc/httpd/conf.d
|
||||
do
|
||||
echo -n "$APACHE_DDIR "
|
||||
if [ -d $APACHE_DDIR ]; then
|
||||
echo "Y"
|
||||
AP_DDIR_FOUND=yes
|
||||
cp $basedir/etc/apache/$CONFFILE $APACHE_DDIR
|
||||
break
|
||||
else
|
||||
echo "N"
|
||||
fi
|
||||
done
|
||||
if [ "$AP_DDIR_FOUND" != "yes" ]; then
|
||||
echo "###############################"
|
||||
echo " Could not configure Apache"
|
||||
echo " include following file into apache config manually:"
|
||||
echo " $basedir/etc/apache/$CONFFILE"
|
||||
echo "###############################"
|
||||
fi
|
||||
echo "done"
|
||||
|
||||
echo "Restarting apache...";
|
||||
AP_SCR_FOUND=no
|
||||
for APACHE_SCRIPT in apache apache2 httpd ; do
|
||||
echo -n "$APACHE_SCRIPT "
|
||||
if [ -x /etc/init.d/$APACHE_SCRIPT ]; then
|
||||
echo "Y"
|
||||
AP_SCR_FOUND=yes
|
||||
/etc/init.d/$APACHE_SCRIPT restart
|
||||
break
|
||||
else
|
||||
echo "N"
|
||||
fi
|
||||
done
|
||||
if [ "$AP_SCR_FOUND" != "yes" ]; then
|
||||
echo "###############################"
|
||||
echo " Could not reload Apache"
|
||||
echo " please reload apache manually"
|
||||
echo "###############################"
|
||||
fi
|
||||
echo "done"
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Create symlinks
|
||||
#-------------------------------------------------------------------------------
|
||||
echo "Creating symlinks...";
|
||||
|
||||
# create symlink for the PHP pages in apache's document root
|
||||
rm -f $www_root/campcaster
|
||||
ln -s $install_var_ls $www_root/campcaster
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Initialize the database
|
||||
#-------------------------------------------------------------------------------
|
||||
echo "Initializing database...";
|
||||
|
||||
if [ "$storage_is_local" = "yes" ]; then
|
||||
# create PHP-related database tables
|
||||
cd $install_var_ls/storageServer/var/install
|
||||
# workaround for #2059; restore to "exit 1" after the ticket is closed
|
||||
php -q install.php || exit 1;
|
||||
#php -q install.php || true
|
||||
cd -
|
||||
fi
|
||||
|
||||
# workaround for ticket #2059; restore to "exit 1" after the ticket is closed
|
||||
php -q install.php || exit 1;
|
||||
#php -q install.php || true
|
||||
cd -
|
||||
|
||||
# create scheduler-related database tables
|
||||
cd $installdir
|
||||
./bin/campcaster-scheduler.sh install || exit 1;
|
||||
cd -
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Generate a random password for the scheduler's access to the storage
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ "$storage_is_local" = "yes" ]; then
|
||||
grep -q 'ls_scheduler_storage_pass' $install_etc/campcaster-scheduler.xml
|
||||
if [ $? = 0 ]; then
|
||||
SCHEDULER_STORAGE_PASS=`pwgen -N1 -c -n -s`
|
||||
php -q $install_var_ls/storageServer/var/install/airtime-user.php \
|
||||
--addupdate scheduler ${SCHEDULER_STORAGE_PASS}
|
||||
sed -i -e "s/ls_scheduler_storage_pass/${SCHEDULER_STORAGE_PASS}/" \
|
||||
$install_etc/campcaster-scheduler.xml
|
||||
fi
|
||||
fi
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Initialize the twitter cron
|
||||
#-------------------------------------------------------------------------------
|
||||
echo "Initializing twitter cron...";
|
||||
|
||||
cd $install_var_ls/htmlUI/var/install
|
||||
# workaround for #2059; restore to "exit 1" after the ticket is closed
|
||||
php -q install.php || exit 1;
|
||||
#php -q install.php || true
|
||||
cd -
|
||||
|
||||
# We need the scheduler password here too
|
||||
sed -i -e "s/change_me/${SCHEDULER_STORAGE_PASS}/" \
|
||||
$install_var_ls/htmlUI/var/html/ui_twitterCron.php
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Update the database, if necessary
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ "$storage_is_local" = "yes" ]; then
|
||||
php -q $install_var_ls/storageServer/var/install/upgrade/upgrade.php
|
||||
fi
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Say goodbye
|
||||
#-------------------------------------------------------------------------------
|
||||
echo "Done."
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://campcaster.sourcefabric.org/
|
||||
# http://airtime.sourcefabric.org/
|
||||
#
|
||||
# Airtime is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://campcaster.sourcefabric.org/
|
||||
# http://airtime.sourcefabric.org/
|
||||
#
|
||||
# Airtime is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@ dnl-----------------------------------------------------------------------------
|
|||
dnl Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
dnl
|
||||
dnl This file is part of the Airtime project.
|
||||
dnl http://campcaster.sourcefabric.org/
|
||||
dnl http://airtime.sourcefabric.org/
|
||||
dnl
|
||||
dnl Airtime is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
|
@ -27,7 +27,7 @@ dnl This is due to the fact that configure spreads a lot of trash around,
|
|||
dnl like atom4te cache directories, config.* files, etc. into the directory
|
||||
dnl it is being run from. We clearly don't want these in our base directory.
|
||||
dnl-----------------------------------------------------------------------------
|
||||
AC_INIT(GetId3, 0.0, bugs@campware.org)
|
||||
AC_INIT(GetId3, 0.0, contact@sourcefabric.org)
|
||||
AC_PREREQ(2.59)
|
||||
AC_COPYRIGHT([Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL])
|
||||
AC_REVISION($Revision$)
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
require_once '../../application/configs/conf.php';
|
||||
require_once 'DB.php';
|
||||
require_once '../../application/models/Playlist.php';
|
||||
require_once '../../application/models/StoredFile.php';
|
||||
require_once(__DIR__.'/../../library/propel/runtime/lib/Propel.php');
|
||||
// Initialize Propel with the runtime configuration
|
||||
Propel::init(__DIR__."/../../application/configs/propel-config.php");
|
||||
// Add the generated 'classes' directory to the include path
|
||||
set_include_path(__DIR__."/../../application/models" . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
$dsn = $CC_CONFIG['dsn'];
|
||||
|
||||
$CC_DBC = DB::connect($dsn, TRUE);
|
||||
if (PEAR::isError($CC_DBC)) {
|
||||
echo "ERROR: ".$CC_DBC->getMessage()." ".$CC_DBC->getUserInfo()."\n";
|
||||
exit(1);
|
||||
}
|
||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
|
||||
$playlistName = "pypo_playlist_test";
|
||||
$minutesFromNow = 1;
|
||||
|
||||
echo " ************************************************************** \n";
|
||||
echo " This script schedules a playlist to play $minutesFromNow minute(s) from now.\n";
|
||||
echo " This is a utility to help you debug the scheduler.\n";
|
||||
echo " ************************************************************** \n";
|
||||
echo "\n";
|
||||
echo "Deleting playlists with the name '$playlistName'...";
|
||||
// Delete any old playlists
|
||||
$pl2 = Playlist::findPlaylistByName($playlistName);
|
||||
foreach ($pl2 as $playlist) {
|
||||
//var_dump($playlist);
|
||||
$playlist->delete();
|
||||
}
|
||||
echo "done.\n";
|
||||
|
||||
// Create a new playlist
|
||||
echo "Creating new playlist '$playlistName'...";
|
||||
$pl = new Playlist();
|
||||
$pl->create($playlistName);
|
||||
|
||||
// Add a media clip
|
||||
$mediaFile = StoredFile::findByOriginalName("ACDC_-_Back_In_Black-sample.ogg");
|
||||
if (is_null($mediaFile)) {
|
||||
echo "Adding test audio clip to the database.\n";
|
||||
$v = array("filepath" => __DIR__."/../../audio_samples/OpSound/ACDC_-_Back_In_Black-sample.ogg");
|
||||
$mediaFile = StoredFile::Insert($v);
|
||||
if (PEAR::isError($mediaFile)) {
|
||||
var_dump($mediaFile);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
$pl->addAudioClip($mediaFile->getId());
|
||||
|
||||
$mediaFile = StoredFile::findByOriginalName("Peter_Rudenko_-_Opening.mp3");
|
||||
if (is_null($mediaFile)) {
|
||||
echo "Adding test audio clip to the database.\n";
|
||||
$v = array("filepath" => __DIR__."/../../audio_samples/OpSound/Peter Rudenko - Opening.mp3");
|
||||
$mediaFile = StoredFile::Insert($v);
|
||||
if (PEAR::isError($mediaFile)) {
|
||||
var_dump($mediaFile);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
$pl->addAudioClip($mediaFile->getId());
|
||||
echo "done.\n";
|
||||
|
||||
//$pl2 = Playlist::findPlaylistByName("pypo_playlist_test");
|
||||
//var_dump($pl2);
|
||||
|
||||
// Get current time
|
||||
// In the format YYYY-MM-DD HH:MM:SS.nnnnnn
|
||||
$startTime = date("Y-m-d H:i:s");
|
||||
$endTime = date("Y-m-d H:i:s", time()+(60*60));
|
||||
|
||||
echo "Removing everything from the scheduler between $startTime and $endTime...";
|
||||
// Scheduler: remove any playlists for the next hour
|
||||
Schedule::RemoveItemsInRange($startTime, $endTime);
|
||||
// Check for succcess
|
||||
$scheduleClear = Schedule::isScheduleEmptyInRange($startTime, "01:00:00");
|
||||
if (!$scheduleClear) {
|
||||
echo "\nERROR: Schedule could not be cleared.\n\n";
|
||||
var_dump(Schedule::GetItems($startTime, $endTime));
|
||||
exit;
|
||||
}
|
||||
echo "done.\n";
|
||||
|
||||
// Schedule the playlist for two minutes from now
|
||||
echo "Scheduling new playlist...\n";
|
||||
$playTime = date("Y-m-d H:i:s", time()+(60*$minutesFromNow));
|
||||
$scheduleGroup = new ScheduleGroup();
|
||||
$scheduleGroup->add($playTime, null, $pl->getId());
|
||||
|
||||
echo " SUCCESS: Playlist scheduled at $playTime\n\n";
|
||||
?>
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://campcaster.sourcefabric.org/
|
||||
# http://airtime.sourcefabric.org/
|
||||
#
|
||||
# Airtime is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://campcaster.sourcefabric.org/
|
||||
# http://airtime.sourcefabric.org/
|
||||
#
|
||||
# Airtime is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://campcaster.sourcefabric.org/
|
||||
# http://airtime.sourcefabric.org/
|
||||
#
|
||||
# Airtime is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -238,11 +238,7 @@ if ($DEBUG_IMPORT) {
|
|||
$testonly = false;
|
||||
$importMode = "link";
|
||||
$files = array("/path/to/your/test/file.mp3");
|
||||
$dsn = array('username' => 'airtime',
|
||||
'password' => 'airtime',
|
||||
'hostspec' => 'localhost',
|
||||
'phptype' => 'pgsql',
|
||||
'database' => 'airtime');
|
||||
$dsn = $CC_CONFIG['dsn'];
|
||||
} else {
|
||||
$dsn = $CC_CONFIG['dsn'];
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://campcaster.sourcefabric.org/
|
||||
# http://airtime.sourcefabric.org/
|
||||
#
|
||||
# Airtime is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://campcaster.sourcefabric.org/
|
||||
# To report bugs, send an e-mail to bugs@campware.org
|
||||
# http://airtime.sourcefabric.org/
|
||||
# To report bugs, send an e-mail to contact@sourcefabric.org
|
||||
#
|
||||
# Airtime is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://campcaster.sourcefabric.org/
|
||||
# To report bugs, send an e-mail to bugs@campware.org
|
||||
# http://airtime.sourcefabric.org/
|
||||
# To report bugs, send an e-mail to contact@sourcefabric.org
|
||||
#
|
||||
# Airtime is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
Loading…
Reference in New Issue