Working on Baïkal Standalone Server
This commit is contained in:
parent
6a45a50955
commit
f878518332
5 changed files with 61 additions and 54 deletions
|
@ -62,6 +62,7 @@ define("BAIKAL_PATH_FRAMEWORKS", BAIKAL_PATH_CORE . "Frameworks/");
|
||||||
define("BAIKAL_PATH_WWWROOT", BAIKAL_PATH_CORE . "WWWRoot/");
|
define("BAIKAL_PATH_WWWROOT", BAIKAL_PATH_CORE . "WWWRoot/");
|
||||||
|
|
||||||
require_once(BAIKAL_PATH_SPECIFIC . "config.php");
|
require_once(BAIKAL_PATH_SPECIFIC . "config.php");
|
||||||
|
require_once(BAIKAL_PATH_SPECIFIC . "config.system.php");
|
||||||
|
|
||||||
date_default_timezone_set(BAIKAL_TIMEZONE);
|
date_default_timezone_set(BAIKAL_TIMEZONE);
|
||||||
|
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
platform='unknown'
|
|
||||||
unamestr=`uname`
|
|
||||||
if [[ "$unamestr" == 'Linux' ]]; then
|
|
||||||
platform='linux'
|
|
||||||
elif [[ "$unamestr" == 'FreeBSD' ]]; then
|
|
||||||
platform='freebsd'
|
|
||||||
elif [[ "$unamestr" == 'Darwin' ]]; then
|
|
||||||
platform='osx'
|
|
||||||
fi
|
|
||||||
|
|
||||||
PATH_docroot=`cd ../../../html && pwd`
|
|
||||||
echo "Serving $PATH_docroot"
|
|
||||||
|
|
||||||
PATH_this="`pwd`/"
|
|
||||||
MONGOOSE_builds=$PATH_this"builds/"
|
|
||||||
MONGOOSE_cgi=$PATH_this"cgi/"
|
|
||||||
|
|
||||||
if [[ $platform == 'linux' ]]; then
|
|
||||||
MONGOOSE_bin=$MONGOOSE_builds"linux/mongoose"
|
|
||||||
MONGOOSE_cgibin=$MONGOOSE_cgi"ubuntux64/php-cgi"
|
|
||||||
elif [[ $platform == 'freebsd' ]]; then
|
|
||||||
echo "FreeBSD !"
|
|
||||||
elif [[ $platform == 'osx' ]]; then
|
|
||||||
MONGOOSE_bin=$MONGOOSE_builds"mac/mongoose"
|
|
||||||
MONGOOSE_cgibin=$MONGOOSE_cgi"mac/php-cgi"
|
|
||||||
fi
|
|
||||||
|
|
||||||
`$MONGOOSE_bin -I $MONGOOSE_cgibin -i index.html,index.php -r $PATH_docroot`
|
|
56
CoreVersions/Baikal_0.1/Mongoose/run.sh
Executable file
56
CoreVersions/Baikal_0.1/Mongoose/run.sh
Executable file
|
@ -0,0 +1,56 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
PATH_scriptfile=`readlink -f $0`
|
||||||
|
PATH_scriptdir=`dirname $PATH_scriptfile`"/"
|
||||||
|
PATH_root=`dirname $(dirname $(dirname $PATH_scriptdir))`"/"
|
||||||
|
PATH_docroot=$PATH_root"html/"
|
||||||
|
|
||||||
|
PATH_specific=$PATH_root"Specific/"
|
||||||
|
PATH_configfile=$PATH_specific"config.php"
|
||||||
|
|
||||||
|
MONGOOSE_builds=$PATH_scriptdir"builds/"
|
||||||
|
MONGOOSE_cgi=$PATH_scriptdir"cgi/"
|
||||||
|
|
||||||
|
function whichPlatform() {
|
||||||
|
local platform='unknown'
|
||||||
|
local unamestr=`uname`
|
||||||
|
|
||||||
|
if [[ "$unamestr" == 'Linux' ]]; then
|
||||||
|
platform='linux'
|
||||||
|
elif [[ "$unamestr" == 'FreeBSD' ]]; then
|
||||||
|
platform='freebsd'
|
||||||
|
elif [[ "$unamestr" == 'Darwin' ]]; then
|
||||||
|
platform='osx'
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$platform"
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBaikalConf() {
|
||||||
|
local conf=$(php -r "require_once('$PATH_configfile'); if(is_bool($1)) { echo intval($1);} else { echo $1;}")
|
||||||
|
echo $conf
|
||||||
|
}
|
||||||
|
|
||||||
|
BAIKAL_standaloneenabled=$(getBaikalConf BAIKAL_STANDALONE_ENABLED)
|
||||||
|
if [[ "$BAIKAL_standaloneenabled" == '0' ]]; then
|
||||||
|
echo "Baïkal Standalone Server is disabled by config."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
BAIKAL_standaloneport=$(getBaikalConf BAIKAL_STANDALONE_PORT)
|
||||||
|
BAIKAL_baseuri=$(getBaikalConf BAIKAL_BASEURI)
|
||||||
|
|
||||||
|
platform=$(whichPlatform)
|
||||||
|
echo "Serving standalone Baïkal at $BAIKAL_baseuri:$BAIKAL_standaloneport ('$PATH_docroot' on $platform )"
|
||||||
|
|
||||||
|
if [[ $platform == 'linux' ]]; then
|
||||||
|
MONGOOSE_bin=$MONGOOSE_builds"ubuntux64/mongoose"
|
||||||
|
MONGOOSE_cgibin=$MONGOOSE_cgi"ubuntux64/php-cgi"
|
||||||
|
elif [[ $platform == 'freebsd' ]]; then
|
||||||
|
echo "FreeBSD !"
|
||||||
|
elif [[ $platform == 'osx' ]]; then
|
||||||
|
MONGOOSE_bin=$MONGOOSE_builds"mac/mongoose"
|
||||||
|
MONGOOSE_cgibin=$MONGOOSE_cgi"mac/php-cgi"
|
||||||
|
fi
|
||||||
|
|
||||||
|
`$MONGOOSE_bin -p $BAIKAL_standaloneport -I $MONGOOSE_cgibin -i index.html,index.php -r $PATH_docroot`
|
|
@ -14,7 +14,6 @@ define("BAIKAL_BASEURI", "http://dav.mydomain.com/");
|
||||||
# WEB absolute URI
|
# WEB absolute URI
|
||||||
define("BAIKAL_ADMIN_ENABLED", TRUE);
|
define("BAIKAL_ADMIN_ENABLED", TRUE);
|
||||||
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# In this section: Optional configuration: you *may* customize these settings
|
# In this section: Optional configuration: you *may* customize these settings
|
||||||
#
|
#
|
||||||
|
@ -25,28 +24,8 @@ define("BAIKAL_CARD_ENABLED", TRUE);
|
||||||
# CalDAV ON/OFF switch
|
# CalDAV ON/OFF switch
|
||||||
define("BAIKAL_CAL_ENABLED", TRUE);
|
define("BAIKAL_CAL_ENABLED", TRUE);
|
||||||
|
|
||||||
|
# CalDAV ON/OFF switch
|
||||||
|
define("BAIKAL_STANDALONE_ENABLED", FALSE);
|
||||||
|
|
||||||
##############################################################################
|
# CalDAV ON/OFF switch
|
||||||
##############################################################################
|
define("BAIKAL_STANDALONE_PORT", 8888);
|
||||||
##############################################################################
|
|
||||||
# System configuration
|
|
||||||
# Should not be changed, unless YNWYD
|
|
||||||
#
|
|
||||||
# RULES
|
|
||||||
# 0. All folder pathes *must* be suffixed by "/"
|
|
||||||
#
|
|
||||||
|
|
||||||
# PATH to SabreDAV
|
|
||||||
define("BAIKAL_PATH_SABREDAV", BAIKAL_PATH_FRAMEWORKS . "SabreDAV/lib/Sabre/");
|
|
||||||
|
|
||||||
# If you change this value, you'll have to re-generate passwords for all your users
|
|
||||||
define("BAIKAL_AUTH_REALM", "BaikalDAV");
|
|
||||||
|
|
||||||
# Should begin with a "/"
|
|
||||||
define("BAIKAL_CARD_BASEURI", "/card.php/");
|
|
||||||
|
|
||||||
# Should begin with a "/"
|
|
||||||
define("BAIKAL_CAL_BASEURI", "/cal.php/");
|
|
||||||
|
|
||||||
# SQLite DB path
|
|
||||||
define("BAIKAL_SQLITE_FILE", BAIKAL_PATH_SPECIFIC . "db/baikal.sqlite");
|
|
Loading…
Reference in a new issue