migrated to cryptsetup-luks
list of packages reduced more dfsbuild-probe devices: sda sdb sdc sdd GPL added to all scripts check_smb_idle.sh is temporarily disabled for now initial_checks removed
This commit is contained in:
parent
8d1c3aa9c4
commit
eaa06602ee
28 changed files with 713 additions and 211 deletions
|
@ -4,7 +4,7 @@
|
||||||
LANGUAGE=de
|
LANGUAGE=de
|
||||||
NET_IFACE=eth0
|
NET_IFACE=eth0
|
||||||
SAMBA_USER=nobody
|
SAMBA_USER=nobody
|
||||||
SCAN_DEVICES="/dev/hda /dev/hdb /dev/hdc /dev/hde /dev/hdf /dev/hdg /dev/scd0 /dev/scd1 /dev/scd2 /dev/scd3 /dev/sg /dev/sda /dev/sdb /dev/sdc /dev/sdd"
|
SCAN_DEVICES="hda hdb hdc hdd hde hdf hdg scd0 scd1 scd2 scd3 sg sda sdb sdc sdd"
|
||||||
|
|
||||||
# directories
|
# directories
|
||||||
LANGUAGE_DIR=/usr/share/cryptobox/lang
|
LANGUAGE_DIR=/usr/share/cryptobox/lang
|
||||||
|
@ -12,7 +12,7 @@ HTML_TEMPLATE_DIR=/usr/share/cryptobox/templates
|
||||||
DOC_DIR=/usr/share/doc/cryptobox/html
|
DOC_DIR=/usr/share/doc/cryptobox/html
|
||||||
CONFIG_DEFAULTS_DIR=/usr/share/cryptobox/defaults
|
CONFIG_DEFAULTS_DIR=/usr/share/cryptobox/defaults
|
||||||
CONFIG_DIR=/mnt/cb-etc
|
CONFIG_DIR=/mnt/cb-etc
|
||||||
CRYPTO_DIR=/mnt/crypto
|
MNT_PARENT=/mnt/crypto
|
||||||
|
|
||||||
# some files
|
# some files
|
||||||
CB_SCRIPT=/usr/lib/cryptobox/cbox-manage.sh
|
CB_SCRIPT=/usr/lib/cryptobox/cbox-manage.sh
|
||||||
|
@ -25,8 +25,9 @@ OPENSSL_CONF_FILE=/etc/cryptobox/openssl.cnf
|
||||||
IDLE_COUNTER_FILE=/tmp/cbox-idle-counter
|
IDLE_COUNTER_FILE=/tmp/cbox-idle-counter
|
||||||
|
|
||||||
# crypto settings
|
# crypto settings
|
||||||
# since 0.2.1 you find the default crypto settings in /usr/share/cryptobox/defaults
|
# there is no default hash, as this is ignored by luks
|
||||||
CRYPTMAPPER_DEV=/dev/mapper/cryptobox-data
|
DEFAULT_CIPHER=aes-cbc-essiv:sha256
|
||||||
|
CRYPTMAPPER_DIR=/dev/mapper
|
||||||
|
|
||||||
# some programs
|
# some programs
|
||||||
SFDISK=/sbin/sfdisk
|
SFDISK=/sbin/sfdisk
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
CryptoBox r$Revision$
|
CryptoBox $Revision$
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# this script does EVERYTHING
|
# this script does EVERYTHING
|
||||||
|
@ -18,7 +24,11 @@ set -eu
|
||||||
CONFIG_MARKER="$CONFIG_DIR/cryptobox.marker"
|
CONFIG_MARKER="$CONFIG_DIR/cryptobox.marker"
|
||||||
CERT_TEMP=/tmp/stunnel.pem
|
CERT_TEMP=/tmp/stunnel.pem
|
||||||
|
|
||||||
#####
|
######## stuff ##########
|
||||||
|
|
||||||
|
ALL_PARTITIONS=$(cat /proc/partitions | sed '1,2d; s/ */ /g; s/^ *//' | cut -d " " -f 4)
|
||||||
|
|
||||||
|
#########################
|
||||||
|
|
||||||
function log_msg()
|
function log_msg()
|
||||||
{
|
{
|
||||||
|
@ -35,25 +45,16 @@ function error_msg()
|
||||||
{
|
{
|
||||||
echo "[`date`] - $2" | tee -a "$LOG_FILE" >&2
|
echo "[`date`] - $2" | tee -a "$LOG_FILE" >&2
|
||||||
# print the execution stack - not usable with busybox
|
# print the execution stack - not usable with busybox
|
||||||
#caller | sed 's/^/\t/' >&2
|
# caller | sed 's/^/\t/' >&2
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function initial_checks()
|
|
||||||
# Parameter: device
|
|
||||||
{
|
|
||||||
local device="$1"
|
|
||||||
[ ! -b "$device" ] && log_msg "blockdevice $device does not exist" && return 1
|
|
||||||
[ ! -x "$SFDISK" ] && log_msg "$SFDISK not found" && return 1
|
|
||||||
log_msg "inital checks successful"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function create_partitions()
|
function create_partitions()
|
||||||
# Parameter: device
|
# Parameter: device
|
||||||
{
|
{
|
||||||
|
# TODO: allow different layouts
|
||||||
|
# TODO: skip config partition if a configuration is already active
|
||||||
local device="$1"
|
local device="$1"
|
||||||
# first partition size is 1 sector, second goes til end
|
# first partition size is 1 sector, second goes til end
|
||||||
# sfdisk -n doesn't actually write (for testing purpose)
|
# sfdisk -n doesn't actually write (for testing purpose)
|
||||||
|
@ -62,10 +63,14 @@ function create_partitions()
|
||||||
|
|
||||||
|
|
||||||
function config_set_value()
|
function config_set_value()
|
||||||
# parameters: SettingName SettingValue
|
# parameters: SettingName [SettingValue]
|
||||||
|
# read from stdin if SettingValue is not defined
|
||||||
{
|
{
|
||||||
mount -o rw,remount "$CONFIG_DIR"
|
mount -o rw,remount "$CONFIG_DIR"
|
||||||
echo -n "$2" > "$CONFIG_DIR/$1"
|
if [ $# -gt 1 ]
|
||||||
|
then echo -n "$2" > "$CONFIG_DIR/$1"
|
||||||
|
else cat - >"$CONFIG_DIR/$1"
|
||||||
|
fi
|
||||||
mount -o ro,remount "$CONFIG_DIR"
|
mount -o ro,remount "$CONFIG_DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,15 +88,8 @@ function config_get_value()
|
||||||
# check for existence - maybe use default values (for old releases without this setting)
|
# check for existence - maybe use default values (for old releases without this setting)
|
||||||
if [ ! -e "$conf_dir/$1" ]
|
if [ ! -e "$conf_dir/$1" ]
|
||||||
then case "$1" in
|
then case "$1" in
|
||||||
version )
|
# you may place default values for older versions here
|
||||||
echo -n "0.2"
|
# for compatibility
|
||||||
;;
|
|
||||||
cipher )
|
|
||||||
echo -n "aes"
|
|
||||||
;;
|
|
||||||
hash )
|
|
||||||
echo -n "sha512"
|
|
||||||
;;
|
|
||||||
* )
|
* )
|
||||||
error_msg 2 "unknown configuration value ($1)"
|
error_msg 2 "unknown configuration value ($1)"
|
||||||
# empty output
|
# empty output
|
||||||
|
@ -108,7 +106,7 @@ function config_get_value()
|
||||||
function create_config()
|
function create_config()
|
||||||
# Parameter: device
|
# Parameter: device
|
||||||
{
|
{
|
||||||
local device="${1}1"
|
local device="$1"
|
||||||
log_msg "Creating config filesystem ..."
|
log_msg "Creating config filesystem ..."
|
||||||
# filter output through 'tr' to replace tabs
|
# filter output through 'tr' to replace tabs
|
||||||
$MKFS_CONFIG "$device" | tr '\010' ' '
|
$MKFS_CONFIG "$device" | tr '\010' ' '
|
||||||
|
@ -124,9 +122,12 @@ function create_config()
|
||||||
# beware: the temp file should always be there - even after reboot - see "mount_config"
|
# beware: the temp file should always be there - even after reboot - see "mount_config"
|
||||||
cp -p "$CERT_TEMP" "$CERT_FILE"
|
cp -p "$CERT_TEMP" "$CERT_FILE"
|
||||||
|
|
||||||
|
# create database of readable names
|
||||||
|
touch "$CONFIG_DIR/names.db"
|
||||||
|
|
||||||
log_msg "Setting inital values ..."
|
log_msg "Setting inital values ..."
|
||||||
# beware: config_set_value remounts the config partition read-only
|
# beware: config_set_value remounts the config partition read-only
|
||||||
config_set_value "device" "$1"
|
config_set_value "device" "$device"
|
||||||
config_set_value "ip" "$(get_current_ip)"
|
config_set_value "ip" "$(get_current_ip)"
|
||||||
|
|
||||||
# reinitialise configuration
|
# reinitialise configuration
|
||||||
|
@ -145,54 +146,119 @@ function get_current_ip()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function create_crypto()
|
function list_crypto_containers()
|
||||||
# Parameter: device
|
|
||||||
{
|
{
|
||||||
local device="$1"
|
for a in $ALL_PARTITIONS
|
||||||
# passphrase may be passed via command line
|
do $CRYPTSETUP isLuks "/dev/$a" 2>/dev/null && echo "/dev/$a"
|
||||||
log_msg "Creating crypto partition with -h $(config_get_value hash) -c $(config_get_value cipher) on ${device}2"
|
done
|
||||||
$CRYPTSETUP -h "$(config_get_value hash)" -c "$(config_get_value cipher)" create "`basename $CRYPTMAPPER_DEV`" "${device}2"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function mkfs_crypto()
|
function list_unused_partitions()
|
||||||
# split from create_crypto to allow background execution via web interface
|
|
||||||
{
|
{
|
||||||
local device=$(find_harddisk)
|
for a in $ALL_PARTITIONS
|
||||||
|
do $CRYPTSETUP isLuks "/dev/$a" 2>/dev/null || echo "/dev/$a"
|
||||||
|
done | grep -v "$(config_get_value device)1"
|
||||||
|
# replace the config_get_value by a sub, that returns the config partition
|
||||||
|
}
|
||||||
|
|
||||||
# flood the crypto partition with noise
|
|
||||||
# writing to the real partition is faster
|
function get_crypto_uuid()
|
||||||
# TODO: this takes _much_ too long - maybe add a "secure wipe" switch to the interface?
|
# Parameter: DEVICE
|
||||||
#dd if=/dev/urandom of="${device}2" bs=512
|
{
|
||||||
|
$CRYPTSETUP luksUUID "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get_crypto_name()
|
||||||
|
# Parameter: DEVICE
|
||||||
|
# return the readable name of the crypto container, it it is already defined
|
||||||
|
# if undefined - return the uuid
|
||||||
|
{
|
||||||
|
local uuid=$($CRYPTSETUP luksUUID $1)
|
||||||
|
local dbname=$(config_get_value "names.db" | grep "^$uuid:" | cut -d ":" -f 2-)
|
||||||
|
if [ -z "$dbname" ]
|
||||||
|
then echo -n "$uuid"
|
||||||
|
else echo -n "$dbname"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function set_crypto_name()
|
||||||
|
# Parameter: DEVICE NAME
|
||||||
|
{
|
||||||
|
local uuid=$($CRYPTSETUP luksUUID $1)
|
||||||
|
# remove the old setting for this device and every possible entry with the same name
|
||||||
|
(config_get_value 'names.db' | sed "/^$uuid:/d; /^[^:]*:$2$/d"; echo "$uuid:$2") | config_set_value 'names.db'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function does_crypto_name_exist()
|
||||||
|
# Parameter: NAME
|
||||||
|
{
|
||||||
|
config_get_value 'names.db' | grep -q "^[^:]*:$1$"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function create_crypto()
|
||||||
|
# Parameter: DEVICE NAME KEYFILE
|
||||||
|
# keyfile is necessary, to allow background execution via 'at'
|
||||||
|
{
|
||||||
|
local device=$1
|
||||||
|
local name=$2
|
||||||
|
local keyfile=$3
|
||||||
|
# otherwise the web interface will hang
|
||||||
|
# passphrase may be passed via command line
|
||||||
|
log_msg "Creating crypto partition with the cipher $DEFAULT_CIPHER on $device"
|
||||||
|
# the hash is ignored by luks
|
||||||
|
# the iter-time specifies the time spent on PBKDF2 - one second is said to be sufficient
|
||||||
|
# luksFormat floods the container with random noise automatically
|
||||||
|
cat "$keyfile" | $CRYPTSETUP -c "$DEFAULT_CIPHER" luksFormat "$device"
|
||||||
|
set_crypto_name "$device" "$name"
|
||||||
|
local uuid=$(get_crypto_uuid "$device")
|
||||||
|
|
||||||
|
# map the crypto container
|
||||||
|
cat "$keyfile" | $CRYPTSETUP luksOpen "$device" "$uuid"
|
||||||
|
|
||||||
|
# remove the passphrase-file as soon as possible
|
||||||
|
dd if=/dev/zero of="$keyfile" bs=512 count=1 2>/dev/null
|
||||||
|
rm "$keyfile"
|
||||||
|
|
||||||
# filter output through 'tr' to replace tabs
|
# filter output through 'tr' to replace tabs
|
||||||
$MKFS_DATA "$CRYPTMAPPER_DEV" | tr '\0101' ' '
|
$MKFS_DATA "$CRYPTMAPPER_DIR/$uuid" | tr '\0101' ' '
|
||||||
|
|
||||||
|
# set user for samba
|
||||||
|
mkdir -p "$MNT_PARENT/$name"
|
||||||
|
mount "$CRYPTMAPPER_DIR/$uuid" "$MNT_PARENT/$name"
|
||||||
|
chown $SAMBA_USER "$MNT_PARENT/$name"
|
||||||
|
umount_crypto "$device"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function config_mount_test()
|
function config_mount_test()
|
||||||
# Parameter: device
|
# Parameter: device
|
||||||
{
|
{
|
||||||
local device="${1}"
|
local device=$1
|
||||||
local STATUS=0
|
local STATUS=0
|
||||||
mount "${device}1" "$CONFIG_DIR" &>/dev/null || true
|
mount "${device}1" "$CONFIG_DIR" &>/dev/null || true
|
||||||
is_config_mounted && STATUS=1
|
is_config_mounted && STATUS=1
|
||||||
umount "$CONFIG_DIR" &>/dev/null || true
|
umount "$CONFIG_DIR" &>/dev/null || true
|
||||||
# return code is the result of this expression
|
# return code is the result of this expression
|
||||||
[ 1 -eq "$STATUS" ] && return 0
|
test 1 -eq "$STATUS"
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function is_config_mounted()
|
function is_config_mounted()
|
||||||
{
|
{
|
||||||
mount | grep -q " ${CONFIG_DIR} " && [ -f "$CONFIG_MARKER" ]
|
mount | grep -q " $CONFIG_DIR " && [ -f "$CONFIG_MARKER" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function is_crypto_mounted()
|
function is_crypto_mounted()
|
||||||
|
# Parameter: DEVICE
|
||||||
{
|
{
|
||||||
mount | grep -q " ${CRYPTO_DIR} "
|
local uuid=$(get_crypto_uuid $1)
|
||||||
|
test -e "$CRYPTMAPPER_DIR/$uuid"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,30 +285,29 @@ function check_at_command_queue()
|
||||||
function find_harddisk()
|
function find_harddisk()
|
||||||
# look for the harddisk to be partitioned
|
# look for the harddisk to be partitioned
|
||||||
{
|
{
|
||||||
local dev=$(
|
local device
|
||||||
if is_config_mounted
|
if is_config_mounted
|
||||||
then config_get_value "device"
|
then device=$(config_get_value "device")
|
||||||
else for a in $SCAN_DEVICES
|
else device=$(get_available_disks | head -1)
|
||||||
do grep -q " `basename $a`$" /proc/partitions && echo "$a" && break
|
fi
|
||||||
done
|
if [ -z "$device" ] ; then
|
||||||
fi )
|
|
||||||
if [ -z "$dev" ] ; then
|
|
||||||
log_msg "no valid harddisk for initialisation found!"
|
log_msg "no valid harddisk for initialisation found!"
|
||||||
cat /proc/partitions >>"$LOG_FILE"
|
cat /proc/partitions >>"$LOG_FILE"
|
||||||
# do not return with an error, to avoid a failing of the script ('break on error')
|
# do not return with an error, to avoid a failing of the script ('break on error')
|
||||||
# the caller of this function should handle an empty return string
|
# the caller of this function should handle an empty return string
|
||||||
fi
|
fi
|
||||||
echo -n "$dev"
|
echo -n "$device"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_available_disks()
|
function get_available_disks()
|
||||||
# looks which allowed disks are at the moment connected with the cbox
|
# looks which allowed disks are at the moment connected with the cbox
|
||||||
{
|
{
|
||||||
local dev=$(
|
for scan in $SCAN_DEVICES
|
||||||
for a in $SCAN_DEVICES
|
do for avail in $ALL_PARTITIONS
|
||||||
do grep -q " `basename $a`$" /proc/partitions && echo "$a"
|
do [ "$scan" = "$avail" ] && echo "$a"
|
||||||
done )
|
done
|
||||||
echo -n "$dev"
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -268,27 +333,35 @@ function mount_config()
|
||||||
|
|
||||||
|
|
||||||
function mount_crypto()
|
function mount_crypto()
|
||||||
|
# Parameter: DEVICE
|
||||||
{
|
{
|
||||||
is_crypto_mounted && echo "The cryptofilesystem is already active!" && return
|
local device=$1
|
||||||
local device=`find_harddisk`
|
|
||||||
[ -z "$device" ] && error_msg 4 'No valid harddisk found!' && return 1
|
[ -z "$device" ] && error_msg 4 'No valid harddisk found!' && return 1
|
||||||
|
is_crypto_mounted "$device" && echo "The crypto filesystem is already active!" && return
|
||||||
|
local uuid=$(get_crypto_uuid $device)
|
||||||
|
local name=$(get_crypto_name $device)
|
||||||
# passphrase is read from stdin
|
# passphrase is read from stdin
|
||||||
log_msg "Mounting crypto partition with -h $(config_get_value hash) -c $(config_get_value cipher) on ${device}2"
|
log_msg "Mounting crypto partition $name ($device)"
|
||||||
$CRYPTSETUP -h "$(config_get_value hash)" -c "$(config_get_value cipher)" create "`basename $CRYPTMAPPER_DEV`" "${device}2"
|
$CRYPTSETUP luksOpen "$device" "$uuid"
|
||||||
if mount "$CRYPTMAPPER_DEV" "$CRYPTO_DIR"
|
[ -e "$MNT_PARENT/$name" ] || mkdir -p "$MNT_PARENT/$name"
|
||||||
then log_msg "Mount succeded - now starting samba ..."
|
if mount "$CRYPTMAPPER_DIR/$uuid" "$MNT_PARENT/$name"
|
||||||
|
then log_msg "Mount succeeded - now starting samba ..."
|
||||||
/etc/init.d/samba start
|
/etc/init.d/samba start
|
||||||
else log_msg "Mount failed - removing dev-mapper ..."
|
return 0
|
||||||
dmsetup remove $(basename $CRYPTMAPPER_DEV)
|
else log_msg "Mount failed - removing the crypto device $uuid ..."
|
||||||
|
$CRYPTSETUP luksClose "$uuid"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function umount_crypto()
|
function umount_crypto()
|
||||||
|
# Parameter: DEVICE
|
||||||
{
|
{
|
||||||
|
local device=$1
|
||||||
# do not break on error
|
# do not break on error
|
||||||
set +e
|
set +e
|
||||||
|
# TODO: do not stop samba - or do it just temporarily
|
||||||
if ps -e | grep -q " [sn]mbd$"
|
if ps -e | grep -q " [sn]mbd$"
|
||||||
then log_msg "Stopping samba ..."
|
then log_msg "Stopping samba ..."
|
||||||
/etc/init.d/samba stop
|
/etc/init.d/samba stop
|
||||||
|
@ -297,13 +370,16 @@ function umount_crypto()
|
||||||
ps -e | grep -q " smbd$" && killall -9 smbd
|
ps -e | grep -q " smbd$" && killall -9 smbd
|
||||||
ps -e | grep -q " nmbd$" && killall -9 nmbd
|
ps -e | grep -q " nmbd$" && killall -9 nmbd
|
||||||
fi
|
fi
|
||||||
if mount | grep -q " $CRYPTO_DIR "
|
local uuid=$(get_crypto_uuid $device)
|
||||||
|
local name=$(get_crypto_name $device)
|
||||||
|
if mount | grep -q " $MNT_PARENT/$name "
|
||||||
then log_msg "Unmounting crypto partition ..."
|
then log_msg "Unmounting crypto partition ..."
|
||||||
umount "$CRYPTO_DIR"
|
umount "$MNT_PARENT/$name"
|
||||||
|
rmdir "$MNT_PARENT/$name"
|
||||||
fi
|
fi
|
||||||
if [ -e "$CRYPTMAPPER_DEV" ]
|
if [ -e "$CRYPTMAPPER_DIR/$uuid" ]
|
||||||
then log_msg "Removing dev-mapper ..."
|
then log_msg "Removing dev-mapper ..."
|
||||||
$CRYPTSETUP remove $(basename $CRYPTMAPPER_DEV)
|
$CRYPTSETUP luksClose "$uuid"
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
@ -312,51 +388,36 @@ function umount_crypto()
|
||||||
function box_purge()
|
function box_purge()
|
||||||
# removing just the first bytes from the harddisk should be enough
|
# removing just the first bytes from the harddisk should be enough
|
||||||
{
|
{
|
||||||
local device=$(find_harddisk)
|
local device
|
||||||
log_msg "Purging $device ..."
|
get_available_disks | while read a
|
||||||
dd if=/dev/zero of=$device bs=1M count=1
|
do log_msg "Purging $device ..."
|
||||||
log_msg " "
|
dd if=/dev/zero of=$device bs=1M count=1
|
||||||
|
log_msg " "
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function init_cryptobox_part1()
|
function init_cryptobox()
|
||||||
# this is only the first part of initialisation that takes no time - good for a smooth web interface
|
# this is only the first part of initialisation that takes no time - good for a smooth web interface
|
||||||
{
|
{
|
||||||
local device=$(find_harddisk)
|
local device=$(find_harddisk)
|
||||||
[ -z "$device" ] && log_msg 'No valid harddisk found!' && return 1
|
[ -z "$device" ] && log_msg 'No valid harddisk found!' && return 1
|
||||||
(
|
turn_off_all_crypto
|
||||||
log_msg "Initializing crypto partition on $device ..."
|
mount | grep -q " $CONFIG_DIR " && umount "$CONFIG_DIR" || true
|
||||||
umount_crypto || true
|
log_msg "Initializing config partition on $device ..."
|
||||||
mount | grep -q " $CONFIG_DIR " && umount "$CONFIG_DIR" || true
|
create_partitions "$device"
|
||||||
initial_checks "$device" || { log_msg "initial checks failed" && return 1 ;}
|
create_config "${device}1"
|
||||||
create_partitions "$device"
|
|
||||||
create_config "$device"
|
|
||||||
) >>"$LOG_FILE" 2>&1
|
|
||||||
# the output of create_crypto may NOT be redirected - this would prevent cryptsetup from
|
|
||||||
# reading the passphrase from stdin
|
|
||||||
log_msg "Creating the crypto partition ..."
|
|
||||||
create_crypto "$device"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function init_cryptobox_part2()
|
function turn_off_all_crypto()
|
||||||
# some things to be done in the background
|
|
||||||
# these are the final steps of initialisation
|
|
||||||
# the uid must be changed initially, therfore it needs to be mounted
|
|
||||||
{
|
{
|
||||||
mkfs_crypto
|
list_crypto_containers | while read a
|
||||||
mount "$CRYPTMAPPER_DEV" "$CRYPTO_DIR"
|
do is_crypto_mounted "$a" && umount_crypto "$a"
|
||||||
chown $SAMBA_USER "$CRYPTO_DIR"
|
done
|
||||||
umount_crypto
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function init_cryptobox_complete()
|
|
||||||
{
|
|
||||||
init_cryptobox_part1
|
|
||||||
init_cryptobox_part2
|
|
||||||
}
|
|
||||||
|
|
||||||
### main ###
|
### main ###
|
||||||
|
|
||||||
# set PATH because thttpd removes /sbin and /usr/sbin for cgis
|
# set PATH because thttpd removes /sbin and /usr/sbin for cgis
|
||||||
|
@ -364,7 +425,7 @@ export PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
|
|
||||||
ACTION=help
|
ACTION=help
|
||||||
[ $# -gt 0 ] && ACTION="$1"
|
[ $# -gt 0 ] && ACTION="$1" && shift
|
||||||
|
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
config-up )
|
config-up )
|
||||||
|
@ -374,13 +435,13 @@ case "$ACTION" in
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
config-down )
|
config-down )
|
||||||
umount "$CONFIG_DIR" || error_msg 4 "Could not unmount configuration partition"
|
mount | grep -q " $CONFIG_DIR$ " && umount "$CONFIG_DIR" || error_msg 4 "Could not unmount configuration partition"
|
||||||
;;
|
;;
|
||||||
network-up )
|
network-up )
|
||||||
kudzu -s -q --class network
|
kudzu -s -q --class network
|
||||||
conf_ip=$(config_get_value "ip")
|
conf_ip=$(config_get_value "ip")
|
||||||
ifconfig $NET_IFACE "$conf_ip"
|
|
||||||
log_msg "Configured $NET_IFACE for $conf_ip ..."
|
log_msg "Configured $NET_IFACE for $conf_ip ..."
|
||||||
|
ifconfig $NET_IFACE "$conf_ip"
|
||||||
echo "Configured network interface for $NET_IFACE: $conf_ip"
|
echo "Configured network interface for $NET_IFACE: $conf_ip"
|
||||||
log_msg "Starting the firewall ..."
|
log_msg "Starting the firewall ..."
|
||||||
"$FIREWALL_SCRIPT" start
|
"$FIREWALL_SCRIPT" start
|
||||||
|
@ -403,46 +464,57 @@ case "$ACTION" in
|
||||||
log_msg "Stopping stunnel ..."
|
log_msg "Stopping stunnel ..."
|
||||||
killall stunnel
|
killall stunnel
|
||||||
log_msg "Shutting the network interface down ..."
|
log_msg "Shutting the network interface down ..."
|
||||||
ifconfig $NET_IFACE down
|
ifconfig "$NET_IFACE" down
|
||||||
;;
|
;;
|
||||||
services-up )
|
services-up )
|
||||||
|
# the mount point has to be writeable
|
||||||
|
mount -t tmpfs tmpfs "$MNT_PARENT"
|
||||||
# is something special necessary?
|
# is something special necessary?
|
||||||
;;
|
;;
|
||||||
services-down )
|
services-down )
|
||||||
/etc/init.d/samba stop
|
umount "$MNT_PARENT"
|
||||||
/etc/init.d/thttpd stop
|
/etc/init.d/samba stop || true
|
||||||
|
/etc/init.d/thttpd stop || true
|
||||||
|
true
|
||||||
;;
|
;;
|
||||||
crypto-up )
|
crypto-up )
|
||||||
mount_crypto
|
[ $# -ne 1 ] && error_msg "invalid number of parameters for 'crypto-up'"
|
||||||
|
mount_crypto "$1"
|
||||||
;;
|
;;
|
||||||
crypto-down )
|
crypto-down )
|
||||||
umount_crypto
|
[ $# -ne 1 ] && error_msg "invalid number of parameters for 'crypto-up'"
|
||||||
|
umount_crypto "$1"
|
||||||
;;
|
;;
|
||||||
box-init )
|
init )
|
||||||
# do complete initialization
|
init_cryptobox </dev/null >>"$LOG_FILE" 2>&1
|
||||||
"$0" box-init-fg
|
|
||||||
# the background part will recall itself as an at-command
|
|
||||||
"$0" box-init-bg
|
|
||||||
;;
|
;;
|
||||||
box-init-fg )
|
crypto-create )
|
||||||
# only partitioning and configuration
|
# Parameter: DEVICE NAME
|
||||||
# this is nice for the web interface, as it is fast
|
[ $# -ne 2 ] && error_msg "invalid number of parameters for 'crypto-create'"
|
||||||
# output redirection does not work, as it prevents cryptsetup from asking
|
|
||||||
# for a password
|
|
||||||
init_cryptobox_part1
|
|
||||||
;;
|
|
||||||
box-init-bg )
|
|
||||||
# do it in the background to provide a smoother web interface
|
# do it in the background to provide a smoother web interface
|
||||||
# messages and errors get written to $LOG_FILE
|
# messages and errors get written to $LOG_FILE
|
||||||
|
keyfile=/tmp/$(basename $0)-passphrase-$(basename $1)
|
||||||
# make sure, that this is always called via 'at':
|
# read the password
|
||||||
if check_at_command_queue " box-init-bg"
|
cat - >"$keyfile"
|
||||||
then init_cryptobox_part2 </dev/null >>"$LOG_FILE" 2>&1
|
# execute it in the background
|
||||||
else echo -n "'$0' box-init-bg" | at now
|
echo "'$0' crypto-create-bg '$1' '$2' '$keyfile' </dev/null >>'$LOG_FILE' 2>&1" | at now
|
||||||
fi
|
;;
|
||||||
|
crypto-create-bg )
|
||||||
|
create_crypto "$@"
|
||||||
|
;;
|
||||||
|
crypto-list )
|
||||||
|
list_crypto_containers
|
||||||
|
;;
|
||||||
|
crypto-list-unused )
|
||||||
|
list_unused_partitions
|
||||||
|
;;
|
||||||
|
crypto-name )
|
||||||
|
# Parameter: DEVICE
|
||||||
|
get_crypto_name "$1"
|
||||||
;;
|
;;
|
||||||
is_crypto_mounted )
|
is_crypto_mounted )
|
||||||
is_crypto_mounted
|
[ $# -ne 1 ] && error_msg 10 "invalid number of parameters for 'is_crypto_mounted'"
|
||||||
|
is_crypto_mounted "$1"
|
||||||
;;
|
;;
|
||||||
is_config_mounted )
|
is_config_mounted )
|
||||||
is_config_mounted
|
is_config_mounted
|
||||||
|
@ -460,36 +532,38 @@ case "$ACTION" in
|
||||||
echo -n "sleep 5; ifconfig $NET_IFACE `config_get_value ip`" | at now
|
echo -n "sleep 5; ifconfig $NET_IFACE `config_get_value ip`" | at now
|
||||||
;;
|
;;
|
||||||
get_available_disks )
|
get_available_disks )
|
||||||
get_available_disks
|
get_available_disks
|
||||||
;;
|
;;
|
||||||
get_current_ip )
|
get_current_ip )
|
||||||
get_current_ip
|
get_current_ip
|
||||||
;;
|
;;
|
||||||
set_config )
|
set_config )
|
||||||
[ $# -ne 3 ] && error_msg 7 "'set_config' requires two parameters"
|
[ $# -ne 2 ] && error_msg 7 "'set_config' requires two parameters"
|
||||||
config_set_value "$2" "$3"
|
config_set_value "$1" "$2"
|
||||||
;;
|
;;
|
||||||
get_config )
|
get_config )
|
||||||
[ $# -ne 2 ] && error_msg 6 "'get_config' requires exactly one parameter"
|
[ $# -ne 1 ] && error_msg 6 "'get_config' requires exactly one parameter"
|
||||||
config_get_value "$2"
|
config_get_value "$1"
|
||||||
;;
|
;;
|
||||||
diskinfo )
|
diskinfo )
|
||||||
$SFDISK -L -q -l `find_harddisk`
|
get_available_disks | while read a
|
||||||
|
do $SFDISK -L -q -l "$a"
|
||||||
|
done
|
||||||
;;
|
;;
|
||||||
box-purge )
|
box-purge )
|
||||||
log_msg "Cleaning the CryptoBox ..."
|
log_msg "Cleaning the CryptoBox ..."
|
||||||
$0 crypto-down
|
turn_off_all_crypto
|
||||||
$0 config-down
|
"$0" config-down
|
||||||
box_purge
|
box_purge
|
||||||
;;
|
;;
|
||||||
poweroff )
|
poweroff )
|
||||||
is_crypto_mounted && umount_crypto
|
|
||||||
log_msg "Turning off the CryptoBox ..."
|
log_msg "Turning off the CryptoBox ..."
|
||||||
|
turn_off_all_crypto
|
||||||
echo "poweroff" | at now
|
echo "poweroff" | at now
|
||||||
;;
|
;;
|
||||||
reboot )
|
reboot )
|
||||||
is_crypto_mounted && umount_crypto
|
|
||||||
log_msg "Rebooting the CryptoBox ..."
|
log_msg "Rebooting the CryptoBox ..."
|
||||||
|
turn_off_all_crypto
|
||||||
echo "reboot" | at now
|
echo "reboot" | at now
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# a simple script to check, if there was no smb traffic for the specified
|
# a simple script to check, if there was no smb traffic for the specified
|
||||||
|
@ -49,6 +55,9 @@ function check_for_traffic()
|
||||||
|
|
||||||
################### main ######################
|
################### main ######################
|
||||||
|
|
||||||
|
# TODO: migrate to multi-container-setup
|
||||||
|
exit 0
|
||||||
|
|
||||||
# break, if crypto partition is not mounted
|
# break, if crypto partition is not mounted
|
||||||
"$CB_SCRIPT" is_crypto_mounted || exit 0
|
"$CB_SCRIPT" is_crypto_mounted || exit 0
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# FOR DEVELOPMENT ONLY!
|
# FOR DEVELOPMENT ONLY!
|
||||||
|
@ -11,6 +17,7 @@
|
||||||
# parameter: [commandline]
|
# parameter: [commandline]
|
||||||
#
|
#
|
||||||
# if "commandline" is empty, "bash" will be used
|
# if "commandline" is empty, "bash" will be used
|
||||||
|
#
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# this script is part of the building process of the cryptobox
|
# this script is part of the building process of the cryptobox
|
||||||
|
@ -17,8 +23,13 @@ set -eu
|
||||||
RUNTIMEDIR=/opt/dfsruntime/runtimerd
|
RUNTIMEDIR=/opt/dfsruntime/runtimerd
|
||||||
TUNDEV=$RUNTIMEDIR/dev/net/tun
|
TUNDEV=$RUNTIMEDIR/dev/net/tun
|
||||||
|
|
||||||
SECURITY_REMOVE_PACKAGES="ssh strace unzip tar zip wget nvi nano gzip curl bzip2 aptitude tasksel elinks vim vim-common"
|
REMOVE_PACKAGES="strace
|
||||||
DEVEL_REMOVE_PACKAGES="exim4-daemon-light exim4-config exim4-base netkit-inetd telnet ppp pppconfig pppoe pppoeconf"
|
nvi nano vim vim-common
|
||||||
|
unzip tar zip gzip bzip2
|
||||||
|
aptitude tasksel
|
||||||
|
ssh elinks curl wget netkit-inetd telnet
|
||||||
|
exim4-daemon-light exim4-config exim4-base
|
||||||
|
ppp pppconfig pppoe pppoeconf"
|
||||||
|
|
||||||
# remove rc symlinks for these services
|
# remove rc symlinks for these services
|
||||||
SERVICES_OFF="ssh samba setserial nviboot mountnfs ntpdate"
|
SERVICES_OFF="ssh samba setserial nviboot mountnfs ntpdate"
|
||||||
|
@ -26,8 +37,13 @@ SERVICES_OFF="ssh samba setserial nviboot mountnfs ntpdate"
|
||||||
function configure_normal()
|
function configure_normal()
|
||||||
# the usual stuff - not optimized for security
|
# the usual stuff - not optimized for security
|
||||||
{
|
{
|
||||||
|
########### boot up ###########
|
||||||
# set default runlevel to 3
|
# set default runlevel to 3
|
||||||
sed -i 's/^id:2:initdefault/id:3:initdefault/' /etc/inittab
|
sed -i 's/^id:2:initdefault/id:3:initdefault/' /etc/inittab
|
||||||
|
# turn off creation of "/etc/nologin" (read-only fs)
|
||||||
|
sed -i '/^DELAYLOGIN=/s/^DELAYLOGIN=.*$/DELAYLOGIN=no/' /etc/default/rcS
|
||||||
|
# turn off modifying /etc/motd (read-only fs)
|
||||||
|
sed -i '/^EDITMOTD=/s/^EDITMOTD=.*$/EDITMOTD=no/' /etc/default/rcS
|
||||||
|
|
||||||
######### devices ##########
|
######### devices ##########
|
||||||
# create tun device for running under qemu
|
# create tun device for running under qemu
|
||||||
|
@ -60,10 +76,6 @@ function configure_normal()
|
||||||
sed -i 's/^PasswordAuthentication.*$/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
sed -i 's/^PasswordAuthentication.*$/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove unnecessary packages - return true, if no packages were
|
|
||||||
# removed
|
|
||||||
dpkg --force-all -P $DEVEL_REMOVE_PACKAGES 2>&1 | grep -v "which isn't installed." || true
|
|
||||||
|
|
||||||
# remove symlinks for unwanted services
|
# remove symlinks for unwanted services
|
||||||
for a in $SERVICES_OFF; do
|
for a in $SERVICES_OFF; do
|
||||||
# echo "Turning off service $a ..."
|
# echo "Turning off service $a ..."
|
||||||
|
@ -72,9 +84,6 @@ function configure_normal()
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
# remove deb-files, that were left by dfsbuild
|
|
||||||
test -d /opt/packages && rm -r /opt/packages
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +96,7 @@ function configure_secure()
|
||||||
sed -i '/getty/d' /etc/inittab
|
sed -i '/getty/d' /etc/inittab
|
||||||
|
|
||||||
# remove unnecessary packages
|
# remove unnecessary packages
|
||||||
dpkg --force-all -P $SECURITY_REMOVE_PACKAGES 2>&1 | grep -v "which isn't installed." || true
|
dpkg --force-all -P $REMOVE_PACKAGES 2>&1 | grep -v "which isn't installed." || true
|
||||||
|
|
||||||
# remove the development features script
|
# remove the development features script
|
||||||
[ -e "$DEV_FEATURES_SCRIPT" ] && rm -f "$DEV_FEATURES_SCRIPT"
|
[ -e "$DEV_FEATURES_SCRIPT" ] && rm -f "$DEV_FEATURES_SCRIPT"
|
||||||
|
@ -96,6 +105,12 @@ function configure_secure()
|
||||||
# as the openssh package was removed anyway
|
# as the openssh package was removed anyway
|
||||||
[ -d /root/.ssh ] && rm -rf /root/.ssh
|
[ -d /root/.ssh ] && rm -rf /root/.ssh
|
||||||
|
|
||||||
|
############## clean up ################
|
||||||
|
# remove deb-files, that were left by dfsbuild
|
||||||
|
test -d /opt/packages && rm -r /opt/packages
|
||||||
|
# remove packages and package lists
|
||||||
|
rm -fr /var/cache/apt/
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# this script is part of the boot process of a developer's cryptobox
|
# this script is part of the boot process of a developer's cryptobox
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# set up the firewall of the cryptobox
|
# set up the firewall of the cryptobox
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# this script creates the stunnel certificate for https
|
# this script creates the stunnel certificate for https
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
aes-cbc-essiv:sha256
|
|
|
@ -1 +0,0 @@
|
||||||
ripemd160
|
|
0
luks/cbox-tree.d/usr/share/cryptobox/defaults/names.db
Normal file
0
luks/cbox-tree.d/usr/share/cryptobox/defaults/names.db
Normal file
340
luks/cbox-tree.d/usr/share/doc/cryptobox/LICENSE
Normal file
340
luks/cbox-tree.d/usr/share/doc/cryptobox/LICENSE
Normal file
|
@ -0,0 +1,340 @@
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
|
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Library General Public License instead.) You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if you
|
||||||
|
distribute copies of the software, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
|
you have. You must make sure that they, too, receive or can get the
|
||||||
|
source code. And you must show them these terms so they know their
|
||||||
|
rights.
|
||||||
|
|
||||||
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
|
distribute and/or modify the software.
|
||||||
|
|
||||||
|
Also, for each author's protection and ours, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
software. If the software is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original, so
|
||||||
|
that any problems introduced by others will not reflect on the original
|
||||||
|
authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that redistributors of a free
|
||||||
|
program will individually obtain patent licenses, in effect making the
|
||||||
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License applies to any program or other work which contains
|
||||||
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
|
under the terms of this General Public License. The "Program", below,
|
||||||
|
refers to any such program or work, and a "work based on the Program"
|
||||||
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
|
source code as you receive it, in any medium, provided that you
|
||||||
|
conspicuously and appropriately publish on each copy an appropriate
|
||||||
|
copyright notice and disclaimer of warranty; keep intact all the
|
||||||
|
notices that refer to this License and to the absence of any warranty;
|
||||||
|
and give any other recipients of the Program a copy of this License
|
||||||
|
along with the Program.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy, and
|
||||||
|
you may at your option offer warranty protection in exchange for a fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Program or any portion
|
||||||
|
of it, thus forming a work based on the Program, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) You must cause the modified files to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
b) You must cause any work that you distribute or publish, that in
|
||||||
|
whole or in part contains or is derived from the Program or any
|
||||||
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
|
parties under the terms of this License.
|
||||||
|
|
||||||
|
c) If the modified program normally reads commands interactively
|
||||||
|
when run, you must cause it, when started running for such
|
||||||
|
interactive use in the most ordinary way, to print or display an
|
||||||
|
announcement including an appropriate copyright notice and a
|
||||||
|
notice that there is no warranty (or else, saying that you provide
|
||||||
|
a warranty) and that users may redistribute the program under
|
||||||
|
these conditions, and telling the user how to view a copy of this
|
||||||
|
License. (Exception: if the Program itself is interactive but
|
||||||
|
does not normally print such an announcement, your work based on
|
||||||
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Program,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Program, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Program.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Program
|
||||||
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
|
under Section 2) in object code or executable form under the terms of
|
||||||
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
|
a) Accompany it with the complete corresponding machine-readable
|
||||||
|
source code, which must be distributed under the terms of Sections
|
||||||
|
1 and 2 above on a medium customarily used for software interchange; or,
|
||||||
|
|
||||||
|
b) Accompany it with a written offer, valid for at least three
|
||||||
|
years, to give any third party, for a charge no more than your
|
||||||
|
cost of physically performing source distribution, a complete
|
||||||
|
machine-readable copy of the corresponding source code, to be
|
||||||
|
distributed under the terms of Sections 1 and 2 above on a medium
|
||||||
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
|
c) Accompany it with the information you received as to the offer
|
||||||
|
to distribute corresponding source code. (This alternative is
|
||||||
|
allowed only for noncommercial distribution and only if you
|
||||||
|
received the program in object code or executable form with such
|
||||||
|
an offer, in accord with Subsection b above.)
|
||||||
|
|
||||||
|
The source code for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For an executable work, complete source
|
||||||
|
code means all the source code for all modules it contains, plus any
|
||||||
|
associated interface definition files, plus the scripts used to
|
||||||
|
control compilation and installation of the executable. However, as a
|
||||||
|
special exception, the source code distributed need not include
|
||||||
|
anything that is normally distributed (in either source or binary
|
||||||
|
form) with the major components (compiler, kernel, and so on) of the
|
||||||
|
operating system on which the executable runs, unless that component
|
||||||
|
itself accompanies the executable.
|
||||||
|
|
||||||
|
If distribution of executable or object code is made by offering
|
||||||
|
access to copy from a designated place, then offering equivalent
|
||||||
|
access to copy the source code from the same place counts as
|
||||||
|
distribution of the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
|
except as expressly provided under this License. Any attempt
|
||||||
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
|
void, and will automatically terminate your rights under this License.
|
||||||
|
However, parties who have received copies, or rights, from you under
|
||||||
|
this License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
5. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Program or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Program (or any work based on the
|
||||||
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Program or works based on it.
|
||||||
|
|
||||||
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
|
Program), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute or modify the Program subject to
|
||||||
|
these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
7. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Program at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Program by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Program.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under
|
||||||
|
any particular circumstance, the balance of the section is intended to
|
||||||
|
apply and the section as a whole is intended to apply in other
|
||||||
|
circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system, which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Program under this License
|
||||||
|
may add an explicit geographical distribution limitation excluding
|
||||||
|
those countries, so that distribution is permitted only in or among
|
||||||
|
countries not thus excluded. In such case, this License incorporates
|
||||||
|
the limitation as if written in the body of this License.
|
||||||
|
|
||||||
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies a version number of this License which applies to it and "any
|
||||||
|
later version", you have the option of following the terms and conditions
|
||||||
|
either of that version or of any later version published by the Free
|
||||||
|
Software Foundation. If the Program does not specify a version number of
|
||||||
|
this License, you may choose any version ever published by the Free Software
|
||||||
|
Foundation.
|
||||||
|
|
||||||
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
|
programs whose distribution conditions are different, write to the author
|
||||||
|
to ask for permission. For software which is copyrighted by the Free
|
||||||
|
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||||
|
make exceptions for this. Our decision will be guided by the two goals
|
||||||
|
of preserving the free status of all derivatives of our free software and
|
||||||
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||||
|
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||||
|
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||||
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||||
|
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||||
|
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||||
|
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||||
|
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program is interactive, make it output a short notice like this
|
||||||
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, the commands you use may
|
||||||
|
be called something other than `show w' and `show c'; they could even be
|
||||||
|
mouse-clicks or menu items--whatever suits your program.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
|
<signature of Ty Coon>, 1 April 1989
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
This General Public License does not permit incorporating your program into
|
||||||
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
|
consider it more useful to permit linking proprietary applications with the
|
||||||
|
library. If this is what you want to do, use the GNU Library General
|
||||||
|
Public License instead of this License.
|
|
@ -1,3 +1,8 @@
|
||||||
|
Version 0.3 - 11/??/02005
|
||||||
|
* uses cryptsetup-luks instead of cryptsetup
|
||||||
|
* bugfix: add /dev/hdd to device scan
|
||||||
|
* support for usb, scsi and firewire cdrom drive
|
||||||
|
|
||||||
Version 0.2.1 - 10/22/02005
|
Version 0.2.1 - 10/22/02005
|
||||||
* fixed a critical bug in the initialisation process
|
* fixed a critical bug in the initialisation process
|
||||||
* default cipher changed to "aes-cbc-essiv:sha256" (more secure)
|
* default cipher changed to "aes-cbc-essiv:sha256" (more secure)
|
18
luks/cbox-tree.d/usr/share/doc/cryptobox/copyright
Normal file
18
luks/cbox-tree.d/usr/share/doc/cryptobox/copyright
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, version 2.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License with
|
||||||
|
your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or with the
|
||||||
|
Debian GNU/Linux hello source package as the file COPYING. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
$Id$
|
|
@ -1,7 +1,13 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# web interface of the CryptoBox
|
# the web interface of the CryptoBox
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +23,7 @@ my $CONFIG_FILE = '/etc/cryptobox/cryptobox.conf';
|
||||||
my ($pagedata, $pagename);
|
my ($pagedata, $pagename);
|
||||||
|
|
||||||
my ($LANGUAGE_DIR, $DEFAULT_LANGUAGE, $HTML_TEMPLATE_DIR, $DOC_DIR);
|
my ($LANGUAGE_DIR, $DEFAULT_LANGUAGE, $HTML_TEMPLATE_DIR, $DOC_DIR);
|
||||||
my ($CB_SCRIPT, $LOG_FILE, $IS_DEV);
|
my ($CB_SCRIPT, $LOG_FILE, $IS_DEVEL);
|
||||||
|
|
||||||
&fatal_error ("could not find configuration file ($CONFIG_FILE)") unless (-e $CONFIG_FILE);
|
&fatal_error ("could not find configuration file ($CONFIG_FILE)") unless (-e $CONFIG_FILE);
|
||||||
my $config = ConfigFile::read_config_file($CONFIG_FILE);
|
my $config = ConfigFile::read_config_file($CONFIG_FILE);
|
||||||
|
@ -28,7 +34,10 @@ $LANGUAGE_DIR = $config->{LANGUAGE_DIR};
|
||||||
$DEFAULT_LANGUAGE = $config->{LANGUAGE};
|
$DEFAULT_LANGUAGE = $config->{LANGUAGE};
|
||||||
$HTML_TEMPLATE_DIR = $config->{HTML_TEMPLATE_DIR};
|
$HTML_TEMPLATE_DIR = $config->{HTML_TEMPLATE_DIR};
|
||||||
$DOC_DIR = $config->{DOC_DIR};
|
$DOC_DIR = $config->{DOC_DIR};
|
||||||
$IS_DEV = ( -e $config->{DEV_FEATURES_SCRIPT});
|
$IS_DEVEL = ( -e $config->{DEV_FEATURES_SCRIPT});
|
||||||
|
|
||||||
|
# TODO: just a quick-and-dirty hack during migration to multiple containers
|
||||||
|
my $CRYPTO_DEV = "`$CB_SCRIPT get_config device`2";
|
||||||
|
|
||||||
my $query = new CGI;
|
my $query = new CGI;
|
||||||
|
|
||||||
|
@ -192,13 +201,13 @@ sub check_ssl
|
||||||
|
|
||||||
sub check_mounted
|
sub check_mounted
|
||||||
{
|
{
|
||||||
return (system("$CB_SCRIPT","is_crypto_mounted") == 0);
|
return (system("$CB_SCRIPT","is_crypto_mounted",$CRYPTO_DEV) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub check_config
|
sub check_config
|
||||||
{
|
{
|
||||||
return (system("$CB_SCRIPT","is_config_mounted") == 0);
|
return (system("$CB_SCRIPT","is_config_mounted",$CRYPTO_DEV) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -253,7 +262,7 @@ sub mount_vol
|
||||||
if (&check_mounted) {
|
if (&check_mounted) {
|
||||||
$pagedata->setValue('Data.Warning', 'IsMounted');
|
$pagedata->setValue('Data.Warning', 'IsMounted');
|
||||||
} else {
|
} else {
|
||||||
open(PW_INPUT, "| $CB_SCRIPT crypto-up");
|
open(PW_INPUT, "| $CB_SCRIPT crypto-up $CRYPTO_DEV");
|
||||||
print PW_INPUT $pw;
|
print PW_INPUT $pw;
|
||||||
close(PW_INPUT);
|
close(PW_INPUT);
|
||||||
}
|
}
|
||||||
|
@ -263,7 +272,7 @@ sub mount_vol
|
||||||
sub umount_vol
|
sub umount_vol
|
||||||
{
|
{
|
||||||
if (&check_mounted) {
|
if (&check_mounted) {
|
||||||
system("$CB_SCRIPT", "crypto-down");
|
system("$CB_SCRIPT", "crypto-down",$CRYPTO_DEV);
|
||||||
} else {
|
} else {
|
||||||
$pagedata->setValue('Data.Warning', 'NotMounted');
|
$pagedata->setValue('Data.Warning', 'NotMounted');
|
||||||
}
|
}
|
||||||
|
@ -274,16 +283,16 @@ sub box_init
|
||||||
{
|
{
|
||||||
my ($crypto_pw, $admin_pw) = @_;
|
my ($crypto_pw, $admin_pw) = @_;
|
||||||
|
|
||||||
|
system("$CB_SCRIPT", "init");
|
||||||
# partitioning, config and initial cryptsetup
|
# partitioning, config and initial cryptsetup
|
||||||
open(PW_INPUT, "|$CB_SCRIPT box-init-fg");
|
# TODO: define the name of the crypto container
|
||||||
|
# TODO: split init and create_crypto
|
||||||
|
open(PW_INPUT, "|$CB_SCRIPT crypto-create",$CRYPTO_DEV,"default");
|
||||||
print PW_INPUT $crypto_pw;
|
print PW_INPUT $crypto_pw;
|
||||||
close(PW_INPUT);
|
close(PW_INPUT);
|
||||||
|
|
||||||
# set administration password
|
# set administration password
|
||||||
system("$CB_SCRIPT", "set_config", "admin_pw", "$admin_pw");
|
system("$CB_SCRIPT", "set_config", "admin_pw", "$admin_pw");
|
||||||
|
|
||||||
# wipe and mkfs takes some time - it will be done in the background
|
|
||||||
system("$CB_SCRIPT", "box-init-bg");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub box_purge
|
sub box_purge
|
||||||
|
@ -678,7 +687,7 @@ if (-e "$LOG_FILE") {
|
||||||
}
|
}
|
||||||
$pagedata->setValue('Data.Log',"$output");
|
$pagedata->setValue('Data.Log',"$output");
|
||||||
|
|
||||||
$pagedata->setValue('Data.Status.DevelopmentMode', 1) if ($IS_DEV);
|
$pagedata->setValue('Data.Status.DevelopmentMode', 1) if ($IS_DEVEL);
|
||||||
|
|
||||||
# save QUERY_STRING (e.g. for weblang-links)
|
# save QUERY_STRING (e.g. for weblang-links)
|
||||||
my $querystring = $ENV{'QUERY_STRING'};
|
my $querystring = $ENV{'QUERY_STRING'};
|
||||||
|
|
|
@ -58,20 +58,13 @@ allpackages = util-linux
|
||||||
nano
|
nano
|
||||||
ssh
|
ssh
|
||||||
less
|
less
|
||||||
zip
|
|
||||||
unzip
|
|
||||||
tar
|
tar
|
||||||
bash
|
bash
|
||||||
coreutils
|
coreutils
|
||||||
module-init-tools
|
module-init-tools
|
||||||
iputils-tracepath
|
|
||||||
iputils-ping
|
iputils-ping
|
||||||
iptraf
|
|
||||||
iptables
|
iptables
|
||||||
ifupdown
|
ifupdown
|
||||||
# TODO: remove bzip2 dhcp-client iptraf iputils-tracepath zip unzip
|
|
||||||
dhcp-client
|
|
||||||
bzip2
|
|
||||||
busybox-static
|
busybox-static
|
||||||
usbutils
|
usbutils
|
||||||
pciutils
|
pciutils
|
||||||
|
@ -85,36 +78,16 @@ allpackages = util-linux
|
||||||
thttpd
|
thttpd
|
||||||
stunnel
|
stunnel
|
||||||
samba
|
samba
|
||||||
cryptsetup
|
|
||||||
hashalot
|
hashalot
|
||||||
kudzu
|
kudzu
|
||||||
elinks
|
elinks
|
||||||
ssh
|
ssh
|
||||||
strace
|
strace
|
||||||
python-clearsilver
|
python-clearsilver
|
||||||
# needed for validation
|
# necessary for cryptobox.pl
|
||||||
curl
|
|
||||||
# needed for cryptobox.pl
|
|
||||||
libconfigfile-perl
|
libconfigfile-perl
|
||||||
## unnoetig
|
# cryptsetup is replaced by cryptsetup-luks (installed from local file)
|
||||||
#gawk
|
#cryptsetup
|
||||||
#e2undel
|
|
||||||
#dfsbuild
|
|
||||||
#kernel-package
|
|
||||||
#libncurses5-dev
|
|
||||||
#tla
|
|
||||||
#build-essential
|
|
||||||
#g++
|
|
||||||
#smbclient
|
|
||||||
#debhelper
|
|
||||||
#bind9-host
|
|
||||||
#whois
|
|
||||||
#dnsutils
|
|
||||||
#cpio
|
|
||||||
#devscripts
|
|
||||||
#cdebootstrap
|
|
||||||
#diff
|
|
||||||
#patch
|
|
||||||
|
|
||||||
|
|
||||||
# select a mirror for the repository (apt-cacher, apt-proxy, no caching) by
|
# select a mirror for the repository (apt-cacher, apt-proxy, no caching) by
|
||||||
|
@ -128,7 +101,7 @@ mirror = http://127.0.0.1/apt-cacher/ftp.debian.org/debian
|
||||||
|
|
||||||
|
|
||||||
# Devices to probe for CD
|
# Devices to probe for CD
|
||||||
devices = scd0 scd1 scd2 scd3 scd4 hda hdb hdc hdd hde hdf hdg
|
devices = scd0 scd1 scd2 scd3 scd4 hda hdb hdc hdd hde hdf hdg sda sdb sdc sdd
|
||||||
|
|
||||||
# Files to place on the ramdisk
|
# Files to place on the ramdisk
|
||||||
ramdisk_files = /etc/resolv.conf
|
ramdisk_files = /etc/resolv.conf
|
||||||
|
@ -172,14 +145,17 @@ deletefiles = /etc/rcS.d/*discover
|
||||||
#modules = /lib/modules/2.4.27-2-386
|
#modules = /lib/modules/2.4.27-2-386
|
||||||
|
|
||||||
# Debs from local fs to unpack on live FS (will not be configured)
|
# Debs from local fs to unpack on live FS (will not be configured)
|
||||||
#unpackdebs = kernel/kernel-image-2.6.8_1.dfs_i386.deb
|
# cryptsetup-luks can not be install regurlarly, because of a weird dpkg error
|
||||||
unpackdebs = kernel/kernel-image-2.6.12.6_cryptobox0.3_i386.deb
|
# ("statusoverride ... Debian-exim" - this can probably be fixed, by adding the group
|
||||||
|
# Debian-exim to the host system)
|
||||||
|
unpackdebs = packages/kernel-image-2.6.12.6_cryptobox0.3_i386.deb
|
||||||
|
packages/cryptsetup-luks_1.0.1-3_i386.deb
|
||||||
|
|
||||||
# Other packages to install besides the list in DEFAULT
|
# Other packages to install besides the list in DEFAULT
|
||||||
packages = %(allpackages)s
|
packages = %(allpackages)s
|
||||||
|
|
||||||
# Debs from local fs to isntall on live fs
|
# Debs from local fs to isntall on live fs
|
||||||
# installdebs =
|
#installdebs =
|
||||||
|
|
||||||
# Bootloader (see options under default)
|
# Bootloader (see options under default)
|
||||||
bootloader = grub-no-emul
|
bootloader = grub-no-emul
|
||||||
|
@ -196,12 +172,6 @@ grubconfig = timeout 0
|
||||||
[repo stable]
|
[repo stable]
|
||||||
suite = stable
|
suite = stable
|
||||||
|
|
||||||
[repo testing]
|
|
||||||
suite = testing
|
|
||||||
|
|
||||||
[repo unstable]
|
|
||||||
suite = unstable
|
|
||||||
|
|
||||||
[repo amd64]
|
[repo amd64]
|
||||||
suite = unstable
|
suite = unstable
|
||||||
# Override default mirror
|
# Override default mirror
|
||||||
|
@ -214,7 +184,6 @@ arch = amd64
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
[appendfiles]
|
[appendfiles]
|
||||||
/etc/fstab = /dev/mapper/staub /mnt/crypto auto noauto,defaults 0 0
|
|
||||||
|
|
||||||
/etc/network/interfaces = auto lo
|
/etc/network/interfaces = auto lo
|
||||||
iface lo inet loopback
|
iface lo inet loopback
|
||||||
|
|
BIN
luks/packages/cryptsetup-luks_1.0.1-3_i386.deb
Normal file
BIN
luks/packages/cryptsetup-luks_1.0.1-3_i386.deb
Normal file
Binary file not shown.
|
@ -1,3 +1,6 @@
|
||||||
BEWARE: the uml kernel does not work correctly - see ../hints/starting_uml.txt for details
|
BEWARE: the uml kernel does not work correctly - see ../hints/starting_uml.txt for details
|
||||||
|
|
||||||
see hints/kernel-build.txt for details on how to build and include a new kernel
|
see hints/kernel-build.txt for details on how to build and include a new kernel
|
||||||
|
|
||||||
|
cryptsetup-luks is not yet officially available for debian
|
||||||
|
Source: http://einsteinmg.dyndns.org/debian/unstable/
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# managing our work at the cryptobox
|
# managing our work at the cryptobox
|
||||||
|
@ -53,6 +59,8 @@ function run_dfsbuild()
|
||||||
|
|
||||||
function create_uncompressed_iso()
|
function create_uncompressed_iso()
|
||||||
{
|
{
|
||||||
|
# check for a mounted procfs
|
||||||
|
mount | grep -q " $IMAGE_DIR/proc " && umount "$IMAGE_DIR/proc"
|
||||||
echo "Creating the iso ..."
|
echo "Creating the iso ..."
|
||||||
mkisofs $MKISOFS_OPTIONS -o "$IMAGE_FILE" "$IMAGE_DIR"
|
mkisofs $MKISOFS_OPTIONS -o "$IMAGE_FILE" "$IMAGE_DIR"
|
||||||
}
|
}
|
||||||
|
@ -60,6 +68,8 @@ function create_uncompressed_iso()
|
||||||
|
|
||||||
function create_compressed_iso()
|
function create_compressed_iso()
|
||||||
{
|
{
|
||||||
|
# check for a mounted procfs
|
||||||
|
mount | grep -q " $IMAGE_DIR/proc " && umount "$IMAGE_DIR/proc"
|
||||||
echo "Creating the compressed iso ..."
|
echo "Creating the compressed iso ..."
|
||||||
[ -e "$IMAGEZ_DIR" ] && rm -r "$IMAGEZ_DIR"
|
[ -e "$IMAGEZ_DIR" ] && rm -r "$IMAGEZ_DIR"
|
||||||
mkdir "$IMAGEZ_DIR"
|
mkdir "$IMAGEZ_DIR"
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# managing our work at the cryptobox
|
# managing our work at the cryptobox
|
||||||
|
@ -48,7 +54,7 @@ function qemu_boot()
|
||||||
# create a virtual harddisk image file
|
# create a virtual harddisk image file
|
||||||
if [ ! -e "$HD_IMAGE" ]
|
if [ ! -e "$HD_IMAGE" ]
|
||||||
then echo "Creating temporary harddisk image ..."
|
then echo "Creating temporary harddisk image ..."
|
||||||
dd if=/dev/zero of="$HD_IMAGE" bs=1M count=20
|
dd if=/dev/zero of="$HD_IMAGE" bs=1M count=7
|
||||||
fi
|
fi
|
||||||
echo "Starting qemu ..."
|
echo "Starting qemu ..."
|
||||||
qemu -cdrom "$1" -m 96 -hda "$IMAGE_FILE" -boot d -n "$QEMU_IFUP_FILE" || true
|
qemu -cdrom "$1" -m 96 -hda "$IMAGE_FILE" -boot d -n "$QEMU_IFUP_FILE" || true
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
|
|
||||||
grep "TODO" $(find "$(dirname $0)/.." -type f | grep -v "\.svn" | grep -v "$(basename $0)")
|
grep "TODO" $(find "$(dirname $0)/.." -type f | grep -v "\.svn" | grep -v "$(basename $0)")
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
# export wiki pages to the cryptobox development tree
|
# export wiki pages to the cryptobox development tree
|
||||||
# this creates static and integrated pages
|
# this creates static and integrated pages
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 02005 sense.lab <senselab@systemausfall.org>
|
||||||
|
#
|
||||||
|
# License: This script is distributed under the terms of version 2
|
||||||
|
# of the GNU GPL. See the LICENSE file included with the package.
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
# do a validation
|
# do a validation
|
||||||
#
|
#
|
||||||
# use "--help" for a list of possible actions
|
# use "--help" for a list of possible actions
|
||||||
|
|
Loading…
Reference in a new issue