diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c7bc2df..21a8b3b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,7 +26,7 @@ The full log with the outputted error. **Version report (please complete the following information):** - Host OS: [e.g. `uname -a`] - Docker: [e.g. `docker --version`] - - Image tag: [e.g. `3005.1-2`] + - Image tag: [e.g. `3005.1-2_1`] **Additional context** Add any other context about the problem here. diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a3b8c0..634b840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This file only reflects the changes that are made in this image. Please refer to the [Salt 3005.1 Release Notes](https://docs.saltstack.com/en/latest/topics/releases/3005.1.html) for the list of changes in SaltStack. +**3005.1-2_1** + +- Fix: check GPG env variables before exiting if `gpgkeys` directory is empty. + **3005.1-2** - Upgrade `salt-master` to `3005.1-2` *Phosphorus*. diff --git a/Dockerfile b/Dockerfile index f08b438..094e33a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ARG VCS_REF # https://github.com/saltstack/salt/releases ENV SALT_VERSION="3005.1-2" -ENV IMAGE_VERSION="${SALT_VERSION}" +ENV IMAGE_VERSION="${SALT_VERSION}_1" ENV SALT_DOCKER_DIR="/etc/docker-salt" \ SALT_ROOT_DIR="/etc/salt" \ diff --git a/Makefile b/Makefile index 49c59fb..a27d942 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ build: release: build @docker tag cdalvaro/docker-salt-master:latest \ - cdalvaro/docker-salt-master:$(shell cat VERSION) + cdalvaro/docker-salt-master:$(shell cat VERSION)_1 quickstart: @echo "Starting docker-salt-master container..." diff --git a/README.md b/README.md index 4a87ee3..e86ef7c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Automated builds of the image are available on the recommended method of installation. ```sh -docker pull ghcr.io/cdalvaro/docker-salt-master:3005.1-2 +docker pull ghcr.io/cdalvaro/docker-salt-master:3005.1-2_1 ``` You can also pull the latest tag which is built from the repository `HEAD` diff --git a/assets/runtime/functions.sh b/assets/runtime/functions.sh index 68460a4..15290ff 100755 --- a/assets/runtime/functions.sh +++ b/assets/runtime/functions.sh @@ -276,8 +276,11 @@ function _check_and_link_gpgkey() { return 1 fi + mkdir -p "$(dirname "${TARGET_GPGKEY}")" + log_info "Linking '${SOURCE_GPGKEY}' to '${TARGET_GPGKEY}' ..." ln -sfn "${SOURCE_GPGKEY}" "${TARGET_GPGKEY}" + chown "${SALT_USER}:${SALT_USER}" "${TARGET_GPGKEY}" } #--- FUNCTION ------------------------------------------------------------------------------------------------------- @@ -286,15 +289,19 @@ function _check_and_link_gpgkey() { #---------------------------------------------------------------------------------------------------------------------- function _setup_gpgkeys() { - [[ -d "${SALT_KEYS_GPGKEYS_DIR}" && -n "$(ls -A "${SALT_KEYS_GPGKEYS_DIR}")" ]] || return 0 - log_info " ==> Setting up GPG keys ..." + local private_key="${SALT_KEYS_GPGKEYS_DIR}/private.key" local public_key="${SALT_KEYS_GPGKEYS_DIR}/pubkey.gpg" _check_and_link_gpgkey 'SALT_GPG_PRIVATE_KEY_FILE' "${private_key}" _check_and_link_gpgkey 'SALT_GPG_PUBLIC_KEY_FILE' "${public_key}" + if [[ ! -d "${SALT_KEYS_GPGKEYS_DIR}" || -z "$(ls -A "${SALT_KEYS_GPGKEYS_DIR}")" ]]; then + log_info "Could not find GPG keys. GPG setup skipped." + return 0 + fi + if [[ ! -f "${private_key}" || ! -f "${public_key}" ]]; then log_error "GPG keys are not valid. Please, check the documentation for more information:" log_error " - https://github.com/cdalvaro/docker-salt-master#gpg-keys-for-renderers"