distributions specific config file introduced (for program locations)
pmount added to debian dependencies
This commit is contained in:
parent
1bae6a759e
commit
3da483ffec
11 changed files with 55 additions and 18 deletions
10
Makefile
10
Makefile
|
@ -13,6 +13,8 @@ DOC_DIR = $(PREFIX)/share/doc/cryptobox
|
|||
BUILD_DIR = build_dir
|
||||
INSTALL = install
|
||||
|
||||
OS_TYPE=$(shell uname -o | tr [:upper:] [:lower:] | sed s/[^a-z0-9\._\-]/_/g)
|
||||
|
||||
.PHONY: install clean build
|
||||
|
||||
build:
|
||||
|
@ -23,6 +25,12 @@ build:
|
|||
@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
|
||||
|
@ -51,6 +59,8 @@ install: $(BUILD_DIR)-stamp
|
|||
$(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:
|
||||
|
|
|
@ -21,13 +21,13 @@ build: $(CGI_SUID_FILE) $(ROOT_SUID_FILE)
|
|||
|
||||
|
||||
$(CGI_SUID_FILE): $(SRC_FILE)
|
||||
$(NOECHO) echo '#define EXEC_PATH "$(LIB_DIR)/$(CGI_FILENAME)"' >$(HEADER_FILE)
|
||||
@echo '#define EXEC_PATH "$(LIB_DIR)/$(CGI_FILENAME)"' >$(HEADER_FILE)
|
||||
$(CC) -o $(CGI_SUID_FILE) $(SRC_FILE)
|
||||
-rm $(HEADER_FILE)
|
||||
|
||||
|
||||
$(ROOT_SUID_FILE): $(SRC_FILE)
|
||||
$(NOECHO) echo '#define EXEC_PATH "$(LIB_DIR)/$(ROOT_SCRIPT_FILENAME)"' >$(HEADER_FILE)
|
||||
@echo '#define EXEC_PATH "$(LIB_DIR)/$(ROOT_SCRIPT_FILENAME)"' >$(HEADER_FILE)
|
||||
$(CC) -o $(ROOT_SUID_FILE) $(SRC_FILE)
|
||||
-rm $(HEADER_FILE)
|
||||
|
||||
|
|
|
@ -32,8 +32,15 @@ CONFIG_DIR=~/config
|
|||
# read the default setting file, if it exists
|
||||
[ -e /etc/default/cryptobox ] && . /etc/default/cryptobox
|
||||
|
||||
[ ! -e "$CONF_FILE" ] && error_msg 1 "Could not find the configuration file: $CONF_FILE"
|
||||
|
||||
# parse config file
|
||||
. "$CONF_FILE"
|
||||
source "$CONF_FILE"
|
||||
|
||||
[ ! -e "$CONF_FILE" ] && error_msg 1 "Could not find the distribution specific configuration file: $CONF_FILE"
|
||||
|
||||
# parse the distribution specific file
|
||||
source "$DISTRIBUTION_CONF"
|
||||
|
||||
# check for writable log file
|
||||
[ -w "$LOG_FILE" ] || LOG_FILE=/tmp/$(basename "$LOG_FILE")
|
||||
|
|
|
@ -20,12 +20,14 @@ set -eu
|
|||
[ "$(id -u)" -ne 0 ] && echo "$(basename $0) - only root may call this script" >&2 && exit 100
|
||||
|
||||
# read the default setting file, if it exists
|
||||
[ -e /etc/default/cryptobox ] && . /etc/default/cryptobox
|
||||
[ -e /etc/default/cryptobox ] && source /etc/default/cryptobox
|
||||
|
||||
# set CONF_FILE to default value, if not configured in /etc/default/cryptobox
|
||||
CONF_FILE=${CONF_FILE:-/etc/cryptobox/cryptobox.conf}
|
||||
# parse config file
|
||||
. "$CONF_FILE"
|
||||
source "$CONF_FILE"
|
||||
# parse distribution specific file
|
||||
source "$DISTRIBUTION_CONF"
|
||||
|
||||
|
||||
############ some useful functions ###############
|
||||
|
|
|
@ -737,5 +737,7 @@ $pagedata->setValue('Data.QueryString', "$querystring") if ($querystring ne '');
|
|||
|
||||
&render();
|
||||
|
||||
close STDOUT;
|
||||
|
||||
exit 0;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
[ -e "/usr/lib/cryptobox/cbox-manage.sh" ] || exit 0
|
||||
|
||||
# read the default setting file, if it exists
|
||||
[ -e /etc/default/cryptobox ] && . /etc/default/cryptobox
|
||||
[ -e /etc/default/cryptobox ] && source /etc/default/cryptobox
|
||||
|
||||
# startup switch defaults to zero (enabled)
|
||||
NO_START=${NO_START:-0}
|
||||
|
@ -29,7 +29,7 @@ CONF_FILE=${CONF_FILE:-/etc/cryptobox/cryptobox.conf}
|
|||
|
||||
# parse config file
|
||||
if [ -e "$CONF_FILE" ]
|
||||
then . "$CONF_FILE"
|
||||
then source "$CONF_FILE"
|
||||
else echo "[$(basename $0)] - configuration file ($CONF_FILE) not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
LANGUAGE=en
|
||||
NET_IFACE=eth0
|
||||
FILE_USER=cryptobox-data
|
||||
CRYPTOBOX_USER=cryptobox
|
||||
SCAN_DEVICES="sda"
|
||||
#SCAN_DEVICES="hda hdb hdc hdd hde hdf hdg scd sg sda sdb sdc sdd"
|
||||
|
@ -30,10 +29,6 @@ CONFIG_MARKER=cryptobox.marker
|
|||
DEFAULT_CIPHER=aes-cbc-essiv:sha256
|
||||
DEV_MAPPER_DIR=/dev/mapper
|
||||
|
||||
# some programs
|
||||
SFDISK=/sbin/sfdisk
|
||||
MKFS_DATA=/sbin/mkfs.ext3
|
||||
MKFS_CONFIG=/sbin/mkfs.ext2
|
||||
CRYPTSETUP=/sbin/cryptsetup
|
||||
IFCONFIG=/sbin/ifconfig
|
||||
|
||||
# distribution specific configuration
|
||||
# examples can be found in /usr/local/share/cryptobox/distributions
|
||||
DISTRIBUTION_CONF=/etc/cryptobox/distribution.conf
|
||||
|
|
11
conf-examples/distributions/README
Normal file
11
conf-examples/distributions/README
Normal file
|
@ -0,0 +1,11 @@
|
|||
You need to copy one of these files to /etc/cryptobox/distribution.conf.
|
||||
Choose the one, that fits to your particular operating system - if you are
|
||||
not sure which operation system you are using, then you should run
|
||||
uname -o
|
||||
to get to know yourself :)
|
||||
|
||||
If the file for your specific operating system is not available, then you
|
||||
may consider to send a copy of the one you wrote for yourself to
|
||||
devel@systemausfall.org.
|
||||
Thanks!
|
||||
|
9
conf-examples/distributions/gnu_linux
Normal file
9
conf-examples/distributions/gnu_linux
Normal file
|
@ -0,0 +1,9 @@
|
|||
# program locations for debian
|
||||
SFDISK=/sbin/sfdisk
|
||||
MKFS_DATA=/sbin/mkfs.ext3
|
||||
MKFS_CONFIG=/sbin/mkfs.ext2
|
||||
CRYPTSETUP=/sbin/cryptsetup
|
||||
IFCONFIG=/sbin/ifconfig
|
||||
PMOUNT=/bin/pmount
|
||||
PUMOUNT=/bin/pumount
|
||||
|
4
debian/control
vendored
4
debian/control
vendored
|
@ -6,8 +6,8 @@ Build-Depends: debhelper (>>3.0.0), dpatch, gcc (>=2.95)
|
|||
Standards-Version: 3.6.2
|
||||
|
||||
Package: cryptobox
|
||||
Architecture: all
|
||||
Depends: bash (>=2.0), sed (>=4.0), coreutils, grep (>=2.0), perl, httpd-cgi, hashalot, libconfigfile-perl, cryptsetup (>=20050111), dmsetup, at
|
||||
Architecture: any
|
||||
Depends: bash (>=2.0), sed (>=4.0), coreutils, grep (>=2.0), perl, httpd-cgi, hashalot, libconfigfile-perl, cryptsetup (>=20050111), dmsetup, at, pmount
|
||||
Recommends: perl-clearsilver
|
||||
Suggests: stunnel, cron, iptables, samba
|
||||
Description: Web interface for an encrypting fileserver
|
||||
|
|
3
debian/rules
vendored
3
debian/rules
vendored
|
@ -20,7 +20,7 @@ DEB_BUILD_DIR=$(CURDIR)/debian/cryptobox
|
|||
configure: configure-stamp
|
||||
configure-stamp: patch
|
||||
dh_testdir
|
||||
# PUT SOMETHING HERE
|
||||
@# PUT SOMETHING HERE
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
|
@ -56,6 +56,7 @@ install: build
|
|||
dh_installdirs
|
||||
$(MAKE) install PREFIX=$(DEB_BUILD_DIR)/usr
|
||||
install -c -m 644 build_dir/etc/cryptobox.conf $(DEB_BUILD_DIR)/etc/cryptobox/
|
||||
install -c -m 644 build_dir/etc/distribution.conf $(DEB_BUILD_DIR)/etc/cryptobox/
|
||||
install -c -m 644 conf-examples/defaults-cryptobox.conf $(DEB_BUILD_DIR)/etc/default/cryptobox
|
||||
install -c -m 755 bin/init-script.sh $(DEB_BUILD_DIR)/etc/init.d/cryptobox
|
||||
install -c -m 755 bin/cryptobox_cgi_wrapper $(DEB_BUILD_DIR)/usr/lib/cgi-bin/cryptobox
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue