exit 1
fi
+if test -f src/plugins/fd/kubernetes-backend/Makefile.in; then
+ PFILES="${PFILES} src/plugins/fd/kubernetes-backend/Makefile"
+fi
+
+if test -f src/plugins/fd/kubernetes-backend/baculak8s/plugins/k8sbackend/baculabackupimage.py.in; then
+ PFILES="${PFILES} src/plugins/fd/kubernetes-backend/baculak8s/plugins/k8sbackend/baculabackupimage.py"
+fi
+
AC_CONFIG_FILES([
autoconf/Make.common \
Makefile \
scripts/mtx-changer \
scripts/disk-changer \
scripts/key-manager.py \
+ scripts/install-key-manager.sh \
scripts/logwatch/Makefile \
scripts/logwatch/logfile.bacula.conf \
scripts/bat.desktop \
cd scripts
chmod 755 bacula btraceback mtx-changer
-chmod 755 bconsole disk-changer devel_bacula logrotate key-manager.py
+chmod 755 bconsole disk-changer devel_bacula logrotate
+chmod 755 key-manager.py install-key-manager.sh
cd ..
c=updatedb
$(MV) -f ${DESTDIR}${scriptdir}/key-manager.py ${DESTDIR}${scriptdir}/key-manager.py.old; \
fi
$(INSTALL_SCRIPT) key-manager.py $(DESTDIR)$(scriptdir)/key-manager.py
-
-
+ $(INSTALL_SCRIPT) install-key-manager.sh $(DESTDIR)$(scriptdir)/install-key-manager.sh
uninstall:
(cd $(DESTDIR)$(sbindir); $(RMF) btraceback)
(cd $(DESTDIR)$(sbindir); $(RMF) generic_cloud_driver)
(cd $(DESTDIR)$(sbindir); $(RMF) aws_cloud_driver)
+ (cd $(DESTDIR)$(scriptdir); $(RMF) key-manager.py)
+ (cd $(DESTDIR)$(scriptdir); $(RMF) install-key-manager.sh)
aws_cloud_driver.C: aws_cloud_driver
chmod 755 bacula btraceback
chmod 755 bacula-ctl-dir bacula-ctl-fd bacula-ctl-sd bacula_config
chmod 755 disk-changer mtx-changer bconsole tapealert
+ chmod 755 key-manager.py install-key-manager.sh
Makefiles:
$(SHELL) config.status
--- /dev/null
+#!/bin/sh
+#
+# Copyright (C) 2023 Bacula Systems SA
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# This script setup a "master-key" for the volume encryption on the SD
+#
+
+# tell where GNUPG will work (usually in /opt/bacula/etc/gnupg)
+GNUPGHOME="@sysconfdir@/gnupg"
+KEYMAN_CONF="@sysconfdir@/key-manager.conf"
+
+#############################################################################
+#
+# usage
+#
+#############################################################################
+usage()
+{
+ echo "$0 [ check | install ]"
+ echo "setup a master key for the key-manager"
+ exit 1
+}
+
+#############################################################################
+#
+# check_gnupg
+#
+#############################################################################
+check_gnupg()
+{
+ # Check if GnuPG is installed
+ GNUPGBIN=`which gpg`
+ if [ -z "$GNUPGBIN" ] ; then
+ echo "GnuPG is not found or not installed" >&2
+ exit 1
+ fi
+}
+
+#############################################################################
+#
+# check_gnupg
+#
+#############################################################################
+check_gnupg()
+{
+ # Check if GnuPG is installed
+ GNUPGBIN=`which gpg`
+ if [ -z "$GNUPGBIN" ] ; then
+ echo "GnuPG is not found or not installed" >&2
+ exit 1
+ fi
+}
+
+#############################################################################
+#
+# check
+#
+#############################################################################
+check()
+{
+ check_gnupg
+
+ if [ -e $GNUPGHOME ] ; then
+ echo "Directory \"$GNUPGHOME\" exists"
+ exit 0
+ else
+ echo "Directory \"$GNUPGHOME\" don't exist"
+ exit 1
+ fi
+}
+
+#############################################################################
+#
+# install
+#
+#############################################################################
+install()
+{
+ check_gnupg
+
+ # Don't overwrite an existing configuration
+ if [ -e "$GNUPGHOME" ] ; then
+ echo "Directory \"$GNUPGHOME\" already exists, abort" >&2
+ exit 1
+ fi
+
+ mkdir $GNUPGHOME
+ chmod go-rwx $GNUPGHOME
+ export GNUPGHOME
+
+ PASSPHRASE=`openssl rand -base64 10`
+
+ GNUPG_SCRIPT=`mktemp`
+ cat > $GNUPG_SCRIPT <<EOF
+Key-Type: default
+Subkey-Type: default
+Name-Real: Bacula
+Name-Email: bacula@localhost
+Expire-Date: 0
+Passphrase: $PASSPHRASE
+%commit
+%echo done
+EOF
+
+ GNUPG_OUT=`mktemp`
+ $GNUPGBIN --batch --full-gen-key $GNUPG_SCRIPT >$GNUPG_OUT 2>&1
+ if [ $? != 0 ] ; then
+ cat $GNUPG_OUT
+ rm $GNUPG_OUT
+ echo "Error with gpg" >&2
+ exit 1
+ fi
+ rm $GNUPG_SCRIPT
+
+ # retrieve the fingerprint of the key
+ fpr=`$GNUPGBIN -k --with-colons | awk -F : '$1 ~/fpr/ { print $10;exit }'`
+
+ cat >$KEYMAN_CONF <<EOF
+[DEFAULT]
+gnupghome="$GNUPGHOME"
+
+[$fpr]
+#volume_regex=Volume[0-9]+|TestVolume[0-9]+
+uid=bacula@localhost
+passphrase=$PASSPHRASE
+stealth=off
+EOF
+ if [ "$USER" = root -o "$UID" = 0 ]; then
+ echo change ownership to user bacula
+ chown -R bacula.bacula $KEYMAN_CONF $GNUPGHOME
+ fi
+ echo "public and private keys have been created in $GNUPGHOME"
+ echo "the key-manager configuration file is in $KEYMAN_CONF"
+ exit 0
+}
+
+operation=$1
+shift
+
+case $operation in
+ "check")
+ check
+ ;;
+ "install")
+ install
+ ;;
+ *)
+ usage
+ ;;
+esac
# -*- coding: utf-8 -*-
#
# Bacula(R) - The Network Backup Solution
-
- Copyright (C) 2000-2023 Kern Sibbald
-
- The original author of Bacula is Kern Sibbald, with contributions
- from many others, a complete list can be found in the file AUTHORS.
-
- You may use this file and others of this release according to the
- license defined in the LICENSE file, which includes the Affero General
- Public License, v3.0 ("AGPLv3") and some additional permissions and
- terms pursuant to its AGPLv3 Section 7.
-
- This notice must be preserved when any source code is
- conveyed and/or propagated.
-
- Bacula(R) is a registered trademark of Kern Sibbald.
#
# License: BSD 2-Clause; see file LICENSE-FOSS
#