Compare commits

...

37 Commits

Author SHA1 Message Date
b90cbd2fe5 using apt-cache
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-13 13:02:39 +01:00
5a06752501 bogus edit for testing
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-12-13 12:56:41 +01:00
58bfaf1970 cleanup
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone Build was killed
2023-11-30 17:40:44 +01:00
f84bf90797 docker pipeline
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-11-21 16:57:56 +01:00
e9d46944e5 type podman?
Some checks failed
continuous-integration/drone Build is failing
2023-11-15 12:38:25 +01:00
75ad5e3e4e just because eclipse does not like to show dot-files
Some checks reported errors
continuous-integration/drone Build was killed
2023-10-24 17:24:45 +02:00
5ef561e5bd how the hell?
Some checks reported errors
continuous-integration/drone Build was killed
2023-10-24 17:19:01 +02:00
81993c9e38 how the hell? 2023-10-24 17:18:35 +02:00
31502766ab how the hell?
All checks were successful
continuous-integration/drone Build is passing
2023-10-24 17:04:14 +02:00
10c1b930f2 how the hell?
Some checks reported errors
continuous-integration/drone Build encountered an error
2023-10-24 16:58:46 +02:00
ac732e567d how the hell?
Some checks reported errors
continuous-integration/drone Build encountered an error
2023-10-24 16:57:05 +02:00
386faf4b71 custom registry: https://docs.drone.io/plugins/popular/docker/
Some checks reported warnings
continuous-integration/drone Build is passing
Publish Docker image / Metadata (push) Has been cancelled
Publish Docker image / Publish (push) Has been cancelled
Security analysis / Trivy scan (push) Has been cancelled
2023-10-23 19:11:13 +02:00
2a8bd27356 adding debug and insecure=true
Some checks reported errors
Publish Docker image / Metadata (push) Has been cancelled
Publish Docker image / Publish (push) Has been cancelled
continuous-integration/drone Build was killed
Security analysis / Trivy scan (push) Has been cancelled
2023-10-23 19:06:51 +02:00
64ead81c35 building a docker image
Some checks reported warnings
continuous-integration/drone Build is passing
Publish Docker image / Metadata (push) Has been cancelled
Publish Docker image / Publish (push) Has been cancelled
Security analysis / Trivy scan (push) Has been cancelled
2023-10-22 15:34:44 +02:00
de40fe2f9b building a docker image
Some checks reported warnings
continuous-integration/drone Build is passing
Security analysis / Trivy scan (push) Has been cancelled
Publish Docker image / Metadata (push) Has been cancelled
Publish Docker image / Publish (push) Has been cancelled
2023-10-22 15:19:15 +02:00
09a2e93897 busybox
Some checks reported errors
continuous-integration/drone Build was killed
Publish Docker image / Metadata (push) Has been cancelled
Publish Docker image / Publish (push) Has been cancelled
Security analysis / Trivy scan (push) Has been cancelled
2023-10-21 19:46:51 +02:00
659a3f69b0 need three dashes?
Some checks reported warnings
Publish Docker image / Metadata (push) Has been cancelled
Publish Docker image / Publish (push) Has been cancelled
Security analysis / Trivy scan (push) Has been cancelled
2023-10-21 18:55:36 +02:00
94f85210ef initial drone test
Some checks reported warnings
Publish Docker image / Metadata (push) Has been cancelled
Publish Docker image / Publish (push) Has been cancelled
Security analysis / Trivy scan (push) Has been cancelled
2023-10-21 18:47:49 +02:00
5735e22bf0 jenkins and gitea actions gone 2023-10-21 18:42:33 +02:00
860c9873a5 Jenkinsfile
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
chaos/docker-salt-master/pipeline/head Build queued...
2023-10-20 15:46:28 +02:00
ba3cce81e8 Jenkinsfile
Some checks failed
chaos/docker-salt-master/pipeline/head There was a failure building this commit
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2023-10-20 15:45:33 +02:00
92cc176d1f Jenkinsfile
Some checks failed
chaos/docker-salt-master/pipeline/head There was a failure building this commit
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2023-10-20 15:43:30 +02:00
91536703cb Jenkinsfile
Some checks failed
chaos/docker-salt-master/pipeline/head There was a failure building this commit
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2023-10-20 15:42:06 +02:00
1d590689e3 Merge branch 'main' of ssh://gitea.service.nr5:2222/chaos/docker-salt-master
Some checks failed
chaos/docker-salt-master/pipeline/head There was a failure building this commit
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2023-10-20 15:38:23 +02:00
93dd080c4e Jenkinsfile 2023-10-20 15:38:12 +02:00
01d4f9b295 no short name
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
2023-10-11 11:51:31 +02:00
b827cea669 demo workflow
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2s
2023-10-11 11:45:16 +02:00
9a432932a0 getting rid of custom stuff 2023-10-01 13:39:31 +02:00
Carlos Álvaro
ddf9573e6c doc: Update README.md 2023-09-14 23:59:19 +02:00
Carlos Álvaro
8f55384986 fix: Set salt home directory permissions
Closes #211
2023-09-14 23:56:42 +02:00
dependabot[bot]
1fd232ffc0 build(deps): Bump docker/setup-qemu-action from 2 to 3
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-14 06:26:35 +02:00
dependabot[bot]
9c269531c6 build(deps): Bump docker/build-push-action from 4.2.1 to 5.0.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.2.1 to 5.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.2.1...v5.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 11:41:12 +02:00
dependabot[bot]
92001f0701 build(deps): Bump docker/setup-buildx-action from 2 to 3
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 10:27:19 +02:00
dependabot[bot]
d4d71d67e0 build(deps): Bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 09:57:31 +02:00
dependabot[bot]
5c0ba3d82e build(deps): Bump docker/build-push-action from 4.1.1 to 4.2.1
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.1 to 4.2.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.1.1...v4.2.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 09:47:19 +02:00
Carlos Álvaro
5ed81c554e fix: Change salt's logrotate config file 2023-09-08 13:43:15 +02:00
Carlos Álvaro
bc4c65559f feat: Upgrade pygit2 to version 1.12.2 2023-09-08 13:43:15 +02:00
13 changed files with 87 additions and 33 deletions

