Skip to content

Commit

Permalink
Univention: setup bareos.com repository
Browse files Browse the repository at this point in the history
When the user specifies the UCR variables
bareos/subscription/username and bareos/subscription/password,
the download.bareos.com update repository is automatically configured
in the file /etc/apt/sources.list.d/60_bareos.list
  • Loading branch information
joergsteffens committed Jul 4, 2016
1 parent d2c06e5 commit dc7920b
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 1 deletion.
2 changes: 2 additions & 0 deletions autoconf/configure.in
Expand Up @@ -4249,6 +4249,8 @@ debian|ubuntu|univention)
PFILES="${PFILES} \
debian/univention-bareos.install \
debian/univention-bareos.postinst \
platforms/univention/conffiles/etc/apt/sources.list.d/60_bareos.list \
platforms/univention/get_bareos_release_key.sh \
platforms/univention/Makefile \
platforms/univention/AppCenter/univention-bareos.ini \
platforms/univention/AppCenter/LICENSE_AGREEMENT"
Expand Down
1 change: 1 addition & 0 deletions debian/univention-bareos.install.in
@@ -1,3 +1,4 @@
/etc/bareos/bareos-com-release.key
/etc/bareos/autogenerated/clients/generic.template
/etc/bareos/autogenerated/clients/windows.template
/etc/bareos/autogenerated/fd-configs/generic.template
Expand Down
7 changes: 7 additions & 0 deletions debian/univention-bareos.univention-config-registry
Expand Up @@ -27,3 +27,10 @@ Type: file
File: etc/bareos/bconsole.conf
Variables: hostname
Variables: domainname

Type: file
File: etc/apt/sources.list.d/60_bareos.list
Variables: bareos/subscription/username
Variables: bareos/subscription/password
Variables: version/version

12 changes: 12 additions & 0 deletions debian/univention-bareos.univention-config-registry-variables
Expand Up @@ -46,6 +46,18 @@ Description[en]=Maximum number of volumes for the full backup pool
Type=int
Categories=backup

[bareos/subscription/username]
Description[de]=Benutzername für den bareos.com Zugang
Description[en]=Username for accessing bareos.com
Type=str
Categories=backup

[bareos/subscription/password]
Description[de]=Passwort für den bareos.com Zugang
Description[en]=Password for accessing bareos.com
Type=str
Categories=backup

[bareos/webui/console/user1/username]
Description[de]=Benutzername
Description[en]=Username
Expand Down
2 changes: 1 addition & 1 deletion platforms/packaging/bareos-Univention_4.0.dsc
Expand Up @@ -6,7 +6,7 @@ Version: 15.2.4
Maintainer: Bareos Packaging Team <packager@bareos.com>
Homepage: http://www.bareos.org/
Standards-Version: 3.9.4
Build-Depends: acl-dev, autotools-dev, bc, chrpath, debhelper (>= 7.0.50~), dpkg-dev (>= 1.13.19), git-core, libacl1-dev, libcap-dev, libfastlz-dev, libjansson-dev, liblzo2-dev, libqt4-dev, libreadline-dev, libssl-dev, libwrap0-dev, libx11-dev, libsqlite3-dev, libmysqlclient-dev, libpq-dev (>= 8.4), logrotate, lsb-release, mtx, ncurses-dev, openssl, pkg-config, po-debconf (>= 0.8.2), python-dev, ucslint, univention-config-dev, zlib1g-dev
Build-Depends: acl-dev, autotools-dev, bc, chrpath, debhelper (>= 7.0.50~), dpkg-dev (>= 1.13.19), git-core, libacl1-dev, libcap-dev, libfastlz-dev, libjansson-dev, liblzo2-dev, libqt4-dev, libreadline-dev, libssl-dev, libwrap0-dev, libx11-dev, libsqlite3-dev, libmysqlclient-dev, libpq-dev (>= 8.4), logrotate, lsb-release, mtx, ncurses-dev, openssl, pkg-config, po-debconf (>= 0.8.2), python-dev, ucslint, univention-config-dev, wget, zlib1g-dev
Build-Conflicts: python2.2-dev, python2.3, python2.4, qt3-dev-tools
DEBTRANSFORM-RELEASE: 1
Files:
8 changes: 8 additions & 0 deletions platforms/univention/Makefile.in
Expand Up @@ -10,7 +10,11 @@

all:
(cd ../debian; $(MAKE) $@;)
$(MKDIR) ../../conffiles/
cp -r conffiles/. ../../conffiles/.
(cd ../..; platforms/univention/create_ucs_template_files.sh conffiles/)
# remove autoconf template files
find ../../conffiles/ -name "*.in" -exec rm {} \;
@$(MKDIR) ../../AppCenter/
$(INSTALL_DATA) AppCenter/univention-bareos.ini ../../AppCenter/
$(INSTALL_DATA) AppCenter/LICENSE_AGREEMENT ../../AppCenter/
Expand All @@ -19,6 +23,8 @@ all:
$(INSTALL_DATA) AppCenter/bareos-webui_screenshot.png ../../AppCenter/
$(INSTALL_DATA) ../../src/images/bareos-logo.svg ../../AppCenter/
$(INSTALL_DATA) ../../src/images/bareos-logo-full.svg ../../AppCenter/
# disabled. use static release key
#sh get_bareos_release_key.sh bareos-com-release.key

