From: Valentin Vidic Date: Mon, 7 Mar 2011 14:27:41 +0000 (+0100) Subject: Initial version. X-Git-Tag: debian/20110307^0 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=61a9b0bac4e17612f29bea434aaa39511942d0dd;p=bacula-cn.git Initial version. --- 61a9b0bac4e17612f29bea434aaa39511942d0dd diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..ed33f95 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +bacula-cn (20110307) unstable; urgency=low + + * Initial Release. + + -- Valentin Vidic Thu, 07 Mar 2011 14:32:30 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/config b/debian/config new file mode 100644 index 0000000..1fe6e1f --- /dev/null +++ b/debian/config @@ -0,0 +1,64 @@ +#! /bin/sh +set -e + +. /usr/share/debconf/confmodule + +# Guess default hostname +HOST=$( hostname -f ) +db_get bacula-cn/hostname || true +if [ -z "$RET" ]; then + db_set bacula-cn/hostname "$HOST" +fi + +# Guess default ip +. /usr/share/carnet-tools/functions.sh +cp_get_ifaddr +IP=$RET +db_get bacula-cn/ip || true +if [ -z "$RET" ]; then + db_set bacula-cn/ip "$IP" +fi + +# Sample contact +db_get bacula-cn/contact || true +if [ -z "$RET" ]; then + db_set bacula-cn/contact "Ime Prezime " +fi + +# Check hostname +while true; do + ! db_input high bacula-cn/hostname && [ $? -eq 30 ] && break + db_go || true + + db_get bacula-cn/hostname + [ -z "$RET" ] && continue + echo "$RET" | grep -Eqi '^[a-z0-9-]+(\.[a-z0-9.-]+)+$' || continue + + break +done + +# Check ip +while true; do + ! db_input high bacula-cn/ip && [ $? -eq 30 ] && break + db_go || true + + db_get bacula-cn/ip + [ -z "$RET" ] && continue + echo "$RET" | grep -Eqi '^[0-9]{1,3}(\.[0-9]{1,3}){3}$' || continue + + break +done + +# Check contact +while true; do + ! db_input high bacula-cn/contact && [ $? -eq 30 ] && break + db_go || true + + db_get bacula-cn/contact + [ -z "$RET" ] && continue + echo "$RET" | grep -Eqi '^([^@]*<)?[a-z0-9.+-]+@[a-z0-9-]+(\.[a-z0-9.-]+)+>?$' || continue + + break +done + +exit 0 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..ae305f3 --- /dev/null +++ b/debian/control @@ -0,0 +1,17 @@ +Source: bacula-cn +Section: admin +Priority: extra +Maintainer: Grupa za izradu paketa +Uploaders: Valentin Vidic +Build-Depends-Indep: debhelper (>= 7.0.50~), po-debconf +Standards-Version: 3.9.1 +Bugs: mailto:paketi@carnet.hr +Vcs-Git: http://ftp.carnet.hr/carnet-debian/scm/bacula-cn.git +Vcs-Browser: http://ftp.carnet.hr/carnet-debian/scm/?p=bacula-cn.git;a=summary + +Package: bacula-cn +Architecture: all +Depends: bacula-fd (>= 5), bacula-console (>= 5), openssl, gnupg, debconf (>= 0.5) | debconf-2.0, carnet-tools-cn, ${misc:Depends} +Description: Network backup configuration for CARNet members + This package install Bacula client daemon and configures it for use + with CARNet backup service for member institutions. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..2555ba8 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,31 @@ +This work was packaged for Debian by: + + Valentin Vidic on Thu, 03 Mar 2011 14:32:30 +0100 + +Copyright: + + + +License: + + 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 3 of the License, or + (at your option) any later version. + + This package 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, see . + +On Debian systems, the complete text of the GNU General +Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + +The Debian packaging is: + + Copyright (C) 2011 Valentin Vidic + +and is licensed under the GPL version 3, see above. diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..d4e38e6 --- /dev/null +++ b/debian/install @@ -0,0 +1,2 @@ +sysbackup.pem etc/bacula/ +gpg var/lib/bacula-cn/ diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in new file mode 100644 index 0000000..cef83a3 --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates diff --git a/debian/po/templates.pot b/debian/po/templates.pot new file mode 100644 index 0000000..f16f8fc --- /dev/null +++ b/debian/po/templates.pot @@ -0,0 +1,73 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: bacula-cn@packages.debian.org\n" +"POT-Creation-Date: 2011-03-04 17:32+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#: ../templates:1001 +msgid "Naziv posluzitelja:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:1001 +msgid "" +"Unesite puno ime posluzitelja koji se dodaje u backup sustav. Najcesce se " +"koristi oblik ime.ustanova.hr." +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "IP adresa posluzitelja:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "" +"Unesite javnu IP adresu posluzitelja. Putem ove adrese obavljat ce se " +"backup posluzitelja." +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Kontakt adresa:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Unesite ime i kontakt adresu administratora posluzitelja u obliku:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Ime Prezime " +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "" +"Ova adresa koristit ce se prilikom slanja zahtjeva za pokretanje usluge " +"backupa i za kontakt u slucaju problema. Zbog toga molimo da unesete radecu " +"mail adresu." +msgstr "" diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..78a47ec --- /dev/null +++ b/debian/postinst @@ -0,0 +1,320 @@ +#!/bin/sh +# postinst script for bacula-cn +# +# see: dh_installdeb(1) + +set -e + +# Source debconf library. +. /usr/share/debconf/confmodule + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +generate_fd_config() { + FD_CONFIG=/etc/bacula/bacula-fd.conf + + if [ -s $FD_CONFIG ] && grep -q 'PKI Keypair' $FD_CONFIG; then + echo $FD_CONFIG already exists, skipping. + else + umask 077 + + if [ -e $FD_CONFIG -a ! -e $FD_CONFIG.bak ]; then + cp -av $FD_CONFIG $FD_CONFIG.bak + fi + + echo Generating $FD_CONFIG + CONFIG_CHANGED=1 + cat >$FD_CONFIG <$BCONSOLE_CONFIG </dev/null`" ]; then + invoke-rc.d bacula-fd restart || exit $? + else + /etc/init.d/bacula-fd restart || exit $? + fi + fi +} + +send_mail() { + REQUEST_FILE=/etc/bacula/bacula-fd.txt + GPG_HOME=/var/lib/bacula-cn/gpg + + BOUNDARY=$( head -20 /dev/urandom | openssl dgst -sha1 ) + GPG="gpg --homedir $GPG_HOME --batch --encrypt --armour --recipient rt@tt.carnet.hr --always-trust" + + if [ -z "$CONFIG_CHANGED" ]; then + echo Config has not changed, skipping request. + return + fi + + umask 077 + chmod 0700 $GPG_HOME + echo Generating request in $REQUEST_FILE + + # Header + cat > $REQUEST_FILE <> $REQUEST_FILE <> $REQUEST_FILE + +# attachment: client config +cat >> $REQUEST_FILE <> $REQUEST_FILE +# Requested by $CONTACT on $DATE +Client { + Name = $HOST-fd + Address = $IP + Password = "$PASS_FD" # password for bacula-fd(8) + @/etc/bacula/include/client-debian-default.conf + + TLS Enable = yes + TLS Require = yes + TLS CA Certificate File = "/etc/bacula/clients.d/$HOST-fd.pem" + TLS Certificate = "/etc/bacula/bacula.pem" + TLS Key = "/etc/bacula/bacula.pem" +} + +Job { + Name = "$HOST" + Client = $HOST-fd + JobDefs = "Job_SysBackup" +} + +Console { + Name = $HOST-acl + Password = "$PASS_BCONSOLE" # password for bconsole(8) + JobACL = $HOST, RestoreFiles + ClientACL = $HOST-fd + @/etc/bacula/include/acl-default.conf +} +EOF + +# attachment: client certificate +cat >> $REQUEST_FILE <> $REQUEST_FILE + +cat >> $REQUEST_FILE <&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..ce4e5b6 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,41 @@ +#!/bin/sh +# postrm script for bacula-cn +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +clean_gpg() { + rm -rf /var/lib/bacula-cn/ +} + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + clean_gpg + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..b760bee --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/templates b/debian/templates new file mode 100644 index 0000000..ce763b4 --- /dev/null +++ b/debian/templates @@ -0,0 +1,22 @@ +Template: bacula-cn/hostname +Type: string +_Description: Naziv posluzitelja: + Unesite puno ime posluzitelja koji se dodaje u backup sustav. + Najcesce se koristi oblik ime.ustanova.hr. + +Template: bacula-cn/ip +Type: string +_Description: IP adresa posluzitelja: + Unesite javnu IP adresu posluzitelja. Putem ove adrese obavljat + ce se backup posluzitelja. + +Template: bacula-cn/contact +Type: string +_Description: Kontakt adresa: + Unesite ime i kontakt adresu administratora posluzitelja u obliku: + . + Ime Prezime + . + Ova adresa koristit ce se prilikom slanja zahtjeva za pokretanje + usluge backupa i za kontakt u slucaju problema. Zbog toga molimo + da unesete radecu mail adresu. diff --git a/gpg/pubring.gpg b/gpg/pubring.gpg new file mode 100644 index 0000000..471b4cb Binary files /dev/null and b/gpg/pubring.gpg differ diff --git a/gpg/secring.gpg b/gpg/secring.gpg new file mode 100644 index 0000000..e69de29 diff --git a/gpg/trustdb.gpg b/gpg/trustdb.gpg new file mode 100644 index 0000000..1dd5d29 Binary files /dev/null and b/gpg/trustdb.gpg differ diff --git a/sysbackup.pem b/sysbackup.pem new file mode 100644 index 0000000..36fe627 --- /dev/null +++ b/sysbackup.pem @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIIDvjCCAqagAwIBAgIJAItXEkopbZMZMA0GCSqGSIb3DQEBBQUAMEgxCzAJBgNV +BAYTAkhSMQowCAYDVQQIEwEgMQ8wDQYDVQQKEwZDQVJOZXQxHDAaBgNVBAMTE3N5 +c2JhY2t1cC5jYXJuZXQuaHIwHhcNMT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