summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-08-14 21:11:07 +0300
committerAlon Levy <alon@pobox.com>2015-08-15 10:31:01 +0300
commit4056393d58d2d91cfd8d24d77c1812e1fdd04cb3 (patch)
treeeab15c1542244401dbeab725c74075b52ac00f27 /src
parent46404014a08158d1b8c491cda26f9880576ebe4c (diff)
rz-mux: use rhizi-custom
rhizi-mux package: add templates (TODO: should be in the common part)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/local/rz-mux/rz-mux-tool.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/local/rz-mux/rz-mux-tool.sh b/src/local/rz-mux/rz-mux-tool.sh
index 6c52b720..021f7076 100755
--- a/src/local/rz-mux/rz-mux-tool.sh
+++ b/src/local/rz-mux/rz-mux-tool.sh
@@ -108,7 +108,10 @@ install_instance__apache() {
ln -vfs -T /etc/rhizi/mux-conf.d/${RZI_NAME} ${apache_module__rootdir}/webapp/etc
ln -vfs -T /usr/lib/rhizi/webapp/static/js ${apache_module__rootdir}/webapp/static/js
- ln -vfs -T /usr/share/rhizi/webapp/static/css ${apache_module__rootdir}/webapp/static/css
+
+ ln -vfs -T ${rhizi_custom__instance}/js/domain_types.js ${apache_module__rootdir}/webapp/fragment.d/js/domain_types.js
+ ln -vfs -T ${rhizi_custom__instance}/css ${apache_module__rootdir}/webapp/static/css
+
ln -vfs -T /usr/share/rhizi/webapp/static/font ${apache_module__rootdir}/webapp/static/font
ln -vfs -T /usr/share/rhizi/webapp/static/img ${apache_module__rootdir}/webapp/static/img
ln -vfs -T /usr/share/rhizi/webapp/static/lib ${apache_module__rootdir}/webapp/static/lib
@@ -117,6 +120,12 @@ install_instance__apache() {
ln -vfs -T /etc/apache2/sites-available/${apache_module__siteconf_filename} /etc/apache2/sites-enabled/${apache_module__siteconf_filename}
}
+install_instance__apache__custom() {
+ if [ -e ${rhizi_custom__fragment} ]; then
+ cp -vr ${rhizi_custom__fragment}/* ${apache_module__rootdir}/webapp/fragment.d/template.d/
+ fi
+}
+
install_instance__rhizi() { # depends on install_instance__apache()
[[ -e "${rz_module__confdir}" ]] && die "error: rhizi module already installed: ${rz_module__confdir}"
@@ -125,7 +134,7 @@ install_instance__rhizi() { # depends on install_instance__apache()
--directory ${rz_module__bkp}
# install default fragments - JS
- cp -vr /usr/share/rhizi/webapp/domain-fragment.d/default/* ${apache_module__rootdir}/webapp/fragment.d/
+ cp -vr /usr/share/rhizi/webapp/domain-fragment.d/default/* ${apache_module__rootdir}/webapp/fragment.d/template.d/
}
@@ -164,6 +173,10 @@ RZI_RZ_PID_FILE=/var/run/rhizi/${RZI_NAME}.pid
RZI_RZ_INIT_SCRIPT_PATH=/etc/init.d/rhizi__${RZI_NAME}
RZI_RZ_CRON_SCRIPT_PATH=/etc/cron.daily/rhizi__${RZI_NAME}
+rhizi_custom__rootdir=$3
+rhizi_custom__instance=${rhizi_custom__rootdir}/domain-fragment.d/${RZI_NAME}
+rhizi_custom__fragment=${rhizi_custom__rootdir}/fragment/by-domain/${RZI_NAME}
+
#
# sanity checks
#
@@ -171,6 +184,9 @@ RZI_RZ_CRON_SCRIPT_PATH=/etc/cron.daily/rhizi__${RZI_NAME}
[ -z ${RZI_NAME} ] && die 'error: RZI_NAME arg missing, aborting'
[ -e ${RZI_NEO4J_PID_FILE} ] && die "error: ${RZI_NEO4J_SVC_NAME} server seems to be running, please stop it before continuing"
[ -e ${RZI_RZ_PID_FILE} ] && die "error: ${RZI_RZ_PID_FILE} server seems to be running, please stop it before continuing"
+[ ! -e ${rhizi_custom__rootdir}/domain-fragment.d ] && die 'error: 3rd argument must point to rhizi-custom git checkout'
+[ ! -e ${rhizi_custom__instance} ] && die 'error: no such instance in rhizi-custom (${RZI_NAME} in ${rhizi_custom__rootdir}}'
+[ -e /usr/lib/rhizi/webapp/static/js/domain_types.js ] && die 'unexpected domain_types.js in rhizi install'
set_path_vars
@@ -182,10 +198,11 @@ case $1 in
install_instance__apache
install_instance__neo4j
install_instance__rhizi
+ install_instance__apache__custom
# pass-on extra argument to python: install dom-x ...:
# - opt: --rz_config__disable_access_control
- if [ $# -ge 3 ] ; then shift 2; py_extra_args=$@ ; fi
+ if [ $# -ge 4 ] ; then shift 3; py_extra_args=$@ ; fi
python /usr/lib/rhizi/tools/rz-mux/rz-mux-tool.py \
--template-dir /usr/share/rhizi/rz-mux/ \
--domain ${RZI_NAME} ${py_extra_args}