18
.drone.yml Normal file
View File

@@ -0,0 +1,18 @@
kind: pipeline
type: docker
name: docker-salt-master
platform:
os: linux
arch: arm64
steps:
- name: build
image: plugins/docker
settings:
repo: cr.wks/salt
registry: http://cr.wks
insecure: true
debug: true
tags:
- latest

View File

@@ -26,10 +26,10 @@ jobs:
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
@@ -60,7 +60,7 @@ jobs:
echo "Cache contents available at: ${CACHE_PATH}"
- name: Build docker-salt-master image
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.0.0
with:
context: .
file: ./Dockerfile

View File

@@ -84,10 +84,10 @@ jobs:
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
id: cache-docker-layers
@@ -110,27 +110,27 @@ jobs:
echo "Cache contents available at: ${CACHE_PATH}"
- name: Login to Docker Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Login to Quay.io Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}
- name: Build
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.0.0
with:
context: .
file: ./Dockerfile

View File

@@ -22,11 +22,11 @@ jobs:
- name: Set up QEMU
if: github.event_name != 'schedule'
uses: docker/setup-qemu-action@v2.1.0
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: github.event_name != 'schedule'
uses: docker/setup-buildx-action@v2.5.0
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
if: github.event_name != 'schedule'
@@ -39,7 +39,7 @@ jobs:
- name: Build docker-salt-master image
if: github.event_name != 'schedule'
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.0.0
with:
context: .
file: ./Dockerfile

11
.project Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>docker-salt-master</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View File

@@ -4,10 +4,15 @@ This file only reflects the changes that are made in this image.
Please refer to the [Salt 3006.3 Release Notes](https://docs.saltstack.com/en/latest/topics/releases/3006.3.html)
for the list of changes in SaltStack.
**3006.3_1**
- Fix salt home directory permissions. Issue #211
**3006.3**
- Upgrade `salt-master` to `3006.3` *Sulfur*.
- Change Docker base image to `ubuntu:jammy-20230816`.
- Upgrade `pygit2` to version `1.12.2`.
**3006.2**

View File

@@ -1,11 +1,11 @@
FROM ubuntu:jammy-20230816
FROM docker.io/debian:bullseye-slim
ARG BUILD_DATE
ARG VCS_REF
# https://github.com/saltstack/salt/releases
ENV SALT_VERSION="3006.3"
ENV IMAGE_VERSION="${SALT_VERSION}"
ENV SALT_VERSION="3002.6+dfsg1-4+deb11u1"
ENV IMAGE_VERSION="${SALT_VERSION}_1"
ENV SALT_DOCKER_DIR="/etc/docker-salt" \
SALT_ROOT_DIR="/etc/salt" \
@@ -28,6 +28,8 @@ WORKDIR ${SALT_BUILD_DIR}
# Install packages
# hadolint ignore=DL3008
RUN sed -i 's@deb.debian.org@apt-cache.service.nr5/deb.debian.org@g' /etc/apt/sources.list && \
sed -i 's@security.debian.org@apt-cache.service.nr5/security.debian.org@g' /etc/apt/sources.list
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
sudo ca-certificates apt-transport-https wget locales openssh-client gpg gpg-agent \

View File

@@ -23,7 +23,7 @@ Automated builds of the image are available on
the recommended method of installation.
```sh
docker pull ghcr.io/cdalvaro/docker-salt-master:3006.3
docker pull ghcr.io/cdalvaro/docker-salt-master:3006.3_1
```
You can also pull the latest tag which is built from the repository `HEAD`

View File

@@ -139,10 +139,10 @@ function add_salt_repository()
local arch=amd64
is_arm64 && arch=arm64
source /etc/os-release
mkdir -p /etc/apt/keyrings
local keyring_file="/etc/apt/keyrings/salt-archive-keyring.gpg"
local root_url="https://repo.saltproject.io/salt/py3/ubuntu/${VERSION_ID:?}/${arch}"
#https://repo.saltproject.io/salt/py3/debian/11/arm64/SALT-PROJECT-GPG-PUBKEY-2023.gpg
local root_url="https://repo.saltproject.io/salt/py3/debian/${VERSION_ID:?}/${arch}"
download "${root_url}/SALT-PROJECT-GPG-PUBKEY-2023.gpg" "${keyring_file}"
echo "deb [signed-by=${keyring_file} arch=${arch}] ${root_url}/minor/${SALT_VERSION} ${VERSION_CODENAME:?} main" > /etc/apt/sources.list.d/salt.list
}

View File

