distributions specific config file introduced (for program locations)
pmount added to debian dependencies
This commit is contained in:
parent
1bae6a759e
commit
3da483ffec
10
Makefile
10
Makefile
|
@ -13,6 +13,8 @@ DOC_DIR = $(PREFIX)/share/doc/cryptobox
|
||||||
BUILD_DIR = build_dir
|
BUILD_DIR = build_dir
|
||||||
INSTALL = install
|
INSTALL = install
|
||||||
|
|
||||||
|
OS_TYPE=$(shell uname -o | tr [:upper:] [:lower:] | sed s/[^a-z0-9\._\-]/_/g)
|
||||||
|
|
||||||
.PHONY: install clean build
|
.PHONY: install clean build
|
||||||
|
|
||||||
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#^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
|
@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
|
# compile the suid wrapper
|
||||||
$(MAKE) -C bin LIB_DIR=$(LIB_DIR)
|
$(MAKE) -C bin LIB_DIR=$(LIB_DIR)
|
||||||
@touch $(BUILD_DIR)-stamp
|
@touch $(BUILD_DIR)-stamp
|
||||||
|
@ -51,6 +59,8 @@ install: $(BUILD_DIR)-stamp
|
||||||
$(INSTALL) -d -m 755 $(DOC_DIR)/html/de
|
$(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/en/* $(DOC_DIR)/html/en/
|
||||||
$(INSTALL) -c -m 644 doc/html/de/* $(DOC_DIR)/html/de/
|
$(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:
|
clean:
|
||||||
|
|
|
@ -21,13 +21,13 @@ build: $(CGI_SUID_FILE) $(ROOT_SUID_FILE)
|
||||||
|
|
||||||
|
|
||||||
$(CGI_SUID_FILE): $(SRC_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)
|
$(CC) -o $(CGI_SUID_FILE) $(SRC_FILE)
|
||||||
-rm $(HEADER_FILE)
|
-rm $(HEADER_FILE)
|
||||||
|
|
||||||
|
|
||||||
$(ROOT_SUID_FILE): $(SRC_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)
|
$(CC) -o $(ROOT_SUID_FILE) $(SRC_FILE)
|
||||||
-rm $(HEADER_FILE)
|
-rm $(HEADER_FILE)
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,15 @@ CONFIG_DIR=~/config
|
||||||
# read the default setting file, if it exists
|
# read the default setting file, if it exists
|
||||||
[ -e /etc/default/cryptobox ] && . /etc/default/cryptobox
|
[ -e /etc/default/cryptobox ] && . /etc/default/cryptobox
|
||||||
|
|
||||||
|
[ ! -e "$CONF_FILE" ] && error_msg 1 "Could not find the configuration file: $CONF_FILE"
|
||||||
|
|
||||||
# parse config 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
|
# check for writable log file
|
||||||
[ -w "$LOG_FILE" ] || LOG_FILE=/tmp/$(basename "$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
|
[ "$(id -u)" -ne 0 ] && echo "$(basename $0) - only root may call this script" >&2 && exit 100
|
||||||
|
|
||||||
# read the default setting file, if it exists
|
# 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
|
# set CONF_FILE to default value, if not configured in /etc/default/cryptobox
|
||||||
CONF_FILE=${CONF_FILE:-/etc/cryptobox/cryptobox.conf}
|
CONF_FILE=${CONF_FILE:-/etc/cryptobox/cryptobox.conf}
|
||||||
# parse config file
|
# parse config file
|
||||||
. "$CONF_FILE"
|
source "$CONF_FILE"
|
||||||
|
# parse distribution specific file
|
||||||
|
source "$DISTRIBUTION_CONF"
|
||||||
|
|
||||||
|
|
||||||
############ some useful functions ###############
|
############ some useful functions ###############
|
||||||
|
|
|
@ -737,5 +737,7 @@ $pagedata->setValue('Data.QueryString', "$querystring") if ($querystring ne '');
|
||||||
|
|
||||||
&render();
|
&render();
|
||||||
|
|
||||||
|
close STDOUT;
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
[ -e "/usr/lib/cryptobox/cbox-manage.sh" ] || exit 0
|
[ -e "/usr/lib/cryptobox/cbox-manage.sh" ] || exit 0
|
||||||
|
|
||||||
# read the default setting file, if it exists
|
# 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)
|
# startup switch defaults to zero (enabled)
|
||||||
NO_START=${NO_START:-0}
|
NO_START=${NO_START:-0}
|
||||||
|
@ -29,7 +29,7 @@ CONF_FILE=${CONF_FILE:-/etc/cryptobox/cryptobox.conf}
|
||||||
|
|
||||||
# parse config file
|
# parse config file
|
||||||
if [ -e "$CONF_FILE" ]
|
if [ -e "$CONF_FILE" ]
|
||||||
then . "$CONF_FILE"
|
then source "$CONF_FILE"
|
||||||
else echo "[$(basename $0)] - configuration file ($CONF_FILE) not found!" >&2
|
else echo "[$(basename $0)] - configuration file ($CONF_FILE) not found!" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
LANGUAGE=en
|
LANGUAGE=en
|
||||||
NET_IFACE=eth0
|
NET_IFACE=eth0
|
||||||
FILE_USER=cryptobox-data
|
|
||||||
CRYPTOBOX_USER=cryptobox
|
CRYPTOBOX_USER=cryptobox
|
||||||
SCAN_DEVICES="sda"
|
SCAN_DEVICES="sda"
|
||||||
#SCAN_DEVICES="hda hdb hdc hdd hde hdf hdg scd sg sda sdb sdc sdd"
|
#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
|
DEFAULT_CIPHER=aes-cbc-essiv:sha256
|
||||||
DEV_MAPPER_DIR=/dev/mapper
|
DEV_MAPPER_DIR=/dev/mapper
|
||||||
|
|
||||||
# some programs
|
# distribution specific configuration
|
||||||
SFDISK=/sbin/sfdisk
|
# examples can be found in /usr/local/share/cryptobox/distributions
|
||||||
MKFS_DATA=/sbin/mkfs.ext3
|
DISTRIBUTION_CONF=/etc/cryptobox/distribution.conf
|
||||||
MKFS_CONFIG=/sbin/mkfs.ext2
|
|
||||||
CRYPTSETUP=/sbin/cryptsetup
|
|
||||||
IFCONFIG=/sbin/ifconfig
|
|
||||||
|
|
||||||
|
|
|
@ -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!
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -6,8 +6,8 @@ Build-Depends: debhelper (>>3.0.0), dpatch, gcc (>=2.95)
|
||||||
Standards-Version: 3.6.2
|
Standards-Version: 3.6.2
|
||||||
|
|
||||||
Package: cryptobox
|
Package: cryptobox
|
||||||
Architecture: all
|
Architecture: any
|
||||||
Depends: bash (>=2.0), sed (>=4.0), coreutils, grep (>=2.0), perl, httpd-cgi, hashalot, libconfigfile-perl, cryptsetup (>=20050111), dmsetup, at
|
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
|
Recommends: perl-clearsilver
|
||||||
Suggests: stunnel, cron, iptables, samba
|
Suggests: stunnel, cron, iptables, samba
|
||||||
Description: Web interface for an encrypting fileserver
|
Description: Web interface for an encrypting fileserver
|
||||||
|
|
|
@ -20,7 +20,7 @@ DEB_BUILD_DIR=$(CURDIR)/debian/cryptobox
|
||||||
configure: configure-stamp
|
configure: configure-stamp
|
||||||
configure-stamp: patch
|
configure-stamp: patch
|
||||||
dh_testdir
|
dh_testdir
|
||||||
# PUT SOMETHING HERE
|
@# PUT SOMETHING HERE
|
||||||
touch configure-stamp
|
touch configure-stamp
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ install: build
|
||||||
dh_installdirs
|
dh_installdirs
|
||||||
$(MAKE) install PREFIX=$(DEB_BUILD_DIR)/usr
|
$(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/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 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/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
|
install -c -m 755 bin/cryptobox_cgi_wrapper $(DEB_BUILD_DIR)/usr/lib/cgi-bin/cryptobox
|
||||||
|
|
Loading…
Reference in New Issue