3 # Configure Loggerhead for FusionForge
8 if [ `id -u` != 0 ] ; then
9 echo "You must be root to run this, please enter passwd"
13 configfile=~gforge/.bazaar/bazaar.conf
14 cachedir=/var/cache/gforge/loggerhead
18 PATH=/usr/share/gforge/bin:/usr/share/fusionforge/bin:$PATH
19 repos_path=$(forge_get_config repos_path scmbzr)
20 web_host=$(forge_get_config web_host)
21 url_prefix=$(forge_get_config url_prefix)
22 use_ssl=$(forge_get_config use_ssl)
24 if [ -z "$use_ssl" ] || [ "$use_ssl" = no ] ; then
25 http_user_prefix=http://${web_host}${url_prefix}scm/loggerhead
27 http_user_prefix=https://${web_host}${url_prefix}scm/loggerhead
30 if [ ! -e $configfile ] ; then
31 mkdir -p $(dirname $configfile)
32 cat > $configfile <<EOF
33 # Directory to serve bzr branches from
34 # Non-bzr directories under this path will also be visible in loggerhead
35 http_root_dir = '${repos_path}'
37 # The url prefix for the bzr branches.
38 http_user_prefix = '${http_user_prefix}'
40 # Directory to put cache files in
41 http_sql_dir = '/var/cache/gforge/loggerhead'
44 chown gforge $cachedir
49 rm -rf $configfile $cachedir
50 rmdir $(dirname $configfile) || true
54 echo "Usage: $0 {configure|purge}"