@@ -11,13 +11,13 @@ source "${FUNCTIONS_FILE}"
log_info "Installing required packages and build dependencies ..."
REQUIRED_PACKAGES=(
binutils patchelf
binutils patchelf python3-pip
)
BUILD_DEPENDENCIES=()
log_info "Adding salt repository..."
add_salt_repository
#log_info "Adding salt repository..."
#add_salt_repository
apt-get update
install_pkgs "${REQUIRED_PACKAGES[@]}" "${BUILD_DEPENDENCIES[@]}"
@@ -28,6 +28,7 @@ log_info "Creating ${SALT_USER} user ..."
useradd --home-dir "${SALT_HOME}" --create-home \
--shell /bin/bash --user-group "${SALT_USER}" \
--groups shadow
id ${SALT_USER}
# Set PATH
exec_as_salt cat >> "${SALT_HOME}/.profile" <<EOF
@@ -39,7 +40,8 @@ log_info "Installing salt packages ..."
install_pkgs salt-master="${SALT_VERSION}" salt-api="${SALT_VERSION}"
# Install python packages
exec_as_salt salt-pip install pygit2==1.12.0
log_info "Installing python packages ..."
pip3 install pygit2==1.12.2
# Configure ssh
log_info "Configuring ssh ..."
@@ -107,3 +109,7 @@ apt-get clean --yes
rm -rf /var/lib/apt/lists/*
export -n DEBIAN_FRONTEND
# Set home directory permissions
log_info "Setting ${SALT_USER} home directory permissions ..."
chown -R "${SALT_USER}:${SALT_USER}" "${SALT_HOME}"

View File

@@ -556,8 +556,11 @@ function initialize_datadir()
function configure_logrotate()
{
log_info "Configuring logrotate ..."
local LOGROTATE_CONFIG_DIR='/etc/logrotate.d/salt'
local LOGROTATE_CONFIG_FILE="${LOGROTATE_CONFIG_DIR}/salt-common.logrotate"
rm -f /etc/logrotate.d/salt-common
rm -rf "${LOGROTATE_CONFIG_DIR}"
mkdir -p "${LOGROTATE_CONFIG_DIR}"
# configure supervisord log rotation
cat > /etc/logrotate.d/supervisord <<EOF
@@ -573,13 +576,14 @@ ${SALT_LOGS_DIR}/supervisor/*.log {
EOF
# configure salt master, minion and key log rotation
cat > /etc/logrotate.d/salt <<EOF
cat > "${LOGROTATE_CONFIG_FILE}" <<EOF
${SALT_LOGS_DIR}/salt/master.log {
${SALT_LOG_ROTATE_FREQUENCY}
missingok
rotate ${SALT_LOG_ROTATE_RETENTION}
compress
notifempty
create 0640 ${SALT_USER} ${SALT_USER}
}
${SALT_LOGS_DIR}/salt/key.log {
@@ -588,20 +592,23 @@ ${SALT_LOGS_DIR}/salt/key.log {
rotate ${SALT_LOG_ROTATE_RETENTION}
compress
notifempty
create 0640 ${SALT_USER} ${SALT_USER}
}
EOF
if [[ "${SALT_API_SERVICE_ENABLED,,}" == true ]]; then
# configure salt-api log rotation
cat >> /etc/logrotate.d/salt <<EOF
cat >> "${LOGROTATE_CONFIG_FILE}" <<EOF
${SALT_LOGS_DIR}/salt/api.log {
${SALT_LOG_ROTATE_FREQUENCY}
missingok
rotate ${SALT_LOG_ROTATE_RETENTION}
compress
notifempty
create 0640 ${SALT_USER} ${SALT_USER}
}
EOF
fi
@@ -638,10 +645,10 @@ function initialize_system()
initialize_datadir
configure_logrotate
configure_timezone
configure_salt_master
configure_salt_api
configure_salt_formulas
#configure_salt_master
#configure_salt_api
#configure_salt_formulas
configure_config_reloader
setup_salt_keys
#setup_salt_keys
rm -rf /var/run/supervisor.sock
}

View File

@@ -23,7 +23,7 @@ case "${1}" in
;;
app:gen-signed-keys)
shift 1
gen_signed_keys "${1}"
#gen_signed_keys "${1}"
;;
esac
;;
@@ -41,7 +41,7 @@ case "${1}" in
esac
;;
app:reload-3rd-formulas)
configure_salt_formulas
#configure_salt_formulas
exec "$0" app:restart salt-master
;;
app:help)

View File

@@ -46,3 +46,8 @@ ok "salt-minion started"
salt "${TEST_MINION_ID}" test.ping || error "${TEST_MINION_ID} ping"
ok "${TEST_MINION_ID} ping"
# Test salt home permissions
# shellcheck disable=SC2016
docker-exec bash -c 'test $(stat -c "%U:%G" "${SALT_HOME}") = "${SALT_USER}:${SALT_USER}"' || error "salt home permissions"
ok "salt home permissions"