From 00efeecd78deceed843b1f06ea0a5c078a893346 Mon Sep 17 00:00:00 2001 From: Alexander Weidinger Date: Fri, 27 Apr 2018 13:04:10 +0200 Subject: [PATCH] Drop default AdminAuth --- apt-cacher/ng/files/security.conf | 8 ++++++-- apt-cacher/ng/map.jinja | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apt-cacher/ng/files/security.conf b/apt-cacher/ng/files/security.conf index 9ebc00b..1041c26 100644 --- a/apt-cacher/ng/files/security.conf +++ b/apt-cacher/ng/files/security.conf @@ -7,6 +7,10 @@ # Basic authentication with username and password, required to # visit pages with administrative functionality. Format: username:password -{% from "apt-cacher/ng/map.jinja" import apt_cacher_ng with context %} -AdminAuth: {{ apt_cacher_ng.admin_account }}:{{ apt_cacher_ng.admin_passwd }} +{%- set cfg = salt['pillar.get']('apt_cacher_ng', {}) %} +{%- set admin_account = cfg.get('admin_account', False) %} +{%- set admin_passwd = cfg.get('admin_passwd', False) %} +{%- if admin_account and admin_passwd %} +AdminAuth: {{ admin_account }}:{{ admin_passwd }} +{%- endif %} diff --git a/apt-cacher/ng/map.jinja b/apt-cacher/ng/map.jinja index aea97a6..0362316 100644 --- a/apt-cacher/ng/map.jinja +++ b/apt-cacher/ng/map.jinja @@ -13,7 +13,5 @@ 'service': 'apt-cacher-ng', 'credentials': '/etc/apt-cacher-ng/security.conf', 'client_config': '/etc/apt/apt.conf.d/80proxy', - 'admin_account': 'root', - 'admin_passwd': 'admin' }, }, merge=salt['pillar.get']('apt_cacher_ng')) %}