updated the Makefile (just a bit)
This commit is contained in:
parent
7d05d9fdea
commit
fc67727692
26
Makefile
26
Makefile
|
@ -19,52 +19,36 @@ OS_TYPE=$(shell uname -o | tr [:upper:] [:lower:] | sed s/[^a-z0-9\._\-]/_/g)
|
|||
|
||||
build:
|
||||
$(INSTALL) -d -m 755 $(BUILD_DIR)/etc
|
||||
$(INSTALL) -c -m 644 conf-examples/cryptobox.conf $(BUILD_DIR)/etc/
|
||||
$(INSTALL) -c -m 644 bin/cryptobox.conf $(BUILD_DIR)/etc/
|
||||
@sed -i 's#^HTML_TEMPLATE_DIR=.*$$#HTML_TEMPLATE_DIR=$(SHARE_DIR)/templates#' $(BUILD_DIR)/etc/cryptobox.conf
|
||||
@sed -i 's#^LANGUAGE_DIR=.*$$#LANGUAGE_DIR=$(SHARE_DIR)/lang#' $(BUILD_DIR)/etc/cryptobox.conf
|
||||
@sed -i 's#^DOC_DIR=.*$$#DOC_DIR=$(DOC_DIR)/html#' $(BUILD_DIR)/etc/cryptobox.conf
|
||||
@sed -i 's#^CONFIG_DEFAULTS_DIR=.*$$#CONFIG_DEFAULTS_DIR=$(SHARE_DIR)/defaults#' $(BUILD_DIR)/etc/cryptobox.conf
|
||||
|
||||
# choose the appropriate program_locations.conf
|
||||
if test -e conf-examples/distributions/$(OS_TYPE) ; \
|
||||
then cat conf-examples/distributions/$(OS_TYPE) ;\
|
||||
else cat conf-examples/distributions/default ;\
|
||||
fi >$(BUILD_DIR)/etc/distribution.conf
|
||||
|
||||
# compile the suid wrapper
|
||||
$(MAKE) -C bin LIB_DIR=$(LIB_DIR)
|
||||
@touch $(BUILD_DIR)-stamp
|
||||
|
||||
|
||||
install: $(BUILD_DIR)-stamp
|
||||
$(INSTALL) -d -m 755 $(LIB_DIR)
|
||||
$(INSTALL) -c -m 755 bin/cbox-manage.sh $(LIB_DIR)
|
||||
$(INSTALL) -c -m 755 bin/cbox-root-actions.sh $(LIB_DIR)
|
||||
$(INSTALL) -c -m 755 bin/cryptobox.pl $(LIB_DIR)
|
||||
$(INSTALL) -c -m 755 bin/cryptobox_cgi_wrapper $(LIB_DIR)
|
||||
$(INSTALL) -c -m 4755 bin/cryptobox_root_wrapper $(LIB_DIR)
|
||||
$(INSTALL) -c -m 755 bin/*.py $(LIB_DIR)/
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/lang
|
||||
$(INSTALL) -c -m 644 lang/* $(SHARE_DIR)/lang/
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/templates
|
||||
$(INSTALL) -c -m 644 templates/*.cs $(SHARE_DIR)/templates
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/defaults
|
||||
$(INSTALL) -c -m 644 conf-examples/default-settings/* $(SHARE_DIR)/defaults/
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/html
|
||||
$(INSTALL) -c -m 644 www-data/*.css $(SHARE_DIR)/html/
|
||||
$(INSTALL) -c -m 644 www-data/*.png $(SHARE_DIR)/html/
|
||||
$(INSTALL) -c -m 644 www-data/*.gif $(SHARE_DIR)/html/
|
||||
#$(INSTALL) -d -m 755 $(SHARE_DIR)/html/screenshots
|
||||
#$(INSTALL) -c -m 644 www-data/screenshots/*.png $(SHARE_DIR)/html/screenshots/
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/html/screenshots
|
||||
$(INSTALL) -c -m 644 www-data/screenshots/*.png $(SHARE_DIR)/html/screenshots/
|
||||
$(INSTALL) -d -m 755 $(DOC_DIR)/html/en
|
||||
$(INSTALL) -d -m 755 $(DOC_DIR)/html/de
|
||||
$(INSTALL) -c -m 644 doc/html/en/* $(DOC_DIR)/html/en/
|
||||
$(INSTALL) -c -m 644 doc/html/de/* $(DOC_DIR)/html/de/
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/distributions
|
||||
$(INSTALL) -c -m 644 conf-examples/distributions/* $(SHARE_DIR)/distributions/
|
||||
|
||||
|
||||
clean:
|
||||
$(MAKE) -C bin clean
|
||||
#$(MAKE) -C bin clean
|
||||
-rm -rf $(BUILD_DIR)
|
||||
-rm -f $(BUILD_DIR)-stamp
|
||||
|
||||
|
|
|
@ -355,6 +355,7 @@ DefaultVolumePrefix = string(min=1)
|
|||
DefaultCipher = string(default="aes-cbc-essiv:sha256")
|
||||
ConfigVolumeLabel = string(min=1, default="cbox_config")
|
||||
UseConfigPartition = integer(min=0, max=1, default=0)
|
||||
DisabledPlugins = list(default=[])
|
||||
|
||||
[Locations]
|
||||
MountParentDir = directoryExists(default="/var/cache/cryptobox/mnt")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python2.4
|
||||
#!/usr/bin/python2.4
|
||||
import os
|
||||
import WebInterfaceSites
|
||||
import sys
|
||||
|
@ -17,7 +17,7 @@ class CryptoBoxWebserver:
|
|||
#expose static content:
|
||||
#I currently have no idea how to cleanly extract the stylesheet path from
|
||||
#the config object without an extra CryptoBox.CryptoBoxProps instance.
|
||||
#perhaps put config handling into a seperate class in CryptoBox.py?
|
||||
#perhaps put config handling into a separate class in CryptoBox.py?
|
||||
#
|
||||
# the following manual mapping is necessary, as we may not use relative
|
||||
# paths in the config file
|
||||
|
|
|
@ -50,8 +50,15 @@ class PluginManager:
|
|||
|
||||
def __getPluginFiles(self):
|
||||
result = []
|
||||
if self.cbox and self.cbox.prefs["Main"]["DisabledPlugins"]:
|
||||
disabled = self.cbox.prefs["Main"]["DisabledPlugins"]
|
||||
else:
|
||||
disabled = []
|
||||
for dir in [os.path.abspath(e) for e in self.plugin_dirs if os.access(e, os.R_OK) and os.path.isdir(e)]:
|
||||
for plname in [f for f in os.listdir(dir)]:
|
||||
if plname in disabled:
|
||||
if self.cbox: self.cbox.log.info("skipped plugin '%s' (disabled via config)" % plname)
|
||||
continue
|
||||
pldir = os.path.join(dir, plname)
|
||||
plfile = os.path.join(pldir, plname + ".py")
|
||||
if os.path.isfile(plfile) and os.access(plfile, os.R_OK):
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# beware: .e.g "/dev/hd" grants access to _all_ harddisks
|
||||
AllowedDevices = /dev/loop, /dev/ubdb
|
||||
|
||||
# use sepepate config partition? (1=yes / 0=no)
|
||||
# use separate config partition? (1=yes / 0=no)
|
||||
UseConfigPartition = 1
|
||||
|
||||
# the default name prefix of not unnamed containers
|
||||
|
@ -17,6 +17,9 @@ DefaultCipher = aes-plain
|
|||
# label of the configuration partition (you should never change this)
|
||||
ConfigVolumeLabel = cbox_config
|
||||
|
||||
# which plugins should be disabled? (comma seperated list)
|
||||
#DisabledPlugins = network, shutdown, partition
|
||||
|
||||
|
||||
[Locations]
|
||||
# where should we mount volumes?
|
||||
|
@ -43,7 +46,7 @@ DocDir = ../doc/html
|
|||
PluginDir = ../plugins
|
||||
|
||||
# path to the hook directory (e.g. containing some scripts)
|
||||
#HookDir = /etc/cryptobox/hooks
|
||||
#HookDir = /etc/cryptobox/hooks.d
|
||||
HookDir = ../hook-scripts
|
||||
|
||||
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
#!/bin/sh
|
||||
|
||||
#TODO: CBXPATH=/usr/lib/cryptobox
|
||||
CBXPATH=$(pwd)
|
||||
CBXSERVER=CryptoBoxWebserver.py
|
||||
PIDFILE=/var/run/cryptobox.pid
|
||||
DAEMON=/usr/bin/python2.4
|
||||
DAEMON_OPTS=${CBXPATH}/CryptoBoxWebserver.py
|
||||
NAME=cryptoboxd
|
||||
DESC="CryptoBox Daemon (webinterface)"
|
||||
#TODO: RUNAS=cryptobox
|
||||
RUNAS=$USERNAME
|
||||
|
||||
#test -x $DAEMON -a -f /etc/exports || exit 0
|
||||
if test -e "./$CBXSERVER"
|
||||
then CBXPATH=$(pwd)
|
||||
else CBXPATH=/usr/lib/cryptobox
|
||||
fi
|
||||
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting $DESC: "
|
||||
start-stop-daemon --background --chdir "$CBXPATH" --chuid "$RUNAS" --start --quiet --oknodo --user "$RUNAS" --make-pidfile --pidfile "$PIDFILE" --exec "$DAEMON" \
|
||||
-- $DAEMON_OPTS
|
||||
start-stop-daemon --background --chdir "$CBXPATH" --chuid "$RUNAS" --start --quiet --user "$RUNAS" --make-pidfile --pidfile "$PIDFILE" --exec "$DAEMON" -- $DAEMON_OPTS
|
||||
echo "$NAME."
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo -n "Stopping $DESC: "
|
||||
#FIXME: this is the same as "killall python2.4"
|
||||
# using a pid file instead prevents problems, but does not kill children???
|
||||
start-stop-daemon --stop --oknodo --exec "$DAEMON"
|
||||
# does the pid file exist?
|
||||
test ! -e "$PIDFILE" && echo "pid file ($PIDFILE) not found!" && exit 1
|
||||
# kill all process with the parent pid that we saved before
|
||||
pkill -f -P "$(cat $PIDFILE)" -u "$RUNAS" && rm "$PIDFILE"
|
||||
echo "$NAME."
|
||||
;;
|
||||
restart )
|
||||
"$0" stop
|
||||
"$0" start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $(basename $0) {start|stop}" >&2
|
||||
echo "Usage: $(basename $0) {start|stop|restart}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue