Set($WebPath , "/rt3"); # e.g. Set($WebPath , "");
#URL
-Set($WebBaseURL , "https://PLC_RT_HOSTNAME"); # Set($WebBaseURL , "http://rt.PLC_RT_HOSTNAME");
+Set($WebBaseURL , "http://PLC_RT_HOSTNAME"); # Set($WebBaseURL , "http://rt.PLC_RT_HOSTNAME");
#Adding plugins
#Set(@Plugins,qw(RT::FM));
$UserObj->Create(Name => $email_address,
RealName => $realname,
EmailAddress => $email_address,
- Password => 'tpdemo2009',
+ Password => 'default2009',
Organization => $organization,
Privileged => $priv);
#Address1 => $address1,
--- /dev/null
+#!/usr/bin/python
+
+import os
+import sys
+
+#NOTE: I'm so sorry for this.
+try:
+ # if this file deos not exist, then we will jump to the exception and use
+ # the local PLCSH without passing any additional arguments.
+
+ os.stat("/etc/planetlab/master.py")
+ sys.path.append("/etc/planetlab")
+ import master
+
+ # Use the values given to us in the /etc/planetlab/master.py file taken from
+ # the master PLC and use them to construct the proper arguments to plcsh so
+ # that we can get a user list from managing, CoPLC
+
+ user=master.PLC_ROOT_USER
+ passwd=master.PLC_ROOT_PASSWORD
+ url = "https://" + master.PLC_API_HOST + ":" \
+ + master.PLC_API_PORT + master.PLC_API_PATH
+
+ cmd = "plcsh --user=%s --password=%s --url=%s %s" % (user,
+ passwd, url, " ".join(sys.argv[1:]))
+except:
+ cmd = "plcsh %s" % " ".join(sys.argv[1:])
+
+os.system(cmd)
#!/bin/bash
RTDIR=/usr/share/plcrt
-${RTDIR}/getadmins.py | ${RTDIR}/adduserstort.pl priv -
+${RTDIR}/callplcsh.py ${RTDIR}/getadmins.py admin | ${RTDIR}/adduserstort.pl priv -
for f in $PLCRTPATH/conf.d/*.pl ; do
update_config PLC_RT_HOSTNAME $PLC_RT_HOST $f
done
+
+ # TODO: need a better approach for this.
+ if [ -f /etc/httpd/conf.d/rt3.conf ] ; then
+ update_config PLC_RT_HOST $PLC_RT_HOST /etc/httpd/conf.d/rt3.conf
+ fi
# if the templates are newer than the actual config, then replace them.
if [ $PLCRTPATH/RT_SiteConfig.pm -nt /etc/rt3/RT_SiteConfig.pm ] ;
USER=$RT3_DB_USER
CONF=$PGDATA/pg_hba.conf.d/${NAME}.conf
PATTERN="host all postgres 127.0.0.1/32 trust"
+ PATTERN="host all postgres $PLC_RT_IP/32 trust"
if ! grep -q "$PATTERN" $CONF ; then
#### SETUP ACCESS from postgres user to run init for the first time.
check_pg_hba $RT3_DB_NAME $RT3_DB_USER
#check_user_and_db $RT3_DB_NAME $RT3_DB_USER
check_rt_siteconfig
+ # TODO: make this dependent on whether a change was made!
+ service plc restart httpd
+
check_rt_pghba
if [ -n "$WROTE_PG_CONFIG" ] ; then
# NOTE: restart db to enable access by users granted above.
check_rt_sendmail
check_rt_custom # todo: restart httpd if needed.
+ # TODO: remove external permission
+
result "$MESSAGE"
;;
dropuser -U postgres $RT3_DB_USER
rm -f /etc/rt3/RT_SiteConfig.pm
rm -f /etc/rt3/initialdata
- PATTERN="host all postgres 127.0.0.1/32 trust"
rm -f $PGDATA/pg_hba.conf.d/${RT3_DB_NAME}.conf
sed -i -e "s/.*mailgate.*//g" /etc/aliases
fi
if ! grep '<category id="plc_rt">' /etc/planetlab/default_config.xml ; then
- sed -i 's|<category id="plc_net">| <category id="plc_rt">\n <name>RT Configuration</name>\n <description>RT</description>\n <variablelist>\n <variable id="enabled" type="boolean">\n <name>Enabled</name>\n <value>false</value>\n <description>Enable on this machine.</description>\n </variable>\n <variable id="host" type="hostname">\n <name>Hostname</name>\n <value>localhost.localdomain</value>\n <description>The fully qualified hostname.</description>\n </variable>\n <variable id="ip" type="ip">\n <name>IP Address</name>\n <value/>\n <description>The IP address of the RT server.</description>\n </variable>\n </variablelist>\n </category>\n <category id="plc_net">|' /etc/planetlab/default_config.xml
+ sed -i 's|<category id="plc_net">| <category id="plc_rt">\n <name>RT Configuration</name>\n <description>RT</description>\n <variablelist>\n <variable id="enabled" type="boolean">\n <name>Enabled</name>\n <value>false</value>\n <description>Enable on this machine.</description>\n </variable>\n <variable id="host" type="hostname">\n <name>Hostname</name>\n <value>localhost.localdomain</value>\n <description>The fully qualified hostname.</description>\n </variable>\n <variable id="ip" type="ip">\n <name>IP Address</name>\n <value/>\n <description>The IP address of the RT server.</description>\n </variable>\n <variable id="web_user" type="string">\n <name>username</name>\n <value>root</value>\n <description>The user name for RT access.</description>\n </variable>\n <variable id="web_password" type="password">\n <name>password</name>\n <value>password</value>\n <description>password to the rt user.</description>\n </variable>\n </variablelist>\n </category>\n <category id="plc_net">|' /etc/planetlab/default_config.xml
fi
mkdir -p /etc/planetlab/configs
-plc-config --save /etc/planetlab/configs/site.xml \
- --category plc_rt --variable enabled --value true
+plc-config --category plc_rt --variable enabled --value true \
+ --save /etc/planetlab/configs/site.xml /etc/planetlab/default_config.xml
+
+# NOTE: setup default values until myplc includes them by default.
+plc-config --category plc_rt --variable host --value localhost.localdomain \
+ --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
+plc-config --category plc_rt --variable ip --value "" \
+ --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
+plc-config --category plc_rt --variable web_user --value root \
+ --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
+plc-config --category plc_rt --variable web_password --value password \
+ --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
+
mkdir -p /var/log/rt3
touch /var/log/rt3/rt.log