install:
(cd ../debian; $(MAKE) $@;)
Expand Down Expand Up @@ -55,6 +61,8 @@ install:
@$(MKDIR) $(DESTDIR)/etc/univention/templates/scripts/etc/bareos/
@$(INSTALL_PROGRAM) bareos-dir.conf $(DESTDIR)/etc/univention/templates/scripts/etc/bareos/

@$(INSTALL_CONFIG) bareos-com-release.key $(DESTDIR)/etc/bareos/

clean:
(cd ../debian; $(MAKE) $@;)
@$(RMF) 1 2 3
Expand Down
31 changes: 31 additions & 0 deletions platforms/univention/bareos-com-release.key
@@ -0,0 +1,31 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.15 (GNU/Linux)

mQINBFXbK+sBEADHrDhXMa3bvy4f5MBwifTQswcXqiAkKQ5GRsHxMZIsJkq86Ewr
vt2jOn+sXPiWLn/hSXNohUmWu63OKiCJFZ9TLAWzFM0T3vYeevB3XviEzLlMcQZx
/dlCKpwa7B2dSISPsN1pe0Nnm0TKRUzIhEzYvwLs1mhBk0nJTrLMiuK+eJBnaI7R
9nnf3EBM0Am7ejJIZCbNKWik8wtF/h6MfeZ8bk3K4bHwGTl8lr27SOCFXcXJQgbR
bgSNHf/krRyItcIFf9eXP7YW2IOZqit+SdAnqlx6qFP1Y1JZHLADvCKesGEv9xDz
4mMWpcUmKt/lJD03CzG4hqLUe8IPEHrVsFgpz/wBML2qdD1iFWhhbjinEox/fCvG
BTqupd9Th9unRDuM+bOvV2AnldysCO88fbdVoXKFmyA28Uq349eEy4us8qVMbGHc
29BViHk7eHRewfQftKOdlmwgiqaxcyvaIbitsS3cpVuz+iHYlqR5X5U7yLeDJnI7
9YYfEAzpl9bAZP55RBcCgQ4Fdn+hFW60kzVa0dlsfI3Zujjxq/uXVTLgQkbXmhtD
BbkCIryyfOQwkLsbkq0A2U+7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P PUBLIC KEY BLOCK-----
@@ -0,0 +1,42 @@
@%@UCRWARNING=#@%@

@!@
import subprocess
import sys
from urllib import quote

username = configRegistry.get('bareos/subscription/username', '')
password = configRegistry.get('bareos/subscription/password', '')

if username and password:

bareos_major_version = @MAJOR_VERSION@
#bareos_sign_key_id = 'F93C028C093BFBA2'

ucs_version = configRegistry.get('version/version')
bareos_univention_dist = 'Univention_4.0'

#
# example:
# http://download.bareos.com/bareos/release/15.2/Univention_4.0/
# https does not work on UCS 4.0, even if apt-transport-https is installed.
#
bareos_com_url = "http://{username}:{password}@download.bareos.com/bareos/release/{version}/{dist}".format(username=quote(username), password=password, version=bareos_major_version, dist=bareos_univention_dist)

# import the bareos signing key from a keyserver (does work, if internet connection is available)
#cmd = subprocess.Popen(['apt-key', 'adv', '--keyserver', 'pool.sks-keyservers.net', '--recv-key', bareos_sign_key_id], stdout=sys.stderr, stderr=sys.stderr)
sys.stderr.write("importing bareos.com release key: ")
cmd = subprocess.Popen(['apt-key', 'add', '/etc/bareos/bareos-com-release.key'], stdout=sys.stderr, stderr=sys.stderr)
rc = cmd.wait()
#sys.stderr.write("rc=" + str(rc) + "\n")

print "deb {url} /".format(url=bareos_com_url)

else:

print "# The bareos.com repository is disabled."
print "# To enable it, you must have a valid Bareos subscription."
print "# Specify your Bareos credentials in the UCR variables"
print "# 'bareos/subscription/username' and"
print "# 'bareos/subscription/password'."
@!@
17 changes: 17 additions & 0 deletions platforms/univention/get_bareos_release_key.sh.in
@@ -0,0 +1,17 @@
#!/bin/sh

DEST=${1:-bareos-com-release.key}

if [ -z "@OBS_DISTRIBUTION@" ]; then
echo "OBS_DISTRIBUTION not defined, skipped."
exit 0
fi

# use bareos.org Release.key,
# as it is identical with the bareos.com key and we do not require a authentication.
URL_BRANCH="http://download.bareos.org/bareos/release/@MAJOR_VERSION@/@OBS_DISTRIBUTION@/Release.key"
URL_MASTER="http://download.bareos.org/bareos/experimental/nightly/@OBS_DISTRIBUTION@/Release.key"

wget -O "$DEST" "$URL_BRANCH" || wget -O "$DEST" "$URL_MASTER"
exit $?

0 comments on commit dc7920b

Please sign in to comment.