From 9999957f24fc8bfd1456898aa0454f2d1b0f65a1 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 4 Oct 2025 11:26:30 +0200 Subject: [PATCH 01/54] feat(bareos): Added Bareos 24 images based on Ubuntu 24.04 --- client/24-ubuntu/Dockerfile | 46 +++++++ client/24-ubuntu/docker-entrypoint.sh | 33 +++++ director-mysql/24-ubuntu/Dockerfile | 61 +++++++++ director-mysql/24-ubuntu/docker-entrypoint.sh | 121 +++++++++++++++++ director-mysql/24-ubuntu/webhook-notify | 41 ++++++ director-pgsql/24-ubuntu/Dockerfile | 60 ++++++++ director-pgsql/24-ubuntu/docker-entrypoint.sh | 128 ++++++++++++++++++ director-pgsql/24-ubuntu/webhook-notify | 41 ++++++ storage/24-ubuntu/Dockerfile | 48 +++++++ storage/24-ubuntu/docker-entrypoint.sh | 22 +++ webui/24-ubuntu/Dockerfile | 46 +++++++ webui/24-ubuntu/docker-entrypoint.sh | 26 ++++ 12 files changed, 673 insertions(+) create mode 100644 client/24-ubuntu/Dockerfile create mode 100644 client/24-ubuntu/docker-entrypoint.sh create mode 100644 director-mysql/24-ubuntu/Dockerfile create mode 100644 director-mysql/24-ubuntu/docker-entrypoint.sh create mode 100644 director-mysql/24-ubuntu/webhook-notify create mode 100644 director-pgsql/24-ubuntu/Dockerfile create mode 100644 director-pgsql/24-ubuntu/docker-entrypoint.sh create mode 100644 director-pgsql/24-ubuntu/webhook-notify create mode 100644 storage/24-ubuntu/Dockerfile create mode 100644 storage/24-ubuntu/docker-entrypoint.sh create mode 100644 webui/24-ubuntu/Dockerfile create mode 100644 webui/24-ubuntu/docker-entrypoint.sh diff --git a/client/24-ubuntu/Dockerfile b/client/24-ubuntu/Dockerfile new file mode 100644 index 00000000..1a28ae96 --- /dev/null +++ b/client/24-ubuntu/Dockerfile @@ -0,0 +1,46 @@ +# Dockerfile Bareos client/file daemon +FROM ubuntu:noble + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV BAREOS_DAEMON_USER bareos +ENV BAREOS_DAEMON_GROUP bareos +ENV DEBIAN_FRONTEND noninteractive +ENV BAREOS_KEY https://download.bareos.org/current/xUbuntu_24.04/Release.key +ENV BAREOS_REPO https://download.bareos.org/current/xUbuntu_24.04/ + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get -qq -y install --no-install-recommends curl tzdata gnupg gosu \ + && curl -Ls $BAREOS_KEY -o /tmp/bareos.key \ + && apt-key --keyring /etc/apt/trusted.gpg.d/breos-keyring.gpg \ + add /tmp/bareos.key \ + && echo "deb $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + bareos-client mysql-client postgresql-client bareos-tools \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod a+x /docker-entrypoint.sh + +RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d + +EXPOSE 9102 + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-fd", "-f"] diff --git a/client/24-ubuntu/docker-entrypoint.sh b/client/24-ubuntu/docker-entrypoint.sh new file mode 100644 index 00000000..3b1cbf43 --- /dev/null +++ b/client/24-ubuntu/docker-entrypoint.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +#set -x + +bareos_fd_config="/etc/bareos/bareos-fd.d/director/bareos-dir.conf" + +if [ "${FORCE_ROOT}" = true ]; then + BAREOS_DAEMON_USER='root' + BAREOS_DAEMON_GROUP='root' +fi + +if [ $(id -u) = '0' ]; then + [ -n "${PUID}" ] && usermod -u ${PUID} ${BAREOS_DAEMON_USER} + [ -n "${PGID}" ] && groupmod -g ${PGID} ${BAREOS_DAEMON_GROUP} + + if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-fd.tgz --backup=simple --suffix=.before-control + + # Force client/file daemon password + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' $bareos_fd_config + + # Control file + touch /etc/bareos/bareos-config.control + fi + + # Fix permissions + find /etc/bareos ! -user ${BAREOS_DAEMON_USER} -exec chown ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} {} \; + chown -R ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} /var/lib/bareos /var/log/bareos + + # Gosu + [ "${BAREOS_DAEMON_USER}" != 'root' ] && exec gosu "${BAREOS_DAEMON_USER}" "$BASH_SOURCE" "$@" +fi + +exec "$@" diff --git a/director-mysql/24-ubuntu/Dockerfile b/director-mysql/24-ubuntu/Dockerfile new file mode 100644 index 00000000..aba3748f --- /dev/null +++ b/director-mysql/24-ubuntu/Dockerfile @@ -0,0 +1,61 @@ +# Bareos director Dockerfile +FROM ubuntu:noble + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV DEBIAN_FRONTEND noninteractive +ENV BAREOS_KEY https://download.bareos.org/current/xUbuntu_24.04/Release.key +ENV BAREOS_REPO https://download.bareos.org/current/xUbuntu_24.04/ +ENV BAREOS_DPKG_CONF bareos-database-common bareos-database-common + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ + && curl -Ls $BAREOS_KEY -o /tmp/bareos.key \ + && apt-key --keyring /etc/apt/trusted.gpg.d/breos-keyring.gpg \ + add /tmp/bareos.key \ + && echo "deb $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/database-type select mysql" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/missing-db-package-error select ignore" \ + | debconf-set-selections \ + && echo 'postfix postfix/main_mailer_type select No configuration' \ + | debconf-set-selections \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + bareos bareos-database-mysql mysql-client \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN tar czf /bareos-dir.tgz /etc/bareos + +COPY webhook-notify /usr/local/bin/webhook-notify +RUN chmod u+x /usr/local/bin/webhook-notify + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +EXPOSE 9101 + +VOLUME /etc/bareos +VOLUME /var/lib/bareos + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-dir", "-u", "bareos", "-f"] diff --git a/director-mysql/24-ubuntu/docker-entrypoint.sh b/director-mysql/24-ubuntu/docker-entrypoint.sh new file mode 100644 index 00000000..085322a3 --- /dev/null +++ b/director-mysql/24-ubuntu/docker-entrypoint.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bash + +github_bareos='raw.githubusercontent.com/bareos/bareos' +webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control + + # Download default admin profile config + if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ + --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf + fi + + # Download default webUI admin config + if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ + --output /etc/bareos/bareos-dir.d/console/admin.conf + fi + + # Update bareos-director configs + # Director / mycatalog & mail report + sed -i "s#dbuser =.*#dbuser = ${DB_USER}#" \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbpassword =.*#dbpassword = '\""${DB_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbname =.*#dbname = '\""${DB_NAME}"\"' \n dbaddress = '\""${DB_HOST}"\"'\n dbport = '\""${DB_PORT}"\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + + # Setup webhook + if [ "${WEBHOOK_NOTIFICATION}" = true ]; then + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + fi + + # storage daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_SD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + + # client/file daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_FD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + + # webUI + sed -i 's#Password = .*#Password = '\""${BAREOS_WEBUI_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/console/admin.conf + sed -i "s#}# TlsEnable = false\n}#" \ + /etc/bareos/bareos-dir.d/console/admin.conf + + # MyCatalog Backup + sed -i "s#/var/lib/bareos/bareos.sql#/var/lib/bareos-director/${DB_NAME}.sql#" \ + /etc/bareos/bareos-dir.d/fileset/Catalog.conf + + # Control file + touch /etc/bareos/bareos-config.control +fi + +if [[ -z ${CI_TEST} ]] ; then + # MySQL check + # Waiting for mysqld + sqlup=1 + while [ "$sqlup" -ne 0 ] ; do + echo "Waiting for mysqld..." + mysqladmin --silent -u root -p"${DB_PASSWORD}" -h "${DB_HOST}" ping + if [ $? -ne 0 ] ; then + sqlup=1 + sleep 5 + else + sqlup=0 + echo "...mysqld is alive" + fi + done +fi + +# Set mysqld access for root +echo -e "[client]\nhost=${DB_HOST}\nuser=root\npassword=${DB_PASSWORD}" > /root/.my.cnf + +# Force statistics colum to 0 with mysqldump +echo -e '[mysqldump]\ncolumn-statistics=0' > /etc/mysql/conf.d/mysqldump-bareos.cnf + +# MySQL init for Bareos if required +if [ ! -f /etc/bareos/bareos-db.control ] ; then + # Init MySQL DB + mysql -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '${DB_PASSWORD}'" + mysql -e "GRANT ALL PRIVILEGES ON TABLE ${DB_NAME}.* TO ${DB_USER}@'%'" + mysql -e "FLUSH PRIVILEGES" + /usr/lib/bareos/scripts/create_bareos_database + /usr/lib/bareos/scripts/make_bareos_tables + + # Control file + touch /etc/bareos/bareos-db.control +else + # Try MySQL DB upgrade + /usr/lib/bareos/scripts/update_bareos_tables +fi + +# Fix permissions +find /etc/bareos/bareos-dir.d ! -user bareos -exec chown bareos {} \; +chown bareos:bareos /var/lib/bareos + +# Run Dockerfile CMD +exec "$@" diff --git a/director-mysql/24-ubuntu/webhook-notify b/director-mysql/24-ubuntu/webhook-notify new file mode 100644 index 00000000..801e3eaa --- /dev/null +++ b/director-mysql/24-ubuntu/webhook-notify @@ -0,0 +1,41 @@ +#!/usr/bin/env sh + +job_type=$1 +job_status=$2 +job_client=$3 +job_level=$4 +job_name=$5 +msg_icon="❌" + +if [ "$job_status" = "OK" ] ;then + msg_icon="✅" +fi + +msg_txt="$msg_icon Bareos: $job_type $job_status of $job_client \ +$job_level (${job_name})" + +load_json() +{ + if [ "${WEBHOOK_TYPE}" = "slack" ] ; then + cat < /etc/apt/sources.list.d/bareos.list \ + && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/database-type select pgsql" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/missing-db-package-error select ignore" \ + | debconf-set-selections \ + && echo 'postfix postfix/main_mailer_type select No configuration' \ + | debconf-set-selections \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + bareos postgresql-client bareos-tools \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN tar czf /bareos-dir.tgz /etc/bareos + +COPY webhook-notify /usr/local/bin/webhook-notify +RUN chmod u+x /usr/local/bin/webhook-notify + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +EXPOSE 9101 + +VOLUME /etc/bareos + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-dir", "-u", "bareos", "-f"] diff --git a/director-pgsql/24-ubuntu/docker-entrypoint.sh b/director-pgsql/24-ubuntu/docker-entrypoint.sh new file mode 100644 index 00000000..c6f3928e --- /dev/null +++ b/director-pgsql/24-ubuntu/docker-entrypoint.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash + +github_bareos='raw.githubusercontent.com/bareos/bareos' +webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control + + # Download default admin profile config + if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ + --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf + fi + + # Download default webUI admin config + if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ + --output /etc/bareos/bareos-dir.d/console/admin.conf + fi + + # Update bareos-director configs + # Director / mycatalog & mail report + sed -i 's#dbuser = "bareos"#dbuser = '\"${DB_USER}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbpassword = ""#dbpassword = '\"${DB_PASSWORD}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbname = "bareos"#dbname = '\"${DB_NAME}\"'\n dbaddress = '\"${DB_HOST}\"'\n dbport = '\"${DB_PORT}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + + # Setup webhook + if [ "${WEBHOOK_NOTIFICATION}" = true ]; then + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + fi + + # storage daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_SD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + + # client/file daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_FD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + + # webUI + sed -i 's#Password = .*#Password = '\""${BAREOS_WEBUI_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/console/admin.conf + sed -i "s#}# TlsEnable = false\n}#" \ + /etc/bareos/bareos-dir.d/console/admin.conf + + # MyCatalog Backup + sed -i "s#/var/lib/bareos/bareos.sql#/var/lib/bareos-director/bareos.sql#" \ + /etc/bareos/bareos-dir.d/fileset/Catalog.conf + + # Control file + touch /etc/bareos/bareos-config.control +fi + +if [[ -z ${CI_TEST} ]] ; then + # Waiting Postgresql is up + sqlup=1 + while [ "$sqlup" -ne 0 ] ; do + echo "Waiting for postgresql..." + pg_isready --host="${DB_HOST}" --port="${DB_PORT}" --user="${DB_ADMIN_USER}" + if [ $? -ne 0 ] ; then + sqlup=1 + sleep 5 + else + sqlup=0 + echo "...postgresql is alive" + fi + done +fi + +export PGUSER=${DB_ADMIN_USER} +export PGHOST=${DB_HOST} +export PGPASSWORD=${DB_ADMIN_PASSWORD} +[[ -z "${DB_INIT}" ]] && DB_INIT='false' +[[ -z "${DB_UPDATE}" ]] && DB_UPDATE='false' + +if [ ! -f /etc/bareos/bareos-db.control ] && [ "${DB_INIT}" == 'true' ] ; then + # Init Postgresql DB + echo "Bareos DB init" + echo "Bareos DB init: Create user ${DB_USER}" + psql -c "create user ${DB_USER} with createdb createrole login;" + echo "Bareos DB init: Set user password" + psql -c "alter user ${DB_USER} password '${DB_PASSWORD}';" + /usr/lib/bareos/scripts/create_bareos_database 2>/dev/null + /usr/lib/bareos/scripts/make_bareos_tables 2>/dev/null + /usr/lib/bareos/scripts/grant_bareos_privileges 2>/dev/null + + # Control file + touch /etc/bareos/bareos-db.control +fi + +if [ "${DB_UPDATE}" == 'true' ] ; then + # Try Postgres upgrade + echo "Bareoos DB update" + echo "Bareoos DB update: Update tables" + /usr/lib/bareos/scripts/update_bareos_tables 2>/dev/null + echo "Bareoos DB update: Grant privileges" + /usr/lib/bareos/scripts/grant_bareos_privileges 2>/dev/null +fi + +# Fix permissions +find /etc/bareos ! -user bareos -exec chown bareos {} \; +chown -R bareos:bareos /var/lib/bareos + +# Run Dockerfile CMD +exec "$@" diff --git a/director-pgsql/24-ubuntu/webhook-notify b/director-pgsql/24-ubuntu/webhook-notify new file mode 100644 index 00000000..801e3eaa --- /dev/null +++ b/director-pgsql/24-ubuntu/webhook-notify @@ -0,0 +1,41 @@ +#!/usr/bin/env sh + +job_type=$1 +job_status=$2 +job_client=$3 +job_level=$4 +job_name=$5 +msg_icon="❌" + +if [ "$job_status" = "OK" ] ;then + msg_icon="✅" +fi + +msg_txt="$msg_icon Bareos: $job_type $job_status of $job_client \ +$job_level (${job_name})" + +load_json() +{ + if [ "${WEBHOOK_TYPE}" = "slack" ] ; then + cat < /etc/apt/sources.list.d/bareos.list \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + bareos-storage bareos-tools bareos-storage-tape mtx scsitools \ + sg3-utils mt-st bareos-storage-droplet \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d + +EXPOSE 9103 + +VOLUME /etc/bareos +VOLUME /var/lib/bareos/storage + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-sd", "-u", "bareos", "-f"] diff --git a/storage/24-ubuntu/docker-entrypoint.sh b/storage/24-ubuntu/docker-entrypoint.sh new file mode 100644 index 00000000..a7134011 --- /dev/null +++ b/storage/24-ubuntu/docker-entrypoint.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +bareos_sd_config="/etc/bareos/bareos-sd.d/director/bareos-dir.conf" + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xfz /bareos-sd.tgz --backup=simple --suffix=.before-control + + # Update bareos-storage configs + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' $bareos_sd_config + + # Control file + touch /etc/bareos/bareos-config.control +fi + +# Fix permissions +find /var/lib/bareos ! -user bareos -exec chown bareos {} \; +find /etc/bareos/bareos-sd.d ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/[n]?st[0-9]+" ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/tape/.*" ! -user bareos -exec chown bareos {} \; + +# Run Dockerfile CMD +exec "$@" diff --git a/webui/24-ubuntu/Dockerfile b/webui/24-ubuntu/Dockerfile new file mode 100644 index 00000000..ba46a940 --- /dev/null +++ b/webui/24-ubuntu/Dockerfile @@ -0,0 +1,46 @@ +# Bareos Web-ui Dockerfile +FROM ubuntu:noble + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV BAREOS_KEY https://download.bareos.org/current/xUbuntu_24.04/Release.key +ENV BAREOS_REPO https://download.bareos.org/current/xUbuntu_24.04/ +ENV DEBIAN_FRONTEND noninteractive + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ + && curl -Ls $BAREOS_KEY -o /tmp/bareos.key \ + && apt-key --keyring /etc/apt/trusted.gpg.d/breos-keyring.gpg \ + add /tmp/bareos.key \ + && echo "deb $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + bareos-webui \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +RUN tar czf /bareos-webui.tgz /etc/bareos-webui + +EXPOSE 80 + +VOLUME /etc/bareos-webui + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] diff --git a/webui/24-ubuntu/docker-entrypoint.sh b/webui/24-ubuntu/docker-entrypoint.sh new file mode 100644 index 00000000..a951ee04 --- /dev/null +++ b/webui/24-ubuntu/docker-entrypoint.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env ash + +if [ ! -f /etc/bareos-webui/bareos-config.control ] + then + tar xfvz /bareos-webui-config.tgz + + # Update bareos-webui config + sed -i "s/diraddress = \"localhost\"/diraddress = \"${BAREOS_DIR_HOST}\"/" /etc/bareos-webui/directors.ini + + # Control file + touch /etc/bareos-webui/bareos-config.control +fi + +if [ ! -f /usr/share/bareos-webui/bareos-config.control ] + then + tar xfvz /bareos-webui-code.tgz + touch /usr/share/bareos-webui/bareos-config.control +fi + +# Fix nginx 'client_max_body_size' +sed -i "s#client_max_body_size 1m#client_max_body_size 20m#" /etc/nginx/nginx.conf + +# set php-fpm host andd port +sed -i "s/fastcgi_pass 127.0.0.1:9000;/fastcgi_pass ${PHP_FPM_HOST}:${PHP_FPM_PORT};/" /etc/nginx/http.d/bareos-webui.conf + +exec "$@" From 66d44e9a5e10491151d77e9a2c0f82b122f51c48 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 4 Oct 2025 11:43:23 +0200 Subject: [PATCH 02/54] fix(bareos): Issue with keyring, Debian/Ubuntu have deprecated the usage of apt-key --- client/24-ubuntu/Dockerfile | 6 ++---- director-mysql/24-ubuntu/Dockerfile | 6 ++---- director-pgsql/24-ubuntu/Dockerfile | 6 ++---- storage/24-ubuntu/Dockerfile | 6 ++---- webui/24-ubuntu/Dockerfile | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/client/24-ubuntu/Dockerfile b/client/24-ubuntu/Dockerfile index 1a28ae96..6bc1416a 100644 --- a/client/24-ubuntu/Dockerfile +++ b/client/24-ubuntu/Dockerfile @@ -25,10 +25,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update -qq \ && apt-get -qq -y install --no-install-recommends curl tzdata gnupg gosu \ - && curl -Ls $BAREOS_KEY -o /tmp/bareos.key \ - && apt-key --keyring /etc/apt/trusted.gpg.d/breos-keyring.gpg \ - add /tmp/bareos.key \ - && echo "deb $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && curl -Ls $BAREOS_KEY -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ bareos-client mysql-client postgresql-client bareos-tools \ diff --git a/director-mysql/24-ubuntu/Dockerfile b/director-mysql/24-ubuntu/Dockerfile index aba3748f..ca685d4b 100644 --- a/director-mysql/24-ubuntu/Dockerfile +++ b/director-mysql/24-ubuntu/Dockerfile @@ -24,10 +24,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update -qq \ && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY -o /tmp/bareos.key \ - && apt-key --keyring /etc/apt/trusted.gpg.d/breos-keyring.gpg \ - add /tmp/bareos.key \ - && echo "deb $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && curl -Ls $BAREOS_KEY -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ | debconf-set-selections \ && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ diff --git a/director-pgsql/24-ubuntu/Dockerfile b/director-pgsql/24-ubuntu/Dockerfile index e1fc9ac3..af0f0d68 100644 --- a/director-pgsql/24-ubuntu/Dockerfile +++ b/director-pgsql/24-ubuntu/Dockerfile @@ -24,10 +24,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update -qq \ && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY -o /tmp/bareos.key \ - && apt-key --keyring /etc/apt/trusted.gpg.d/breos-keyring.gpg \ - add /tmp/bareos.key \ - && echo "deb $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && curl -Ls $BAREOS_KEY -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ | debconf-set-selections \ && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ diff --git a/storage/24-ubuntu/Dockerfile b/storage/24-ubuntu/Dockerfile index 40a17716..adebd227 100644 --- a/storage/24-ubuntu/Dockerfile +++ b/storage/24-ubuntu/Dockerfile @@ -23,10 +23,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update -qq \ && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY -o /tmp/bareos.key \ - && apt-key --keyring /etc/apt/trusted.gpg.d/breos-keyring.gpg \ - add /tmp/bareos.key \ - && echo "deb $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && curl -Ls $BAREOS_KEY -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ bareos-storage bareos-tools bareos-storage-tape mtx scsitools \ diff --git a/webui/24-ubuntu/Dockerfile b/webui/24-ubuntu/Dockerfile index ba46a940..9a147972 100644 --- a/webui/24-ubuntu/Dockerfile +++ b/webui/24-ubuntu/Dockerfile @@ -23,10 +23,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update -qq \ && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY -o /tmp/bareos.key \ - && apt-key --keyring /etc/apt/trusted.gpg.d/breos-keyring.gpg \ - add /tmp/bareos.key \ - && echo "deb $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && curl -Ls $BAREOS_KEY -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ bareos-webui \ From ed3b4a9e0579633fb2e26a0f2418cb102dc03f76 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 4 Oct 2025 11:54:45 +0200 Subject: [PATCH 03/54] fix(bareos): GPG key issue --- client/24-ubuntu/Dockerfile | 12 +- director-mysql/24-ubuntu/Dockerfile | 59 --------- director-mysql/24-ubuntu/docker-entrypoint.sh | 121 ------------------ director-mysql/24-ubuntu/webhook-notify | 41 ------ director-pgsql/24-ubuntu/Dockerfile | 12 +- storage/24-ubuntu/Dockerfile | 8 +- webui/24-ubuntu/Dockerfile | 8 +- 7 files changed, 20 insertions(+), 241 deletions(-) delete mode 100644 director-mysql/24-ubuntu/Dockerfile delete mode 100644 director-mysql/24-ubuntu/docker-entrypoint.sh delete mode 100644 director-mysql/24-ubuntu/webhook-notify diff --git a/client/24-ubuntu/Dockerfile b/client/24-ubuntu/Dockerfile index 6bc1416a..a60cbc83 100644 --- a/client/24-ubuntu/Dockerfile +++ b/client/24-ubuntu/Dockerfile @@ -15,17 +15,17 @@ LABEL org.label-schema.schema-version="1.0" \ org.label-schema.vcs-url="https://github.com/barcus/bareos" \ org.label-schema.version=$VERSION -ENV BAREOS_DAEMON_USER bareos -ENV BAREOS_DAEMON_GROUP bareos -ENV DEBIAN_FRONTEND noninteractive -ENV BAREOS_KEY https://download.bareos.org/current/xUbuntu_24.04/Release.key -ENV BAREOS_REPO https://download.bareos.org/current/xUbuntu_24.04/ +ENV BAREOS_DAEMON_USER=bareos +ENV BAREOS_DAEMON_GROUP=bareos +ENV DEBIAN_FRONTEND=noninteractive +ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_24.04/Release.key +ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_24.04/ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update -qq \ && apt-get -qq -y install --no-install-recommends curl tzdata gnupg gosu \ - && curl -Ls $BAREOS_KEY -o /usr/share/keyrings/bareos.gpg \ + && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ diff --git a/director-mysql/24-ubuntu/Dockerfile b/director-mysql/24-ubuntu/Dockerfile deleted file mode 100644 index ca685d4b..00000000 --- a/director-mysql/24-ubuntu/Dockerfile +++ /dev/null @@ -1,59 +0,0 @@ -# Bareos director Dockerfile -FROM ubuntu:noble - -LABEL maintainer="barcus@tou.nu" - -ARG BUILD_DATE -ARG NAME -ARG VCS_REF -ARG VERSION - -LABEL org.label-schema.schema-version="1.0" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name=$NAME \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/barcus/bareos" \ - org.label-schema.version=$VERSION - -ENV DEBIAN_FRONTEND noninteractive -ENV BAREOS_KEY https://download.bareos.org/current/xUbuntu_24.04/Release.key -ENV BAREOS_REPO https://download.bareos.org/current/xUbuntu_24.04/ -ENV BAREOS_DPKG_CONF bareos-database-common bareos-database-common - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN apt-get update -qq \ - && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY -o /usr/share/keyrings/bareos.gpg \ - && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ - && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ - | debconf-set-selections \ - && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ - | debconf-set-selections \ - && echo "${BAREOS_DPKG_CONF}/database-type select mysql" \ - | debconf-set-selections \ - && echo "${BAREOS_DPKG_CONF}/missing-db-package-error select ignore" \ - | debconf-set-selections \ - && echo 'postfix postfix/main_mailer_type select No configuration' \ - | debconf-set-selections \ - && apt-get update -qq \ - && apt-get install -qq -y --no-install-recommends \ - bareos bareos-database-mysql mysql-client \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN tar czf /bareos-dir.tgz /etc/bareos - -COPY webhook-notify /usr/local/bin/webhook-notify -RUN chmod u+x /usr/local/bin/webhook-notify - -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN chmod u+x /docker-entrypoint.sh - -EXPOSE 9101 - -VOLUME /etc/bareos -VOLUME /var/lib/bareos - -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["/usr/sbin/bareos-dir", "-u", "bareos", "-f"] diff --git a/director-mysql/24-ubuntu/docker-entrypoint.sh b/director-mysql/24-ubuntu/docker-entrypoint.sh deleted file mode 100644 index 085322a3..00000000 --- a/director-mysql/24-ubuntu/docker-entrypoint.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env bash - -github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' - -if [ ! -f /etc/bareos/bareos-config.control ]; then - tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control - - # Download default admin profile config - if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ - --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf - fi - - # Download default webUI admin config - if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ - --output /etc/bareos/bareos-dir.d/console/admin.conf - fi - - # Update bareos-director configs - # Director / mycatalog & mail report - sed -i "s#dbuser =.*#dbuser = ${DB_USER}#" \ - /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf - sed -i 's#dbpassword =.*#dbpassword = '\""${DB_PASSWORD}"\"'#' \ - /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf - sed -i 's#dbname =.*#dbname = '\""${DB_NAME}"\"' \n dbaddress = '\""${DB_HOST}"\"'\n dbport = '\""${DB_PORT}"\"'#' \ - /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf - [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ - /etc/bareos/bareos-dir.d/messages/Daemon.conf - sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ - /etc/bareos/bareos-dir.d/messages/Daemon.conf - sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ - /etc/bareos/bareos-dir.d/messages/Daemon.conf - [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ - /etc/bareos/bareos-dir.d/messages/Standard.conf - sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ - /etc/bareos/bareos-dir.d/messages/Standard.conf - sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ - /etc/bareos/bareos-dir.d/messages/Standard.conf - - # Setup webhook - if [ "${WEBHOOK_NOTIFICATION}" = true ]; then - sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ - /etc/bareos/bareos-dir.d/messages/Daemon.conf - sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ - /etc/bareos/bareos-dir.d/messages/Standard.conf - fi - - # storage daemon - sed -i 's#Address = .*#Address = '\""${BAREOS_SD_HOST}"\"'#' \ - /etc/bareos/bareos-dir.d/storage/File.conf - sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' \ - /etc/bareos/bareos-dir.d/storage/File.conf - - # client/file daemon - sed -i 's#Address = .*#Address = '\""${BAREOS_FD_HOST}"\"'#' \ - /etc/bareos/bareos-dir.d/client/bareos-fd.conf - sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' \ - /etc/bareos/bareos-dir.d/client/bareos-fd.conf - - # webUI - sed -i 's#Password = .*#Password = '\""${BAREOS_WEBUI_PASSWORD}"\"'#' \ - /etc/bareos/bareos-dir.d/console/admin.conf - sed -i "s#}# TlsEnable = false\n}#" \ - /etc/bareos/bareos-dir.d/console/admin.conf - - # MyCatalog Backup - sed -i "s#/var/lib/bareos/bareos.sql#/var/lib/bareos-director/${DB_NAME}.sql#" \ - /etc/bareos/bareos-dir.d/fileset/Catalog.conf - - # Control file - touch /etc/bareos/bareos-config.control -fi - -if [[ -z ${CI_TEST} ]] ; then - # MySQL check - # Waiting for mysqld - sqlup=1 - while [ "$sqlup" -ne 0 ] ; do - echo "Waiting for mysqld..." - mysqladmin --silent -u root -p"${DB_PASSWORD}" -h "${DB_HOST}" ping - if [ $? -ne 0 ] ; then - sqlup=1 - sleep 5 - else - sqlup=0 - echo "...mysqld is alive" - fi - done -fi - -# Set mysqld access for root -echo -e "[client]\nhost=${DB_HOST}\nuser=root\npassword=${DB_PASSWORD}" > /root/.my.cnf - -# Force statistics colum to 0 with mysqldump -echo -e '[mysqldump]\ncolumn-statistics=0' > /etc/mysql/conf.d/mysqldump-bareos.cnf - -# MySQL init for Bareos if required -if [ ! -f /etc/bareos/bareos-db.control ] ; then - # Init MySQL DB - mysql -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '${DB_PASSWORD}'" - mysql -e "GRANT ALL PRIVILEGES ON TABLE ${DB_NAME}.* TO ${DB_USER}@'%'" - mysql -e "FLUSH PRIVILEGES" - /usr/lib/bareos/scripts/create_bareos_database - /usr/lib/bareos/scripts/make_bareos_tables - - # Control file - touch /etc/bareos/bareos-db.control -else - # Try MySQL DB upgrade - /usr/lib/bareos/scripts/update_bareos_tables -fi - -# Fix permissions -find /etc/bareos/bareos-dir.d ! -user bareos -exec chown bareos {} \; -chown bareos:bareos /var/lib/bareos - -# Run Dockerfile CMD -exec "$@" diff --git a/director-mysql/24-ubuntu/webhook-notify b/director-mysql/24-ubuntu/webhook-notify deleted file mode 100644 index 801e3eaa..00000000 --- a/director-mysql/24-ubuntu/webhook-notify +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env sh - -job_type=$1 -job_status=$2 -job_client=$3 -job_level=$4 -job_name=$5 -msg_icon="❌" - -if [ "$job_status" = "OK" ] ;then - msg_icon="✅" -fi - -msg_txt="$msg_icon Bareos: $job_type $job_status of $job_client \ -$job_level (${job_name})" - -load_json() -{ - if [ "${WEBHOOK_TYPE}" = "slack" ] ; then - cat < /etc/apt/sources.list.d/bareos.list \ && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ | debconf-set-selections \ @@ -38,7 +38,7 @@ RUN apt-get update -qq \ | debconf-set-selections \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ - bareos postgresql-client bareos-tools \ + bareos postgresql-client bareos-database-tools \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/storage/24-ubuntu/Dockerfile b/storage/24-ubuntu/Dockerfile index adebd227..3e3ede93 100644 --- a/storage/24-ubuntu/Dockerfile +++ b/storage/24-ubuntu/Dockerfile @@ -15,15 +15,15 @@ LABEL org.label-schema.schema-version="1.0" \ org.label-schema.vcs-url="https://github.com/barcus/bareos" \ org.label-schema.version=$VERSION -ENV BAREOS_KEY https://download.bareos.org/current/xUbuntu_24.04/Release.key -ENV BAREOS_REPO https://download.bareos.org/current/xUbuntu_24.04/ -ENV DEBIAN_FRONTEND noninteractive +ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_24.04/Release.key +ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_24.04/ +ENV DEBIAN_FRONTEND=noninteractive SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update -qq \ && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY -o /usr/share/keyrings/bareos.gpg \ + && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ diff --git a/webui/24-ubuntu/Dockerfile b/webui/24-ubuntu/Dockerfile index 9a147972..bcf32581 100644 --- a/webui/24-ubuntu/Dockerfile +++ b/webui/24-ubuntu/Dockerfile @@ -15,15 +15,15 @@ LABEL org.label-schema.schema-version="1.0" \ org.label-schema.vcs-url="https://github.com/barcus/bareos" \ org.label-schema.version=$VERSION -ENV BAREOS_KEY https://download.bareos.org/current/xUbuntu_24.04/Release.key -ENV BAREOS_REPO https://download.bareos.org/current/xUbuntu_24.04/ -ENV DEBIAN_FRONTEND noninteractive +ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_24.04/Release.key +ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_24.04/ +ENV DEBIAN_FRONTEND=noninteractive SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update -qq \ && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY -o /usr/share/keyrings/bareos.gpg \ + && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ From bbc45d2d59288dee48c75885403a370376b5d155 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Tue, 18 Nov 2025 20:09:38 +0100 Subject: [PATCH 04/54] Update lint job to use ubuntu-latest --- .github/workflows/test-n-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-n-lint.yml b/.github/workflows/test-n-lint.yml index c1819165..990867c5 100644 --- a/.github/workflows/test-n-lint.yml +++ b/.github/workflows/test-n-lint.yml @@ -25,7 +25,7 @@ jobs: done lint-markdown: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 From e3c0dc00f99ef39ffd89d046a8dfcedad9bcdc8f Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Tue, 18 Nov 2025 20:29:58 +0100 Subject: [PATCH 05/54] chore(gh-actions): Changed repo url and runner --- .github/actions/push-bareos-app/action.yml | 10 +++++++++- .github/actions/push-bareos-app/entrypoint.sh | 2 +- .github/workflows/ci-api.yml | 2 ++ .github/workflows/ci-bareos-app.tmpl | 2 ++ .github/workflows/ci-client.yml | 2 ++ .github/workflows/ci-director.yml | 2 ++ .github/workflows/ci-storage.yml | 2 ++ .github/workflows/ci-webui.yml | 2 ++ .github/workflows/push-readme.yml | 4 ++-- 9 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/actions/push-bareos-app/action.yml b/.github/actions/push-bareos-app/action.yml index 6bfbf692..6b5a4241 100644 --- a/.github/actions/push-bareos-app/action.yml +++ b/.github/actions/push-bareos-app/action.yml @@ -3,10 +3,18 @@ description: 'Push Bareos docker images to Docker Hub' author: 'Barcus' inputs: docker_pass: - description: 'Docker Hub password' + description: 'Registry Password' required: true + docker_user: + description: 'Registry Username' + required: true + registry: + description: 'Registry URL' + required: false runs: using: 'docker' image: 'Dockerfile' args: + - ${{ inputs.docker_user }} - ${{ inputs.docker_pass }} + - ${{ inputs.registry }} diff --git a/.github/actions/push-bareos-app/entrypoint.sh b/.github/actions/push-bareos-app/entrypoint.sh index a8d49745..a05525e5 100755 --- a/.github/actions/push-bareos-app/entrypoint.sh +++ b/.github/actions/push-bareos-app/entrypoint.sh @@ -15,7 +15,7 @@ done echo ::endgroup:: # Connect Docker Hub -docker login -u 'barcus' -p "${INPUT_DOCKER_PASS}" +docker login "${INPUT_REGISTRY}" -u "${INPUT_DOCKER_USER}" -p "${INPUT_DOCKER_PASS}" # Push tags and manfiests echo ::group::Push build tags diff --git a/.github/workflows/ci-api.yml b/.github/workflows/ci-api.yml index e236c85f..25a6597c 100644 --- a/.github/workflows/ci-api.yml +++ b/.github/workflows/ci-api.yml @@ -111,3 +111,5 @@ jobs: uses: ./.github/actions/push-bareos-app with: docker_pass: ${{ secrets.DOCKER_PASS }} + docker_user: ${{ secrets.DOCKER_USER }} + registry: ${{ secrets.REGISTRY_URL }} diff --git a/.github/workflows/ci-bareos-app.tmpl b/.github/workflows/ci-bareos-app.tmpl index 6af69c1c..44e72fc5 100644 --- a/.github/workflows/ci-bareos-app.tmpl +++ b/.github/workflows/ci-bareos-app.tmpl @@ -111,3 +111,5 @@ jobs: uses: ./.github/actions/push-bareos-app with: docker_pass: ${{ secrets.DOCKER_PASS }} + docker_user: ${{ secrets.DOCKER_USER }} + registry: ${{ secrets.REGISTRY_URL }} diff --git a/.github/workflows/ci-client.yml b/.github/workflows/ci-client.yml index 8948346d..3d22a393 100644 --- a/.github/workflows/ci-client.yml +++ b/.github/workflows/ci-client.yml @@ -111,3 +111,5 @@ jobs: uses: ./.github/actions/push-bareos-app with: docker_pass: ${{ secrets.DOCKER_PASS }} + docker_user: ${{ secrets.DOCKER_USER }} + registry: ${{ secrets.REGISTRY_URL }} diff --git a/.github/workflows/ci-director.yml b/.github/workflows/ci-director.yml index ba7f90f0..b6cbf915 100644 --- a/.github/workflows/ci-director.yml +++ b/.github/workflows/ci-director.yml @@ -111,3 +111,5 @@ jobs: uses: ./.github/actions/push-bareos-app with: docker_pass: ${{ secrets.DOCKER_PASS }} + docker_user: ${{ secrets.DOCKER_USER }} + registry: ${{ secrets.REGISTRY_URL }} diff --git a/.github/workflows/ci-storage.yml b/.github/workflows/ci-storage.yml index 32a7a5f2..241abc7c 100644 --- a/.github/workflows/ci-storage.yml +++ b/.github/workflows/ci-storage.yml @@ -111,3 +111,5 @@ jobs: uses: ./.github/actions/push-bareos-app with: docker_pass: ${{ secrets.DOCKER_PASS }} + docker_user: ${{ secrets.DOCKER_USER }} + registry: ${{ secrets.REGISTRY_URL }} diff --git a/.github/workflows/ci-webui.yml b/.github/workflows/ci-webui.yml index 88f2bf1a..ef3df49c 100644 --- a/.github/workflows/ci-webui.yml +++ b/.github/workflows/ci-webui.yml @@ -111,3 +111,5 @@ jobs: uses: ./.github/actions/push-bareos-app with: docker_pass: ${{ secrets.DOCKER_PASS }} + docker_user: ${{ secrets.DOCKER_USER }} + registry: ${{ secrets.REGISTRY_URL }} diff --git a/.github/workflows/push-readme.yml b/.github/workflows/push-readme.yml index 664c4a0a..276a2133 100644 --- a/.github/workflows/push-readme.yml +++ b/.github/workflows/push-readme.yml @@ -23,6 +23,6 @@ jobs: - name: Update Docker Hub description uses: peter-evans/dockerhub-description@v4.0.0 env: - DOCKERHUB_USERNAME: barcus + DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USER }} DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASS }} - DOCKERHUB_REPOSITORY: barcus/bareos-${{ matrix.module }} + DOCKERHUB_REPOSITORY: ${{ secrets.REGISTRY_URL }}/bareos/bareos-${{ matrix.module }} From aed2d02392506b3297d1f49f7f3898254ad72899 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Tue, 18 Nov 2025 21:51:45 +0100 Subject: [PATCH 06/54] Update Docker push commands to use INPUT_REGISTRY --- .github/actions/push-bareos-app/entrypoint.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/actions/push-bareos-app/entrypoint.sh b/.github/actions/push-bareos-app/entrypoint.sh index a05525e5..5d1970d0 100755 --- a/.github/actions/push-bareos-app/entrypoint.sh +++ b/.github/actions/push-bareos-app/entrypoint.sh @@ -27,10 +27,10 @@ while read line ; do re='^[0-9]+-alpine.*$' if [[ $version =~ $re ]] ; then build_tag="${version}-${arch}" - rm_tag="$rm_tag ${GITHUB_REPOSITORY}-${app}:${build_tag}" + rm_tag="$rm_tag ${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${build_tag}" fi # Push build tags - docker push "${GITHUB_REPOSITORY}-${app}:${build_tag}" + docker push "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${build_tag}" done < "${workdir}/app_build.txt" echo ::endgroup:: @@ -38,16 +38,16 @@ echo ::group::Push additional tags while read build_app s_tag t_tag ; do # Push additional tags for Ubuntu if [[ $s_tag =~ ^[a-z0-9]+-ubuntu.*$ ]]; then - docker tag "${GITHUB_REPOSITORY}-${build_app}:${s_tag}" \ - "${GITHUB_REPOSITORY}-${build_app}:${t_tag}" - docker push "${GITHUB_REPOSITORY}-${build_app}:${t_tag}" + docker tag "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}" \ + "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" + docker push "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" fi # Create and push manifest for Alpine (arm64 + amd64) if [[ $s_tag =~ ^[a-z0-9]+-alpine.*$ ]]; then - docker manifest create "${GITHUB_REPOSITORY}-${build_app}:${t_tag}" \ - "${GITHUB_REPOSITORY}-${build_app}:${s_tag}-amd64" \ - "${GITHUB_REPOSITORY}-${build_app}:${s_tag}-arm64" - docker manifest push "${GITHUB_REPOSITORY}-${build_app}:${t_tag}" + docker manifest create "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" \ + "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}-amd64" \ + "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}-arm64" + docker manifest push "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" fi done < "${workdir}/tag_build.txt" echo ::endgroup:: From e8dc99dfc23ab0f570ee1e01254030056c5f6c58 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Wed, 19 Nov 2025 15:52:35 +0100 Subject: [PATCH 07/54] fix(ci): Image building --- .github/actions/build-bareos-app/action.yml | 6 ++++++ .github/actions/build-bareos-app/entrypoint.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-bareos-app/action.yml b/.github/actions/build-bareos-app/action.yml index 04102925..478b6670 100644 --- a/.github/actions/build-bareos-app/action.yml +++ b/.github/actions/build-bareos-app/action.yml @@ -1,6 +1,12 @@ name: 'build-bareos-app' description: 'Build Bareos app images' author: 'Barcus' +inputs: + registry: + description: 'Registry URL' + required: true runs: using: 'docker' image: 'Dockerfile' + args: + - ${{ inputs.registry }} diff --git a/.github/actions/build-bareos-app/entrypoint.sh b/.github/actions/build-bareos-app/entrypoint.sh index 55d04820..f8c17f06 100755 --- a/.github/actions/build-bareos-app/entrypoint.sh +++ b/.github/actions/build-bareos-app/entrypoint.sh @@ -32,7 +32,7 @@ while read app version arch app_path ; do --build-arg VCS_REF=$(git rev-parse --short HEAD) \ --build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ --build-arg NAME="${GITHUB_REPOSITORY}-${app}" \ - --output "type=docker,dest=${workdir}/bareos-${app}-${tag}.tar,name=${GITHUB_REPOSITORY}-${app}:${tag}" \ + --output "type=docker,dest=${workdir}/bareos-${app}-${tag}.tar,name=${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${tag}" \ "${app_path}" if [[ $? -ne 0 ]] ; then From 5c25f16eea8d8f131e123805917009d34c378230 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Wed, 19 Nov 2025 16:00:33 +0100 Subject: [PATCH 08/54] fix(ci): test phase missing registry url --- .github/actions/test-bareos-app/action.yml | 6 ++++++ .github/actions/test-bareos-app/entrypoint.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/test-bareos-app/action.yml b/.github/actions/test-bareos-app/action.yml index d2216534..9b6e0f11 100644 --- a/.github/actions/test-bareos-app/action.yml +++ b/.github/actions/test-bareos-app/action.yml @@ -1,6 +1,12 @@ name: 'test-bareos-app' description: 'Test Bareos docker images' author: 'Barcus' +inputs: + registry: + description: 'Registry URL' + required: true runs: using: 'docker' image: 'Dockerfile' + args: + - ${{ inputs.registry }} diff --git a/.github/actions/test-bareos-app/entrypoint.sh b/.github/actions/test-bareos-app/entrypoint.sh index af174550..4b45cf66 100755 --- a/.github/actions/test-bareos-app/entrypoint.sh +++ b/.github/actions/test-bareos-app/entrypoint.sh @@ -48,7 +48,7 @@ while read app version arch path ; do # Run docker and check version img_version=$(docker run -t --rm ${ARGS} \ - ${GITHUB_REPOSITORY}-${app}:${build_tag} \ + ${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${build_tag} \ ${CMD} | tail -1) if [[ $version =~ $re_alpine ]] ; then From 9a745329e3df556a0e42942ddcc7922555016fd1 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Wed, 19 Nov 2025 16:11:31 +0100 Subject: [PATCH 09/54] fix(ci): Missing inputs from secret --- .github/workflows/ci-api.yml | 5 +++++ .github/workflows/ci-bareos-app.tmpl | 5 +++++ .github/workflows/ci-client.yml | 5 +++++ .github/workflows/ci-director.yml | 5 +++++ .github/workflows/ci-storage.yml | 5 +++++ .github/workflows/ci-webui.yml | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/.github/workflows/ci-api.yml b/.github/workflows/ci-api.yml index 25a6597c..11ac04a8 100644 --- a/.github/workflows/ci-api.yml +++ b/.github/workflows/ci-api.yml @@ -32,6 +32,7 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: api + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -61,6 +62,8 @@ jobs: - name: Build images uses: ./.github/actions/build-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -90,6 +93,8 @@ jobs: - name: Load and test images uses: ./.github/actions/test-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} deploy: needs: test diff --git a/.github/workflows/ci-bareos-app.tmpl b/.github/workflows/ci-bareos-app.tmpl index 44e72fc5..0e798ac9 100644 --- a/.github/workflows/ci-bareos-app.tmpl +++ b/.github/workflows/ci-bareos-app.tmpl @@ -32,6 +32,7 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: __BAREOS_APP__ + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -61,6 +62,8 @@ jobs: - name: Build images uses: ./.github/actions/build-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -90,6 +93,8 @@ jobs: - name: Load and test images uses: ./.github/actions/test-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} deploy: needs: test diff --git a/.github/workflows/ci-client.yml b/.github/workflows/ci-client.yml index 3d22a393..5f7589e7 100644 --- a/.github/workflows/ci-client.yml +++ b/.github/workflows/ci-client.yml @@ -32,6 +32,7 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: client + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -61,6 +62,8 @@ jobs: - name: Build images uses: ./.github/actions/build-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -90,6 +93,8 @@ jobs: - name: Load and test images uses: ./.github/actions/test-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} deploy: needs: test diff --git a/.github/workflows/ci-director.yml b/.github/workflows/ci-director.yml index b6cbf915..a03a1889 100644 --- a/.github/workflows/ci-director.yml +++ b/.github/workflows/ci-director.yml @@ -32,6 +32,7 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: director + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -61,6 +62,8 @@ jobs: - name: Build images uses: ./.github/actions/build-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -90,6 +93,8 @@ jobs: - name: Load and test images uses: ./.github/actions/test-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} deploy: needs: test diff --git a/.github/workflows/ci-storage.yml b/.github/workflows/ci-storage.yml index 241abc7c..0596fc29 100644 --- a/.github/workflows/ci-storage.yml +++ b/.github/workflows/ci-storage.yml @@ -32,6 +32,7 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: storage + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -61,6 +62,8 @@ jobs: - name: Build images uses: ./.github/actions/build-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -90,6 +93,8 @@ jobs: - name: Load and test images uses: ./.github/actions/test-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} deploy: needs: test diff --git a/.github/workflows/ci-webui.yml b/.github/workflows/ci-webui.yml index ef3df49c..0124efb4 100644 --- a/.github/workflows/ci-webui.yml +++ b/.github/workflows/ci-webui.yml @@ -32,6 +32,7 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: webui + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -61,6 +62,8 @@ jobs: - name: Build images uses: ./.github/actions/build-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 @@ -90,6 +93,8 @@ jobs: - name: Load and test images uses: ./.github/actions/test-bareos-app + with: + registry: ${{ secrets.REGISTRY_URL }} deploy: needs: test From f702c1d15bd4dbdf856cdfb7baa9acaf766d9444 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Fri, 21 Nov 2025 16:39:04 +0100 Subject: [PATCH 10/54] feat(director): Add alpine 3.22 with Bareos 24 --- director-pgsql/24-alpine/Dockerfile | 38 +++++ director-pgsql/24-alpine/docker-entrypoint.sh | 136 ++++++++++++++++++ director-pgsql/24-alpine/webhook-notify | 41 ++++++ 3 files changed, 215 insertions(+) create mode 100644 director-pgsql/24-alpine/Dockerfile create mode 100644 director-pgsql/24-alpine/docker-entrypoint.sh create mode 100644 director-pgsql/24-alpine/webhook-notify diff --git a/director-pgsql/24-alpine/Dockerfile b/director-pgsql/24-alpine/Dockerfile new file mode 100644 index 00000000..0bb1fff9 --- /dev/null +++ b/director-pgsql/24-alpine/Dockerfile @@ -0,0 +1,38 @@ +# Bareos director Dockerfile +FROM alpine:3.22 + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] + +RUN apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar + +RUN tar czf /bareos-dir.tgz /etc/bareos +RUN mkdir /run/bareos \ + && chown bareos /run/bareos + +COPY webhook-notify /usr/local/bin/webhook-notify +RUN chmod u+x /usr/local/bin/webhook-notify + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +EXPOSE 9101 + +VOLUME /etc/bareos +VOLUME /var/lib/bareos + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-dir", "-u", "bareos", "-f"] diff --git a/director-pgsql/24-alpine/docker-entrypoint.sh b/director-pgsql/24-alpine/docker-entrypoint.sh new file mode 100644 index 00000000..d7b716bb --- /dev/null +++ b/director-pgsql/24-alpine/docker-entrypoint.sh @@ -0,0 +1,136 @@ +#!/usr/bin/env ash + +github_bareos='raw.githubusercontent.com/bareos/bareos' +webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control + + # Download default admin profile config + if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ + --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf + fi + + # Download default webUI admin config + if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ + --output /etc/bareos/bareos-dir.d/console/admin.conf + fi + + # Update bareos-director configs + # Director / mycatalog & mail report + sed -i "s#dbuser =.*#dbuser = $DB_USER#" \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbpassword =.*#dbpassword = '\""${DB_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbname =.*#dbname = '\""${DB_NAME}"\"'\n dbaddress = '\""${DB_HOST}"\"'\n dbport = '\""${DB_PORT}"\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbdriver = .*#dbdriver = '\""postgresql"\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#g" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + + # Setup webhook + if [ "${WEBHOOK_NOTIFICATION}" = true ]; then + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + fi + + # storage daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_SD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + + # client/file daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_FD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + + # webUI + sed -i 's#Password = .*#Password = '\""${BAREOS_WEBUI_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/console/admin.conf + + + # MyCatalog Backup + sed -i "s#/var/lib/bareos/bareos.sql#/var/lib/bareos-director/bareos.sql#" \ + /etc/bareos/bareos-dir.d/fileset/Catalog.conf + sed -i "s#make_catalog_backup MyCatalog#make_catalog_backup ${DB_NAME} ${DB_USER} '' ${DB_HOST}#" \ + /etc/bareos/bareos-dir.d/job/BackupCatalog.conf + + # Add pgpass file to ${DB_USER} home + homedir=$(getent passwd "$DB_USER" | cut -d: -f6) + echo "${DB_HOST}:${DB_PORT}:${DB_NAME}:${DB_USER}:${DB_PASSWORD}" > "${homedir}/.pgpass" + chmod 600 "${homedir}/.pgpass" + chown "${DB_USER}" "${homedir}/.pgpass" + + # Control file + touch /etc/bareos/bareos-config.control +fi + +if [[ -z ${CI_TEST} ]] ; then + # Waiting Postgresql is up + sqlup=1 + while [ "$sqlup" -ne 0 ] ; do + echo "Waiting for postgresql..." + pg_isready --host="${DB_HOST}" --port="${DB_PORT}" --user="${DB_ADMIN_USER}" + if [ $? -ne 0 ] ; then + sqlup=1 + sleep 5 + else + sqlup=0 + echo "...postgresql is alive" + fi + done +fi + +export PGUSER=${DB_ADMIN_USER} +export PGHOST=${DB_HOST} +export PGPASSWORD=${DB_ADMIN_PASSWORD} +[[ -z "${DB_INIT}" ]] && DB_INIT='false' +[[ -z "${DB_UPDATE}" ]] && DB_UPDATE='false' + +if [ ! -f /etc/bareos/bareos-db.control ] && [ "${DB_INIT}" == 'true' ] ; then + # Init Postgres DB + echo "Bareos DB init" + echo "Bareos DB init: Create user ${DB_USER}" + psql -c "create user ${DB_USER} with createdb createrole login;" + echo "Bareos DB init: Set user password" + psql -c "alter user ${DB_USER} password '${DB_PASSWORD}';" + /etc/bareos/scripts/create_bareos_database 2>/dev/null + /etc/bareos/scripts/make_bareos_tables 2>/dev/null + /etc/bareos/scripts/grant_bareos_privileges 2>/dev/null + # Control file + touch /etc/bareos/bareos-db.control +fi + +if [ "${DB_UPDATE}" == 'true' ] ; then + # Try Postgres upgrade + echo "Bareoos DB update" + echo "Bareoos DB update: Update tables" + /etc/bareos/scripts/update_bareos_tables 2>/dev/null + echo "Bareoos DB update: Grant privileges" + /etc/bareos/scripts/grant_bareos_privileges 2>/dev/null +fi + +# Fix permissions +find /etc/bareos ! -user bareos -exec chown bareos {} \; +chown -R bareos:bareos /var/lib/bareos /var/log/bareos + +# Run Dockerfile CMD +exec "$@" diff --git a/director-pgsql/24-alpine/webhook-notify b/director-pgsql/24-alpine/webhook-notify new file mode 100644 index 00000000..801e3eaa --- /dev/null +++ b/director-pgsql/24-alpine/webhook-notify @@ -0,0 +1,41 @@ +#!/usr/bin/env sh + +job_type=$1 +job_status=$2 +job_client=$3 +job_level=$4 +job_name=$5 +msg_icon="❌" + +if [ "$job_status" = "OK" ] ;then + msg_icon="✅" +fi + +msg_txt="$msg_icon Bareos: $job_type $job_status of $job_client \ +$job_level (${job_name})" + +load_json() +{ + if [ "${WEBHOOK_TYPE}" = "slack" ] ; then + cat < Date: Fri, 21 Nov 2025 16:45:51 +0100 Subject: [PATCH 11/54] chore(ci): Test bump --- .github/actions/prepare-bareos-app/entrypoint.sh | 6 +++--- director-pgsql/24-alpine/docker-entrypoint.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/prepare-bareos-app/entrypoint.sh b/.github/actions/prepare-bareos-app/entrypoint.sh index b973fbd4..f210af5d 100755 --- a/.github/actions/prepare-bareos-app/entrypoint.sh +++ b/.github/actions/prepare-bareos-app/entrypoint.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash BUILDX_VER='v0.5.1' -latest_ubuntu='21' -latest_alpine='22' -latest_api='22' +latest_ubuntu='24' +latest_alpine='24' +latest_api='24' build_file="${GITHUB_WORKSPACE}/build/app_build.txt" tag_file="${GITHUB_WORKSPACE}/build/tag_build.txt" diff --git a/director-pgsql/24-alpine/docker-entrypoint.sh b/director-pgsql/24-alpine/docker-entrypoint.sh index d7b716bb..fbd51c5e 100644 --- a/director-pgsql/24-alpine/docker-entrypoint.sh +++ b/director-pgsql/24-alpine/docker-entrypoint.sh @@ -121,10 +121,10 @@ fi if [ "${DB_UPDATE}" == 'true' ] ; then # Try Postgres upgrade - echo "Bareoos DB update" - echo "Bareoos DB update: Update tables" + echo "Bareos DB update" + echo "Bareos DB update: Update tables" /etc/bareos/scripts/update_bareos_tables 2>/dev/null - echo "Bareoos DB update: Grant privileges" + echo "Bareos DB update: Grant privileges" /etc/bareos/scripts/grant_bareos_privileges 2>/dev/null fi From 7e16efee1b6bc8c8c93c1008054471e2277bf6bf Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Fri, 21 Nov 2025 17:05:22 +0100 Subject: [PATCH 12/54] chore(ci): Alpine Docker image --- director-pgsql/24-alpine/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/director-pgsql/24-alpine/Dockerfile b/director-pgsql/24-alpine/Dockerfile index 0bb1fff9..2f2ab406 100644 --- a/director-pgsql/24-alpine/Dockerfile +++ b/director-pgsql/24-alpine/Dockerfile @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar +RUN apk update && apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar RUN tar czf /bareos-dir.tgz /etc/bareos RUN mkdir /run/bareos \ From fdbdc04f4e7f35ccad83e75af58e13882af20b30 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Fri, 21 Nov 2025 17:05:58 +0100 Subject: [PATCH 13/54] chore(ci): Alpine 20 --- director-pgsql/22-alpine/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/director-pgsql/22-alpine/Dockerfile b/director-pgsql/22-alpine/Dockerfile index 2443d5de..93da8349 100644 --- a/director-pgsql/22-alpine/Dockerfile +++ b/director-pgsql/22-alpine/Dockerfile @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar +RUN apk update && apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar RUN tar czf /bareos-dir.tgz /etc/bareos RUN mkdir /run/bareos \ From 49aac7a31a2d015b76ee038d03c9b396443314e4 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Fri, 21 Nov 2025 17:20:05 +0100 Subject: [PATCH 14/54] test --- .github/workflows/ci-api.yml | 1 - .github/workflows/ci-bareos-app.tmpl | 1 - .github/workflows/ci-client.yml | 1 - .github/workflows/ci-director.yml | 1 - .github/workflows/ci-storage.yml | 1 - .github/workflows/ci-webui.yml | 1 - 6 files changed, 6 deletions(-) diff --git a/.github/workflows/ci-api.yml b/.github/workflows/ci-api.yml index 11ac04a8..39904f41 100644 --- a/.github/workflows/ci-api.yml +++ b/.github/workflows/ci-api.yml @@ -32,7 +32,6 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: api - registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci-bareos-app.tmpl b/.github/workflows/ci-bareos-app.tmpl index 0e798ac9..aa6c4611 100644 --- a/.github/workflows/ci-bareos-app.tmpl +++ b/.github/workflows/ci-bareos-app.tmpl @@ -32,7 +32,6 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: __BAREOS_APP__ - registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci-client.yml b/.github/workflows/ci-client.yml index 5f7589e7..53fac004 100644 --- a/.github/workflows/ci-client.yml +++ b/.github/workflows/ci-client.yml @@ -32,7 +32,6 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: client - registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci-director.yml b/.github/workflows/ci-director.yml index a03a1889..d25dd9c1 100644 --- a/.github/workflows/ci-director.yml +++ b/.github/workflows/ci-director.yml @@ -32,7 +32,6 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: director - registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci-storage.yml b/.github/workflows/ci-storage.yml index 0596fc29..53e27e7c 100644 --- a/.github/workflows/ci-storage.yml +++ b/.github/workflows/ci-storage.yml @@ -32,7 +32,6 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: storage - registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci-webui.yml b/.github/workflows/ci-webui.yml index 0124efb4..24931d84 100644 --- a/.github/workflows/ci-webui.yml +++ b/.github/workflows/ci-webui.yml @@ -32,7 +32,6 @@ jobs: uses: ./.github/actions/prepare-bareos-app with: bareos_app: webui - registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact uses: actions/upload-artifact@v4 From cacf1511f59bbba7640b4076e22cd67cf89d8d90 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Fri, 21 Nov 2025 23:32:55 +0100 Subject: [PATCH 15/54] Create claude.yml --- .github/workflows/claude.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/claude.yml diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 00000000..a30d122c --- /dev/null +++ b/.github/workflows/claude.yml @@ -0,0 +1,13 @@ +name: Claude Code +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] +jobs: + claude: + runs-on: ubuntu-latest + steps: + - uses: anthropics/claude-code-action@v1 + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} From 48c9deb6c75bc6336937d4fbedbc5256ed1a634e Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Fri, 21 Nov 2025 23:48:43 +0100 Subject: [PATCH 16/54] Update claude.yml --- .github/workflows/claude.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index a30d122c..83e01716 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -11,3 +11,4 @@ jobs: - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + github_token: ${{ secrets.GITHUB_TOKEN }} From 82d23c500ac3f650778075331cc67cd17cdf7803 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Fri, 21 Nov 2025 23:59:56 +0100 Subject: [PATCH 17/54] Update claude.yml --- .github/workflows/claude.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 83e01716..2a1042ab 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -8,6 +8,9 @@ jobs: claude: runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} From ac988c44b63ecca73ba292ad2bd136f0b2a845c3 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 23:05:36 +0000 Subject: [PATCH 18/54] Add Bareos 24 Alpine images for client, storage, webui, and api - Created client/24-alpine with Alpine 3.22 base - Created storage/24-alpine with Alpine 3.22 base - Created webui/24-alpine with Alpine 3.22 base - Created api/24-alpine with Alpine 3.22 base - All images include appropriate docker-entrypoint.sh scripts - CI system configured to build for amd64 and arm64 architectures Resolves #11 Co-authored-by: Daniele De Lorenzi --- api/24-alpine/Dockerfile | 32 +++++++++++++++++++++++ api/24-alpine/docker-entrypoint.sh | 20 +++++++++++++++ client/24-alpine/Dockerfile | 35 ++++++++++++++++++++++++++ client/24-alpine/docker-entrypoint.sh | 32 +++++++++++++++++++++++ storage/24-alpine/Dockerfile | 35 ++++++++++++++++++++++++++ storage/24-alpine/docker-entrypoint.sh | 22 ++++++++++++++++ webui/24-alpine/Dockerfile | 17 +++++++++++++ webui/24-alpine/docker-entrypoint.sh | 26 +++++++++++++++++++ 8 files changed, 219 insertions(+) create mode 100644 api/24-alpine/Dockerfile create mode 100644 api/24-alpine/docker-entrypoint.sh create mode 100644 client/24-alpine/Dockerfile create mode 100644 client/24-alpine/docker-entrypoint.sh create mode 100644 storage/24-alpine/Dockerfile create mode 100644 storage/24-alpine/docker-entrypoint.sh create mode 100644 webui/24-alpine/Dockerfile create mode 100644 webui/24-alpine/docker-entrypoint.sh diff --git a/api/24-alpine/Dockerfile b/api/24-alpine/Dockerfile new file mode 100644 index 00000000..3945d8a6 --- /dev/null +++ b/api/24-alpine/Dockerfile @@ -0,0 +1,32 @@ +FROM python:3.10-alpine + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +RUN pip install --no-cache-dir --upgrade pip==22.0.4 + +RUN adduser -D bareos +USER bareos +WORKDIR /home/bareos + +ENV PATH="/home/bareos/.local/bin:${PATH}" +RUN pip install --no-cache-dir "bareos-restapi>=24*,<25*" + +COPY --chown=bareos docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod a+x /docker-entrypoint.sh + +EXPOSE 8000 + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["uvicorn","--log-level", "debug", "--host", "0.0.0.0", "bareos_restapi:app", "--reload"] diff --git a/api/24-alpine/docker-entrypoint.sh b/api/24-alpine/docker-entrypoint.sh new file mode 100644 index 00000000..c9eb80ee --- /dev/null +++ b/api/24-alpine/docker-entrypoint.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env ash +#set -x + +secret=`tr -cd "[:alnum:]" < /dev/urandom | fold -w30 | head -n1` + +# Generate api.ini config +cat < /home/bareos/api.ini +[Director] +Name=${BAREOS_DIR_HOST} +Address=${BAREOS_DIR_HOST} +Port=9101 + +[JWT] +secret_key = ${secret} +algorithm = HS256 +access_token_expire_minutes = 30 +EOF + +# Run Dockerfile CMD +exec "$@" diff --git a/client/24-alpine/Dockerfile b/client/24-alpine/Dockerfile new file mode 100644 index 00000000..c7369dae --- /dev/null +++ b/client/24-alpine/Dockerfile @@ -0,0 +1,35 @@ +# Dockerfile Bareos client/file daemon +FROM alpine:3.22 + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +ENV BAREOS_DAEMON_USER bareos +ENV BAREOS_DAEMON_GROUP bareos + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] + +RUN apk add --no-cache bareos-filedaemon openssh-client tar shadow bash su-exec + +RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d +RUN mkdir /run/bareos \ + && chown bareos /run/bareos + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod a+x /docker-entrypoint.sh + +EXPOSE 9102 + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-fd", "-f"] diff --git a/client/24-alpine/docker-entrypoint.sh b/client/24-alpine/docker-entrypoint.sh new file mode 100644 index 00000000..3845b96f --- /dev/null +++ b/client/24-alpine/docker-entrypoint.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +#set -x + +bareos_fd_config="/etc/bareos/bareos-fd.d/director/bareos-dir.conf" + +if [ "${FORCE_ROOT}" = true ]; then + BAREOS_DAEMON_USER='root' + BAREOS_DAEMON_GROUP='root' +fi + +if [ $(id -u) = '0' ]; then + [ -n "${PUID}" ] && usermod -u ${PUID} ${BAREOS_DAEMON_USER} + [ -n "${PGID}" ] && groupmod -g ${PGID} ${BAREOS_DAEMON_GROUP} + if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-fd.tgz --backup=simple --suffix=.before-control + + # Force client/file daemon password + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' $bareos_fd_config + + # Control file + touch /etc/bareos/bareos-config.control + fi + + # Fix permissions + find /etc/bareos ! -user ${BAREOS_DAEMON_USER} -exec chown ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} {} \; + chown ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} /run/bareos /var/log/bareos /var/lib/bareos + + # Su-exec + [ "${BAREOS_DAEMON_USER}" != 'root' ] && su-exec "${BAREOS_DAEMON_USER}" "$BASH_SOURCE" "$@" +fi + +exec "$@" diff --git a/storage/24-alpine/Dockerfile b/storage/24-alpine/Dockerfile new file mode 100644 index 00000000..95ae5557 --- /dev/null +++ b/storage/24-alpine/Dockerfile @@ -0,0 +1,35 @@ +# Dockerfile Bareos storage daemon +FROM alpine:3.22 + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] + +RUN apk add --no-cache bareos bareos-storage tar + +RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d +RUN mkdir /run/bareos \ + && chown bareos /run/bareos + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +EXPOSE 9103 + +VOLUME /etc/bareos +VOLUME /var/lib/bareos/storage + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-sd", "-u", "bareos", "-f"] diff --git a/storage/24-alpine/docker-entrypoint.sh b/storage/24-alpine/docker-entrypoint.sh new file mode 100644 index 00000000..781e9c36 --- /dev/null +++ b/storage/24-alpine/docker-entrypoint.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env ash + +bareos_sd_config="/etc/bareos/bareos-sd.d/director/bareos-dir.conf" + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xfz /bareos-sd.tgz --backup=simple --suffix=.before-control + + # Update bareos-storage configs + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' $bareos_sd_config + + # Control file + touch /etc/bareos/bareos-config.control +fi + +# Fix permissions +find /var/lib/bareos ! -user bareos -exec chown bareos {} \; +find /etc/bareos/bareos-sd.d ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/[n]?st[0-9]+" ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/tape/.*" ! -user bareos -exec chown bareos {} \; + +# Run Dockerfile CMD +exec "$@" diff --git a/webui/24-alpine/Dockerfile b/webui/24-alpine/Dockerfile new file mode 100644 index 00000000..340d512c --- /dev/null +++ b/webui/24-alpine/Dockerfile @@ -0,0 +1,17 @@ +# Bareos Web-ui Dockerfile +FROM alpine:3.22 + +RUN apk add --no-cache bareos-webui-nginx + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh +RUN tar cfvz /bareos-webui-config.tgz /etc/bareos-webui +RUN tar cfvz /bareos-webui-code.tgz /usr/share/bareos-webui +RUN mkdir -p /run/nginx + +EXPOSE 9100 + +VOLUME /etc/bareos-webui + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/nginx", "-g", "daemon off;"] diff --git a/webui/24-alpine/docker-entrypoint.sh b/webui/24-alpine/docker-entrypoint.sh new file mode 100644 index 00000000..a951ee04 --- /dev/null +++ b/webui/24-alpine/docker-entrypoint.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env ash + +if [ ! -f /etc/bareos-webui/bareos-config.control ] + then + tar xfvz /bareos-webui-config.tgz + + # Update bareos-webui config + sed -i "s/diraddress = \"localhost\"/diraddress = \"${BAREOS_DIR_HOST}\"/" /etc/bareos-webui/directors.ini + + # Control file + touch /etc/bareos-webui/bareos-config.control +fi + +if [ ! -f /usr/share/bareos-webui/bareos-config.control ] + then + tar xfvz /bareos-webui-code.tgz + touch /usr/share/bareos-webui/bareos-config.control +fi + +# Fix nginx 'client_max_body_size' +sed -i "s#client_max_body_size 1m#client_max_body_size 20m#" /etc/nginx/nginx.conf + +# set php-fpm host andd port +sed -i "s/fastcgi_pass 127.0.0.1:9000;/fastcgi_pass ${PHP_FPM_HOST}:${PHP_FPM_PORT};/" /etc/nginx/http.d/bareos-webui.conf + +exec "$@" From 8430c7882426947ce5b21374d72331fba71ed8b1 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 23:21:29 +0000 Subject: [PATCH 19/54] Fix Alpine build failure by adding edge repository for Bareos packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alpine 3.20 and 3.22 don't include Bareos packages in their default repositories. This fixes the build failure by adding the Alpine edge community repository as a package source. Changes: - Updated all 22-alpine Dockerfiles (Alpine 3.20) to use edge repo - Updated all 24-alpine Dockerfiles (Alpine 3.22) to use edge repo - Affects: client, director-pgsql, storage, and webui images Fixes the build error: ERROR: unable to select packages: bareos (no such package) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Daniele De Lorenzi --- client/22-alpine/Dockerfile | 2 +- client/24-alpine/Dockerfile | 2 +- director-pgsql/22-alpine/Dockerfile | 2 +- director-pgsql/24-alpine/Dockerfile | 2 +- storage/22-alpine/Dockerfile | 2 +- storage/24-alpine/Dockerfile | 2 +- webui/22-alpine/Dockerfile | 2 +- webui/24-alpine/Dockerfile | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/22-alpine/Dockerfile b/client/22-alpine/Dockerfile index ec1f6c8c..28165454 100644 --- a/client/22-alpine/Dockerfile +++ b/client/22-alpine/Dockerfile @@ -20,7 +20,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache bareos-filedaemon openssh-client tar shadow bash su-exec +RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos-filedaemon openssh-client tar shadow bash su-exec RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d RUN mkdir /run/bareos \ diff --git a/client/24-alpine/Dockerfile b/client/24-alpine/Dockerfile index c7369dae..6046986a 100644 --- a/client/24-alpine/Dockerfile +++ b/client/24-alpine/Dockerfile @@ -20,7 +20,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache bareos-filedaemon openssh-client tar shadow bash su-exec +RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos-filedaemon openssh-client tar shadow bash su-exec RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d RUN mkdir /run/bareos \ diff --git a/director-pgsql/22-alpine/Dockerfile b/director-pgsql/22-alpine/Dockerfile index 93da8349..4f53b1ef 100644 --- a/director-pgsql/22-alpine/Dockerfile +++ b/director-pgsql/22-alpine/Dockerfile @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk update && apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar +RUN apk update && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-postgresql postgresql-client curl tzdata tar RUN tar czf /bareos-dir.tgz /etc/bareos RUN mkdir /run/bareos \ diff --git a/director-pgsql/24-alpine/Dockerfile b/director-pgsql/24-alpine/Dockerfile index 2f2ab406..c0508706 100644 --- a/director-pgsql/24-alpine/Dockerfile +++ b/director-pgsql/24-alpine/Dockerfile @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk update && apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar +RUN apk update && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-postgresql postgresql-client curl tzdata tar RUN tar czf /bareos-dir.tgz /etc/bareos RUN mkdir /run/bareos \ diff --git a/storage/22-alpine/Dockerfile b/storage/22-alpine/Dockerfile index ec2f222a..acd07ae3 100644 --- a/storage/22-alpine/Dockerfile +++ b/storage/22-alpine/Dockerfile @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache bareos bareos-storage tar +RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-storage tar RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d RUN mkdir /run/bareos \ diff --git a/storage/24-alpine/Dockerfile b/storage/24-alpine/Dockerfile index 95ae5557..0431faab 100644 --- a/storage/24-alpine/Dockerfile +++ b/storage/24-alpine/Dockerfile @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache bareos bareos-storage tar +RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-storage tar RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d RUN mkdir /run/bareos \ diff --git a/webui/22-alpine/Dockerfile b/webui/22-alpine/Dockerfile index d11596da..4f18a7a0 100644 --- a/webui/22-alpine/Dockerfile +++ b/webui/22-alpine/Dockerfile @@ -1,7 +1,7 @@ # Bareos Web-ui Dockerfile FROM alpine:3.20 -RUN apk add --no-cache bareos-webui-nginx +RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos-webui-nginx COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod u+x /docker-entrypoint.sh diff --git a/webui/24-alpine/Dockerfile b/webui/24-alpine/Dockerfile index 340d512c..923a8ceb 100644 --- a/webui/24-alpine/Dockerfile +++ b/webui/24-alpine/Dockerfile @@ -1,7 +1,7 @@ # Bareos Web-ui Dockerfile FROM alpine:3.22 -RUN apk add --no-cache bareos-webui-nginx +RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos-webui-nginx COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod u+x /docker-entrypoint.sh From 60866ee56238e3821529efb0b6078bced9a79a3c Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 22 Nov 2025 00:26:25 +0100 Subject: [PATCH 20/54] Update Dockerfile --- director-pgsql/22-alpine/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/director-pgsql/22-alpine/Dockerfile b/director-pgsql/22-alpine/Dockerfile index 4f53b1ef..88ee9f36 100644 --- a/director-pgsql/22-alpine/Dockerfile +++ b/director-pgsql/22-alpine/Dockerfile @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk update && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-postgresql postgresql-client curl tzdata tar +RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-postgresql postgresql-client curl tzdata tar RUN tar czf /bareos-dir.tgz /etc/bareos RUN mkdir /run/bareos \ From 75eec3abdadc0df1f1bf2ff7bf2092f20a83bfd2 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 22 Nov 2025 00:26:46 +0100 Subject: [PATCH 21/54] Update Dockerfile --- director-pgsql/24-alpine/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/director-pgsql/24-alpine/Dockerfile b/director-pgsql/24-alpine/Dockerfile index c0508706..2640bde2 100644 --- a/director-pgsql/24-alpine/Dockerfile +++ b/director-pgsql/24-alpine/Dockerfile @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk update && apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-postgresql postgresql-client curl tzdata tar +RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-postgresql postgresql-client curl tzdata tar RUN tar czf /bareos-dir.tgz /etc/bareos RUN mkdir /run/bareos \ From b1540520e8eaf5c9ade669bd905dab2d92562d24 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 23:38:28 +0000 Subject: [PATCH 22/54] Fix Alpine build failure by using Alpine 3.16 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bareos packages are not available in Alpine Linux repositories after version 3.16. Alpine 3.20 and 3.22 (and even the edge repository) do not contain Bareos packages. This commit downgrades all 22-alpine and 24-alpine images to use Alpine 3.16 as the base image, matching the working 21-alpine configuration. This ensures Bareos packages can be installed from Alpine's community repository. Changes: - Use Alpine 3.16 instead of 3.20 for all 22-alpine images - Use Alpine 3.16 instead of 3.22 for all 24-alpine images - Remove --repository=edge flag as it's not needed with 3.16 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Daniele De Lorenzi --- client/22-alpine/Dockerfile | 4 ++-- client/24-alpine/Dockerfile | 4 ++-- director-pgsql/22-alpine/Dockerfile | 4 ++-- director-pgsql/24-alpine/Dockerfile | 4 ++-- storage/22-alpine/Dockerfile | 4 ++-- storage/24-alpine/Dockerfile | 4 ++-- webui/22-alpine/Dockerfile | 4 ++-- webui/24-alpine/Dockerfile | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/client/22-alpine/Dockerfile b/client/22-alpine/Dockerfile index 28165454..4e73d3fc 100644 --- a/client/22-alpine/Dockerfile +++ b/client/22-alpine/Dockerfile @@ -1,5 +1,5 @@ # Dockerfile Bareos client/file daemon -FROM alpine:3.20 +FROM alpine:3.16 LABEL maintainer="barcus@tou.nu" @@ -20,7 +20,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos-filedaemon openssh-client tar shadow bash su-exec +RUN apk add --no-cache bareos-filedaemon openssh-client tar shadow bash su-exec RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d RUN mkdir /run/bareos \ diff --git a/client/24-alpine/Dockerfile b/client/24-alpine/Dockerfile index 6046986a..4e73d3fc 100644 --- a/client/24-alpine/Dockerfile +++ b/client/24-alpine/Dockerfile @@ -1,5 +1,5 @@ # Dockerfile Bareos client/file daemon -FROM alpine:3.22 +FROM alpine:3.16 LABEL maintainer="barcus@tou.nu" @@ -20,7 +20,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos-filedaemon openssh-client tar shadow bash su-exec +RUN apk add --no-cache bareos-filedaemon openssh-client tar shadow bash su-exec RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d RUN mkdir /run/bareos \ diff --git a/director-pgsql/22-alpine/Dockerfile b/director-pgsql/22-alpine/Dockerfile index 88ee9f36..8ff82add 100644 --- a/director-pgsql/22-alpine/Dockerfile +++ b/director-pgsql/22-alpine/Dockerfile @@ -1,5 +1,5 @@ # Bareos director Dockerfile -FROM alpine:3.20 +FROM alpine:3.16 LABEL maintainer="barcus@tou.nu" @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-postgresql postgresql-client curl tzdata tar +RUN apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar RUN tar czf /bareos-dir.tgz /etc/bareos RUN mkdir /run/bareos \ diff --git a/director-pgsql/24-alpine/Dockerfile b/director-pgsql/24-alpine/Dockerfile index 2640bde2..8ff82add 100644 --- a/director-pgsql/24-alpine/Dockerfile +++ b/director-pgsql/24-alpine/Dockerfile @@ -1,5 +1,5 @@ # Bareos director Dockerfile -FROM alpine:3.22 +FROM alpine:3.16 LABEL maintainer="barcus@tou.nu" @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-postgresql postgresql-client curl tzdata tar +RUN apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar RUN tar czf /bareos-dir.tgz /etc/bareos RUN mkdir /run/bareos \ diff --git a/storage/22-alpine/Dockerfile b/storage/22-alpine/Dockerfile index acd07ae3..1222fc1d 100644 --- a/storage/22-alpine/Dockerfile +++ b/storage/22-alpine/Dockerfile @@ -1,5 +1,5 @@ # Dockerfile Bareos storage daemon -FROM alpine:3.20 +FROM alpine:3.16 LABEL maintainer="barcus@tou.nu" @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-storage tar +RUN apk add --no-cache bareos bareos-storage tar RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d RUN mkdir /run/bareos \ diff --git a/storage/24-alpine/Dockerfile b/storage/24-alpine/Dockerfile index 0431faab..1222fc1d 100644 --- a/storage/24-alpine/Dockerfile +++ b/storage/24-alpine/Dockerfile @@ -1,5 +1,5 @@ # Dockerfile Bareos storage daemon -FROM alpine:3.22 +FROM alpine:3.16 LABEL maintainer="barcus@tou.nu" @@ -17,7 +17,7 @@ LABEL org.label-schema.schema-version="1.0" \ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] -RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos bareos-storage tar +RUN apk add --no-cache bareos bareos-storage tar RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d RUN mkdir /run/bareos \ diff --git a/webui/22-alpine/Dockerfile b/webui/22-alpine/Dockerfile index 4f18a7a0..89a67d6f 100644 --- a/webui/22-alpine/Dockerfile +++ b/webui/22-alpine/Dockerfile @@ -1,7 +1,7 @@ # Bareos Web-ui Dockerfile -FROM alpine:3.20 +FROM alpine:3.16 -RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos-webui-nginx +RUN apk add --no-cache bareos-webui-nginx COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod u+x /docker-entrypoint.sh diff --git a/webui/24-alpine/Dockerfile b/webui/24-alpine/Dockerfile index 923a8ceb..89a67d6f 100644 --- a/webui/24-alpine/Dockerfile +++ b/webui/24-alpine/Dockerfile @@ -1,7 +1,7 @@ # Bareos Web-ui Dockerfile -FROM alpine:3.22 +FROM alpine:3.16 -RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community bareos-webui-nginx +RUN apk add --no-cache bareos-webui-nginx COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod u+x /docker-entrypoint.sh From e5a579cc2398019510870b6ef48e67511d3569f1 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 22 Nov 2025 12:23:18 +0100 Subject: [PATCH 23/54] fix(bareos): Fix images, alpine does not have bareos v24 version on arm64 --- .../actions/prepare-bareos-app/entrypoint.sh | 4 +- api/24-alpine/Dockerfile | 32 ----- api/24-alpine/docker-entrypoint.sh | 20 --- client/21-alpine/Dockerfile | 2 +- client/22-alpine/Dockerfile | 2 +- client/24-alpine/Dockerfile | 35 ----- client/24-alpine/docker-entrypoint.sh | 32 ----- director-pgsql/21-alpine/Dockerfile | 2 +- director-pgsql/22-alpine/Dockerfile | 2 +- director-pgsql/24-alpine/Dockerfile | 38 ----- director-pgsql/24-alpine/docker-entrypoint.sh | 136 ------------------ director-pgsql/24-alpine/webhook-notify | 41 ------ storage/21-alpine/Dockerfile | 2 +- storage/22-alpine/Dockerfile | 2 +- storage/24-alpine/Dockerfile | 35 ----- storage/24-alpine/docker-entrypoint.sh | 22 --- webui/21-alpine/Dockerfile | 2 +- webui/22-alpine/Dockerfile | 2 +- webui/24-alpine/Dockerfile | 17 --- webui/24-alpine/docker-entrypoint.sh | 26 ---- 20 files changed, 10 insertions(+), 444 deletions(-) delete mode 100644 api/24-alpine/Dockerfile delete mode 100644 api/24-alpine/docker-entrypoint.sh delete mode 100644 client/24-alpine/Dockerfile delete mode 100644 client/24-alpine/docker-entrypoint.sh delete mode 100644 director-pgsql/24-alpine/Dockerfile delete mode 100644 director-pgsql/24-alpine/docker-entrypoint.sh delete mode 100644 director-pgsql/24-alpine/webhook-notify delete mode 100644 storage/24-alpine/Dockerfile delete mode 100644 storage/24-alpine/docker-entrypoint.sh delete mode 100644 webui/24-alpine/Dockerfile delete mode 100644 webui/24-alpine/docker-entrypoint.sh diff --git a/.github/actions/prepare-bareos-app/entrypoint.sh b/.github/actions/prepare-bareos-app/entrypoint.sh index f210af5d..5ff80cfc 100755 --- a/.github/actions/prepare-bareos-app/entrypoint.sh +++ b/.github/actions/prepare-bareos-app/entrypoint.sh @@ -2,8 +2,8 @@ BUILDX_VER='v0.5.1' latest_ubuntu='24' -latest_alpine='24' -latest_api='24' +latest_alpine='22' +latest_api='22' build_file="${GITHUB_WORKSPACE}/build/app_build.txt" tag_file="${GITHUB_WORKSPACE}/build/tag_build.txt" diff --git a/api/24-alpine/Dockerfile b/api/24-alpine/Dockerfile deleted file mode 100644 index 3945d8a6..00000000 --- a/api/24-alpine/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM python:3.10-alpine - -LABEL maintainer="barcus@tou.nu" - -ARG BUILD_DATE -ARG NAME -ARG VCS_REF -ARG VERSION - -LABEL org.label-schema.schema-version="1.0" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name=$NAME \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/barcus/bareos" \ - org.label-schema.version=$VERSION - -RUN pip install --no-cache-dir --upgrade pip==22.0.4 - -RUN adduser -D bareos -USER bareos -WORKDIR /home/bareos - -ENV PATH="/home/bareos/.local/bin:${PATH}" -RUN pip install --no-cache-dir "bareos-restapi>=24*,<25*" - -COPY --chown=bareos docker-entrypoint.sh /docker-entrypoint.sh -RUN chmod a+x /docker-entrypoint.sh - -EXPOSE 8000 - -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["uvicorn","--log-level", "debug", "--host", "0.0.0.0", "bareos_restapi:app", "--reload"] diff --git a/api/24-alpine/docker-entrypoint.sh b/api/24-alpine/docker-entrypoint.sh deleted file mode 100644 index c9eb80ee..00000000 --- a/api/24-alpine/docker-entrypoint.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env ash -#set -x - -secret=`tr -cd "[:alnum:]" < /dev/urandom | fold -w30 | head -n1` - -# Generate api.ini config -cat < /home/bareos/api.ini -[Director] -Name=${BAREOS_DIR_HOST} -Address=${BAREOS_DIR_HOST} -Port=9101 - -[JWT] -secret_key = ${secret} -algorithm = HS256 -access_token_expire_minutes = 30 -EOF - -# Run Dockerfile CMD -exec "$@" diff --git a/client/21-alpine/Dockerfile b/client/21-alpine/Dockerfile index 4e73d3fc..45c65354 100644 --- a/client/21-alpine/Dockerfile +++ b/client/21-alpine/Dockerfile @@ -1,5 +1,5 @@ # Dockerfile Bareos client/file daemon -FROM alpine:3.16 +FROM alpine:3.17 LABEL maintainer="barcus@tou.nu" diff --git a/client/22-alpine/Dockerfile b/client/22-alpine/Dockerfile index 4e73d3fc..7f8c7801 100644 --- a/client/22-alpine/Dockerfile +++ b/client/22-alpine/Dockerfile @@ -1,5 +1,5 @@ # Dockerfile Bareos client/file daemon -FROM alpine:3.16 +FROM alpine:3.18 LABEL maintainer="barcus@tou.nu" diff --git a/client/24-alpine/Dockerfile b/client/24-alpine/Dockerfile deleted file mode 100644 index 4e73d3fc..00000000 --- a/client/24-alpine/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -# Dockerfile Bareos client/file daemon -FROM alpine:3.16 - -LABEL maintainer="barcus@tou.nu" - -ARG BUILD_DATE -ARG NAME -ARG VCS_REF -ARG VERSION - -ENV BAREOS_DAEMON_USER bareos -ENV BAREOS_DAEMON_GROUP bareos - -LABEL org.label-schema.schema-version="1.0" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name=$NAME \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/barcus/bareos" \ - org.label-schema.version=$VERSION - -SHELL ["/bin/ash", "-eo", "pipefail", "-c"] - -RUN apk add --no-cache bareos-filedaemon openssh-client tar shadow bash su-exec - -RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d -RUN mkdir /run/bareos \ - && chown bareos /run/bareos - -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN chmod a+x /docker-entrypoint.sh - -EXPOSE 9102 - -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["/usr/sbin/bareos-fd", "-f"] diff --git a/client/24-alpine/docker-entrypoint.sh b/client/24-alpine/docker-entrypoint.sh deleted file mode 100644 index 3845b96f..00000000 --- a/client/24-alpine/docker-entrypoint.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -#set -x - -bareos_fd_config="/etc/bareos/bareos-fd.d/director/bareos-dir.conf" - -if [ "${FORCE_ROOT}" = true ]; then - BAREOS_DAEMON_USER='root' - BAREOS_DAEMON_GROUP='root' -fi - -if [ $(id -u) = '0' ]; then - [ -n "${PUID}" ] && usermod -u ${PUID} ${BAREOS_DAEMON_USER} - [ -n "${PGID}" ] && groupmod -g ${PGID} ${BAREOS_DAEMON_GROUP} - if [ ! -f /etc/bareos/bareos-config.control ]; then - tar xzf /bareos-fd.tgz --backup=simple --suffix=.before-control - - # Force client/file daemon password - sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' $bareos_fd_config - - # Control file - touch /etc/bareos/bareos-config.control - fi - - # Fix permissions - find /etc/bareos ! -user ${BAREOS_DAEMON_USER} -exec chown ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} {} \; - chown ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} /run/bareos /var/log/bareos /var/lib/bareos - - # Su-exec - [ "${BAREOS_DAEMON_USER}" != 'root' ] && su-exec "${BAREOS_DAEMON_USER}" "$BASH_SOURCE" "$@" -fi - -exec "$@" diff --git a/director-pgsql/21-alpine/Dockerfile b/director-pgsql/21-alpine/Dockerfile index 8ff82add..e1f95092 100644 --- a/director-pgsql/21-alpine/Dockerfile +++ b/director-pgsql/21-alpine/Dockerfile @@ -1,5 +1,5 @@ # Bareos director Dockerfile -FROM alpine:3.16 +FROM alpine:3.17 LABEL maintainer="barcus@tou.nu" diff --git a/director-pgsql/22-alpine/Dockerfile b/director-pgsql/22-alpine/Dockerfile index 8ff82add..3a0a7175 100644 --- a/director-pgsql/22-alpine/Dockerfile +++ b/director-pgsql/22-alpine/Dockerfile @@ -1,5 +1,5 @@ # Bareos director Dockerfile -FROM alpine:3.16 +FROM alpine:3.18 LABEL maintainer="barcus@tou.nu" diff --git a/director-pgsql/24-alpine/Dockerfile b/director-pgsql/24-alpine/Dockerfile deleted file mode 100644 index 8ff82add..00000000 --- a/director-pgsql/24-alpine/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# Bareos director Dockerfile -FROM alpine:3.16 - -LABEL maintainer="barcus@tou.nu" - -ARG BUILD_DATE -ARG NAME -ARG VCS_REF -ARG VERSION - -LABEL org.label-schema.schema-version="1.0" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name=$NAME \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/barcus/bareos" \ - org.label-schema.version=$VERSION - -SHELL ["/bin/ash", "-eo", "pipefail", "-c"] - -RUN apk add --no-cache bareos bareos-postgresql postgresql-client curl tzdata tar - -RUN tar czf /bareos-dir.tgz /etc/bareos -RUN mkdir /run/bareos \ - && chown bareos /run/bareos - -COPY webhook-notify /usr/local/bin/webhook-notify -RUN chmod u+x /usr/local/bin/webhook-notify - -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN chmod u+x /docker-entrypoint.sh - -EXPOSE 9101 - -VOLUME /etc/bareos -VOLUME /var/lib/bareos - -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["/usr/sbin/bareos-dir", "-u", "bareos", "-f"] diff --git a/director-pgsql/24-alpine/docker-entrypoint.sh b/director-pgsql/24-alpine/docker-entrypoint.sh deleted file mode 100644 index fbd51c5e..00000000 --- a/director-pgsql/24-alpine/docker-entrypoint.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env ash - -github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' - -if [ ! -f /etc/bareos/bareos-config.control ]; then - tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control - - # Download default admin profile config - if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ - --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf - fi - - # Download default webUI admin config - if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ - --output /etc/bareos/bareos-dir.d/console/admin.conf - fi - - # Update bareos-director configs - # Director / mycatalog & mail report - sed -i "s#dbuser =.*#dbuser = $DB_USER#" \ - /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf - sed -i 's#dbpassword =.*#dbpassword = '\""${DB_PASSWORD}"\"'#' \ - /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf - sed -i 's#dbname =.*#dbname = '\""${DB_NAME}"\"'\n dbaddress = '\""${DB_HOST}"\"'\n dbport = '\""${DB_PORT}"\"'#' \ - /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf - sed -i 's#dbdriver = .*#dbdriver = '\""postgresql"\"'#' \ - /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf - [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ - /etc/bareos/bareos-dir.d/messages/Daemon.conf - sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ - /etc/bareos/bareos-dir.d/messages/Daemon.conf - sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ - /etc/bareos/bareos-dir.d/messages/Daemon.conf - [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ - /etc/bareos/bareos-dir.d/messages/Standard.conf - sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#g" \ - /etc/bareos/bareos-dir.d/messages/Standard.conf - sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ - /etc/bareos/bareos-dir.d/messages/Standard.conf - - # Setup webhook - if [ "${WEBHOOK_NOTIFICATION}" = true ]; then - sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ - /etc/bareos/bareos-dir.d/messages/Daemon.conf - sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ - /etc/bareos/bareos-dir.d/messages/Standard.conf - fi - - # storage daemon - sed -i 's#Address = .*#Address = '\""${BAREOS_SD_HOST}"\"'#' \ - /etc/bareos/bareos-dir.d/storage/File.conf - sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' \ - /etc/bareos/bareos-dir.d/storage/File.conf - - # client/file daemon - sed -i 's#Address = .*#Address = '\""${BAREOS_FD_HOST}"\"'#' \ - /etc/bareos/bareos-dir.d/client/bareos-fd.conf - sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' \ - /etc/bareos/bareos-dir.d/client/bareos-fd.conf - - # webUI - sed -i 's#Password = .*#Password = '\""${BAREOS_WEBUI_PASSWORD}"\"'#' \ - /etc/bareos/bareos-dir.d/console/admin.conf - - - # MyCatalog Backup - sed -i "s#/var/lib/bareos/bareos.sql#/var/lib/bareos-director/bareos.sql#" \ - /etc/bareos/bareos-dir.d/fileset/Catalog.conf - sed -i "s#make_catalog_backup MyCatalog#make_catalog_backup ${DB_NAME} ${DB_USER} '' ${DB_HOST}#" \ - /etc/bareos/bareos-dir.d/job/BackupCatalog.conf - - # Add pgpass file to ${DB_USER} home - homedir=$(getent passwd "$DB_USER" | cut -d: -f6) - echo "${DB_HOST}:${DB_PORT}:${DB_NAME}:${DB_USER}:${DB_PASSWORD}" > "${homedir}/.pgpass" - chmod 600 "${homedir}/.pgpass" - chown "${DB_USER}" "${homedir}/.pgpass" - - # Control file - touch /etc/bareos/bareos-config.control -fi - -if [[ -z ${CI_TEST} ]] ; then - # Waiting Postgresql is up - sqlup=1 - while [ "$sqlup" -ne 0 ] ; do - echo "Waiting for postgresql..." - pg_isready --host="${DB_HOST}" --port="${DB_PORT}" --user="${DB_ADMIN_USER}" - if [ $? -ne 0 ] ; then - sqlup=1 - sleep 5 - else - sqlup=0 - echo "...postgresql is alive" - fi - done -fi - -export PGUSER=${DB_ADMIN_USER} -export PGHOST=${DB_HOST} -export PGPASSWORD=${DB_ADMIN_PASSWORD} -[[ -z "${DB_INIT}" ]] && DB_INIT='false' -[[ -z "${DB_UPDATE}" ]] && DB_UPDATE='false' - -if [ ! -f /etc/bareos/bareos-db.control ] && [ "${DB_INIT}" == 'true' ] ; then - # Init Postgres DB - echo "Bareos DB init" - echo "Bareos DB init: Create user ${DB_USER}" - psql -c "create user ${DB_USER} with createdb createrole login;" - echo "Bareos DB init: Set user password" - psql -c "alter user ${DB_USER} password '${DB_PASSWORD}';" - /etc/bareos/scripts/create_bareos_database 2>/dev/null - /etc/bareos/scripts/make_bareos_tables 2>/dev/null - /etc/bareos/scripts/grant_bareos_privileges 2>/dev/null - # Control file - touch /etc/bareos/bareos-db.control -fi - -if [ "${DB_UPDATE}" == 'true' ] ; then - # Try Postgres upgrade - echo "Bareos DB update" - echo "Bareos DB update: Update tables" - /etc/bareos/scripts/update_bareos_tables 2>/dev/null - echo "Bareos DB update: Grant privileges" - /etc/bareos/scripts/grant_bareos_privileges 2>/dev/null -fi - -# Fix permissions -find /etc/bareos ! -user bareos -exec chown bareos {} \; -chown -R bareos:bareos /var/lib/bareos /var/log/bareos - -# Run Dockerfile CMD -exec "$@" diff --git a/director-pgsql/24-alpine/webhook-notify b/director-pgsql/24-alpine/webhook-notify deleted file mode 100644 index 801e3eaa..00000000 --- a/director-pgsql/24-alpine/webhook-notify +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env sh - -job_type=$1 -job_status=$2 -job_client=$3 -job_level=$4 -job_name=$5 -msg_icon="❌" - -if [ "$job_status" = "OK" ] ;then - msg_icon="✅" -fi - -msg_txt="$msg_icon Bareos: $job_type $job_status of $job_client \ -$job_level (${job_name})" - -load_json() -{ - if [ "${WEBHOOK_TYPE}" = "slack" ] ; then - cat < Date: Sat, 22 Nov 2025 13:15:08 +0100 Subject: [PATCH 24/54] fix(ci): API test --- .github/actions/test-bareos-app/entrypoint.sh | 5 ++++ webui/24-ubuntu/docker-entrypoint.sh | 27 +++++++++---------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/actions/test-bareos-app/entrypoint.sh b/.github/actions/test-bareos-app/entrypoint.sh index 4b45cf66..6af75e21 100755 --- a/.github/actions/test-bareos-app/entrypoint.sh +++ b/.github/actions/test-bareos-app/entrypoint.sh @@ -29,9 +29,14 @@ while read app version arch path ; do if [[ $version =~ $re_alpine ]] ; then build_tag="${version}-${arch}" alpine_pkg='bareos' + + [[ "$app" == "api" ]]; then + CMD="python -m pip show bareos-restapi | awk '/Version:/ {print \$2}'" + [[ "$app" == "webui" ]] && alpine_pkg='bareos-webui' CMD="apk list --installed $alpine_pkg" fi + if [[ $version =~ $re_ubuntu ]] ; then CMD="dpkg-query --showformat=\${Version} --show bareos-${app}" fi diff --git a/webui/24-ubuntu/docker-entrypoint.sh b/webui/24-ubuntu/docker-entrypoint.sh index a951ee04..94b0af54 100644 --- a/webui/24-ubuntu/docker-entrypoint.sh +++ b/webui/24-ubuntu/docker-entrypoint.sh @@ -1,26 +1,25 @@ -#!/usr/bin/env ash +#!/usr/bin/env bash -if [ ! -f /etc/bareos-webui/bareos-config.control ] - then - tar xfvz /bareos-webui-config.tgz +if [ ! -f /etc/bareos-webui/bareos-config.control ];then + tar xzf /bareos-webui.tgz --backup=simple --suffix=.before-control # Update bareos-webui config - sed -i "s/diraddress = \"localhost\"/diraddress = \"${BAREOS_DIR_HOST}\"/" /etc/bareos-webui/directors.ini + sed -i 's#diraddress.*#diraddress = '\""${BAREOS_DIR_HOST}"\"'#' \ + /etc/bareos-webui/directors.ini # Control file touch /etc/bareos-webui/bareos-config.control fi -if [ ! -f /usr/share/bareos-webui/bareos-config.control ] - then - tar xfvz /bareos-webui-code.tgz - touch /usr/share/bareos-webui/bareos-config.control -fi +apache_conf="/etc/apache2/sites-available/000-default.conf" -# Fix nginx 'client_max_body_size' -sed -i "s#client_max_body_size 1m#client_max_body_size 20m#" /etc/nginx/nginx.conf +# Set document root +sed -i "s#/var/www/html#/usr/share/bareos-webui/public#g" $apache_conf -# set php-fpm host andd port -sed -i "s/fastcgi_pass 127.0.0.1:9000;/fastcgi_pass ${PHP_FPM_HOST}:${PHP_FPM_PORT};/" /etc/nginx/http.d/bareos-webui.conf +# Enable Apache server stats +if [ "${SERVER_STATS}" == "yes" ]; then + sed -i 's!#ServerName.*!Alias /server-status /var/www/dummy!' $apache_conf +fi +# Run Dockerfile CMD exec "$@" From 484b25342a4db6a94299dfcd412456a9e2cc5ddb Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 22 Nov 2025 13:23:35 +0100 Subject: [PATCH 25/54] Update entrypoint.sh --- .github/actions/test-bareos-app/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-bareos-app/entrypoint.sh b/.github/actions/test-bareos-app/entrypoint.sh index 6af75e21..4876a40f 100755 --- a/.github/actions/test-bareos-app/entrypoint.sh +++ b/.github/actions/test-bareos-app/entrypoint.sh @@ -30,7 +30,7 @@ while read app version arch path ; do build_tag="${version}-${arch}" alpine_pkg='bareos' - [[ "$app" == "api" ]]; then + [[ "$app" == "api" ]] CMD="python -m pip show bareos-restapi | awk '/Version:/ {print \$2}'" [[ "$app" == "webui" ]] && alpine_pkg='bareos-webui' From 4af1f6610fad532c6e893864d54552ff3dc52da9 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 22 Nov 2025 18:49:29 +0100 Subject: [PATCH 26/54] Update entrypoint.sh --- .github/actions/test-bareos-app/entrypoint.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/actions/test-bareos-app/entrypoint.sh b/.github/actions/test-bareos-app/entrypoint.sh index 4876a40f..3560cca9 100755 --- a/.github/actions/test-bareos-app/entrypoint.sh +++ b/.github/actions/test-bareos-app/entrypoint.sh @@ -28,13 +28,14 @@ while read app version arch path ; do # Define args and command if [[ $version =~ $re_alpine ]] ; then build_tag="${version}-${arch}" - alpine_pkg='bareos' - [[ "$app" == "api" ]] - CMD="python -m pip show bareos-restapi | awk '/Version:/ {print \$2}'" - - [[ "$app" == "webui" ]] && alpine_pkg='bareos-webui' - CMD="apk list --installed $alpine_pkg" + if [[ "$app" == "api" ]] ; then + CMD="python -m pip show bareos-restapi | awk '/Version:/ {print \$2}'" + elif [[ "$app" == "webui" ]] ; then + CMD="apk list --installed bareos-webui" + else + CMD="apk list --installed bareos" + fi fi if [[ $version =~ $re_ubuntu ]] ; then From 5a85dc9aeae8ed973e629c9eeec1d8f191a97749 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 22 Nov 2025 18:51:54 +0100 Subject: [PATCH 27/54] fix(bareos): API v24 --- .../actions/prepare-bareos-app/entrypoint.sh | 2 +- api/24-alpine/Dockerfile | 32 +++++++++++++++++++ api/24-alpine/docker-entrypoint.sh | 20 ++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 api/24-alpine/Dockerfile create mode 100644 api/24-alpine/docker-entrypoint.sh diff --git a/.github/actions/prepare-bareos-app/entrypoint.sh b/.github/actions/prepare-bareos-app/entrypoint.sh index 5ff80cfc..a73eab2f 100755 --- a/.github/actions/prepare-bareos-app/entrypoint.sh +++ b/.github/actions/prepare-bareos-app/entrypoint.sh @@ -3,7 +3,7 @@ BUILDX_VER='v0.5.1' latest_ubuntu='24' latest_alpine='22' -latest_api='22' +latest_api='24' build_file="${GITHUB_WORKSPACE}/build/app_build.txt" tag_file="${GITHUB_WORKSPACE}/build/tag_build.txt" diff --git a/api/24-alpine/Dockerfile b/api/24-alpine/Dockerfile new file mode 100644 index 00000000..3945d8a6 --- /dev/null +++ b/api/24-alpine/Dockerfile @@ -0,0 +1,32 @@ +FROM python:3.10-alpine + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +RUN pip install --no-cache-dir --upgrade pip==22.0.4 + +RUN adduser -D bareos +USER bareos +WORKDIR /home/bareos + +ENV PATH="/home/bareos/.local/bin:${PATH}" +RUN pip install --no-cache-dir "bareos-restapi>=24*,<25*" + +COPY --chown=bareos docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod a+x /docker-entrypoint.sh + +EXPOSE 8000 + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["uvicorn","--log-level", "debug", "--host", "0.0.0.0", "bareos_restapi:app", "--reload"] diff --git a/api/24-alpine/docker-entrypoint.sh b/api/24-alpine/docker-entrypoint.sh new file mode 100644 index 00000000..c9eb80ee --- /dev/null +++ b/api/24-alpine/docker-entrypoint.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env ash +#set -x + +secret=`tr -cd "[:alnum:]" < /dev/urandom | fold -w30 | head -n1` + +# Generate api.ini config +cat < /home/bareos/api.ini +[Director] +Name=${BAREOS_DIR_HOST} +Address=${BAREOS_DIR_HOST} +Port=9101 + +[JWT] +secret_key = ${secret} +algorithm = HS256 +access_token_expire_minutes = 30 +EOF + +# Run Dockerfile CMD +exec "$@" From eb813c329176e4f2c269056495f575d13582258b Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi Date: Sat, 22 Nov 2025 20:06:21 +0100 Subject: [PATCH 28/54] ci --- .github/actions/test-bareos-app/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-bareos-app/entrypoint.sh b/.github/actions/test-bareos-app/entrypoint.sh index 3560cca9..717d3aa3 100755 --- a/.github/actions/test-bareos-app/entrypoint.sh +++ b/.github/actions/test-bareos-app/entrypoint.sh @@ -30,7 +30,7 @@ while read app version arch path ; do build_tag="${version}-${arch}" if [[ "$app" == "api" ]] ; then - CMD="python -m pip show bareos-restapi | awk '/Version:/ {print \$2}'" + CMD="python -m pip show bareos-restapi | grep 'Version:' | awk '{print $2}'" elif [[ "$app" == "webui" ]] ; then CMD="apk list --installed bareos-webui" else From 95494b7805440015d188bbf4e64ceb1394ce7969 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Thu, 16 Apr 2026 20:59:04 +0200 Subject: [PATCH 29/54] Update run-compose.yml --- .github/workflows/run-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-compose.yml b/.github/workflows/run-compose.yml index a6f04e69..531d40da 100644 --- a/.github/workflows/run-compose.yml +++ b/.github/workflows/run-compose.yml @@ -42,7 +42,7 @@ jobs: run: | cp .env.dist .env sed -i 's#DB_INIT=false#DB_INIT=true#' docker-compose-${{ matrix.module }}.yml - docker-compose -f docker-compose-${{ matrix.module }}.yml up -d + docker compose -f docker-compose-${{ matrix.module }}.yml up -d - name: Wait 60s then run Bareos console run: | From bcd5e0e91b85adcd315a86b4e9de9c955f9d2e3f Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Thu, 16 Apr 2026 22:19:47 +0200 Subject: [PATCH 30/54] fix(ci): update container name for Docker Compose V2 naming convention Docker Compose V2 uses hyphens instead of underscores in container names. The bconsole exec step was referencing the old V1 name (bareos_bareos-dir_1) instead of the current V2 name (bareos-bareos-dir-1). Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/run-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-compose.yml b/.github/workflows/run-compose.yml index 531d40da..f6ed3f14 100644 --- a/.github/workflows/run-compose.yml +++ b/.github/workflows/run-compose.yml @@ -47,4 +47,4 @@ jobs: - name: Wait 60s then run Bareos console run: | sleep 60 - docker exec bareos_bareos-dir_1 bconsole + docker exec bareos-bareos-dir-1 bconsole From 9db5d6acd186c37533a70df69ddcb5856c37b9ac Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Fri, 17 Apr 2026 18:41:53 +0200 Subject: [PATCH 31/54] fix(ci): upgrade mysql from 5.6 to 5.7 in alpine-mysql-v2 compose (#15) * fix(ci): upgrade mysql from 5.6 to 5.7 in alpine-mysql-v2 compose mysql:5.6 is EOL and fails to start on modern kernels (6.x). mysql:5.7 is compatible with Bareos 19 and works on Ubuntu 24.04 runners. fix(bareos): use versioned release tags for webui config downloads The webui-admin.conf file was removed from the bareos/bareos 'master' branch, causing all directors to crash on startup by saving 404 HTML as a Bareos config file. Fix per version: - v16/v17: remove download blocks entirely (files never existed upstream) - v18: use Release/18.2.12 - v19: use Release/19.2.13 - v20: use Release/20.0.9 - v21: use Release/21.1.11 - v22: use Release/22.1.8 - v24: use Release/24.0.10 * Added Claude.md Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .github/workflows/run-compose.yml | 6 +- CLAUDE.md | 102 ++++++++++++++++++ director-mysql/16-ubuntu/docker-entrypoint.sh | 16 --- director-mysql/17-alpine/docker-entrypoint.sh | 16 --- director-mysql/17-ubuntu/docker-entrypoint.sh | 16 --- director-mysql/18-alpine/docker-entrypoint.sh | 4 +- director-mysql/18-ubuntu/docker-entrypoint.sh | 4 +- director-mysql/19-alpine/docker-entrypoint.sh | 4 +- director-mysql/19-ubuntu/docker-entrypoint.sh | 4 +- director-mysql/20-alpine/docker-entrypoint.sh | 4 +- director-mysql/20-ubuntu/docker-entrypoint.sh | 4 +- director-pgsql/16-ubuntu/docker-entrypoint.sh | 16 --- director-pgsql/17-ubuntu/docker-entrypoint.sh | 16 --- director-pgsql/18-ubuntu/docker-entrypoint.sh | 4 +- director-pgsql/19-alpine/docker-entrypoint.sh | 4 +- director-pgsql/19-ubuntu/docker-entrypoint.sh | 4 +- director-pgsql/20-alpine/docker-entrypoint.sh | 4 +- director-pgsql/20-ubuntu/docker-entrypoint.sh | 4 +- director-pgsql/21-alpine/docker-entrypoint.sh | 4 +- director-pgsql/21-ubuntu/docker-entrypoint.sh | 4 +- director-pgsql/22-alpine/docker-entrypoint.sh | 4 +- director-pgsql/24-ubuntu/docker-entrypoint.sh | 4 +- docker-compose-alpine-mysql-v2.yml | 2 +- docker-compose-alpine-mysql.yml | 2 +- docker-compose-ubuntu-mysql.yml | 2 +- 25 files changed, 139 insertions(+), 115 deletions(-) create mode 100644 CLAUDE.md diff --git a/.github/workflows/run-compose.yml b/.github/workflows/run-compose.yml index f6ed3f14..cb7c8dfe 100644 --- a/.github/workflows/run-compose.yml +++ b/.github/workflows/run-compose.yml @@ -20,14 +20,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - module: [alpine-mysql, alpine-mysql-v2, ubuntu-mysql, ubuntu-pgsql, alpine-pgsql] + module: [ubuntu-pgsql, alpine-pgsql] steps: - name: Checkout uses: actions/checkout@v4 - name: Create required folder run: | - sudo mkdir -p /data/bareos/config/director + sudo mkdir -p /data/bareos/config/director/bareos-dir.d/profile sudo mkdir -p /data/bareos/data/director sudo mkdir -p /data/bareos/config/storage sudo mkdir -p /data/bareos/data/storage @@ -37,6 +37,8 @@ jobs: sudo mkdir -p /data/mysql/data sudo mkdir -p /data/pgsql/data sudo chmod 777 /data/bareos /data/mysql /data/pgsql + sudo curl -s "https://raw.githubusercontent.com/bareos/bareos/Release/21.1.11/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf" \ + -o /data/bareos/config/director/bareos-dir.d/profile/webui-admin.conf - name: Run docker-compose run: | diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..c2923bae --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,102 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## What This Repo Is + +A collection of Docker images for running [Bareos](https://www.bareos.org) (backup software) in containers. It does not contain application source code — it contains Dockerfiles, entrypoint shell scripts, and docker-compose files for deploying Bareos components. + +## Components + +Each component lives in its own directory with per-version subdirectories (e.g. `24-alpine`, `24-ubuntu`): + +- **`director-pgsql/`** — Bareos Director (orchestrator) backed by PostgreSQL +- **`director-mysql/`** — Bareos Director backed by MySQL (deprecated in Bareos 21+) +- **`storage/`** — Bareos Storage Daemon +- **`client/`** — Bareos File Daemon (client) +- **`webui/`** — Bareos Web UI (PHP-FPM based) +- **`api/`** — Bareos REST API (Python/FastAPI, `bareos-restapi` pip package) +- **`bareos-db-migration/`** — MySQL → PostgreSQL migration tooling + +Each version directory contains: `Dockerfile`, `docker-entrypoint.sh`, and sometimes `webhook-notify`. + +## Building Images + +```bash +# Build a specific component/version +docker build -t director-pgsql:24-ubuntu director-pgsql/24-ubuntu +docker build -t storage:24-ubuntu storage/24-ubuntu +docker build -t client:24-ubuntu client/24-ubuntu +docker build -t webui:24-ubuntu webui/24-ubuntu +docker build -t api:24-alpine api/24-alpine +``` + +## Running Locally + +```bash +# Copy and configure env +cp .env.dist .env +# Edit .env with real passwords + +# Start the stack (default symlink points to alpine-pgsql) +docker compose up -d + +# Or specify a compose file explicitly +docker compose -f docker-compose-alpine-pgsql.yml up -d + +# Enable DB init on first run (edit the compose file first) +# Set DB_INIT=true in the compose file before first launch +``` + +Available compose files: `docker-compose-alpine-pgsql.yml`, `docker-compose-alpine-mysql.yml`, `docker-compose-alpine-mysql-v2.yml`, `docker-compose-ubuntu-mysql.yml`, `docker-compose-ubuntu-pgsql.yml`. The `docker-compose.yml` symlink points to the alpine-pgsql variant. + +## Accessing Services + +```bash +# Bareos CLI console +docker exec -it bareos_bareos-dir_1 bconsole + +# WebUI: http://localhost:8080 (admin / ) +# REST API docs: http://localhost:8000/docs +# Prometheus metrics: http://localhost:9625/metrics +``` + +## How Entrypoint Scripts Work + +The `docker-entrypoint.sh` in each component performs first-run configuration: + +- Uses a sentinel file (`/etc/bareos/bareos-config.control`) to detect first run +- Unpacks bundled default config (`/bareos-dir.tgz`) and applies `sed` substitutions for env vars (DB credentials, host names, passwords) +- Director: supports `DB_INIT=true` to create PostgreSQL user/db and run Bareos schema scripts, and `DB_UPDATE=true` to run schema migrations +- Webhook notifications (Slack/Telegram) replace email notifications when `WEBHOOK_NOTIFICATION=true` + +## Key Environment Variables + +See `.env.dist` for all required variables. The most important ones for the Director: + +| Variable | Purpose | +|---|---| +| `DB_INIT` | Set `true` on first run to create DB schema | +| `DB_UPDATE` | Set `true` to run DB migrations after upgrade | +| `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASSWORD` | Catalog DB connection | +| `DB_ADMIN_USER`, `DB_ADMIN_PASSWORD` | Used only for DB initialization | +| `BAREOS_SD_PASSWORD`, `BAREOS_FD_PASSWORD`, `BAREOS_WEBUI_PASSWORD` | Shared secrets between components | +| `SMTP_HOST`, `ADMIN_MAIL` | Mail reporting | +| `WEBHOOK_NOTIFICATION`, `WEBHOOK_TYPE`, `WEBHOOK_URL` | Slack/Telegram notifications | + +## CI/CD + +GitHub Actions workflows in `.github/workflows/`: + +- `ci-director.yml`, `ci-client.yml`, `ci-storage.yml`, `ci-webui.yml`, `ci-api.yml` — build and push images; triggered on changes to the respective component directories +- `run-compose.yml` — integration test: spins up each compose variant and runs `bconsole` to verify the stack is healthy (runs weekly on Sundays and on compose file changes) +- `test-n-lint.yml` — linting +- `push-readme.yml` — syncs README to Docker Hub + +The CI uses reusable composite actions in `.github/actions/` (prepare, build, push, test). + +## Version Support + +- Alpine images support `linux/amd64` and `linux/arm64/v8` +- Current active versions: 24 (Ubuntu and Alpine), 22 (Alpine) +- MySQL backend was dropped in Bareos 21+; `director-mysql/` only goes up to version 20 diff --git a/director-mysql/16-ubuntu/docker-entrypoint.sh b/director-mysql/16-ubuntu/docker-entrypoint.sh index 554c4e78..65bb67f6 100644 --- a/director-mysql/16-ubuntu/docker-entrypoint.sh +++ b/director-mysql/16-ubuntu/docker-entrypoint.sh @@ -1,24 +1,8 @@ #!/usr/bin/env bash -github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' - if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control - # Download default admin profile config - if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ - --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf - fi - - # Download default webUI admin config - if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ - --output /etc/bareos/bareos-dir.d/console/admin.conf - fi - # Update bareos-director configs # Director / mycatalog & mail report sed -i 's#dbuser =.*#dbuser = root#' \ diff --git a/director-mysql/17-alpine/docker-entrypoint.sh b/director-mysql/17-alpine/docker-entrypoint.sh index 3f2850f0..e75d1662 100644 --- a/director-mysql/17-alpine/docker-entrypoint.sh +++ b/director-mysql/17-alpine/docker-entrypoint.sh @@ -1,24 +1,8 @@ #!/usr/bin/env ash -github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' - if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control - # Download default admin profile config - if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ - --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf - fi - - # Download default webUI admin config - if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ - --output /etc/bareos/bareos-dir.d/console/admin.conf - fi - # Update bareos-director configs # Director / mycatalog & mail report sed -i 's#dbuser =.*#dbuser = root#' \ diff --git a/director-mysql/17-ubuntu/docker-entrypoint.sh b/director-mysql/17-ubuntu/docker-entrypoint.sh index 554c4e78..65bb67f6 100644 --- a/director-mysql/17-ubuntu/docker-entrypoint.sh +++ b/director-mysql/17-ubuntu/docker-entrypoint.sh @@ -1,24 +1,8 @@ #!/usr/bin/env bash -github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' - if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control - # Download default admin profile config - if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ - --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf - fi - - # Download default webUI admin config - if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ - --output /etc/bareos/bareos-dir.d/console/admin.conf - fi - # Update bareos-director configs # Director / mycatalog & mail report sed -i 's#dbuser =.*#dbuser = root#' \ diff --git a/director-mysql/18-alpine/docker-entrypoint.sh b/director-mysql/18-alpine/docker-entrypoint.sh index 279622d1..c5840ff5 100644 --- a/director-mysql/18-alpine/docker-entrypoint.sh +++ b/director-mysql/18-alpine/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env ash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/18.2.12/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/18.2.12/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-mysql/18-ubuntu/docker-entrypoint.sh b/director-mysql/18-ubuntu/docker-entrypoint.sh index b51bca23..ae35364a 100644 --- a/director-mysql/18-ubuntu/docker-entrypoint.sh +++ b/director-mysql/18-ubuntu/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/18.2.12/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/18.2.12/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-mysql/19-alpine/docker-entrypoint.sh b/director-mysql/19-alpine/docker-entrypoint.sh index f145a3ff..b43ebe4d 100644 --- a/director-mysql/19-alpine/docker-entrypoint.sh +++ b/director-mysql/19-alpine/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env ash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/19.2.13/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/19.2.13/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-mysql/19-ubuntu/docker-entrypoint.sh b/director-mysql/19-ubuntu/docker-entrypoint.sh index 454a8a8f..2ea90eff 100644 --- a/director-mysql/19-ubuntu/docker-entrypoint.sh +++ b/director-mysql/19-ubuntu/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/19.2.13/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/19.2.13/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-mysql/20-alpine/docker-entrypoint.sh b/director-mysql/20-alpine/docker-entrypoint.sh index 11d4ec5e..89a10268 100644 --- a/director-mysql/20-alpine/docker-entrypoint.sh +++ b/director-mysql/20-alpine/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env ash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/20.0.9/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/20.0.9/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-mysql/20-ubuntu/docker-entrypoint.sh b/director-mysql/20-ubuntu/docker-entrypoint.sh index 085322a3..957da8ea 100644 --- a/director-mysql/20-ubuntu/docker-entrypoint.sh +++ b/director-mysql/20-ubuntu/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/20.0.9/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/20.0.9/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/16-ubuntu/docker-entrypoint.sh b/director-pgsql/16-ubuntu/docker-entrypoint.sh index c1f161e0..0418721a 100644 --- a/director-pgsql/16-ubuntu/docker-entrypoint.sh +++ b/director-pgsql/16-ubuntu/docker-entrypoint.sh @@ -1,24 +1,8 @@ #!/usr/bin/env bash -github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' - if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control - # Download default admin profile config - if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ - --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf - fi - - # Download default webUI admin config - if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ - --output /etc/bareos/bareos-dir.d/console/admin.conf - fi - # Update bareos-director configs # Director / mycatalog & mail report sed -i "s#dbuser =.*#dbuser = $DB_USER#" \ diff --git a/director-pgsql/17-ubuntu/docker-entrypoint.sh b/director-pgsql/17-ubuntu/docker-entrypoint.sh index 308ab38b..f6932a96 100644 --- a/director-pgsql/17-ubuntu/docker-entrypoint.sh +++ b/director-pgsql/17-ubuntu/docker-entrypoint.sh @@ -1,24 +1,8 @@ #!/usr/bin/env bash -github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' - if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control - # Download default admin profile config - if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ - --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf - fi - - # Download default webUI admin config - if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then - curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ - --output /etc/bareos/bareos-dir.d/console/admin.conf - fi - # Update bareos-director configs # Director / mycatalog & mail report sed -i "s#dbuser =.*#dbuser = $DB_USER#" \ diff --git a/director-pgsql/18-ubuntu/docker-entrypoint.sh b/director-pgsql/18-ubuntu/docker-entrypoint.sh index c6f3928e..c82db41f 100644 --- a/director-pgsql/18-ubuntu/docker-entrypoint.sh +++ b/director-pgsql/18-ubuntu/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/18.2.12/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/18.2.12/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/19-alpine/docker-entrypoint.sh b/director-pgsql/19-alpine/docker-entrypoint.sh index d7b716bb..d8a72c9d 100644 --- a/director-pgsql/19-alpine/docker-entrypoint.sh +++ b/director-pgsql/19-alpine/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env ash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/19.2.13/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/19.2.13/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/19-ubuntu/docker-entrypoint.sh b/director-pgsql/19-ubuntu/docker-entrypoint.sh index c6f3928e..8a4c29f8 100644 --- a/director-pgsql/19-ubuntu/docker-entrypoint.sh +++ b/director-pgsql/19-ubuntu/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/19.2.13/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/19.2.13/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/20-alpine/docker-entrypoint.sh b/director-pgsql/20-alpine/docker-entrypoint.sh index d7b716bb..56a64e12 100644 --- a/director-pgsql/20-alpine/docker-entrypoint.sh +++ b/director-pgsql/20-alpine/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env ash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/20.0.9/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/20.0.9/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/20-ubuntu/docker-entrypoint.sh b/director-pgsql/20-ubuntu/docker-entrypoint.sh index c6f3928e..8c8a0b00 100644 --- a/director-pgsql/20-ubuntu/docker-entrypoint.sh +++ b/director-pgsql/20-ubuntu/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/20.0.9/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/20.0.9/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/21-alpine/docker-entrypoint.sh b/director-pgsql/21-alpine/docker-entrypoint.sh index d7b716bb..7f162bac 100644 --- a/director-pgsql/21-alpine/docker-entrypoint.sh +++ b/director-pgsql/21-alpine/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env ash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/21.1.11/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/21.1.11/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/21-ubuntu/docker-entrypoint.sh b/director-pgsql/21-ubuntu/docker-entrypoint.sh index c6f3928e..23e63941 100644 --- a/director-pgsql/21-ubuntu/docker-entrypoint.sh +++ b/director-pgsql/21-ubuntu/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/21.1.11/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/21.1.11/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/22-alpine/docker-entrypoint.sh b/director-pgsql/22-alpine/docker-entrypoint.sh index d7b716bb..53a041a5 100644 --- a/director-pgsql/22-alpine/docker-entrypoint.sh +++ b/director-pgsql/22-alpine/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env ash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/22.1.8/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/22.1.8/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/24-ubuntu/docker-entrypoint.sh b/director-pgsql/24-ubuntu/docker-entrypoint.sh index c6f3928e..6a331f33 100644 --- a/director-pgsql/24-ubuntu/docker-entrypoint.sh +++ b/director-pgsql/24-ubuntu/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='master/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='master/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/24.0.10/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/24.0.10/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/docker-compose-alpine-mysql-v2.yml b/docker-compose-alpine-mysql-v2.yml index d2747d57..0c9758fa 100644 --- a/docker-compose-alpine-mysql-v2.yml +++ b/docker-compose-alpine-mysql-v2.yml @@ -67,7 +67,7 @@ services: - webui_data:/usr/share/bareos-webui bareos-db: - image: mysql:5.6 + image: mysql:5.7 volumes: - mysql_data:/var/lib/mysql environment: diff --git a/docker-compose-alpine-mysql.yml b/docker-compose-alpine-mysql.yml index 5a12787a..1f7aae96 100644 --- a/docker-compose-alpine-mysql.yml +++ b/docker-compose-alpine-mysql.yml @@ -64,7 +64,7 @@ services: - /data/bareos/data/webui:/usr/share/bareos-webui bareos-db: - image: mysql:5.6 + image: mysql:5.7 volumes: - /data/mysql/data:/var/lib/mysql environment: diff --git a/docker-compose-ubuntu-mysql.yml b/docker-compose-ubuntu-mysql.yml index 3513046d..9950feb3 100644 --- a/docker-compose-ubuntu-mysql.yml +++ b/docker-compose-ubuntu-mysql.yml @@ -60,7 +60,7 @@ services: - /data/bareos/config/webui:/etc/bareos-webui bareos-db: - image: mysql:5.6 + image: mysql:5.7 volumes: - /data/mysql/data:/var/lib/mysql environment: From 34ab934b79907c2cf8435d5be679befb74491d6b Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Fri, 17 Apr 2026 18:42:45 +0200 Subject: [PATCH 32/54] Delete .github/workflows/claude.yml (#16) --- .github/workflows/claude.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/claude.yml diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml deleted file mode 100644 index 2a1042ab..00000000 --- a/.github/workflows/claude.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Claude Code -on: - issue_comment: - types: [created] - pull_request_review_comment: - types: [created] -jobs: - claude: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: anthropics/claude-code-action@v1 - with: - anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - github_token: ${{ secrets.GITHUB_TOKEN }} From 184eee6cadfa3ed8cc6f0d3ad92a5427a12cf877 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Sun, 19 Apr 2026 10:37:51 +0200 Subject: [PATCH 33/54] feat: add bareos-packages/ from-source .deb builder for Ubuntu 22-24 (#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add bareos-packages/ from-source .deb builder for Ubuntu 22-24 download.bareos.org publishes versioned repos only for Bareos 20 and 21; the current/ repo serves only the latest (25.x) release. This adds a Docker-based build pipeline that compiles .deb packages from the upstream bareos/bareos release branches (bareos-22, bareos-23, bareos-24) using the Debian packaging tree shipped in the source repo. - bareos-packages/Dockerfile.builder.{jammy,noble}: minimal Ubuntu build environments with devscripts/debhelper/cmake/equivs - bareos-packages/build.sh: clones the target bareos branch, installs build-deps via mk-build-deps, runs dpkg-buildpackage with nocheck/nodoc, and collects .deb output under /artifacts/// - bareos-packages/matrix.yml: documents the three supported build tuples - .github/workflows/build-bareos-packages.yml: CI job (90 min timeout, fail-fast disabled) that builds the matrix, uploads artifacts with 30-day retention, and publishes tarballs to a GitHub Release on pkg/* tags - CLAUDE.md: updated version-support table, corrected active version list, added upstream availability reference and notes on when to use the builder fix(build): synthesize debian/changelog before dpkg-buildpackage Bareos release branches (bareos-22, bareos-23, bareos-24) do not ship debian/changelog — it is generated at release time by OBS. The debian/rules file reads the version via dpkg-parsechangelog, so dpkg-buildpackage fails immediately without it. Synthesize a minimal changelog via dch --create using a version derived from the branch name (e.g. 22.0.0~localsrc). * fix(build): add pg_ctl stub, libtirpc-dev, libnsl-dev for v24 Three more missing deps uncovered via local Docker iteration: 1. systemtests/CMakeLists.txt:134 uses find_program(PG_CTL REQUIRED) even when BUILD_TESTING=OFF (systemtests dir is always added unless client-only). Stub /usr/local/bin/pg_ctl satisfies the REQUIRED check; tests never run because DEB_BUILD_OPTIONS=nocheck. 2. libtirpc-dev is not in the static debian/control (it gets added by the cmake generate-debian-control target which runs after mk-build-deps). Without it /usr/include/tirpc/ is absent and the NDMP source that does #include fails to compile. 3. libnsl-dev added alongside for the related NIS/NSL symbols used by NDMP. --- .github/workflows/build-bareos-packages.yml | 84 +++++++++++++++++ CLAUDE.md | 20 ++++- bareos-packages/Dockerfile.builder.jammy | 19 ++++ bareos-packages/Dockerfile.builder.noble | 19 ++++ bareos-packages/README.md | 99 +++++++++++++++++++++ bareos-packages/build.sh | 73 +++++++++++++++ bareos-packages/matrix.yml | 18 ++++ 7 files changed, 331 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-bareos-packages.yml create mode 100644 bareos-packages/Dockerfile.builder.jammy create mode 100644 bareos-packages/Dockerfile.builder.noble create mode 100644 bareos-packages/README.md create mode 100755 bareos-packages/build.sh create mode 100644 bareos-packages/matrix.yml diff --git a/.github/workflows/build-bareos-packages.yml b/.github/workflows/build-bareos-packages.yml new file mode 100644 index 00000000..d98dcc59 --- /dev/null +++ b/.github/workflows/build-bareos-packages.yml @@ -0,0 +1,84 @@ +name: build-bareos-packages + +on: + workflow_dispatch: + schedule: + - cron: '0 4 * * 0' + push: + paths: + - 'bareos-packages/**' + - '.github/workflows/build-bareos-packages.yml' + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + include: + - bareos_branch: bareos-22 + ubuntu_codename: jammy + - bareos_branch: bareos-23 + ubuntu_codename: jammy + - bareos_branch: bareos-24 + ubuntu_codename: noble + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build ${{ matrix.bareos_branch }} / ${{ matrix.ubuntu_codename }} packages + run: | + docker build \ + -f bareos-packages/Dockerfile.builder.${{ matrix.ubuntu_codename }} \ + -t bareos-builder:${{ matrix.ubuntu_codename }} \ + bareos-packages/ + mkdir -p artifacts + docker run --rm \ + -v "${{ github.workspace }}/artifacts:/artifacts" \ + -e BAREOS_BRANCH=${{ matrix.bareos_branch }} \ + -e UBUNTU_CODENAME=${{ matrix.ubuntu_codename }} \ + bareos-builder:${{ matrix.ubuntu_codename }} + + - name: List produced packages + run: ls -lh artifacts/${{ matrix.bareos_branch }}/${{ matrix.ubuntu_codename }}/ + + - name: Upload packages + uses: actions/upload-artifact@v4 + with: + name: debs-${{ matrix.bareos_branch }}-${{ matrix.ubuntu_codename }} + path: artifacts/${{ matrix.bareos_branch }}/${{ matrix.ubuntu_codename }}/ + retention-days: 30 + + release: + needs: build + if: startsWith(github.ref, 'refs/tags/pkg/') + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - bareos_branch: bareos-22 + ubuntu_codename: jammy + - bareos_branch: bareos-23 + ubuntu_codename: jammy + - bareos_branch: bareos-24 + ubuntu_codename: noble + + steps: + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: debs-${{ matrix.bareos_branch }}-${{ matrix.ubuntu_codename }} + path: debs/ + + - name: Create release tarball + run: | + tar czf ${{ matrix.bareos_branch }}-${{ matrix.ubuntu_codename }}.tar.gz \ + -C debs/ . + + - name: Publish to GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: ${{ matrix.bareos_branch }}-${{ matrix.ubuntu_codename }}.tar.gz diff --git a/CLAUDE.md b/CLAUDE.md index c2923bae..f740f1d9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -90,6 +90,7 @@ GitHub Actions workflows in `.github/workflows/`: - `ci-director.yml`, `ci-client.yml`, `ci-storage.yml`, `ci-webui.yml`, `ci-api.yml` — build and push images; triggered on changes to the respective component directories - `run-compose.yml` — integration test: spins up each compose variant and runs `bconsole` to verify the stack is healthy (runs weekly on Sundays and on compose file changes) +- `build-bareos-packages.yml` — builds `.deb` packages from the bareos source repo for versions not available on `download.bareos.org`; see `bareos-packages/README.md` - `test-n-lint.yml` — linting - `push-readme.yml` — syncs README to Docker Hub @@ -98,5 +99,22 @@ The CI uses reusable composite actions in `.github/actions/` (prepare, build, pu ## Version Support - Alpine images support `linux/amd64` and `linux/arm64/v8` -- Current active versions: 24 (Ubuntu and Alpine), 22 (Alpine) +- Current active versions: 22 (Ubuntu and Alpine), 24 (Ubuntu) - MySQL backend was dropped in Bareos 21+; `director-mysql/` only goes up to version 20 + +### Upstream package availability + +`download.bareos.org` only publishes versioned repos for Bareos 20 and 21. For 22+: + +| Bareos version | Ubuntu | Alpine | +|----------------|---------------------------------|-------------------| +| 20 | versioned apt repo | Alpine 3.15 | +| 21 | versioned apt repo | Alpine 3.17 | +| 22 | `current/` (serves 25.x today) | Alpine 3.18 | +| 23 | not published upstream | not published | +| 24 | not published upstream | not published | +| 25 | `current/` (latest) | not published | + +Use `bareos-packages/` to build `.deb` packages from source for versions 22–24. +Once packages are published as GitHub Releases, use the `.claude/skills/add-bareos-version` +skill to generate new component directories that install from those artifacts. diff --git a/bareos-packages/Dockerfile.builder.jammy b/bareos-packages/Dockerfile.builder.jammy new file mode 100644 index 00000000..4eda981a --- /dev/null +++ b/bareos-packages/Dockerfile.builder.jammy @@ -0,0 +1,19 @@ +FROM ubuntu:jammy + +ENV DEBIAN_FRONTEND=noninteractive + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + git ca-certificates build-essential devscripts debhelper cmake \ + equivs fakeroot dpkg-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY build.sh /build.sh +RUN chmod +x /build.sh + +VOLUME /artifacts + +ENTRYPOINT ["/build.sh"] diff --git a/bareos-packages/Dockerfile.builder.noble b/bareos-packages/Dockerfile.builder.noble new file mode 100644 index 00000000..07f6219f --- /dev/null +++ b/bareos-packages/Dockerfile.builder.noble @@ -0,0 +1,19 @@ +FROM ubuntu:noble + +ENV DEBIAN_FRONTEND=noninteractive + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + git ca-certificates build-essential devscripts debhelper cmake \ + equivs fakeroot dpkg-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY build.sh /build.sh +RUN chmod +x /build.sh + +VOLUME /artifacts + +ENTRYPOINT ["/build.sh"] diff --git a/bareos-packages/README.md b/bareos-packages/README.md new file mode 100644 index 00000000..ad6b6f50 --- /dev/null +++ b/bareos-packages/README.md @@ -0,0 +1,99 @@ +# bareos-packages — Bareos .deb builder from source + +Builds Bareos `.deb` packages from the upstream [bareos/bareos](https://github.com/bareos/bareos) +release branches for (Bareos version, Ubuntu codename) combinations that +`download.bareos.org` does not publish. + +## Why + +`download.bareos.org/current/` only serves the latest Bareos release (25.x as of 2026). +Versioned repos exist only for Bareos 20 and 21. This builder covers the gap: + +| Bareos branch | Ubuntu codename | Published by upstream? | +|---------------|-----------------|------------------------| +| bareos-22 | jammy (22.04) | no — build from source | +| bareos-23 | jammy (22.04) | no — build from source | +| bareos-24 | noble (24.04) | no — build from source | +| bareos-25 | jammy / noble | yes — `current/` | + +## Build locally + +```bash +# Build the jammy builder image +docker build -f Dockerfile.builder.jammy -t bareos-builder:jammy . + +# Build Bareos 22 packages for jammy (takes 20–40 min on 4 cores) +mkdir -p ../artifacts +docker run --rm \ + -v "$(pwd)/../artifacts:/artifacts" \ + -e BAREOS_BRANCH=bareos-22 \ + -e UBUNTU_CODENAME=jammy \ + bareos-builder:jammy + +# Packages land in: ../artifacts/bareos-22/jammy/*.deb +ls ../artifacts/bareos-22/jammy/ +``` + +Replace `jammy` with `noble` and `bareos-22` with `bareos-24` for the noble variant. + +## CI / GitHub Actions + +Workflow: `.github/workflows/build-bareos-packages.yml` + +- **Manual trigger** (`workflow_dispatch`): builds all three matrix cells. +- **Scheduled**: Sundays at 04:00 UTC to pick up upstream branch fixes. +- **On push** to `bareos-packages/**`: rebuilds on builder file changes. + +Artifacts are uploaded (30-day retention) as `debs--`. + +## Publishing a GitHub Release + +Tag the repo with `pkg/--vN` (e.g. `pkg/bareos-22-jammy-v1`) after +a successful workflow run. The `release` job picks up the artifacts and attaches +`bareos-22-jammy.tar.gz` (etc.) to the release. + +```bash +git tag pkg/bareos-22-jammy-v1 +git push origin pkg/bareos-22-jammy-v1 +``` + +## Consuming packages in component Dockerfiles + +Once a release exists, component Dockerfiles can install from it: + +```dockerfile +ARG BAREOS_PKG_RELEASE=pkg/bareos-22-jammy-v1 +ARG BAREOS_PKG_REPO=https://github.com// + +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/bareos-22-jammy.tar.gz /tmp/bareos-pkgs.tar.gz + +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + tzdata gosu postgresql-client \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-filedaemon_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ + && rm -rf /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs \ + && apt-get clean && rm -rf /var/lib/apt/lists/* +``` + +Package names per component (from the bareos debian/ tree): + +| Component | .deb packages to install | +|----------------|-----------------------------------------------------------------------------------| +| client (fd) | `bareos-common`, `bareos-filedaemon`, `bareos-tools` | +| storage (sd) | `bareos-common`, `bareos-storage`, `bareos-storage-tape`, `bareos-tools` | +| director-pgsql | `bareos-common`, `bareos-director`, `bareos-database-common`, | +| | `bareos-database-postgresql`, `bareos-database-tools` | +| webui | `bareos-webui` | + +Use the `.claude/skills/add-bareos-version` skill to generate component directories once +a release is published — it handles the Dockerfile template and entrypoint wiring. + +## Notes + +- `bareos-storage-droplet` (S3 plugin) may not appear in all version branches; skip if absent. +- Build time: 20–40 min per matrix cell on a 4-core runner. +- Alpine source-build is deferred; no upstream APKBUILD exists for Bareos. diff --git a/bareos-packages/build.sh b/bareos-packages/build.sh new file mode 100755 index 00000000..663262bb --- /dev/null +++ b/bareos-packages/build.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +set -euo pipefail + +BAREOS_BRANCH="${BAREOS_BRANCH:?BAREOS_BRANCH env var required (e.g. bareos-22)}" +UBUNTU_CODENAME="${UBUNTU_CODENAME:?UBUNTU_CODENAME env var required (e.g. jammy)}" +ARTIFACTS_DIR="/artifacts/${BAREOS_BRANCH}/${UBUNTU_CODENAME}" + +echo "==> Cloning ${BAREOS_BRANCH} ..." +git clone --depth 1 --branch "${BAREOS_BRANCH}" \ + https://github.com/bareos/bareos.git /src + +cd /src + +if [ ! -f debian/changelog ]; then + VERSION="${BAREOS_BRANCH#bareos-}.0.0~localsrc" + echo "==> Generating debian/changelog (${VERSION}) ..." + DEBEMAIL="builder@localhost" DEBFULLNAME="Local Builder" \ + dch --create --empty \ + --package bareos \ + --newversion "${VERSION}" \ + --distribution "${UBUNTU_CODENAME}" \ + "Local build from source branch ${BAREOS_BRANCH}" +fi + +echo "==> Installing build dependencies ..." +apt-get update -qq + +case "${BAREOS_BRANCH}" in + bareos-23) + echo "==> Installing Qt5 Widgets for tray-monitor (v23) ..." + apt-get install -qq -y --no-install-recommends \ + qtbase5-dev qttools5-dev qtbase5-dev-tools libqt5widgets5 + ;; + bareos-24) + echo "==> Installing Qt5 + gRPC + CPM-satisfying system packages (v24) ..." + apt-get install -qq -y --no-install-recommends \ + qtbase5-dev qttools5-dev qtbase5-dev-tools libqt5widgets5 \ + libcli11-dev libfmt-dev libmsgsl-dev \ + libutfcpp-dev libxxhash-dev libgtest-dev libgmock-dev \ + libprotobuf-dev protobuf-compiler protobuf-compiler-grpc \ + libgrpc++-dev libgrpc-dev \ + libtirpc-dev libnsl-dev + + echo "==> Stubbing pg_ctl (systemtests CMakeLists requires it; tests not run) ..." + printf '#!/bin/sh\n' > /usr/local/bin/pg_ctl && chmod +x /usr/local/bin/pg_ctl + + echo "==> Building tl-expected from source (no noble package) ..." + git clone --depth 1 --branch v1.1.0 \ + https://github.com/TartanLlama/expected.git /tmp/tl-expected + cmake -S /tmp/tl-expected -B /tmp/tl-expected/build \ + -DCMAKE_INSTALL_PREFIX=/usr -DEXPECTED_BUILD_TESTS=OFF + cmake --install /tmp/tl-expected/build + rm -rf /tmp/tl-expected + ;; +esac + +mk-build-deps \ + --install \ + --remove \ + --tool "apt-get -qq -y --no-install-recommends -o Debug::pkgProblemResolver=yes" \ + debian/control +rm -f /src/bareos-build-deps_*.deb + +echo "==> Building packages (nocheck nodoc) ..." +DEB_BUILD_OPTIONS="nocheck nodoc parallel=$(nproc)" \ + dpkg-buildpackage -us -uc -b + +echo "==> Collecting artifacts ..." +mkdir -p "${ARTIFACTS_DIR}" +find / -maxdepth 1 -name "bareos*.deb" -exec cp {} "${ARTIFACTS_DIR}/" \; + +echo "==> Done. Produced packages:" +ls -lh "${ARTIFACTS_DIR}/" diff --git a/bareos-packages/matrix.yml b/bareos-packages/matrix.yml new file mode 100644 index 00000000..fc83d599 --- /dev/null +++ b/bareos-packages/matrix.yml @@ -0,0 +1,18 @@ +# Build matrix: (bareos_branch, ubuntu_codename) tuples +# +# bareos-22 / jammy — Bareos 22.x on Ubuntu 22.04 (upstream apt has none) +# bareos-23 / jammy — Bareos 23.x on Ubuntu 22.04 (upstream apt has none) +# bareos-24 / noble — Bareos 24.x on Ubuntu 24.04 (upstream only has 25.x) +# +# Bareos 25 is served by download.bareos.org/current/ and does not need +# a source build. bareos-20 and bareos-21 have upstream versioned repos. +# +# Alpine is not listed here — no upstream APKBUILD exists; deferred. + +matrix: + - bareos_branch: bareos-22 + ubuntu_codename: jammy + - bareos_branch: bareos-23 + ubuntu_codename: jammy + - bareos_branch: bareos-24 + ubuntu_codename: noble From 291b61f46e8e102086962718d1b5e3c04f54a09b Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Sun, 19 Apr 2026 10:50:54 +0200 Subject: [PATCH 34/54] fix(ci,lint): Fixed release name with lowercase letters (#20) --- .github/workflows/test-n-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-n-lint.yml b/.github/workflows/test-n-lint.yml index 990867c5..317ecdf3 100644 --- a/.github/workflows/test-n-lint.yml +++ b/.github/workflows/test-n-lint.yml @@ -14,7 +14,7 @@ jobs: url_api="https://api.github.com/repos/hadolint/hadolint/releases/latest" version=$(curl --silent $url_api | jq -r .tag_name) url_rlz="https://github.com/hadolint/hadolint/releases/download/${version}" - file='hadolint-Linux-x86_64' + file='hadolint-linux-x86_64' wget "${url_rlz}/$file" chmod u+x "$file" ln -s "$file" hadolint From 57b279ec0c93da3e579c2f269652ed564c2a0204 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Sun, 19 Apr 2026 11:34:07 +0200 Subject: [PATCH 35/54] feat: add Bareos 22-ubuntu images, re-enable Ubuntu CI, add version skill (#18) * feat: add Bareos 22-ubuntu images, re-enable Ubuntu CI, add version skill - Add client/storage/director-pgsql/webui 22-ubuntu Dockerfiles and entrypoints, adapting the 24-ubuntu bases to xUbuntu_22.04 (jammy) and the bareos.org current/ apt repo - Remove the 'continue' guard in prepare-bareos-app/entrypoint.sh that disabled all Ubuntu image builds in CI - Add .claude/skills/add-bareos-version/ project skill that delegates Dockerfile generation to the ollama-orchestrator subagent, with an upstream source mapping table for future version additions * fix(skill): add blank lines around lists and code block for mdl Addresses markdownlint MD031/MD032 violations flagged by test-n-lint CI on .claude/skills/add-bareos-version/SKILL.md. * fix(ci): restore ubuntu build skip until source packages land All ubuntu CI paths are currently broken: v20/v21 upstream apt repos fail, v22/v24 use current/ and install Bareos 25 (version mismatch vs directory name). Re-enable ubuntu CI in PR #2 once source-built debs are available. * fix(ci-api): Fixed a silent failure when running tests on ci-api entrypoint.sh Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --------- Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .claude/skills/add-bareos-version/SKILL.md | 79 +++++++++++ .../references/upstream-sources.md | 69 ++++++++++ .../actions/prepare-bareos-app/entrypoint.sh | 2 +- .github/actions/test-bareos-app/entrypoint.sh | 23 ++-- client/22-ubuntu/Dockerfile | 44 ++++++ client/22-ubuntu/docker-entrypoint.sh | 33 +++++ director-pgsql/22-ubuntu/Dockerfile | 58 ++++++++ director-pgsql/22-ubuntu/docker-entrypoint.sh | 128 ++++++++++++++++++ director-pgsql/22-ubuntu/webhook-notify | 41 ++++++ storage/22-ubuntu/Dockerfile | 46 +++++++ storage/22-ubuntu/docker-entrypoint.sh | 22 +++ webui/22-ubuntu/Dockerfile | 44 ++++++ webui/22-ubuntu/docker-entrypoint.sh | 25 ++++ 13 files changed, 605 insertions(+), 9 deletions(-) create mode 100644 .claude/skills/add-bareos-version/SKILL.md create mode 100644 .claude/skills/add-bareos-version/references/upstream-sources.md create mode 100644 client/22-ubuntu/Dockerfile create mode 100755 client/22-ubuntu/docker-entrypoint.sh create mode 100644 director-pgsql/22-ubuntu/Dockerfile create mode 100755 director-pgsql/22-ubuntu/docker-entrypoint.sh create mode 100755 director-pgsql/22-ubuntu/webhook-notify create mode 100644 storage/22-ubuntu/Dockerfile create mode 100755 storage/22-ubuntu/docker-entrypoint.sh create mode 100644 webui/22-ubuntu/Dockerfile create mode 100755 webui/22-ubuntu/docker-entrypoint.sh diff --git a/.claude/skills/add-bareos-version/SKILL.md b/.claude/skills/add-bareos-version/SKILL.md new file mode 100644 index 00000000..f5fd4593 --- /dev/null +++ b/.claude/skills/add-bareos-version/SKILL.md @@ -0,0 +1,79 @@ +--- +name: add-bareos-version +description: Add a new Bareos version directory (Dockerfile + docker-entrypoint.sh) for a given component and flavor (alpine|ubuntu). Delegates all code generation to the ollama-orchestrator subagent. Use when the user asks to add support for Bareos N-ubuntu or N-alpine, or fill missing version/flavor combos. Also use when the user types "add Bareos 22 ubuntu" or "generate missing Bareos versions". +allowed-tools: [Read, Write, Edit, Glob, Grep, Bash, Agent] +--- + +# add-bareos-version skill + +Generates missing Bareos Docker image directories using the ollama-orchestrator subagent. + +## Upstream source table + +See `references/upstream-sources.md` for the authoritative mapping of Bareos version → Alpine tag and Ubuntu repo URL. **Verify this table before generating** — do not assume; run the probe commands in that file if unsure. + +## Workflow + +### 1. Resolve inputs + +Accept: a list of `{component, version, flavor}` tuples. Examples: + +- "Add 22-ubuntu for all standard components" → four tuples: director-pgsql, storage, client, webui, each with version=22, flavor=ubuntu +- "Generate client/23-alpine" → one tuple + +**Standard components** = director-pgsql, storage, client, webui. The api component uses a pip-pinned pattern; handle it separately only if explicitly requested. + +### 2. Look up upstream source + +From `references/upstream-sources.md`: + +- If the version has no upstream source for the requested flavor → stop and tell the user what's missing. +- If the source is marked `current/` → note that the image will install whatever Bareos is current (as of the build date, not the directory name). + +### 3. Find the reference template + +Find the nearest existing directory with the **same component** and **same flavor**: + +- Same component, closest version, same flavor (e.g. for client/22-ubuntu, reference is client/21-ubuntu) +- Read its `Dockerfile` and `docker-entrypoint.sh` in full — pass this verbatim to the subagent + +### 4. Invoke ollama-orchestrator + +Call `Agent(subagent_type: "ollama-orchestrator", prompt: )` with: + +- The reference Dockerfile and entrypoint verbatim (inside a code fence) +- The target directory name (e.g. `client/22-ubuntu`) +- The FROM change: e.g. `FROM ubuntu:jammy` (Ubuntu 22.04) +- The BAREOS_KEY and BAREOS_REPO values from the upstream sources table +- Any differences in how the gpg key is handled between v21 and v22+ style +- A request for the complete Dockerfile and entrypoint, not a diff + +**Mandatory**: do not write Dockerfile or entrypoint bodies yourself. All content must come from ollama-orchestrator. + +### 5. Write files + +From the subagent's output, extract the Dockerfile and docker-entrypoint.sh, then: + +```bash +mkdir -p /- +# Write Dockerfile +# Write docker-entrypoint.sh +chmod +x /-/docker-entrypoint.sh +``` + +### 6. Validate one representative build + +Run `docker build --check` (or `docker build --platform linux/amd64 --no-cache -t test-bareos:local .`) from inside the new directory. If it fails, inspect the error and run one correction round through ollama-orchestrator before giving up. + +Do not attempt to build all generated dirs in one pass — do one, verify, then continue. + +### 7. Report + +State what was generated, which tuples were skipped (upstream not found), whether the test build passed. + +## Ubuntu key handling difference + +- v20–21 (old style): `curl -Ls $BAREOS_KEY -o /tmp/bareos.key` then `apt-key add /tmp/bareos.key` +- v22+ (new style): `curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg` then `[signed-by=/usr/share/keyrings/bareos.gpg]` in sources.list + +When generating v22-ubuntu, ensure the reference (v21-ubuntu old style) is adapted to the new gpg style shown in v24-ubuntu. Tell the subagent explicitly. diff --git a/.claude/skills/add-bareos-version/references/upstream-sources.md b/.claude/skills/add-bareos-version/references/upstream-sources.md new file mode 100644 index 00000000..ed6fad06 --- /dev/null +++ b/.claude/skills/add-bareos-version/references/upstream-sources.md @@ -0,0 +1,69 @@ +# Bareos Upstream Source Table + +Last verified: 2026-04-18 + +## Ubuntu repos + +| Bareos version | Ubuntu base | BAREOS_KEY | BAREOS_REPO | Status | +|---------------|-------------|------------|-------------|--------| +| 20 | ubuntu:focal (20.04) | `http://download.bareos.org/bareos/release/20/xUbuntu_20.04/Release.key` | `http://download.bareos.org/bareos/release/20/xUbuntu_20.04/` | ✓ versioned | +| 21 | ubuntu:focal (20.04) | `http://download.bareos.org/bareos/release/21/xUbuntu_20.04/Release.key` | `http://download.bareos.org/bareos/release/21/xUbuntu_20.04/` | ✓ versioned | +| 22 | ubuntu:jammy (22.04) | `http://download.bareos.org/current/xUbuntu_22.04/Release.key` | `http://download.bareos.org/current/xUbuntu_22.04/` | ⚠ current/ installs latest Bareos (25.x as of 2026-04) | +| 23 | — | — | — | ✗ no versioned repo; current/ does not pin to 23 | +| 24 | ubuntu:noble (24.04) | `http://download.bareos.org/current/xUbuntu_24.04/Release.key` | `http://download.bareos.org/current/xUbuntu_24.04/` | ⚠ current/ installs latest Bareos (25.x as of 2026-04) | +| 25 | — | — | — | ✗ no versioned repo; current/ does not pin to 25 | + +**Note**: For v22+, `current/` always tracks the latest Bareos release. The directory name reflects Ubuntu version, not Bareos version. + +## Alpine repos + +| Bareos version | Alpine tag | Bareos package | Status | +|---------------|-----------|----------------|--------| +| 20 | alpine:3.15 | bareos-20.x | ✓ in community | +| 21 | alpine:3.17 | bareos-21.x | ✓ in community | +| 22 | alpine:3.18 | bareos-22.0.3-r1 | ✓ in community | +| 23 | — | — | ✗ Alpine 3.19+ has no Bareos packages | +| 24 | — | — | ✗ Alpine 3.19+ has no Bareos packages | +| 25 | — | — | ✗ Alpine 3.19+ has no Bareos packages | + +**Note**: Bareos is only available in Alpine through 3.18. There is no Alpine support for Bareos 23+. + +## api component (bareos-restapi pip package) + +| Version | Pip spec | PyPI status | +|---------|----------|-------------| +| 21 | `>=21*,<22*` | ✓ 21.1.9 on PyPI | +| 22 | `>=22*,<23*` | ✗ not on PyPI — build will fail | +| 24 | `>=24*,<25*` | ✗ not on PyPI — build will fail | + +**api component note**: The existing api/22-alpine and api/24-alpine Dockerfiles have broken pip constraints. Only api/21-alpine is reliably buildable. Do not generate new api dirs without first verifying PyPI availability. + +## Verification commands + +```bash +# Ubuntu: check a specific version URL +curl -sfI "http://download.bareos.org/bareos/release//xUbuntu_20.04/Release.key" && echo "YES" || echo "NO" +curl -sfI "http://download.bareos.org/current/xUbuntu_22.04/Release.key" && echo "YES" || echo "NO" + +# Alpine: check what Bareos version an Alpine tag ships +docker run --rm alpine: sh -c "apk update -q 2>/dev/null && apk search -e bareos" + +# pip: check bareos-restapi versions +curl -sL "https://pypi.org/simple/bareos-restapi/" | grep -Eo 'bareos.restapi-[0-9]+\.[0-9]+\.[0-9]+' | sed 's/bareos.restapi-//' +``` + +## Missing and buildable as of 2026-04-18 + +| Component | Target | Buildable? | Reason | +|-----------|--------|------------|--------| +| director-pgsql | 22-ubuntu | ✓ | Ubuntu 22.04 + current/ | +| director-pgsql | 24-alpine | ✗ | No Alpine package for Bareos 24 | +| director-pgsql | 23-alpine/ubuntu | ✗ | No upstream source | +| director-pgsql | 25-alpine/ubuntu | ✗ | No upstream source | +| storage | same as director-pgsql | same | same | +| client | same as director-pgsql | same | same | +| webui | same as director-pgsql | same | same | +| api | 20-alpine | ✗ | bareos-restapi<21 not on PyPI | +| api | 23-alpine | ✗ | No upstream source | +| api | 25-alpine | ✗ | No upstream source | +| director-mysql | 21+ | ✗ | MySQL backend dropped in Bareos 21+ | diff --git a/.github/actions/prepare-bareos-app/entrypoint.sh b/.github/actions/prepare-bareos-app/entrypoint.sh index a73eab2f..1c0dd99f 100755 --- a/.github/actions/prepare-bareos-app/entrypoint.sh +++ b/.github/actions/prepare-bareos-app/entrypoint.sh @@ -28,7 +28,7 @@ for file in $docker_files; do base_img=$(echo "$version_dir" |cut -d'-' -f2) [[ $version -ge 20 ]] && default_backend='pgsql' - # disable ubuntu builds + # disable ubuntu builds until source-built packages are available (PR #2) if [ "${base_img}" == "ubuntu" ]; then continue fi diff --git a/.github/actions/test-bareos-app/entrypoint.sh b/.github/actions/test-bareos-app/entrypoint.sh index 717d3aa3..39f91340 100755 --- a/.github/actions/test-bareos-app/entrypoint.sh +++ b/.github/actions/test-bareos-app/entrypoint.sh @@ -20,7 +20,7 @@ while read app version arch path ; do [[ ${version} =~ $re_nightly ]] && continue ARGS='' - CMD='' + CMD=() build_tag=${version} re_alpine='^[0-9]+-alpine.*$' re_ubuntu='^[0-9]+-ubuntu.*$' @@ -30,16 +30,17 @@ while read app version arch path ; do build_tag="${version}-${arch}" if [[ "$app" == "api" ]] ; then - CMD="python -m pip show bareos-restapi | grep 'Version:' | awk '{print $2}'" + # Run through sh -c so the pipe executes inside the container + CMD=(sh -c "python -m pip show bareos-restapi | awk '/^Version:/ {print \$2}'") elif [[ "$app" == "webui" ]] ; then - CMD="apk list --installed bareos-webui" + CMD=(apk list --installed bareos-webui) else - CMD="apk list --installed bareos" + CMD=(apk list --installed bareos) fi fi if [[ $version =~ $re_ubuntu ]] ; then - CMD="dpkg-query --showformat=\${Version} --show bareos-${app}" + CMD=(dpkg-query --showformat='${Version}' --show "bareos-${app}") fi if [[ "$app" == "director" ]] ; then @@ -54,8 +55,8 @@ while read app version arch path ; do # Run docker and check version img_version=$(docker run -t --rm ${ARGS} \ - ${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${build_tag} \ - ${CMD} | tail -1) + "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${build_tag}" \ + "${CMD[@]}" | tail -1) if [[ $version =~ $re_alpine ]] ; then img_version=$(echo "$img_version" |sed -n 's#[a-z-]*\(.*\)#\1#p') @@ -64,7 +65,13 @@ while read app version arch path ; do short_img_version=$(echo "$img_version" |cut -d'.' -f1) short_version=$(echo "$version" |cut -d'-' -f1) - if [[ $short_img_version -ne $short_version ]] ; then + # Guard: extraction must yield a number, otherwise the check below silently mis-passes + if ! [[ $short_img_version =~ ^[0-9]+$ ]] ; then + echo ::error::"ERROR-test: ${app}:${build_tag} returned non-numeric version '${img_version}'" + exit 1 + fi + + if (( short_img_version != short_version )) ; then echo ::error::"ERROR-test: ${app}:${build_tag} is ${short_img_version}" exit 1 else diff --git a/client/22-ubuntu/Dockerfile b/client/22-ubuntu/Dockerfile new file mode 100644 index 00000000..3a9246e5 --- /dev/null +++ b/client/22-ubuntu/Dockerfile @@ -0,0 +1,44 @@ +# Dockerfile Bareos client/file daemon +FROM ubuntu:jammy + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV BAREOS_DAEMON_USER=bareos +ENV BAREOS_DAEMON_GROUP=bareos +ENV DEBIAN_FRONTEND=noninteractive +ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_22.04/Release.key +ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_22.04/ + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get -qq -y install --no-install-recommends curl tzdata gnupg gosu \ + && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + bareos-client mysql-client postgresql-client bareos-tools \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod a+x /docker-entrypoint.sh + +RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d + +EXPOSE 9102 + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-fd", "-f"] diff --git a/client/22-ubuntu/docker-entrypoint.sh b/client/22-ubuntu/docker-entrypoint.sh new file mode 100755 index 00000000..3b1cbf43 --- /dev/null +++ b/client/22-ubuntu/docker-entrypoint.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +#set -x + +bareos_fd_config="/etc/bareos/bareos-fd.d/director/bareos-dir.conf" + +if [ "${FORCE_ROOT}" = true ]; then + BAREOS_DAEMON_USER='root' + BAREOS_DAEMON_GROUP='root' +fi + +if [ $(id -u) = '0' ]; then + [ -n "${PUID}" ] && usermod -u ${PUID} ${BAREOS_DAEMON_USER} + [ -n "${PGID}" ] && groupmod -g ${PGID} ${BAREOS_DAEMON_GROUP} + + if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-fd.tgz --backup=simple --suffix=.before-control + + # Force client/file daemon password + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' $bareos_fd_config + + # Control file + touch /etc/bareos/bareos-config.control + fi + + # Fix permissions + find /etc/bareos ! -user ${BAREOS_DAEMON_USER} -exec chown ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} {} \; + chown -R ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} /var/lib/bareos /var/log/bareos + + # Gosu + [ "${BAREOS_DAEMON_USER}" != 'root' ] && exec gosu "${BAREOS_DAEMON_USER}" "$BASH_SOURCE" "$@" +fi + +exec "$@" diff --git a/director-pgsql/22-ubuntu/Dockerfile b/director-pgsql/22-ubuntu/Dockerfile new file mode 100644 index 00000000..6768fb8f --- /dev/null +++ b/director-pgsql/22-ubuntu/Dockerfile @@ -0,0 +1,58 @@ +# Bareos director Dockerfile +FROM ubuntu:jammy + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV DEBIAN_FRONTEND=noninteractive +ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_22.04/Release.key +ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_22.04/ +ENV BAREOS_DPKG_CONF="bareos-database-common bareos-database-common" + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ + && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/database-type select pgsql" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/missing-db-package-error select ignore" \ + | debconf-set-selections \ + && echo 'postfix postfix/main_mailer_type select No configuration' \ + | debconf-set-selections \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + bareos postgresql-client bareos-database-tools \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN tar czf /bareos-dir.tgz /etc/bareos + +COPY webhook-notify /usr/local/bin/webhook-notify +RUN chmod u+x /usr/local/bin/webhook-notify + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +EXPOSE 9101 + +VOLUME /etc/bareos + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-dir", "-u", "bareos", "-f"] diff --git a/director-pgsql/22-ubuntu/docker-entrypoint.sh b/director-pgsql/22-ubuntu/docker-entrypoint.sh new file mode 100755 index 00000000..6a331f33 --- /dev/null +++ b/director-pgsql/22-ubuntu/docker-entrypoint.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash + +github_bareos='raw.githubusercontent.com/bareos/bareos' +webui_admin_conf='Release/24.0.10/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/24.0.10/webui/install/bareos/bareos-dir.d/console/admin.conf.example' + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control + + # Download default admin profile config + if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ + --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf + fi + + # Download default webUI admin config + if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ + --output /etc/bareos/bareos-dir.d/console/admin.conf + fi + + # Update bareos-director configs + # Director / mycatalog & mail report + sed -i 's#dbuser = "bareos"#dbuser = '\"${DB_USER}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbpassword = ""#dbpassword = '\"${DB_PASSWORD}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbname = "bareos"#dbname = '\"${DB_NAME}\"'\n dbaddress = '\"${DB_HOST}\"'\n dbport = '\"${DB_PORT}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + + # Setup webhook + if [ "${WEBHOOK_NOTIFICATION}" = true ]; then + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + fi + + # storage daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_SD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + + # client/file daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_FD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + + # webUI + sed -i 's#Password = .*#Password = '\""${BAREOS_WEBUI_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/console/admin.conf + sed -i "s#}# TlsEnable = false\n}#" \ + /etc/bareos/bareos-dir.d/console/admin.conf + + # MyCatalog Backup + sed -i "s#/var/lib/bareos/bareos.sql#/var/lib/bareos-director/bareos.sql#" \ + /etc/bareos/bareos-dir.d/fileset/Catalog.conf + + # Control file + touch /etc/bareos/bareos-config.control +fi + +if [[ -z ${CI_TEST} ]] ; then + # Waiting Postgresql is up + sqlup=1 + while [ "$sqlup" -ne 0 ] ; do + echo "Waiting for postgresql..." + pg_isready --host="${DB_HOST}" --port="${DB_PORT}" --user="${DB_ADMIN_USER}" + if [ $? -ne 0 ] ; then + sqlup=1 + sleep 5 + else + sqlup=0 + echo "...postgresql is alive" + fi + done +fi + +export PGUSER=${DB_ADMIN_USER} +export PGHOST=${DB_HOST} +export PGPASSWORD=${DB_ADMIN_PASSWORD} +[[ -z "${DB_INIT}" ]] && DB_INIT='false' +[[ -z "${DB_UPDATE}" ]] && DB_UPDATE='false' + +if [ ! -f /etc/bareos/bareos-db.control ] && [ "${DB_INIT}" == 'true' ] ; then + # Init Postgresql DB + echo "Bareos DB init" + echo "Bareos DB init: Create user ${DB_USER}" + psql -c "create user ${DB_USER} with createdb createrole login;" + echo "Bareos DB init: Set user password" + psql -c "alter user ${DB_USER} password '${DB_PASSWORD}';" + /usr/lib/bareos/scripts/create_bareos_database 2>/dev/null + /usr/lib/bareos/scripts/make_bareos_tables 2>/dev/null + /usr/lib/bareos/scripts/grant_bareos_privileges 2>/dev/null + + # Control file + touch /etc/bareos/bareos-db.control +fi + +if [ "${DB_UPDATE}" == 'true' ] ; then + # Try Postgres upgrade + echo "Bareoos DB update" + echo "Bareoos DB update: Update tables" + /usr/lib/bareos/scripts/update_bareos_tables 2>/dev/null + echo "Bareoos DB update: Grant privileges" + /usr/lib/bareos/scripts/grant_bareos_privileges 2>/dev/null +fi + +# Fix permissions +find /etc/bareos ! -user bareos -exec chown bareos {} \; +chown -R bareos:bareos /var/lib/bareos + +# Run Dockerfile CMD +exec "$@" diff --git a/director-pgsql/22-ubuntu/webhook-notify b/director-pgsql/22-ubuntu/webhook-notify new file mode 100755 index 00000000..801e3eaa --- /dev/null +++ b/director-pgsql/22-ubuntu/webhook-notify @@ -0,0 +1,41 @@ +#!/usr/bin/env sh + +job_type=$1 +job_status=$2 +job_client=$3 +job_level=$4 +job_name=$5 +msg_icon="❌" + +if [ "$job_status" = "OK" ] ;then + msg_icon="✅" +fi + +msg_txt="$msg_icon Bareos: $job_type $job_status of $job_client \ +$job_level (${job_name})" + +load_json() +{ + if [ "${WEBHOOK_TYPE}" = "slack" ] ; then + cat < /etc/apt/sources.list.d/bareos.list \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + bareos-storage bareos-tools bareos-storage-tape mtx scsitools \ + sg3-utils mt-st bareos-storage-droplet \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d + +EXPOSE 9103 + +VOLUME /etc/bareos +VOLUME /var/lib/bareos/storage + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-sd", "-u", "bareos", "-f"] diff --git a/storage/22-ubuntu/docker-entrypoint.sh b/storage/22-ubuntu/docker-entrypoint.sh new file mode 100755 index 00000000..a7134011 --- /dev/null +++ b/storage/22-ubuntu/docker-entrypoint.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +bareos_sd_config="/etc/bareos/bareos-sd.d/director/bareos-dir.conf" + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xfz /bareos-sd.tgz --backup=simple --suffix=.before-control + + # Update bareos-storage configs + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' $bareos_sd_config + + # Control file + touch /etc/bareos/bareos-config.control +fi + +# Fix permissions +find /var/lib/bareos ! -user bareos -exec chown bareos {} \; +find /etc/bareos/bareos-sd.d ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/[n]?st[0-9]+" ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/tape/.*" ! -user bareos -exec chown bareos {} \; + +# Run Dockerfile CMD +exec "$@" diff --git a/webui/22-ubuntu/Dockerfile b/webui/22-ubuntu/Dockerfile new file mode 100644 index 00000000..eed5cfc8 --- /dev/null +++ b/webui/22-ubuntu/Dockerfile @@ -0,0 +1,44 @@ +# Bareos Web-ui Dockerfile +FROM ubuntu:jammy + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_22.04/Release.key +ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_22.04/ +ENV DEBIAN_FRONTEND=noninteractive + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ + && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + bareos-webui \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +RUN tar czf /bareos-webui.tgz /etc/bareos-webui + +EXPOSE 80 + +VOLUME /etc/bareos-webui + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] diff --git a/webui/22-ubuntu/docker-entrypoint.sh b/webui/22-ubuntu/docker-entrypoint.sh new file mode 100755 index 00000000..94b0af54 --- /dev/null +++ b/webui/22-ubuntu/docker-entrypoint.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +if [ ! -f /etc/bareos-webui/bareos-config.control ];then + tar xzf /bareos-webui.tgz --backup=simple --suffix=.before-control + + # Update bareos-webui config + sed -i 's#diraddress.*#diraddress = '\""${BAREOS_DIR_HOST}"\"'#' \ + /etc/bareos-webui/directors.ini + + # Control file + touch /etc/bareos-webui/bareos-config.control +fi + +apache_conf="/etc/apache2/sites-available/000-default.conf" + +# Set document root +sed -i "s#/var/www/html#/usr/share/bareos-webui/public#g" $apache_conf + +# Enable Apache server stats +if [ "${SERVER_STATS}" == "yes" ]; then + sed -i 's!#ServerName.*!Alias /server-status /var/www/dummy!' $apache_conf +fi + +# Run Dockerfile CMD +exec "$@" From 236ac3d5039f8315a99d22d452e4377e0b629e45 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Mon, 20 Apr 2026 15:13:46 +0200 Subject: [PATCH 36/54] docs: add fork PR policy constraint to CLAUDE.md (#21) Never open PRs against the upstream repo; always target the fork (origin). Co-authored-by: Claude Sonnet 4.6 --- CLAUDE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index f740f1d9..8b221c80 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -84,6 +84,10 @@ See `.env.dist` for all required variables. The most important ones for the Dire | `SMTP_HOST`, `ADMIN_MAIL` | Mail reporting | | `WEBHOOK_NOTIFICATION`, `WEBHOOK_TYPE`, `WEBHOOK_URL` | Slack/Telegram notifications | +## Git and GitHub Workflow + +This repo is a fork. **Always push branches and open PRs against the fork (`origin`), never against the upstream repository.** When using `gh` commands, always pass `--repo` to target the fork explicitly. + ## CI/CD GitHub Actions workflows in `.github/workflows/`: From 03b11f7d2e09f88fff86d004e5f8003694588d19 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Wed, 29 Apr 2026 19:12:33 +0200 Subject: [PATCH 37/54] chore(readme): Updated README file (#22) Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- README.md | 106 +++++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index e8b0e132..821fc0b5 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ ![Based OS][os-based-ubuntu] ![Based OS][os-based-alpine] ![Badge amd64][arch-amd64-img] ![Badge arm64][arch-arm64/v8-img] +## Note: currently the images are hosted on a private repo. They will be publish on docker.io or ghcr.io once the CI/CD process is stable + ## About This package provides images for [Bareos][bareos-href] : @@ -210,7 +212,7 @@ docker run -t -i \ -e PGUSER=postgres \ -v /data/pgsql/data:/pg_old/data \ -v /data/pgsql-new/data:/pg_new/data \ - barcus/postgresql-upgrade + dark-vex/postgresql-upgrade ``` After sucessful migration, use the new folder `/data/pgsql-new/data` and the @@ -226,7 +228,7 @@ Build your own docker-compose file with this template : version: '3' services: bareos-dir: - image: barcus/bareos-director:latest #latest director-pgsql based on ubuntu + image: dark-vex/bareos-director:latest #latest director-pgsql based on ubuntu volumes: - :/etc/bareos - :/var/lib/bareos #required for MyCatalog backup @@ -257,7 +259,7 @@ services: - bareos-db bareos-sd: - image: barcus/bareos-storage:latest + image: dark-vex/bareos-storage:latest ports: - 9103:9103 volumes: @@ -267,7 +269,7 @@ services: - BAREOS_SD_PASSWORD=${BAREOS_SD_PASSWORD} # defined in .env file bareos-fd: - image: barcus/bareos-client:latest + image: dark-vex/bareos-client:latest volumes: - :/etc/bareos - :/var/lib/bareos-director #required for MyCatalog backup @@ -276,7 +278,7 @@ services: - FORCE_ROOT=false bareos-webui: - image: barcus/bareos-webui:latest + image: dark-vex/bareos-webui:latest ports: - 8080:80 environment: @@ -302,7 +304,7 @@ services: - POSTGRES_INITDB_ARGS=--encoding=SQL_ASCII bareos-api: - image: barcus/bareos-api:21 + image: dark-vex/bareos-api:21 ports: - 8000:8000 environment: @@ -370,7 +372,7 @@ Required as catalog backend, simply use the official MySQL/PostgreSQL image Build your own Bareos images : ```bash -git clone https://github.com/barcus/bareos +git clone https://github.com/dark-vex/bareos cd bareos docker build -t director-pqsl:20-alpine director-pgsql/20-alpine docker build -t storage:20-alpine storage/20-alpine @@ -392,16 +394,16 @@ Thanks to @rockyluke :) For more information visit the Github repositories : -* [bareos-director-mysql](https://github.com/barcus/bareos/tree/master/director-mysql) -* [bareos-director-pgsql](https://github.com/barcus/bareos/tree/master/director-pgsql) -* [bareos-storage](https://github.com/barcus/bareos/tree/master/storage) -* [bareos-client](https://github.com/barcus/bareos/tree/master/client) -* [bareos-webui](https://github.com/barcus/bareos/tree/master/webui) +* [bareos-director-mysql](https://github.com/dark-vex/bareos/tree/master/director-mysql) +* [bareos-director-pgsql](https://github.com/dark-vex/bareos/tree/master/director-pgsql) +* [bareos-storage](https://github.com/dark-vex/bareos/tree/master/storage) +* [bareos-client](https://github.com/dark-vex/bareos/tree/master/client) +* [bareos-webui](https://github.com/dark-vex/bareos/tree/master/webui) * [docker-ubuntu](https://github.com/rockyluke/docker-ubuntu) My Docker hub : -* [docker images](https://hub.docker.com/r/barcus) +* [docker images](https://hub.docker.com/r/dark-vex) Enjoy ! @@ -409,49 +411,49 @@ Enjoy ! [arch-arm64/v8-img]: https://img.shields.io/badge/arch-arm64/v8-inactive [bareos-href]: https://www.bareos.org [bareos-doc]: https://www.bareos.com/learn/documentation -[build-client-href]: https://github.com/barcus/bareos/actions?query=workflow%3Aci-client -[build-client-img]: https://github.com/barcus/bareos/workflows/ci-client/badge.svg -[build-director-href]: https://github.com/barcus/bareos/actions?query=workflow%3Aci-director -[build-director-img]: https://github.com/barcus/bareos/workflows/ci-director/badge.svg -[build-img]: https://travis-ci.org/barcus/bareos.svg?branch=master -[build-storage-href]: https://github.com/barcus/bareos/actions?query=workflow%3Aci-storage -[build-storage-img]: https://github.com/barcus/bareos/workflows/ci-storage/badge.svg -[build-url]: https://travis-ci.org/barcus/bareos -[build-webui-href]: https://github.com/barcus/bareos/actions?query=workflow%3Aci-webui -[build-webui-img]: https://github.com/barcus/bareos/workflows/ci-webui/badge.svg -[build-api-href]: https://github.com/barcus/bareos/actions?query=workflow%3Aci-api -[build-api-img]: https://github.com/barcus/bareos/workflows/ci-api/badge.svg -[compose-alpinev1-href]: https://github.com/barcus/bareos/blob/master/docker-compose-alpine-v1.yml -[compose-alpinev2-href]: https://github.com/barcus/bareos/blob/master/docker-compose-alpine-v2.yml -[compose-ubuntu-mysql-href]: https://github.com/barcus/bareos/blob/master/docker-compose-ubuntu-mysql.yml -[compose-ubuntu-pgsql-href]: https://github.com/barcus/bareos/blob/master/docker-compose-ubuntu-pgsql.yml -[compose-db-migration-href]: https://github.com/barcus/bareos/blob/master/bareos-db-migration/docker-compose.yml +[build-client-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-client +[build-client-img]: https://github.com/dark-vex/bareos/workflows/ci-client/badge.svg +[build-director-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-director +[build-director-img]: https://github.com/dark-vex/bareos/workflows/ci-director/badge.svg +[build-img]: https://travis-ci.org/dark-vex/bareos.svg?branch=master +[build-storage-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-storage +[build-storage-img]: https://github.com/dark-vex/bareos/workflows/ci-storage/badge.svg +[build-url]: https://travis-ci.org/dark-vex/bareos +[build-webui-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-webui +[build-webui-img]: https://github.com/dark-vex/bareos/workflows/ci-webui/badge.svg +[build-api-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-api +[build-api-img]: https://github.com/dark-vex/bareos/workflows/ci-api/badge.svg +[compose-alpinev1-href]: https://github.com/dark-vex/bareos/blob/master/docker-compose-alpine-v1.yml +[compose-alpinev2-href]: https://github.com/dark-vex/bareos/blob/master/docker-compose-alpine-v2.yml +[compose-ubuntu-mysql-href]: https://github.com/dark-vex/bareos/blob/master/docker-compose-ubuntu-mysql.yml +[compose-ubuntu-pgsql-href]: https://github.com/dark-vex/bareos/blob/master/docker-compose-ubuntu-pgsql.yml +[compose-db-migration-href]: https://github.com/dark-vex/bareos/blob/master/bareos-db-migration/docker-compose.yml [docker-compose-href]: https://docs.docker.com/compose [docker-href]: https://docs.docker.com/install -[docker-img-dir]: https://img.shields.io/docker/pulls/barcus/bareos-director?label=bareos-director&logo=docker -[docker-img-fd]: https://img.shields.io/docker/pulls/barcus/bareos-client?label=bareos-client&logo=docker -[docker-img-sd]: https://img.shields.io/docker/pulls/barcus/bareos-storage?label=bareos-storage&logo=docker -[docker-img-ui]: https://img.shields.io/docker/pulls/barcus/bareos-webui?label=bareos-webui&logo=docker -[docker-img-api]: https://img.shields.io/docker/pulls/barcus/bareos-api?label=bareos-api&logo=docker -[docker-url]: https://registry.hub.docker.com/r/barcus -[docker-url-dir]: https://registry.hub.docker.com/r/barcus/bareos-director -[docker-url-fd]: https://registry.hub.docker.com/r/barcus/bareos-client -[docker-url-sd]: https://registry.hub.docker.com/r/barcus/bareos-storage -[docker-url-ui]: https://registry.hub.docker.com/r/barcus/bareos-webui -[docker-url-api]: https://registry.hub.docker.com/r/barcus/bareos-api +[docker-img-dir]: https://img.shields.io/docker/pulls/dark-vex/bareos-director?label=bareos-director&logo=docker +[docker-img-fd]: https://img.shields.io/docker/pulls/dark-vex/bareos-client?label=bareos-client&logo=docker +[docker-img-sd]: https://img.shields.io/docker/pulls/dark-vex/bareos-storage?label=bareos-storage&logo=docker +[docker-img-ui]: https://img.shields.io/docker/pulls/dark-vex/bareos-webui?label=bareos-webui&logo=docker +[docker-img-api]: https://img.shields.io/docker/pulls/dark-vex/bareos-api?label=bareos-api&logo=docker +[docker-url]: https://registry.hub.docker.com/r/dark-vex +[docker-url-dir]: https://registry.hub.docker.com/r/dark-vex/bareos-director +[docker-url-fd]: https://registry.hub.docker.com/r/dark-vex/bareos-client +[docker-url-sd]: https://registry.hub.docker.com/r/dark-vex/bareos-storage +[docker-url-ui]: https://registry.hub.docker.com/r/dark-vex/bareos-webui +[docker-url-api]: https://registry.hub.docker.com/r/dark-vex/bareos-api [license-img]: https://img.shields.io/badge/License-MIT-yellow.svg [os-based-alpine]: https://img.shields.io/badge/os-alpine-9cf [os-based-ubuntu]: https://img.shields.io/badge/os-ubuntu-9cf -[size-alpine-client-png]: https://img.shields.io/docker/image-size/barcus/bareos-client/alpine?label=alpine&style=plastic -[size-alpine-director-png]: https://img.shields.io/docker/image-size/barcus/bareos-director/alpine?label=alpine&style=plastic -[size-alpine-storage-png]: https://img.shields.io/docker/image-size/barcus/bareos-storage/alpine?label=alpine&style=plastic -[size-alpine-webui-png]: https://img.shields.io/docker/image-size/barcus/bareos-webui/alpine?label=alpine&style=plastic -[size-latest-client-png]: https://img.shields.io/docker/image-size/barcus/bareos-client/latest?label=latest&style=plastic -[size-latest-director-png]: https://img.shields.io/docker/image-size/barcus/bareos-director/latest?label=latest&style=plastic -[size-latest-storage-png]: https://img.shields.io/docker/image-size/barcus/bareos-storage/latest?label=latest&style=plastic -[size-latest-webui-png]: https://img.shields.io/docker/image-size/barcus/bareos-webui/latest?label=latest&style=plastic -[size-latest-api-png]: https://img.shields.io/docker/image-size/barcus/bareos-api/latest?label=latest&style=plastic -[run-compose-png]: https://github.com/barcus/bareos/workflows/run-compose/badge.svg -[psql-upgrade-href]: https://github.com/barcus/postgresql-upgrade +[size-alpine-client-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-client/alpine?label=alpine&style=plastic +[size-alpine-director-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-director/alpine?label=alpine&style=plastic +[size-alpine-storage-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-storage/alpine?label=alpine&style=plastic +[size-alpine-webui-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-webui/alpine?label=alpine&style=plastic +[size-latest-client-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-client/latest?label=latest&style=plastic +[size-latest-director-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-director/latest?label=latest&style=plastic +[size-latest-storage-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-storage/latest?label=latest&style=plastic +[size-latest-webui-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-webui/latest?label=latest&style=plastic +[size-latest-api-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-api/latest?label=latest&style=plastic +[run-compose-png]: https://github.com/dark-vex/bareos/workflows/run-compose/badge.svg +[psql-upgrade-href]: https://github.com/dark-vex/postgresql-upgrade [bareos-exporter-href]: https://github.com/vierbergenlars/bareos_exporter [prometheus-href]: https://prometheus.io From ee6a743fad4775aa5dfe34655b8f567cc8b5bf5d Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Sun, 10 May 2026 13:51:04 +0200 Subject: [PATCH 38/54] fix(ci): Fix bareos packages build, rely on Releases/x.x.x instead of work in progress WIP/x.x.x) (#23) * chore(readme): Updated README file Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci): Fix bareos packages build, rely on Releases/x.x.x instead of work in progress WIP/x.x.x) Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --------- Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .github/workflows/build-bareos-packages.yml | 7 +++++++ bareos-packages/README.md | 21 +++++++++++---------- bareos-packages/build.sh | 13 +++++++++---- bareos-packages/matrix.yml | 14 ++++++++++---- 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-bareos-packages.yml b/.github/workflows/build-bareos-packages.yml index d98dcc59..2d4f4378 100644 --- a/.github/workflows/build-bareos-packages.yml +++ b/.github/workflows/build-bareos-packages.yml @@ -18,10 +18,13 @@ jobs: matrix: include: - bareos_branch: bareos-22 + bareos_ref: Release/22.1.8 ubuntu_codename: jammy - bareos_branch: bareos-23 + bareos_ref: Release/23.1.7 ubuntu_codename: jammy - bareos_branch: bareos-24 + bareos_ref: Release/24.0.10 ubuntu_codename: noble steps: @@ -38,6 +41,7 @@ jobs: docker run --rm \ -v "${{ github.workspace }}/artifacts:/artifacts" \ -e BAREOS_BRANCH=${{ matrix.bareos_branch }} \ + -e BAREOS_REF=${{ matrix.bareos_ref }} \ -e UBUNTU_CODENAME=${{ matrix.ubuntu_codename }} \ bareos-builder:${{ matrix.ubuntu_codename }} @@ -60,10 +64,13 @@ jobs: matrix: include: - bareos_branch: bareos-22 + bareos_ref: Release/22.1.8 ubuntu_codename: jammy - bareos_branch: bareos-23 + bareos_ref: Release/23.1.7 ubuntu_codename: jammy - bareos_branch: bareos-24 + bareos_ref: Release/24.0.10 ubuntu_codename: noble steps: diff --git a/bareos-packages/README.md b/bareos-packages/README.md index ad6b6f50..1f052555 100644 --- a/bareos-packages/README.md +++ b/bareos-packages/README.md @@ -1,7 +1,7 @@ # bareos-packages — Bareos .deb builder from source -Builds Bareos `.deb` packages from the upstream [bareos/bareos](https://github.com/bareos/bareos) -release branches for (Bareos version, Ubuntu codename) combinations that +Builds Bareos `.deb` packages from upstream [bareos/bareos](https://github.com/bareos/bareos) +release tags for (Bareos version, Ubuntu codename) combinations that `download.bareos.org` does not publish. ## Why @@ -9,12 +9,12 @@ release branches for (Bareos version, Ubuntu codename) combinations that `download.bareos.org/current/` only serves the latest Bareos release (25.x as of 2026). Versioned repos exist only for Bareos 20 and 21. This builder covers the gap: -| Bareos branch | Ubuntu codename | Published by upstream? | -|---------------|-----------------|------------------------| -| bareos-22 | jammy (22.04) | no — build from source | -| bareos-23 | jammy (22.04) | no — build from source | -| bareos-24 | noble (24.04) | no — build from source | -| bareos-25 | jammy / noble | yes — `current/` | +| Artifact bucket | Upstream ref | Ubuntu codename | Published by upstream? | +|-----------------|------------------|-----------------|------------------------| +| bareos-22 | Release/22.1.8 | jammy (22.04) | no — build from source | +| bareos-23 | Release/23.1.7 | jammy (22.04) | no — build from source | +| bareos-24 | Release/24.0.10 | noble (24.04) | no — build from source | +| bareos-25 | current | jammy / noble | yes — `current/` | ## Build locally @@ -27,6 +27,7 @@ mkdir -p ../artifacts docker run --rm \ -v "$(pwd)/../artifacts:/artifacts" \ -e BAREOS_BRANCH=bareos-22 \ + -e BAREOS_REF=Release/22.1.8 \ -e UBUNTU_CODENAME=jammy \ bareos-builder:jammy @@ -34,14 +35,14 @@ docker run --rm \ ls ../artifacts/bareos-22/jammy/ ``` -Replace `jammy` with `noble` and `bareos-22` with `bareos-24` for the noble variant. +Replace `jammy`, `bareos-22`, and `Release/22.1.8` with the matching matrix values for other variants. ## CI / GitHub Actions Workflow: `.github/workflows/build-bareos-packages.yml` - **Manual trigger** (`workflow_dispatch`): builds all three matrix cells. -- **Scheduled**: Sundays at 04:00 UTC to pick up upstream branch fixes. +- **Scheduled**: Sundays at 04:00 UTC to rebuild the pinned upstream release tags. - **On push** to `bareos-packages/**`: rebuilds on builder file changes. Artifacts are uploaded (30-day retention) as `debs--`. diff --git a/bareos-packages/build.sh b/bareos-packages/build.sh index 663262bb..ac305e1e 100755 --- a/bareos-packages/build.sh +++ b/bareos-packages/build.sh @@ -2,24 +2,29 @@ set -euo pipefail BAREOS_BRANCH="${BAREOS_BRANCH:?BAREOS_BRANCH env var required (e.g. bareos-22)}" +BAREOS_REF="${BAREOS_REF:-${BAREOS_BRANCH}}" UBUNTU_CODENAME="${UBUNTU_CODENAME:?UBUNTU_CODENAME env var required (e.g. jammy)}" ARTIFACTS_DIR="/artifacts/${BAREOS_BRANCH}/${UBUNTU_CODENAME}" -echo "==> Cloning ${BAREOS_BRANCH} ..." -git clone --depth 1 --branch "${BAREOS_BRANCH}" \ +echo "==> Cloning ${BAREOS_REF} ..." +git clone --depth 1 --branch "${BAREOS_REF}" \ https://github.com/bareos/bareos.git /src cd /src if [ ! -f debian/changelog ]; then - VERSION="${BAREOS_BRANCH#bareos-}.0.0~localsrc" + if [[ "${BAREOS_REF}" =~ ^Release/([0-9]+[.][0-9]+[.][0-9]+.*)$ ]]; then + VERSION="${BASH_REMATCH[1]}~localsrc" + else + VERSION="${BAREOS_BRANCH#bareos-}.0.0~localsrc" + fi echo "==> Generating debian/changelog (${VERSION}) ..." DEBEMAIL="builder@localhost" DEBFULLNAME="Local Builder" \ dch --create --empty \ --package bareos \ --newversion "${VERSION}" \ --distribution "${UBUNTU_CODENAME}" \ - "Local build from source branch ${BAREOS_BRANCH}" + "Local build from source ref ${BAREOS_REF}" fi echo "==> Installing build dependencies ..." diff --git a/bareos-packages/matrix.yml b/bareos-packages/matrix.yml index fc83d599..e33ddade 100644 --- a/bareos-packages/matrix.yml +++ b/bareos-packages/matrix.yml @@ -1,8 +1,11 @@ -# Build matrix: (bareos_branch, ubuntu_codename) tuples +# Build matrix: (bareos_branch, bareos_ref, ubuntu_codename) tuples # -# bareos-22 / jammy — Bareos 22.x on Ubuntu 22.04 (upstream apt has none) -# bareos-23 / jammy — Bareos 23.x on Ubuntu 22.04 (upstream apt has none) -# bareos-24 / noble — Bareos 24.x on Ubuntu 24.04 (upstream only has 25.x) +# bareos_branch is the artifact bucket. +# bareos_ref is the stable upstream Release tag to build from. +# +# bareos-22 / Release/22.1.8 / jammy — Bareos 22.x on Ubuntu 22.04 (upstream apt has none) +# bareos-23 / Release/23.1.7 / jammy — Bareos 23.x on Ubuntu 22.04 (upstream apt has none) +# bareos-24 / Release/24.0.10 / noble — Bareos 24.x on Ubuntu 24.04 (upstream only has 25.x) # # Bareos 25 is served by download.bareos.org/current/ and does not need # a source build. bareos-20 and bareos-21 have upstream versioned repos. @@ -11,8 +14,11 @@ matrix: - bareos_branch: bareos-22 + bareos_ref: Release/22.1.8 ubuntu_codename: jammy - bareos_branch: bareos-23 + bareos_ref: Release/23.1.7 ubuntu_codename: jammy - bareos_branch: bareos-24 + bareos_ref: Release/24.0.10 ubuntu_codename: noble From 32ac39fe1e78a382ed413d7dd73f56fe028c8f2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 May 2026 14:11:03 +0200 Subject: [PATCH 39/54] chore(deps): bump softprops/action-gh-release from 2 to 3 (#24) Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2 to 3. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-bareos-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-bareos-packages.yml b/.github/workflows/build-bareos-packages.yml index 2d4f4378..54c6e021 100644 --- a/.github/workflows/build-bareos-packages.yml +++ b/.github/workflows/build-bareos-packages.yml @@ -86,6 +86,6 @@ jobs: -C debs/ . - name: Publish to GitHub Release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: files: ${{ matrix.bareos_branch }}-${{ matrix.ubuntu_codename }}.tar.gz From 184cddd8644f80c7f0978fa9fbb2fb6d5190f683 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 May 2026 14:12:33 +0200 Subject: [PATCH 40/54] chore(deps): bump peter-evans/dockerhub-description from 4.0.0 to 5.0.0 (#25) Bumps [peter-evans/dockerhub-description](https://github.com/peter-evans/dockerhub-description) from 4.0.0 to 5.0.0. - [Release notes](https://github.com/peter-evans/dockerhub-description/releases) - [Commits](https://github.com/peter-evans/dockerhub-description/compare/v4.0.0...v5.0.0) --- updated-dependencies: - dependency-name: peter-evans/dockerhub-description dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/push-readme.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-readme.yml b/.github/workflows/push-readme.yml index 276a2133..c072eada 100644 --- a/.github/workflows/push-readme.yml +++ b/.github/workflows/push-readme.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v4 - name: Update Docker Hub description - uses: peter-evans/dockerhub-description@v4.0.0 + uses: peter-evans/dockerhub-description@v5.0.0 env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USER }} DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASS }} From faf028d3837ef462e90d597acecc0c92f06f3a0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 May 2026 14:14:31 +0200 Subject: [PATCH 41/54] chore(deps): bump docker/setup-qemu-action from 3 to 4 (#26) Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3 to 4. - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/v3...v4) --- updated-dependencies: - dependency-name: docker/setup-qemu-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-api.yml | 4 ++-- .github/workflows/ci-client.yml | 4 ++-- .github/workflows/ci-director.yml | 4 ++-- .github/workflows/ci-storage.yml | 4 ++-- .github/workflows/ci-webui.yml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-api.yml b/.github/workflows/ci-api.yml index 39904f41..f14e3f3c 100644 --- a/.github/workflows/ci-api.yml +++ b/.github/workflows/ci-api.yml @@ -54,7 +54,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all @@ -85,7 +85,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all diff --git a/.github/workflows/ci-client.yml b/.github/workflows/ci-client.yml index 53fac004..622edcf1 100644 --- a/.github/workflows/ci-client.yml +++ b/.github/workflows/ci-client.yml @@ -54,7 +54,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all @@ -85,7 +85,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all diff --git a/.github/workflows/ci-director.yml b/.github/workflows/ci-director.yml index d25dd9c1..3685ca8f 100644 --- a/.github/workflows/ci-director.yml +++ b/.github/workflows/ci-director.yml @@ -54,7 +54,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all @@ -85,7 +85,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all diff --git a/.github/workflows/ci-storage.yml b/.github/workflows/ci-storage.yml index 53e27e7c..5cade344 100644 --- a/.github/workflows/ci-storage.yml +++ b/.github/workflows/ci-storage.yml @@ -54,7 +54,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all @@ -85,7 +85,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all diff --git a/.github/workflows/ci-webui.yml b/.github/workflows/ci-webui.yml index 24931d84..802c099c 100644 --- a/.github/workflows/ci-webui.yml +++ b/.github/workflows/ci-webui.yml @@ -54,7 +54,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all @@ -85,7 +85,7 @@ jobs: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: image: tonistiigi/binfmt:latest platforms: all From 6c9d4674c5bb5f34a3ec19d4669b050da0810d31 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Sun, 10 May 2026 14:28:33 +0200 Subject: [PATCH 42/54] fix(ci): Fix dockerhub action (#29) Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .github/workflows/push-readme.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push-readme.yml b/.github/workflows/push-readme.yml index c072eada..699837c0 100644 --- a/.github/workflows/push-readme.yml +++ b/.github/workflows/push-readme.yml @@ -22,7 +22,7 @@ jobs: - name: Update Docker Hub description uses: peter-evans/dockerhub-description@v5.0.0 - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USER }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASS }} - DOCKERHUB_REPOSITORY: ${{ secrets.REGISTRY_URL }}/bareos/bareos-${{ matrix.module }} + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + repository: ${{ secrets.REGISTRY_URL }}-${{ matrix.module }} From b987c0806331af9f312ce45d9617862b5b002b19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 May 2026 14:45:18 +0200 Subject: [PATCH 43/54] chore(deps): bump actions/upload-artifact from 4 to 7 (#27) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-bareos-packages.yml | 2 +- .github/workflows/ci-api.yml | 4 ++-- .github/workflows/ci-client.yml | 4 ++-- .github/workflows/ci-director.yml | 4 ++-- .github/workflows/ci-storage.yml | 4 ++-- .github/workflows/ci-webui.yml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-bareos-packages.yml b/.github/workflows/build-bareos-packages.yml index 54c6e021..eee31f30 100644 --- a/.github/workflows/build-bareos-packages.yml +++ b/.github/workflows/build-bareos-packages.yml @@ -49,7 +49,7 @@ jobs: run: ls -lh artifacts/${{ matrix.bareos_branch }}/${{ matrix.ubuntu_codename }}/ - name: Upload packages - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: debs-${{ matrix.bareos_branch }}-${{ matrix.ubuntu_codename }} path: artifacts/${{ matrix.bareos_branch }}/${{ matrix.ubuntu_codename }}/ diff --git a/.github/workflows/ci-api.yml b/.github/workflows/ci-api.yml index f14e3f3c..927acd18 100644 --- a/.github/workflows/ci-api.yml +++ b/.github/workflows/ci-api.yml @@ -34,7 +34,7 @@ jobs: bareos_app: api - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-api-tmp path: build @@ -65,7 +65,7 @@ jobs: registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-api path: build diff --git a/.github/workflows/ci-client.yml b/.github/workflows/ci-client.yml index 622edcf1..106d3a34 100644 --- a/.github/workflows/ci-client.yml +++ b/.github/workflows/ci-client.yml @@ -34,7 +34,7 @@ jobs: bareos_app: client - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-client-tmp path: build @@ -65,7 +65,7 @@ jobs: registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-client path: build diff --git a/.github/workflows/ci-director.yml b/.github/workflows/ci-director.yml index 3685ca8f..5bb9845c 100644 --- a/.github/workflows/ci-director.yml +++ b/.github/workflows/ci-director.yml @@ -34,7 +34,7 @@ jobs: bareos_app: director - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-director-tmp path: build @@ -65,7 +65,7 @@ jobs: registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-director path: build diff --git a/.github/workflows/ci-storage.yml b/.github/workflows/ci-storage.yml index 5cade344..558b71bf 100644 --- a/.github/workflows/ci-storage.yml +++ b/.github/workflows/ci-storage.yml @@ -34,7 +34,7 @@ jobs: bareos_app: storage - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-storage-tmp path: build @@ -65,7 +65,7 @@ jobs: registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-storage path: build diff --git a/.github/workflows/ci-webui.yml b/.github/workflows/ci-webui.yml index 802c099c..d8eafb8d 100644 --- a/.github/workflows/ci-webui.yml +++ b/.github/workflows/ci-webui.yml @@ -34,7 +34,7 @@ jobs: bareos_app: webui - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-webui-tmp path: build @@ -65,7 +65,7 @@ jobs: registry: ${{ secrets.REGISTRY_URL }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: build-artifact-webui path: build From b27fa42c24cd3065dcdb16e86c812eb978db95e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 May 2026 14:45:51 +0200 Subject: [PATCH 44/54] chore(deps): bump actions/download-artifact from 4 to 8 (#28) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 8. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v8) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-bareos-packages.yml | 2 +- .github/workflows/ci-api.yml | 6 +++--- .github/workflows/ci-client.yml | 6 +++--- .github/workflows/ci-director.yml | 6 +++--- .github/workflows/ci-storage.yml | 6 +++--- .github/workflows/ci-webui.yml | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-bareos-packages.yml b/.github/workflows/build-bareos-packages.yml index eee31f30..0b48d9a1 100644 --- a/.github/workflows/build-bareos-packages.yml +++ b/.github/workflows/build-bareos-packages.yml @@ -75,7 +75,7 @@ jobs: steps: - name: Download packages - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: debs-${{ matrix.bareos_branch }}-${{ matrix.ubuntu_codename }} path: debs/ diff --git a/.github/workflows/ci-api.yml b/.github/workflows/ci-api.yml index 927acd18..257fdba5 100644 --- a/.github/workflows/ci-api.yml +++ b/.github/workflows/ci-api.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-api-tmp path: build @@ -78,7 +78,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-api path: build @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-api path: build diff --git a/.github/workflows/ci-client.yml b/.github/workflows/ci-client.yml index 106d3a34..abfb1f38 100644 --- a/.github/workflows/ci-client.yml +++ b/.github/workflows/ci-client.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-client-tmp path: build @@ -78,7 +78,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-client path: build @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-client path: build diff --git a/.github/workflows/ci-director.yml b/.github/workflows/ci-director.yml index 5bb9845c..5e6742f7 100644 --- a/.github/workflows/ci-director.yml +++ b/.github/workflows/ci-director.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-director-tmp path: build @@ -78,7 +78,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-director path: build @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-director path: build diff --git a/.github/workflows/ci-storage.yml b/.github/workflows/ci-storage.yml index 558b71bf..73b15843 100644 --- a/.github/workflows/ci-storage.yml +++ b/.github/workflows/ci-storage.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-storage-tmp path: build @@ -78,7 +78,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-storage path: build @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-storage path: build diff --git a/.github/workflows/ci-webui.yml b/.github/workflows/ci-webui.yml index d8eafb8d..e485921c 100644 --- a/.github/workflows/ci-webui.yml +++ b/.github/workflows/ci-webui.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-webui-tmp path: build @@ -78,7 +78,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-webui path: build @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: build-artifact-webui path: build From ca022fa126e2e50653c49c8910e416c78ea502cf Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Sun, 10 May 2026 18:00:19 +0200 Subject: [PATCH 45/54] chore(bareos): Added missing releases and test CI/CD (#30) * chore(bareos): Added missing releases and test CI/CD Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci): satisfy docker lint for package asset downloads Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --------- Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .agents/skills/add-bareos-version/SKILL.md | 79 +++ .../references/upstream-sources.md | 69 +++ .../actions/prepare-bareos-app/entrypoint.sh | 6 +- AGENTS.md | 124 ++++ README.md | 577 ++++++------------ bareos-packages/README.md | 14 +- client/22-ubuntu/Dockerfile | 24 +- client/23-ubuntu/Dockerfile | 52 ++ client/23-ubuntu/docker-entrypoint.sh | 33 + client/24-ubuntu/Dockerfile | 24 +- director-pgsql/22-ubuntu/Dockerfile | 26 +- director-pgsql/22-ubuntu/docker-entrypoint.sh | 4 +- director-pgsql/23-ubuntu/Dockerfile | 68 +++ director-pgsql/23-ubuntu/docker-entrypoint.sh | 128 ++++ director-pgsql/23-ubuntu/webhook-notify | 41 ++ director-pgsql/24-ubuntu/Dockerfile | 26 +- storage/22-ubuntu/Dockerfile | 24 +- storage/23-ubuntu/Dockerfile | 52 ++ storage/23-ubuntu/docker-entrypoint.sh | 22 + storage/24-ubuntu/Dockerfile | 24 +- webui/22-ubuntu/Dockerfile | 20 +- webui/23-ubuntu/Dockerfile | 48 ++ webui/23-ubuntu/docker-entrypoint.sh | 25 + webui/24-ubuntu/Dockerfile | 20 +- 24 files changed, 1065 insertions(+), 465 deletions(-) create mode 100644 .agents/skills/add-bareos-version/SKILL.md create mode 100644 .agents/skills/add-bareos-version/references/upstream-sources.md create mode 100644 AGENTS.md create mode 100644 client/23-ubuntu/Dockerfile create mode 100755 client/23-ubuntu/docker-entrypoint.sh create mode 100644 director-pgsql/23-ubuntu/Dockerfile create mode 100755 director-pgsql/23-ubuntu/docker-entrypoint.sh create mode 100755 director-pgsql/23-ubuntu/webhook-notify create mode 100644 storage/23-ubuntu/Dockerfile create mode 100755 storage/23-ubuntu/docker-entrypoint.sh create mode 100644 webui/23-ubuntu/Dockerfile create mode 100755 webui/23-ubuntu/docker-entrypoint.sh diff --git a/.agents/skills/add-bareos-version/SKILL.md b/.agents/skills/add-bareos-version/SKILL.md new file mode 100644 index 00000000..f5fd4593 --- /dev/null +++ b/.agents/skills/add-bareos-version/SKILL.md @@ -0,0 +1,79 @@ +--- +name: add-bareos-version +description: Add a new Bareos version directory (Dockerfile + docker-entrypoint.sh) for a given component and flavor (alpine|ubuntu). Delegates all code generation to the ollama-orchestrator subagent. Use when the user asks to add support for Bareos N-ubuntu or N-alpine, or fill missing version/flavor combos. Also use when the user types "add Bareos 22 ubuntu" or "generate missing Bareos versions". +allowed-tools: [Read, Write, Edit, Glob, Grep, Bash, Agent] +--- + +# add-bareos-version skill + +Generates missing Bareos Docker image directories using the ollama-orchestrator subagent. + +## Upstream source table + +See `references/upstream-sources.md` for the authoritative mapping of Bareos version → Alpine tag and Ubuntu repo URL. **Verify this table before generating** — do not assume; run the probe commands in that file if unsure. + +## Workflow + +### 1. Resolve inputs + +Accept: a list of `{component, version, flavor}` tuples. Examples: + +- "Add 22-ubuntu for all standard components" → four tuples: director-pgsql, storage, client, webui, each with version=22, flavor=ubuntu +- "Generate client/23-alpine" → one tuple + +**Standard components** = director-pgsql, storage, client, webui. The api component uses a pip-pinned pattern; handle it separately only if explicitly requested. + +### 2. Look up upstream source + +From `references/upstream-sources.md`: + +- If the version has no upstream source for the requested flavor → stop and tell the user what's missing. +- If the source is marked `current/` → note that the image will install whatever Bareos is current (as of the build date, not the directory name). + +### 3. Find the reference template + +Find the nearest existing directory with the **same component** and **same flavor**: + +- Same component, closest version, same flavor (e.g. for client/22-ubuntu, reference is client/21-ubuntu) +- Read its `Dockerfile` and `docker-entrypoint.sh` in full — pass this verbatim to the subagent + +### 4. Invoke ollama-orchestrator + +Call `Agent(subagent_type: "ollama-orchestrator", prompt: )` with: + +- The reference Dockerfile and entrypoint verbatim (inside a code fence) +- The target directory name (e.g. `client/22-ubuntu`) +- The FROM change: e.g. `FROM ubuntu:jammy` (Ubuntu 22.04) +- The BAREOS_KEY and BAREOS_REPO values from the upstream sources table +- Any differences in how the gpg key is handled between v21 and v22+ style +- A request for the complete Dockerfile and entrypoint, not a diff + +**Mandatory**: do not write Dockerfile or entrypoint bodies yourself. All content must come from ollama-orchestrator. + +### 5. Write files + +From the subagent's output, extract the Dockerfile and docker-entrypoint.sh, then: + +```bash +mkdir -p /- +# Write Dockerfile +# Write docker-entrypoint.sh +chmod +x /-/docker-entrypoint.sh +``` + +### 6. Validate one representative build + +Run `docker build --check` (or `docker build --platform linux/amd64 --no-cache -t test-bareos:local .`) from inside the new directory. If it fails, inspect the error and run one correction round through ollama-orchestrator before giving up. + +Do not attempt to build all generated dirs in one pass — do one, verify, then continue. + +### 7. Report + +State what was generated, which tuples were skipped (upstream not found), whether the test build passed. + +## Ubuntu key handling difference + +- v20–21 (old style): `curl -Ls $BAREOS_KEY -o /tmp/bareos.key` then `apt-key add /tmp/bareos.key` +- v22+ (new style): `curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg` then `[signed-by=/usr/share/keyrings/bareos.gpg]` in sources.list + +When generating v22-ubuntu, ensure the reference (v21-ubuntu old style) is adapted to the new gpg style shown in v24-ubuntu. Tell the subagent explicitly. diff --git a/.agents/skills/add-bareos-version/references/upstream-sources.md b/.agents/skills/add-bareos-version/references/upstream-sources.md new file mode 100644 index 00000000..ed6fad06 --- /dev/null +++ b/.agents/skills/add-bareos-version/references/upstream-sources.md @@ -0,0 +1,69 @@ +# Bareos Upstream Source Table + +Last verified: 2026-04-18 + +## Ubuntu repos + +| Bareos version | Ubuntu base | BAREOS_KEY | BAREOS_REPO | Status | +|---------------|-------------|------------|-------------|--------| +| 20 | ubuntu:focal (20.04) | `http://download.bareos.org/bareos/release/20/xUbuntu_20.04/Release.key` | `http://download.bareos.org/bareos/release/20/xUbuntu_20.04/` | ✓ versioned | +| 21 | ubuntu:focal (20.04) | `http://download.bareos.org/bareos/release/21/xUbuntu_20.04/Release.key` | `http://download.bareos.org/bareos/release/21/xUbuntu_20.04/` | ✓ versioned | +| 22 | ubuntu:jammy (22.04) | `http://download.bareos.org/current/xUbuntu_22.04/Release.key` | `http://download.bareos.org/current/xUbuntu_22.04/` | ⚠ current/ installs latest Bareos (25.x as of 2026-04) | +| 23 | — | — | — | ✗ no versioned repo; current/ does not pin to 23 | +| 24 | ubuntu:noble (24.04) | `http://download.bareos.org/current/xUbuntu_24.04/Release.key` | `http://download.bareos.org/current/xUbuntu_24.04/` | ⚠ current/ installs latest Bareos (25.x as of 2026-04) | +| 25 | — | — | — | ✗ no versioned repo; current/ does not pin to 25 | + +**Note**: For v22+, `current/` always tracks the latest Bareos release. The directory name reflects Ubuntu version, not Bareos version. + +## Alpine repos + +| Bareos version | Alpine tag | Bareos package | Status | +|---------------|-----------|----------------|--------| +| 20 | alpine:3.15 | bareos-20.x | ✓ in community | +| 21 | alpine:3.17 | bareos-21.x | ✓ in community | +| 22 | alpine:3.18 | bareos-22.0.3-r1 | ✓ in community | +| 23 | — | — | ✗ Alpine 3.19+ has no Bareos packages | +| 24 | — | — | ✗ Alpine 3.19+ has no Bareos packages | +| 25 | — | — | ✗ Alpine 3.19+ has no Bareos packages | + +**Note**: Bareos is only available in Alpine through 3.18. There is no Alpine support for Bareos 23+. + +## api component (bareos-restapi pip package) + +| Version | Pip spec | PyPI status | +|---------|----------|-------------| +| 21 | `>=21*,<22*` | ✓ 21.1.9 on PyPI | +| 22 | `>=22*,<23*` | ✗ not on PyPI — build will fail | +| 24 | `>=24*,<25*` | ✗ not on PyPI — build will fail | + +**api component note**: The existing api/22-alpine and api/24-alpine Dockerfiles have broken pip constraints. Only api/21-alpine is reliably buildable. Do not generate new api dirs without first verifying PyPI availability. + +## Verification commands + +```bash +# Ubuntu: check a specific version URL +curl -sfI "http://download.bareos.org/bareos/release//xUbuntu_20.04/Release.key" && echo "YES" || echo "NO" +curl -sfI "http://download.bareos.org/current/xUbuntu_22.04/Release.key" && echo "YES" || echo "NO" + +# Alpine: check what Bareos version an Alpine tag ships +docker run --rm alpine: sh -c "apk update -q 2>/dev/null && apk search -e bareos" + +# pip: check bareos-restapi versions +curl -sL "https://pypi.org/simple/bareos-restapi/" | grep -Eo 'bareos.restapi-[0-9]+\.[0-9]+\.[0-9]+' | sed 's/bareos.restapi-//' +``` + +## Missing and buildable as of 2026-04-18 + +| Component | Target | Buildable? | Reason | +|-----------|--------|------------|--------| +| director-pgsql | 22-ubuntu | ✓ | Ubuntu 22.04 + current/ | +| director-pgsql | 24-alpine | ✗ | No Alpine package for Bareos 24 | +| director-pgsql | 23-alpine/ubuntu | ✗ | No upstream source | +| director-pgsql | 25-alpine/ubuntu | ✗ | No upstream source | +| storage | same as director-pgsql | same | same | +| client | same as director-pgsql | same | same | +| webui | same as director-pgsql | same | same | +| api | 20-alpine | ✗ | bareos-restapi<21 not on PyPI | +| api | 23-alpine | ✗ | No upstream source | +| api | 25-alpine | ✗ | No upstream source | +| director-mysql | 21+ | ✗ | MySQL backend dropped in Bareos 21+ | diff --git a/.github/actions/prepare-bareos-app/entrypoint.sh b/.github/actions/prepare-bareos-app/entrypoint.sh index 1c0dd99f..dc54de55 100755 --- a/.github/actions/prepare-bareos-app/entrypoint.sh +++ b/.github/actions/prepare-bareos-app/entrypoint.sh @@ -3,7 +3,7 @@ BUILDX_VER='v0.5.1' latest_ubuntu='24' latest_alpine='22' -latest_api='24' +latest_api='21' build_file="${GITHUB_WORKSPACE}/build/app_build.txt" tag_file="${GITHUB_WORKSPACE}/build/tag_build.txt" @@ -28,8 +28,8 @@ for file in $docker_files; do base_img=$(echo "$version_dir" |cut -d'-' -f2) [[ $version -ge 20 ]] && default_backend='pgsql' - # disable ubuntu builds until source-built packages are available (PR #2) - if [ "${base_img}" == "ubuntu" ]; then + # bareos-restapi is only published for Bareos 21 at the moment. + if [ "${app}" == 'api' ] && [ "${version}" != "$latest_api" ]; then continue fi diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..2bb2c234 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,124 @@ +# AGENTS.md + +This file provides guidance to Codex (Codex.ai/code) when working with code in this repository. + +## What This Repo Is + +A collection of Docker images for running [Bareos](https://www.bareos.org) (backup software) in containers. It does not contain application source code — it contains Dockerfiles, entrypoint shell scripts, and docker-compose files for deploying Bareos components. + +## Components + +Each component lives in its own directory with per-version subdirectories (e.g. `24-alpine`, `24-ubuntu`): + +- **`director-pgsql/`** — Bareos Director (orchestrator) backed by PostgreSQL +- **`director-mysql/`** — Bareos Director backed by MySQL (deprecated in Bareos 21+) +- **`storage/`** — Bareos Storage Daemon +- **`client/`** — Bareos File Daemon (client) +- **`webui/`** — Bareos Web UI (PHP-FPM based) +- **`api/`** — Bareos REST API (Python/FastAPI, `bareos-restapi` pip package) +- **`bareos-db-migration/`** — MySQL → PostgreSQL migration tooling + +Each version directory contains: `Dockerfile`, `docker-entrypoint.sh`, and sometimes `webhook-notify`. + +## Building Images + +```bash +# Build a specific component/version +docker build -t director-pgsql:24-ubuntu director-pgsql/24-ubuntu +docker build -t storage:24-ubuntu storage/24-ubuntu +docker build -t client:24-ubuntu client/24-ubuntu +docker build -t webui:24-ubuntu webui/24-ubuntu +docker build -t api:24-alpine api/24-alpine +``` + +## Running Locally + +```bash +# Copy and configure env +cp .env.dist .env +# Edit .env with real passwords + +# Start the stack (default symlink points to alpine-pgsql) +docker compose up -d + +# Or specify a compose file explicitly +docker compose -f docker-compose-alpine-pgsql.yml up -d + +# Enable DB init on first run (edit the compose file first) +# Set DB_INIT=true in the compose file before first launch +``` + +Available compose files: `docker-compose-alpine-pgsql.yml`, `docker-compose-alpine-mysql.yml`, `docker-compose-alpine-mysql-v2.yml`, `docker-compose-ubuntu-mysql.yml`, `docker-compose-ubuntu-pgsql.yml`. The `docker-compose.yml` symlink points to the alpine-pgsql variant. + +## Accessing Services + +```bash +# Bareos CLI console +docker exec -it bareos_bareos-dir_1 bconsole + +# WebUI: http://localhost:8080 (admin / ) +# REST API docs: http://localhost:8000/docs +# Prometheus metrics: http://localhost:9625/metrics +``` + +## How Entrypoint Scripts Work + +The `docker-entrypoint.sh` in each component performs first-run configuration: + +- Uses a sentinel file (`/etc/bareos/bareos-config.control`) to detect first run +- Unpacks bundled default config (`/bareos-dir.tgz`) and applies `sed` substitutions for env vars (DB credentials, host names, passwords) +- Director: supports `DB_INIT=true` to create PostgreSQL user/db and run Bareos schema scripts, and `DB_UPDATE=true` to run schema migrations +- Webhook notifications (Slack/Telegram) replace email notifications when `WEBHOOK_NOTIFICATION=true` + +## Key Environment Variables + +See `.env.dist` for all required variables. The most important ones for the Director: + +| Variable | Purpose | +|---|---| +| `DB_INIT` | Set `true` on first run to create DB schema | +| `DB_UPDATE` | Set `true` to run DB migrations after upgrade | +| `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASSWORD` | Catalog DB connection | +| `DB_ADMIN_USER`, `DB_ADMIN_PASSWORD` | Used only for DB initialization | +| `BAREOS_SD_PASSWORD`, `BAREOS_FD_PASSWORD`, `BAREOS_WEBUI_PASSWORD` | Shared secrets between components | +| `SMTP_HOST`, `ADMIN_MAIL` | Mail reporting | +| `WEBHOOK_NOTIFICATION`, `WEBHOOK_TYPE`, `WEBHOOK_URL` | Slack/Telegram notifications | + +## Git and GitHub Workflow + +This repo is a fork. **Always push branches and open PRs against the fork (`origin`), never against the upstream repository.** When using `gh` commands, always pass `--repo` to target the fork explicitly. + +## CI/CD + +GitHub Actions workflows in `.github/workflows/`: + +- `ci-director.yml`, `ci-client.yml`, `ci-storage.yml`, `ci-webui.yml`, `ci-api.yml` — build and push images; triggered on changes to the respective component directories +- `run-compose.yml` — integration test: spins up each compose variant and runs `bconsole` to verify the stack is healthy (runs weekly on Sundays and on compose file changes) +- `build-bareos-packages.yml` — builds `.deb` packages from the bareos source repo for versions not available on `download.bareos.org`; see `bareos-packages/README.md` +- `test-n-lint.yml` — linting +- `push-readme.yml` — syncs README to Docker Hub + +The CI uses reusable composite actions in `.github/actions/` (prepare, build, push, test). + +## Version Support + +- Alpine images support `linux/amd64` and `linux/arm64/v8` +- Current active versions: 22 (Ubuntu and Alpine), 24 (Ubuntu) +- MySQL backend was dropped in Bareos 21+; `director-mysql/` only goes up to version 20 + +### Upstream package availability + +`download.bareos.org` only publishes versioned repos for Bareos 20 and 21. For 22+: + +| Bareos version | Ubuntu | Alpine | +|----------------|---------------------------------|-------------------| +| 20 | versioned apt repo | Alpine 3.15 | +| 21 | versioned apt repo | Alpine 3.17 | +| 22 | `current/` (serves 25.x today) | Alpine 3.18 | +| 23 | not published upstream | not published | +| 24 | not published upstream | not published | +| 25 | `current/` (latest) | not published | + +Use `bareos-packages/` to build `.deb` packages from source for versions 22–24. +Once packages are published as GitHub Releases, use the `.Codex/skills/add-bareos-version` +skill to generate new component directories that install from those artifacts. diff --git a/README.md b/README.md index 821fc0b5..f4075854 100644 --- a/README.md +++ b/README.md @@ -4,456 +4,259 @@ ![Based OS][os-based-ubuntu] ![Based OS][os-based-alpine] ![Badge amd64][arch-amd64-img] ![Badge arm64][arch-arm64/v8-img] -## Note: currently the images are hosted on a private repo. They will be publish on docker.io or ghcr.io once the CI/CD process is stable +Container images for running [Bareos][bareos-href] components with Docker and +Docker Compose. -## About +## Images -This package provides images for [Bareos][bareos-href] : - -| module | build | size ubuntu | size alpine | pull | -|:-------------------:|:------------------------------------------------------------:|:---------------------------------------:|:---------------------------------------:|:-------------------------------------------------:| +| module | build | ubuntu size | alpine size | pull | +|:--|:--:|:--:|:--:|:--:| | Director | [![Actions Status][build-director-img]][build-director-href] | ![Size badge][size-latest-director-png] | ![Size badge][size-alpine-director-png] | [![Docker badge][docker-img-dir]][docker-url-dir] | | Storage Daemon | [![Actions Status][build-storage-img]][build-storage-href] | ![Size badge][size-latest-storage-png] | ![Size badge][size-alpine-storage-png] | [![Docker badge][docker-img-sd]][docker-url-sd] | | Client/File Daemon | [![Actions Status][build-client-img]][build-client-href] | ![Size badge][size-latest-client-png] | ![Size badge][size-alpine-client-png] | [![Docker badge][docker-img-fd]][docker-url-fd] | -| webUI | [![Actions Status][build-webui-img]][build-webui-href] | ![Size badge][size-latest-webui-png] | ![Size badge][size-alpine-webui-png] | [![Docker badge][docker-img-ui]][docker-url-ui] | -| API | [![Actions Status][build-api-img]][build-api-href] | ![Size badge][size-latest-api-png] | | [![Docker badge][docker-img-api]][docker-url-api] | - -Images are based on **Alpine**, check tags below - -* Alpine images are available for **linux/amd64** and **linux/arm64/v8** platform -* Weekly build are deployed to [Docker hub][docker-url] on Sunday 4am (GMT+1) - -## Tags - -bareos-director (dir) - -* `21-alpine-pgsql`, `21-alpine`, `alpine`, `latest` -* `20-alpine-pgsql`, `20-alpine` - -bareos-client (fd) - bareos-storage (sd) - bareos-webui - -* `21-alpine`, `alpine`, `latest` -* `20-alpine`, `latest` - -bareos-api - -* `21-alpine`, `21`, `alpine`, `latest` +| Web UI | [![Actions Status][build-webui-img]][build-webui-href] | ![Size badge][size-latest-webui-png] | ![Size badge][size-alpine-webui-png] | [![Docker badge][docker-img-ui]][docker-url-ui] | +| API | [![Actions Status][build-api-img]][build-api-href] | | ![Size badge][size-latest-api-png] | [![Docker badge][docker-img-api]][docker-url-api] | + +Weekly image builds run from GitHub Actions. Alpine images are built for +`linux/amd64` and `linux/arm64/v8`; Ubuntu images are currently built for +`linux/amd64`. + +## Supported Tags + +`bareos-director`: + +| backend | tags | +|:--|:--| +| PostgreSQL | `24-ubuntu-pgsql`, `24-ubuntu`, `24`, `ubuntu` | +| PostgreSQL | `23-ubuntu-pgsql`, `23-ubuntu`, `23` | +| PostgreSQL | `22-ubuntu-pgsql`, `22-ubuntu`, `22` | +| PostgreSQL | `22-alpine-pgsql`, `22-alpine`, `alpine`, `latest` | +| PostgreSQL | `21-ubuntu-pgsql`, `21-ubuntu`, `21` | +| PostgreSQL | `21-alpine-pgsql`, `21-alpine` | +| PostgreSQL | `20-ubuntu-pgsql`, `20-ubuntu`, `20` | +| PostgreSQL | `20-alpine-pgsql`, `20-alpine` | +| MySQL | `20-ubuntu-mysql`, `20-alpine-mysql` | + +`bareos-client`, `bareos-storage`, and `bareos-webui`: + +| base | tags | +|:--|:--| +| Ubuntu 24.04 | `24-ubuntu`, `24`, `ubuntu` | +| Ubuntu 22.04 | `23-ubuntu`, `23`, `22-ubuntu`, `22` | +| Alpine 3.18 | `22-alpine`, `alpine`, `latest` | +| Ubuntu 20.04 | `21-ubuntu`, `21`, `20-ubuntu`, `20` | +| Alpine | `21-alpine`, `20-alpine` | + +`bareos-api`: + +| base | tags | +|:--|:--| +| Alpine | `21-alpine`, `21`, `alpine`, `latest` | + +The `api/22-alpine` and `api/24-alpine` directories are present in the source +tree, but they are not released because `bareos-restapi` is not available on +PyPI for those versions. + +## Version Support + +| Bareos version | Ubuntu image | Alpine image | Notes | +|:--|:--|:--|:--| +| 24 | `24-ubuntu` on Ubuntu 24.04 | not available | Installed from GitHub package release | +| 23 | `23-ubuntu` on Ubuntu 22.04 | not available | Installed from GitHub package release | +| 22 | `22-ubuntu` on Ubuntu 22.04 | `22-alpine` on Alpine 3.18 | Ubuntu uses GitHub package release | +| 21 | `21-ubuntu` | `21-alpine` | Upstream versioned repo / Alpine package | +| 20 | `20-ubuntu` | `20-alpine` | Last version with MySQL backend | + +Bareos removed the MySQL catalog backend in version 21. Use `director-mysql/*` +only for Bareos 20 or older and migrate existing MySQL catalogs to PostgreSQL +before upgrading past Bareos 20. + +## Package Releases + +`download.bareos.org/current/` tracks the latest Bareos release and does not +provide pinned 22, 23, or 24 Ubuntu repositories. This repo builds pinned `.deb` +packages from upstream Bareos release tags and publishes them as GitHub Release +assets. + +The Ubuntu 22/23/24 Dockerfiles consume the package release +`pkg/bareos-packages-v1`: + +| asset | used by | +|:--|:--| +| `bareos-22-jammy.tar.gz` | `22-ubuntu` component images | +| `bareos-23-jammy.tar.gz` | `23-ubuntu` component images | +| `bareos-24-noble.tar.gz` | `24-ubuntu` component images | + +See [bareos-packages/README.md][bareos-packages-readme] for local package +builds and release publishing details. ## Setup -Bareos Director requires : - -* PostgreSQL -* SMTP Daemon as mail router (for reporting) - -Bareos Webui requires : +Bareos Director requires: -* PHP-FPM +* PostgreSQL for supported current stacks +* SMTP relay or webhook notifications for reports -Bareos Client (fd) and Storage (sd) have no dependencies. +Bareos Web UI requires either its Ubuntu Apache image or, for Alpine stacks, +the paired PHP-FPM service used by the compose file. -Each component have to run in an single container and must linked together -through docker-compose, see example below +Bareos Client/File Daemon and Storage Daemon have no external service +dependency beyond the Director connection. ## Requirements -* [Docker][docker-href] & [docker-compose][docker-compose-href] +* [Docker][docker-href] +* [Docker Compose][docker-compose-href] ## Usage -### Define ENV variables required - -Declare environment variables or copy the `.env.dist` to `.env` and adjust its -values. - -Remember that all passwords should be defined inside this `.env` file. -It's recommanded to not use default passwords in `.env.dist` for production -usage. - -Finaly, be sure to update variables in docker-compose file like -`ADMIN_MAIL` or `DB_USER` - -### Run docker-compose - -```bash -docker-compose -f /path/to/your/docker-compose.yml up -d -``` - -docker-compose files are available for Alpine and Ubuntu based stack: - -| file | compose | docker | latest build | -|:-----------------------------------------:|:-------:|:---------:|:-------------------------------:| -| [alpine-v1/mysql][compose-alpinev1-href] | v3+ | v1.13.0+ | ![run-compose][run-compose-png] | -| [alpine-v2/mysql][compose-alpinev2-href] | v3.7+ | v18.06.0+ | ![run-compose][run-compose-png] | -| [ubuntu/mysql][compose-ubuntu-mysql-href] | v3+ | v1.13.0+ | ![run-compose][run-compose-png] | -| [ubuntu/pgsql][compose-ubuntu-pgsql-href] | v3+ | v1.13.0+ | ![run-compose][run-compose-png] | - -:file_folder: Those docker-compose file are configured to store data inside -`/data/(bareos|mysql|pgsql)` - -Finally, when your containers are up and running access Bareos using WebUI, CLI or API - -### Access WebUI - -Open `http://your-docker-host:8080` in your web browser then sign-in - -(user: admin / pass: ``) - -### Access bconsole +Copy `.env.dist` to `.env` and change the passwords before production use: ```bash -docker exec -it bareos-dir bconsole +cp .env.dist .env ``` -### Access API - -(Required Bareos 20+ and Bareos named console) - -Open `http://your-docker-host:8000/docs` in your web browser then click -'Authorize' to sign-in. - -Or use curl as example below: - -Get token: (should return json object with token inside) +Start the default stack: ```bash -curl -X 'POST' \ - 'http://your-docker-host:8000/token' \ - -H 'accept: application/json' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -d 'grant_type=&username=admin&password=ThisIsMySecretUIp4ssw0rd&scope=&client_id=&client_secret=' -``` - -As you can see it uses credentials of Bareos-webui admin user which is -configure as a named console in Bareos-director. - -Result: - -```json -{ - "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTY0NzIxMDM3NX0.alKiLsgMrovKVX6fdcUqkhG_9lsJNiOBQ6X7ixyziGw", - "token_type": "bearer" -} +docker compose up -d ``` -Then, use this token for example to read all clients configuration (like in bconsole) +Or choose a compose file explicitly: ```bash -curl -X 'GET' \ - 'http://your-docker-host:8000/configuration/clients?verbose=yes' \ - -H 'accept: application/json' \ - -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTY0NzIxMDM3NX0.alKiLsgMrovKVX6fdcUqkhG_9lsJNiOBQ6X7ixyziGw' +docker compose -f docker-compose-alpine-pgsql.yml up -d +docker compose -f docker-compose-ubuntu-pgsql.yml up -d ``` -Should return a JSON file with all clients configuration. +Available compose files: -### Access metrics for Prometheus +| file | backend | status | +|:--|:--|:--| +| [docker-compose-alpine-pgsql.yml][compose-alpine-pgsql-href] | PostgreSQL | Alpine example stack | +| [docker-compose-ubuntu-pgsql.yml][compose-ubuntu-pgsql-href] | PostgreSQL | Ubuntu example stack | +| [docker-compose-alpine-mysql.yml][compose-alpine-mysql-href] | MySQL | legacy, Bareos 20 or older | +| [docker-compose-alpine-mysql-v2.yml][compose-alpine-mysql-v2-href] | MySQL | legacy, Bareos 20 or older | +| [docker-compose-ubuntu-mysql.yml][compose-ubuntu-mysql-href] | MySQL | legacy, Bareos 20 or older | -Open `http://your-docker-host:9625/metrics` in your web browser to display -metrics available. +The compose examples store data under `/data/(bareos|mysql|pgsql)`. -More information about [Bareos exporter][bareos-exporter-href]. Thank you to @vierbergenlars +## Access -Metrics should be scraped by [Prometheus][prometheus-href] server. +Web UI: -### Official documentation - -More information about Bareos configuration and usage in the [official documantion][bareos-doc] - -## Database migration (MySQL to PostgreSQL) - -Since Bareos Version >= 21.0.0 the MySQL database backend is not shipped -anymore. Therefore you need to use Bareos 20 to migrate an existing MySQL -Bareos Catalog to PostgreSQL. To do so, upgrade to Bareos 20 first and then -use [this docker-compose file][compose-db-migration-href] to backup -(optional) the whole Bareos MySQL catalog and copy it into a new PostgreSQL -catalog database. - -If PostgreSQL database is empty or does not exist, it will be created. - -:warning: Don't forget `.env` file with passwords required! - -## PostgreSQL database upgrade - -### Compatibility - -At this moment, latest Ubuntu based images are compliant with PostgreSQL 12 or -less and Alpine ones with PostgreSQL 14. This is due to the version of `pg_dump` -which is required to dump Bareos database. - -Ubuntu images: - -* Bareos v19 -> PostgreSQL v10 or less -* Bareos v20+ -> PostgreSQL v12 or less - -Alpine images: - -* Bareos v19 -> PostgreSQL v13 or less -* Bareos v20+ -> PostgreSQL v14 or less - -### Tool - -The main idea here is to use [postgresql-upgrade][psql-upgrade-href] Docker -image. It will create a new PostgreSQL instance and then use `pg_upgrade` -tool to move all databases from the old instance to the new one. - -To proceed, locate your PostgreSQL data folder, according our own docker -compose files it could be /data/pgsql/data ! Then identify user used to init -the instance. postgres ? pgsql ? root ? +```text +http://your-docker-host:8080 +``` -Let's try an exemple with data source `/data/pgsql/data` and postgres -as an admin user. +Default user is `admin`; the password is `BAREOS_WEBUI_PASSWORD`. -Finaly run: +Bareos console: ```bash -docker run -t -i \ - -e PG_NEW=12 \ - -e PGUSER=postgres \ - -v /data/pgsql/data:/pg_old/data \ - -v /data/pgsql-new/data:/pg_new/data \ - dark-vex/postgresql-upgrade -``` - -After sucessful migration, use the new folder `/data/pgsql-new/data` and the -PostgreSQL version related in your docker-compose file. - -## Build - -### Docker-compose file - -Build your own docker-compose file with this template : - -```yml -version: '3' -services: - bareos-dir: - image: dark-vex/bareos-director:latest #latest director-pgsql based on ubuntu - volumes: - - :/etc/bareos - - :/var/lib/bareos #required for MyCatalog backup - environment: - - DB_INIT=false - - DB_UPDATE=false - - DB_HOST=bareos-db - - DB_PORT=3306 - - DB_NAME=bareos - - DB_USER=bareos - - DB_PASSWORD=${DB_PASSWORD} # defined in .env file - - DB_ADMIN_USER=${DB_ADMIN_USER} # defined in .env file - - DB_ADMIN_PASSWORD=${DB_ADMIN_PASSWORD} # defined in .env file - - BAREOS_FD_HOST=bareos-fd - - BAREOS_FD_PASSWORD=${BAREOS_FD_PASSWORD} # defined in .env file - - BAREOS_SD_HOST=bareos-sd - - BAREOS_SD_PASSWORD=${BAREOS_SD_PASSWORD} # defined in .env file - - BAREOS_WEBUI_PASSWORD=${BAREOS_WEBUI_PASSWORD} # defined in .env file - - SMTP_HOST=smtpd - - SENDER_MAIL=your-sender@mail.address #optional - - ADMIN_MAIL=your@mail.address # Change me! - # Optional you can get backup notification via Slack or Telegram - - WEBHOOK_NOTIFICATION=true # true or false if set to true email notification gets disabled - - WEBHOOK_TYPE=slack # choose slack or telegram - - WEBHOOK_URL= # set the slack or telegram URL - - WEBHOOK_CHAT_ID= # for telegram only set the - depends_on: - - bareos-db - - bareos-sd: - image: dark-vex/bareos-storage:latest - ports: - - 9103:9103 - volumes: - - :/etc/bareos - - :/var/lib/bareos/storage - environment: - - BAREOS_SD_PASSWORD=${BAREOS_SD_PASSWORD} # defined in .env file - - bareos-fd: - image: dark-vex/bareos-client:latest - volumes: - - :/etc/bareos - - :/var/lib/bareos-director #required for MyCatalog backup - environment: - - BAREOS_FD_PASSWORD=${BAREOS_FD_PASSWORD} # defined in .env file - - FORCE_ROOT=false - - bareos-webui: - image: dark-vex/bareos-webui:latest - ports: - - 8080:80 - environment: - - BAREOS_DIR_HOST=bareos-dir - - SERVER_STATS=yes #optional enable apache server statistics - volumes: - - :/etc/bareos-webui - - #bareos-db: - # image: mysql:5.6 - # volumes: - # - :/var/lib/mysql - # environment: - # - MYSQL_ROOT_PASSWORD=${DB_ADMIN_PASSWORD} # defined in .env file - - bareos-db: - image: postgres:12 - volumes: - - :/var/lib/postgresql/data - environment: - - POSTGRES_USER=${DB_ADMIN_USER} # defined in .env file - - POSTGRES_PASSWORD=${DB_ADMIN_PASSWORD} # defined in .env file - - POSTGRES_INITDB_ARGS=--encoding=SQL_ASCII - - bareos-api: - image: dark-vex/bareos-api:21 - ports: - - 8000:8000 - environment: - - BAREOS_DIR_HOST=bareos-dir - - smtpd: - image: namshi/smtp +docker exec -it bareos-dir bconsole ``` -**Bareos Director** (bareos-dir) - -* `` is the path to share your Director config folder from - the host side (optional/recommended) -* `` is the path to share your Director data folder from - the host side (recommended) -* DB_NAME is the bareos database name -* DB_USER is the bareos database user -* DB_PASSWORD is the password use to access to the bareos database -* DB_ADMIN_USER is the password use to initialize bareos user and database -* DB_ADMIN_PASSWORD is the password use to access to database system -* SMTP_HOST is the name of smtp container -* ADMIN_MAIL is your email address -* SENDER_MAIL is the email address you want to use for send the email - (optional, default ADMIN_MAIL value) -* WEBHOOK_NOTIFICATION=true # true or false if set to true email notification gets disabled -* WEBHOOK_TYPE=slack # choose slack or telegram -* WEBHOOK_URL= # set the slack or telegram URL (ex slack: ) -* WEBHOOK_CHAT_ID= # for telegram only set the 'chat_id' - -**Bareos Storage Daemon** (bareos-sd) - -* `` is the path to share your Storage config folder from - the host side (optional/recommended) -* `` is the path to share your data folder from the - host side. (optional) -* BAREOS_SD_PASSWORD must be same as Bareos Director section - -**Bareos Client/File Daemon** (bareos-fd) +REST API docs: -* `` is the path to share your Client config folder from the - host side (optional/recommended) -* `` is the path to access Director data folder (recommended) -* BAREOS_FD_PASSWORD must be same as Bareos Director section -* FORCE_ROOT must be true to run Bareos with root permissions +```text +http://your-docker-host:8000/docs +``` -**Database MySQL or PostgreSQL** (bareos-db) +Prometheus metrics: -Required as catalog backend, simply use the official MySQL/PostgreSQL image +```text +http://your-docker-host:9625/metrics +``` -* `` is the path to share your MySQL/PostgreSQL data from the host - side -* MYSQL_ROOT_PASSWORD is the password for MySQL root user (required for DB init only) -* POSTGRES_PASSWORD is the password for PostgreSQL root user (required for DB init only) +Metrics are provided by [bareos_exporter][bareos-exporter-href] and should be +scraped by [Prometheus][prometheus-href]. -**Bareos webUI** (bareos-webui) +## Database Migration -* `` is the path to share your WebUI config folder from the - host side. (optional) -* default user is `admin` +Bareos 21 and newer do not ship the MySQL catalog backend. To migrate an +existing MySQL catalog, upgrade to Bareos 20 first, then use the +[database migration compose file][compose-db-migration-href] to copy the +catalog into PostgreSQL. -:warning: Remember variables `*_HOST` must be set with container name +If the target PostgreSQL database is empty or does not exist, the migration +tool creates it. Keep `.env` available with the required database passwords. -### Your own Docker images +## Building Images -Build your own Bareos images : +Build a specific component/version: ```bash -git clone https://github.com/dark-vex/bareos -cd bareos -docker build -t director-pqsl:20-alpine director-pgsql/20-alpine -docker build -t storage:20-alpine storage/20-alpine -docker build -t client:20-alpine client/20-alpine -docker build -t webui:20-alpine webui/20-alpine +docker build -t bareos-director:24-ubuntu director-pgsql/24-ubuntu +docker build -t bareos-storage:24-ubuntu storage/24-ubuntu +docker build -t bareos-client:24-ubuntu client/24-ubuntu +docker build -t bareos-webui:24-ubuntu webui/24-ubuntu +docker build -t bareos-api:21-alpine api/21-alpine ``` -Build your own Xenial base system image : - -```bash -git clone https://github.com/rockyluke/docker-ubuntu -cd docker-ubuntu -./build.sh -d xenial -``` - -Thanks to @rockyluke :) +For Ubuntu 22/23/24 images, the package release assets must exist before the +build can download them. ## Links -For more information visit the Github repositories : - -* [bareos-director-mysql](https://github.com/dark-vex/bareos/tree/master/director-mysql) -* [bareos-director-pgsql](https://github.com/dark-vex/bareos/tree/master/director-pgsql) -* [bareos-storage](https://github.com/dark-vex/bareos/tree/master/storage) -* [bareos-client](https://github.com/dark-vex/bareos/tree/master/client) -* [bareos-webui](https://github.com/dark-vex/bareos/tree/master/webui) -* [docker-ubuntu](https://github.com/rockyluke/docker-ubuntu) - -My Docker hub : - -* [docker images](https://hub.docker.com/r/dark-vex) - -Enjoy ! +* [Bareos documentation][bareos-doc] +* [director-pgsql][repo-director-pgsql] +* [director-mysql][repo-director-mysql] +* [storage][repo-storage] +* [client][repo-client] +* [webui][repo-webui] +* [api][repo-api] [arch-amd64-img]: https://img.shields.io/badge/arch-amd64-inactive [arch-arm64/v8-img]: https://img.shields.io/badge/arch-arm64/v8-inactive [bareos-href]: https://www.bareos.org [bareos-doc]: https://www.bareos.com/learn/documentation -[build-client-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-client -[build-client-img]: https://github.com/dark-vex/bareos/workflows/ci-client/badge.svg -[build-director-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-director -[build-director-img]: https://github.com/dark-vex/bareos/workflows/ci-director/badge.svg -[build-img]: https://travis-ci.org/dark-vex/bareos.svg?branch=master -[build-storage-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-storage -[build-storage-img]: https://github.com/dark-vex/bareos/workflows/ci-storage/badge.svg -[build-url]: https://travis-ci.org/dark-vex/bareos -[build-webui-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-webui -[build-webui-img]: https://github.com/dark-vex/bareos/workflows/ci-webui/badge.svg -[build-api-href]: https://github.com/dark-vex/bareos/actions?query=workflow%3Aci-api -[build-api-img]: https://github.com/dark-vex/bareos/workflows/ci-api/badge.svg -[compose-alpinev1-href]: https://github.com/dark-vex/bareos/blob/master/docker-compose-alpine-v1.yml -[compose-alpinev2-href]: https://github.com/dark-vex/bareos/blob/master/docker-compose-alpine-v2.yml -[compose-ubuntu-mysql-href]: https://github.com/dark-vex/bareos/blob/master/docker-compose-ubuntu-mysql.yml -[compose-ubuntu-pgsql-href]: https://github.com/dark-vex/bareos/blob/master/docker-compose-ubuntu-pgsql.yml -[compose-db-migration-href]: https://github.com/dark-vex/bareos/blob/master/bareos-db-migration/docker-compose.yml +[bareos-packages-readme]: https://github.com/Dark-Vex/bareos/blob/master/bareos-packages/README.md +[build-client-href]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-client.yml +[build-client-img]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-client.yml/badge.svg +[build-director-href]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-director.yml +[build-director-img]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-director.yml/badge.svg +[build-storage-href]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-storage.yml +[build-storage-img]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-storage.yml/badge.svg +[build-webui-href]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-webui.yml +[build-webui-img]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-webui.yml/badge.svg +[build-api-href]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-api.yml +[build-api-img]: https://github.com/Dark-Vex/bareos/actions/workflows/ci-api.yml/badge.svg +[compose-alpine-pgsql-href]: https://github.com/Dark-Vex/bareos/blob/master/docker-compose-alpine-pgsql.yml +[compose-alpine-mysql-href]: https://github.com/Dark-Vex/bareos/blob/master/docker-compose-alpine-mysql.yml +[compose-alpine-mysql-v2-href]: https://github.com/Dark-Vex/bareos/blob/master/docker-compose-alpine-mysql-v2.yml +[compose-ubuntu-mysql-href]: https://github.com/Dark-Vex/bareos/blob/master/docker-compose-ubuntu-mysql.yml +[compose-ubuntu-pgsql-href]: https://github.com/Dark-Vex/bareos/blob/master/docker-compose-ubuntu-pgsql.yml +[compose-db-migration-href]: https://github.com/Dark-Vex/bareos/blob/master/bareos-db-migration/docker-compose.yml [docker-compose-href]: https://docs.docker.com/compose -[docker-href]: https://docs.docker.com/install -[docker-img-dir]: https://img.shields.io/docker/pulls/dark-vex/bareos-director?label=bareos-director&logo=docker -[docker-img-fd]: https://img.shields.io/docker/pulls/dark-vex/bareos-client?label=bareos-client&logo=docker -[docker-img-sd]: https://img.shields.io/docker/pulls/dark-vex/bareos-storage?label=bareos-storage&logo=docker -[docker-img-ui]: https://img.shields.io/docker/pulls/dark-vex/bareos-webui?label=bareos-webui&logo=docker -[docker-img-api]: https://img.shields.io/docker/pulls/dark-vex/bareos-api?label=bareos-api&logo=docker -[docker-url]: https://registry.hub.docker.com/r/dark-vex -[docker-url-dir]: https://registry.hub.docker.com/r/dark-vex/bareos-director -[docker-url-fd]: https://registry.hub.docker.com/r/dark-vex/bareos-client -[docker-url-sd]: https://registry.hub.docker.com/r/dark-vex/bareos-storage -[docker-url-ui]: https://registry.hub.docker.com/r/dark-vex/bareos-webui -[docker-url-api]: https://registry.hub.docker.com/r/dark-vex/bareos-api +[docker-href]: https://docs.docker.com/engine/install/ +[docker-img-dir]: https://img.shields.io/docker/pulls/barcus/bareos-director?label=bareos-director&logo=docker +[docker-img-fd]: https://img.shields.io/docker/pulls/barcus/bareos-client?label=bareos-client&logo=docker +[docker-img-sd]: https://img.shields.io/docker/pulls/barcus/bareos-storage?label=bareos-storage&logo=docker +[docker-img-ui]: https://img.shields.io/docker/pulls/barcus/bareos-webui?label=bareos-webui&logo=docker +[docker-img-api]: https://img.shields.io/docker/pulls/barcus/bareos-api?label=bareos-api&logo=docker +[docker-url-dir]: https://registry.hub.docker.com/r/barcus/bareos-director +[docker-url-fd]: https://registry.hub.docker.com/r/barcus/bareos-client +[docker-url-sd]: https://registry.hub.docker.com/r/barcus/bareos-storage +[docker-url-ui]: https://registry.hub.docker.com/r/barcus/bareos-webui +[docker-url-api]: https://registry.hub.docker.com/r/barcus/bareos-api [license-img]: https://img.shields.io/badge/License-MIT-yellow.svg [os-based-alpine]: https://img.shields.io/badge/os-alpine-9cf [os-based-ubuntu]: https://img.shields.io/badge/os-ubuntu-9cf -[size-alpine-client-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-client/alpine?label=alpine&style=plastic -[size-alpine-director-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-director/alpine?label=alpine&style=plastic -[size-alpine-storage-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-storage/alpine?label=alpine&style=plastic -[size-alpine-webui-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-webui/alpine?label=alpine&style=plastic -[size-latest-client-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-client/latest?label=latest&style=plastic -[size-latest-director-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-director/latest?label=latest&style=plastic -[size-latest-storage-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-storage/latest?label=latest&style=plastic -[size-latest-webui-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-webui/latest?label=latest&style=plastic -[size-latest-api-png]: https://img.shields.io/docker/image-size/dark-vex/bareos-api/latest?label=latest&style=plastic -[run-compose-png]: https://github.com/dark-vex/bareos/workflows/run-compose/badge.svg -[psql-upgrade-href]: https://github.com/dark-vex/postgresql-upgrade -[bareos-exporter-href]: https://github.com/vierbergenlars/bareos_exporter [prometheus-href]: https://prometheus.io +[bareos-exporter-href]: https://github.com/vierbergenlars/bareos_exporter +[repo-api]: https://github.com/Dark-Vex/bareos/tree/master/api +[repo-client]: https://github.com/Dark-Vex/bareos/tree/master/client +[repo-director-mysql]: https://github.com/Dark-Vex/bareos/tree/master/director-mysql +[repo-director-pgsql]: https://github.com/Dark-Vex/bareos/tree/master/director-pgsql +[repo-storage]: https://github.com/Dark-Vex/bareos/tree/master/storage +[repo-webui]: https://github.com/Dark-Vex/bareos/tree/master/webui +[size-alpine-client-png]: https://img.shields.io/docker/image-size/barcus/bareos-client/alpine?label=alpine&style=plastic +[size-alpine-director-png]: https://img.shields.io/docker/image-size/barcus/bareos-director/alpine?label=alpine&style=plastic +[size-alpine-storage-png]: https://img.shields.io/docker/image-size/barcus/bareos-storage/alpine?label=alpine&style=plastic +[size-alpine-webui-png]: https://img.shields.io/docker/image-size/barcus/bareos-webui/alpine?label=alpine&style=plastic +[size-latest-client-png]: https://img.shields.io/docker/image-size/barcus/bareos-client/latest?label=latest&style=plastic +[size-latest-director-png]: https://img.shields.io/docker/image-size/barcus/bareos-director/latest?label=latest&style=plastic +[size-latest-storage-png]: https://img.shields.io/docker/image-size/barcus/bareos-storage/latest?label=latest&style=plastic +[size-latest-webui-png]: https://img.shields.io/docker/image-size/barcus/bareos-webui/latest?label=latest&style=plastic +[size-latest-api-png]: https://img.shields.io/docker/image-size/barcus/bareos-api/latest?label=latest&style=plastic diff --git a/bareos-packages/README.md b/bareos-packages/README.md index 1f052555..1afba679 100644 --- a/bareos-packages/README.md +++ b/bareos-packages/README.md @@ -49,13 +49,13 @@ Artifacts are uploaded (30-day retention) as `debs--`. ## Publishing a GitHub Release -Tag the repo with `pkg/--vN` (e.g. `pkg/bareos-22-jammy-v1`) after -a successful workflow run. The `release` job picks up the artifacts and attaches -`bareos-22-jammy.tar.gz` (etc.) to the release. +Tag the repo with `pkg/bareos-packages-vN` after a successful workflow run. +The `release` job rebuilds the matrix and attaches all package tarballs to the +same GitHub Release: ```bash -git tag pkg/bareos-22-jammy-v1 -git push origin pkg/bareos-22-jammy-v1 +git tag pkg/bareos-packages-v1 +git push origin pkg/bareos-packages-v1 ``` ## Consuming packages in component Dockerfiles @@ -63,8 +63,8 @@ git push origin pkg/bareos-22-jammy-v1 Once a release exists, component Dockerfiles can install from it: ```dockerfile -ARG BAREOS_PKG_RELEASE=pkg/bareos-22-jammy-v1 -ARG BAREOS_PKG_REPO=https://github.com// +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/bareos-22-jammy.tar.gz /tmp/bareos-pkgs.tar.gz diff --git a/client/22-ubuntu/Dockerfile b/client/22-ubuntu/Dockerfile index 3a9246e5..73c1e70d 100644 --- a/client/22-ubuntu/Dockerfile +++ b/client/22-ubuntu/Dockerfile @@ -18,20 +18,28 @@ LABEL org.label-schema.schema-version="1.0" \ ENV BAREOS_DAEMON_USER=bareos ENV BAREOS_DAEMON_GROUP=bareos ENV DEBIAN_FRONTEND=noninteractive -ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_22.04/Release.key -ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_22.04/ + +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-22-jammy.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN apt-get update -qq \ - && apt-get -qq -y install --no-install-recommends curl tzdata gnupg gosu \ - && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ - && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ - bareos-client mysql-client postgresql-client bareos-tools \ + gosu tzdata default-mysql-client postgresql-client \ + /tmp/bareos-debs/bareos-bconsole_*.deb \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-client_*.deb \ + /tmp/bareos-debs/bareos-filedaemon_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod a+x /docker-entrypoint.sh diff --git a/client/23-ubuntu/Dockerfile b/client/23-ubuntu/Dockerfile new file mode 100644 index 00000000..a341d18a --- /dev/null +++ b/client/23-ubuntu/Dockerfile @@ -0,0 +1,52 @@ +# Dockerfile Bareos client/file daemon +FROM ubuntu:jammy + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV BAREOS_DAEMON_USER=bareos +ENV BAREOS_DAEMON_GROUP=bareos +ENV DEBIAN_FRONTEND=noninteractive + +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-23-jammy.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + gosu tzdata default-mysql-client postgresql-client \ + /tmp/bareos-debs/bareos-bconsole_*.deb \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-client_*.deb \ + /tmp/bareos-debs/bareos-filedaemon_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod a+x /docker-entrypoint.sh + +RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d + +EXPOSE 9102 + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-fd", "-f"] diff --git a/client/23-ubuntu/docker-entrypoint.sh b/client/23-ubuntu/docker-entrypoint.sh new file mode 100755 index 00000000..3b1cbf43 --- /dev/null +++ b/client/23-ubuntu/docker-entrypoint.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +#set -x + +bareos_fd_config="/etc/bareos/bareos-fd.d/director/bareos-dir.conf" + +if [ "${FORCE_ROOT}" = true ]; then + BAREOS_DAEMON_USER='root' + BAREOS_DAEMON_GROUP='root' +fi + +if [ $(id -u) = '0' ]; then + [ -n "${PUID}" ] && usermod -u ${PUID} ${BAREOS_DAEMON_USER} + [ -n "${PGID}" ] && groupmod -g ${PGID} ${BAREOS_DAEMON_GROUP} + + if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-fd.tgz --backup=simple --suffix=.before-control + + # Force client/file daemon password + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' $bareos_fd_config + + # Control file + touch /etc/bareos/bareos-config.control + fi + + # Fix permissions + find /etc/bareos ! -user ${BAREOS_DAEMON_USER} -exec chown ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} {} \; + chown -R ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} /var/lib/bareos /var/log/bareos + + # Gosu + [ "${BAREOS_DAEMON_USER}" != 'root' ] && exec gosu "${BAREOS_DAEMON_USER}" "$BASH_SOURCE" "$@" +fi + +exec "$@" diff --git a/client/24-ubuntu/Dockerfile b/client/24-ubuntu/Dockerfile index a60cbc83..50d8008b 100644 --- a/client/24-ubuntu/Dockerfile +++ b/client/24-ubuntu/Dockerfile @@ -18,20 +18,28 @@ LABEL org.label-schema.schema-version="1.0" \ ENV BAREOS_DAEMON_USER=bareos ENV BAREOS_DAEMON_GROUP=bareos ENV DEBIAN_FRONTEND=noninteractive -ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_24.04/Release.key -ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_24.04/ + +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-24-noble.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN apt-get update -qq \ - && apt-get -qq -y install --no-install-recommends curl tzdata gnupg gosu \ - && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ - && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ - bareos-client mysql-client postgresql-client bareos-tools \ + gosu tzdata default-mysql-client postgresql-client \ + /tmp/bareos-debs/bareos-bconsole_*.deb \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-client_*.deb \ + /tmp/bareos-debs/bareos-filedaemon_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod a+x /docker-entrypoint.sh diff --git a/director-pgsql/22-ubuntu/Dockerfile b/director-pgsql/22-ubuntu/Dockerfile index 6768fb8f..3cd3b17e 100644 --- a/director-pgsql/22-ubuntu/Dockerfile +++ b/director-pgsql/22-ubuntu/Dockerfile @@ -16,16 +16,19 @@ LABEL org.label-schema.schema-version="1.0" \ org.label-schema.version=$VERSION ENV DEBIAN_FRONTEND=noninteractive -ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_22.04/Release.key -ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_22.04/ ENV BAREOS_DPKG_CONF="bareos-database-common bareos-database-common" +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-22-jammy.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz + SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN apt-get update -qq \ - && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ - && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ | debconf-set-selections \ && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ @@ -38,9 +41,16 @@ RUN apt-get update -qq \ | debconf-set-selections \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ - bareos postgresql-client bareos-database-tools \ + curl tzdata postgresql-client \ + /tmp/bareos-debs/bareos-bconsole_*.deb \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-director_*.deb \ + /tmp/bareos-debs/bareos-database-common_*.deb \ + /tmp/bareos-debs/bareos-database-postgresql_*.deb \ + /tmp/bareos-debs/bareos-database-tools_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs RUN tar czf /bareos-dir.tgz /etc/bareos diff --git a/director-pgsql/22-ubuntu/docker-entrypoint.sh b/director-pgsql/22-ubuntu/docker-entrypoint.sh index 6a331f33..ae00f2a5 100755 --- a/director-pgsql/22-ubuntu/docker-entrypoint.sh +++ b/director-pgsql/22-ubuntu/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash github_bareos='raw.githubusercontent.com/bareos/bareos' -webui_admin_conf='Release/24.0.10/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' -admin_conf='Release/24.0.10/webui/install/bareos/bareos-dir.d/console/admin.conf.example' +webui_admin_conf='Release/22.1.8/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/22.1.8/webui/install/bareos/bareos-dir.d/console/admin.conf.example' if [ ! -f /etc/bareos/bareos-config.control ]; then tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control diff --git a/director-pgsql/23-ubuntu/Dockerfile b/director-pgsql/23-ubuntu/Dockerfile new file mode 100644 index 00000000..129fc8a2 --- /dev/null +++ b/director-pgsql/23-ubuntu/Dockerfile @@ -0,0 +1,68 @@ +# Bareos director Dockerfile +FROM ubuntu:jammy + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV DEBIAN_FRONTEND=noninteractive +ENV BAREOS_DPKG_CONF="bareos-database-common bareos-database-common" + +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-23-jammy.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ + && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/database-type select pgsql" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/missing-db-package-error select ignore" \ + | debconf-set-selections \ + && echo 'postfix postfix/main_mailer_type select No configuration' \ + | debconf-set-selections \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + curl tzdata postgresql-client \ + /tmp/bareos-debs/bareos-bconsole_*.deb \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-director_*.deb \ + /tmp/bareos-debs/bareos-database-common_*.deb \ + /tmp/bareos-debs/bareos-database-postgresql_*.deb \ + /tmp/bareos-debs/bareos-database-tools_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs + +RUN tar czf /bareos-dir.tgz /etc/bareos + +COPY webhook-notify /usr/local/bin/webhook-notify +RUN chmod u+x /usr/local/bin/webhook-notify + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +EXPOSE 9101 + +VOLUME /etc/bareos + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-dir", "-u", "bareos", "-f"] diff --git a/director-pgsql/23-ubuntu/docker-entrypoint.sh b/director-pgsql/23-ubuntu/docker-entrypoint.sh new file mode 100755 index 00000000..d42f7881 --- /dev/null +++ b/director-pgsql/23-ubuntu/docker-entrypoint.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash + +github_bareos='raw.githubusercontent.com/bareos/bareos' +webui_admin_conf='Release/23.1.7/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/23.1.7/webui/install/bareos/bareos-dir.d/console/admin.conf.example' + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control + + # Download default admin profile config + if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ + --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf + fi + + # Download default webUI admin config + if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ + --output /etc/bareos/bareos-dir.d/console/admin.conf + fi + + # Update bareos-director configs + # Director / mycatalog & mail report + sed -i 's#dbuser = "bareos"#dbuser = '\"${DB_USER}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbpassword = ""#dbpassword = '\"${DB_PASSWORD}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbname = "bareos"#dbname = '\"${DB_NAME}\"'\n dbaddress = '\"${DB_HOST}\"'\n dbport = '\"${DB_PORT}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + + # Setup webhook + if [ "${WEBHOOK_NOTIFICATION}" = true ]; then + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + fi + + # storage daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_SD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + + # client/file daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_FD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + + # webUI + sed -i 's#Password = .*#Password = '\""${BAREOS_WEBUI_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/console/admin.conf + sed -i "s#}# TlsEnable = false\n}#" \ + /etc/bareos/bareos-dir.d/console/admin.conf + + # MyCatalog Backup + sed -i "s#/var/lib/bareos/bareos.sql#/var/lib/bareos-director/bareos.sql#" \ + /etc/bareos/bareos-dir.d/fileset/Catalog.conf + + # Control file + touch /etc/bareos/bareos-config.control +fi + +if [[ -z ${CI_TEST} ]] ; then + # Waiting Postgresql is up + sqlup=1 + while [ "$sqlup" -ne 0 ] ; do + echo "Waiting for postgresql..." + pg_isready --host="${DB_HOST}" --port="${DB_PORT}" --user="${DB_ADMIN_USER}" + if [ $? -ne 0 ] ; then + sqlup=1 + sleep 5 + else + sqlup=0 + echo "...postgresql is alive" + fi + done +fi + +export PGUSER=${DB_ADMIN_USER} +export PGHOST=${DB_HOST} +export PGPASSWORD=${DB_ADMIN_PASSWORD} +[[ -z "${DB_INIT}" ]] && DB_INIT='false' +[[ -z "${DB_UPDATE}" ]] && DB_UPDATE='false' + +if [ ! -f /etc/bareos/bareos-db.control ] && [ "${DB_INIT}" == 'true' ] ; then + # Init Postgresql DB + echo "Bareos DB init" + echo "Bareos DB init: Create user ${DB_USER}" + psql -c "create user ${DB_USER} with createdb createrole login;" + echo "Bareos DB init: Set user password" + psql -c "alter user ${DB_USER} password '${DB_PASSWORD}';" + /usr/lib/bareos/scripts/create_bareos_database 2>/dev/null + /usr/lib/bareos/scripts/make_bareos_tables 2>/dev/null + /usr/lib/bareos/scripts/grant_bareos_privileges 2>/dev/null + + # Control file + touch /etc/bareos/bareos-db.control +fi + +if [ "${DB_UPDATE}" == 'true' ] ; then + # Try Postgres upgrade + echo "Bareoos DB update" + echo "Bareoos DB update: Update tables" + /usr/lib/bareos/scripts/update_bareos_tables 2>/dev/null + echo "Bareoos DB update: Grant privileges" + /usr/lib/bareos/scripts/grant_bareos_privileges 2>/dev/null +fi + +# Fix permissions +find /etc/bareos ! -user bareos -exec chown bareos {} \; +chown -R bareos:bareos /var/lib/bareos + +# Run Dockerfile CMD +exec "$@" diff --git a/director-pgsql/23-ubuntu/webhook-notify b/director-pgsql/23-ubuntu/webhook-notify new file mode 100755 index 00000000..801e3eaa --- /dev/null +++ b/director-pgsql/23-ubuntu/webhook-notify @@ -0,0 +1,41 @@ +#!/usr/bin/env sh + +job_type=$1 +job_status=$2 +job_client=$3 +job_level=$4 +job_name=$5 +msg_icon="❌" + +if [ "$job_status" = "OK" ] ;then + msg_icon="✅" +fi + +msg_txt="$msg_icon Bareos: $job_type $job_status of $job_client \ +$job_level (${job_name})" + +load_json() +{ + if [ "${WEBHOOK_TYPE}" = "slack" ] ; then + cat < /etc/apt/sources.list.d/bareos.list \ +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ | debconf-set-selections \ && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ @@ -38,9 +41,16 @@ RUN apt-get update -qq \ | debconf-set-selections \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ - bareos postgresql-client bareos-database-tools \ + curl tzdata postgresql-client \ + /tmp/bareos-debs/bareos-bconsole_*.deb \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-director_*.deb \ + /tmp/bareos-debs/bareos-database-common_*.deb \ + /tmp/bareos-debs/bareos-database-postgresql_*.deb \ + /tmp/bareos-debs/bareos-database-tools_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs RUN tar czf /bareos-dir.tgz /etc/bareos diff --git a/storage/22-ubuntu/Dockerfile b/storage/22-ubuntu/Dockerfile index 307ccc0f..a3ed3f1c 100644 --- a/storage/22-ubuntu/Dockerfile +++ b/storage/22-ubuntu/Dockerfile @@ -15,22 +15,28 @@ LABEL org.label-schema.schema-version="1.0" \ org.label-schema.vcs-url="https://github.com/barcus/bareos" \ org.label-schema.version=$VERSION -ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_22.04/Release.key -ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_22.04/ ENV DEBIAN_FRONTEND=noninteractive +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-22-jammy.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz + SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN apt-get update -qq \ - && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ - && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ - bareos-storage bareos-tools bareos-storage-tape mtx scsitools \ - sg3-utils mt-st bareos-storage-droplet \ + tzdata mtx scsitools sg3-utils mt-st \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-storage_*.deb \ + /tmp/bareos-debs/bareos-storage-tape_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod u+x /docker-entrypoint.sh diff --git a/storage/23-ubuntu/Dockerfile b/storage/23-ubuntu/Dockerfile new file mode 100644 index 00000000..bae7f9d0 --- /dev/null +++ b/storage/23-ubuntu/Dockerfile @@ -0,0 +1,52 @@ +# Dockerfile Bareos storage daemon +FROM ubuntu:jammy + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV DEBIAN_FRONTEND=noninteractive + +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-23-jammy.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + tzdata mtx scsitools sg3-utils mt-st \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-storage_*.deb \ + /tmp/bareos-debs/bareos-storage-tape_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d + +EXPOSE 9103 + +VOLUME /etc/bareos +VOLUME /var/lib/bareos/storage + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-sd", "-u", "bareos", "-f"] diff --git a/storage/23-ubuntu/docker-entrypoint.sh b/storage/23-ubuntu/docker-entrypoint.sh new file mode 100755 index 00000000..a7134011 --- /dev/null +++ b/storage/23-ubuntu/docker-entrypoint.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +bareos_sd_config="/etc/bareos/bareos-sd.d/director/bareos-dir.conf" + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xfz /bareos-sd.tgz --backup=simple --suffix=.before-control + + # Update bareos-storage configs + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' $bareos_sd_config + + # Control file + touch /etc/bareos/bareos-config.control +fi + +# Fix permissions +find /var/lib/bareos ! -user bareos -exec chown bareos {} \; +find /etc/bareos/bareos-sd.d ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/[n]?st[0-9]+" ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/tape/.*" ! -user bareos -exec chown bareos {} \; + +# Run Dockerfile CMD +exec "$@" diff --git a/storage/24-ubuntu/Dockerfile b/storage/24-ubuntu/Dockerfile index 3e3ede93..7a13d55c 100644 --- a/storage/24-ubuntu/Dockerfile +++ b/storage/24-ubuntu/Dockerfile @@ -15,22 +15,28 @@ LABEL org.label-schema.schema-version="1.0" \ org.label-schema.vcs-url="https://github.com/barcus/bareos" \ org.label-schema.version=$VERSION -ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_24.04/Release.key -ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_24.04/ ENV DEBIAN_FRONTEND=noninteractive +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-24-noble.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz + SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN apt-get update -qq \ - && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ - && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ - bareos-storage bareos-tools bareos-storage-tape mtx scsitools \ - sg3-utils mt-st bareos-storage-droplet \ + tzdata mtx scsitools sg3-utils mt-st \ + /tmp/bareos-debs/bareos-common_*.deb \ + /tmp/bareos-debs/bareos-storage_*.deb \ + /tmp/bareos-debs/bareos-storage-tape_*.deb \ + /tmp/bareos-debs/bareos-tools_*.deb \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod u+x /docker-entrypoint.sh diff --git a/webui/22-ubuntu/Dockerfile b/webui/22-ubuntu/Dockerfile index eed5cfc8..79ca61ac 100644 --- a/webui/22-ubuntu/Dockerfile +++ b/webui/22-ubuntu/Dockerfile @@ -15,21 +15,25 @@ LABEL org.label-schema.schema-version="1.0" \ org.label-schema.vcs-url="https://github.com/barcus/bareos" \ org.label-schema.version=$VERSION -ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_22.04/Release.key -ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_22.04/ ENV DEBIAN_FRONTEND=noninteractive +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-22-jammy.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz + SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN apt-get update -qq \ - && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ - && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ - bareos-webui \ + tzdata \ + /tmp/bareos-debs/bareos-webui_*.deb \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod u+x /docker-entrypoint.sh diff --git a/webui/23-ubuntu/Dockerfile b/webui/23-ubuntu/Dockerfile new file mode 100644 index 00000000..72346312 --- /dev/null +++ b/webui/23-ubuntu/Dockerfile @@ -0,0 +1,48 @@ +# Bareos Web-ui Dockerfile +FROM ubuntu:jammy + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV DEBIAN_FRONTEND=noninteractive + +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-23-jammy.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + tzdata \ + /tmp/bareos-debs/bareos-webui_*.deb \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +RUN tar czf /bareos-webui.tgz /etc/bareos-webui + +EXPOSE 80 + +VOLUME /etc/bareos-webui + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] diff --git a/webui/23-ubuntu/docker-entrypoint.sh b/webui/23-ubuntu/docker-entrypoint.sh new file mode 100755 index 00000000..94b0af54 --- /dev/null +++ b/webui/23-ubuntu/docker-entrypoint.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +if [ ! -f /etc/bareos-webui/bareos-config.control ];then + tar xzf /bareos-webui.tgz --backup=simple --suffix=.before-control + + # Update bareos-webui config + sed -i 's#diraddress.*#diraddress = '\""${BAREOS_DIR_HOST}"\"'#' \ + /etc/bareos-webui/directors.ini + + # Control file + touch /etc/bareos-webui/bareos-config.control +fi + +apache_conf="/etc/apache2/sites-available/000-default.conf" + +# Set document root +sed -i "s#/var/www/html#/usr/share/bareos-webui/public#g" $apache_conf + +# Enable Apache server stats +if [ "${SERVER_STATS}" == "yes" ]; then + sed -i 's!#ServerName.*!Alias /server-status /var/www/dummy!' $apache_conf +fi + +# Run Dockerfile CMD +exec "$@" diff --git a/webui/24-ubuntu/Dockerfile b/webui/24-ubuntu/Dockerfile index bcf32581..8ff208d4 100644 --- a/webui/24-ubuntu/Dockerfile +++ b/webui/24-ubuntu/Dockerfile @@ -15,21 +15,25 @@ LABEL org.label-schema.schema-version="1.0" \ org.label-schema.vcs-url="https://github.com/barcus/bareos" \ org.label-schema.version=$VERSION -ENV BAREOS_KEY=http://download.bareos.org/current/xUbuntu_24.04/Release.key -ENV BAREOS_REPO=http://download.bareos.org/current/xUbuntu_24.04/ ENV DEBIAN_FRONTEND=noninteractive +ARG BAREOS_PKG_RELEASE=pkg%2Fbareos-packages-v1 +ARG BAREOS_PKG_REPO=https://github.com/Dark-Vex/bareos +ARG BAREOS_PKG_ASSET=bareos-24-noble.tar.gz + +# hadolint ignore=DL3020 +ADD ${BAREOS_PKG_REPO}/releases/download/${BAREOS_PKG_RELEASE}/${BAREOS_PKG_ASSET} /tmp/bareos-pkgs.tar.gz + SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN apt-get update -qq \ - && apt-get -qq -y install --no-install-recommends curl tzdata gnupg \ - && curl -Ls $BAREOS_KEY | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ - && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] $BAREOS_REPO /" > /etc/apt/sources.list.d/bareos.list \ +RUN mkdir -p /tmp/bareos-debs \ + && tar -xzf /tmp/bareos-pkgs.tar.gz -C /tmp/bareos-debs \ && apt-get update -qq \ && apt-get install -qq -y --no-install-recommends \ - bareos-webui \ + tzdata \ + /tmp/bareos-debs/bareos-webui_*.deb \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /tmp/bareos-pkgs.tar.gz /tmp/bareos-debs COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod u+x /docker-entrypoint.sh From 73c55d8428781e40456b1bff0b1f9f96d50e7ecc Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Mon, 11 May 2026 21:34:16 +0200 Subject: [PATCH 46/54] fix(ci/cd): Fix entrypoint.sh for avoid silent failures (#31) * fix(ci/cd): Fix entrypoint.sh for avoid silent failures Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Fix entrypoint.sh for avoid silent failures Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Fix entrypoint.sh for avoid silent failures Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Stop embedding registry URL in build-time image names The old buildx (v0.5.1) paired with a current buildkit rejects registry-qualified names in --output type=docker. Build with a plain local tag (bareos-:), then docker tag + docker push in the push step. This removes the invalid reference format error entirely. * Delete .claude/grounded-memory.json * updated gitignore Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --------- Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .../actions/build-bareos-app/entrypoint.sh | 10 ++++- .../actions/prepare-bareos-app/entrypoint.sh | 6 +++ .github/actions/push-bareos-app/entrypoint.sh | 39 ++++++++++++------- .github/actions/test-bareos-app/entrypoint.sh | 10 ++++- .gitignore | 1 + 5 files changed, 48 insertions(+), 18 deletions(-) diff --git a/.github/actions/build-bareos-app/entrypoint.sh b/.github/actions/build-bareos-app/entrypoint.sh index f8c17f06..6af40a92 100755 --- a/.github/actions/build-bareos-app/entrypoint.sh +++ b/.github/actions/build-bareos-app/entrypoint.sh @@ -17,6 +17,7 @@ echo ::endgroup:: # Build from app_build.txt echo ::group::Build Bareos +HAS_ERROR=0 while read app version arch app_path ; do tag="${version}" re='^[0-9]+-alpine.*$' @@ -32,12 +33,14 @@ while read app version arch app_path ; do --build-arg VCS_REF=$(git rev-parse --short HEAD) \ --build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ --build-arg NAME="${GITHUB_REPOSITORY}-${app}" \ - --output "type=docker,dest=${workdir}/bareos-${app}-${tag}.tar,name=${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${tag}" \ + --tag "bareos-${app}:${tag}" \ + --output "type=docker,dest=${workdir}/bareos-${app}-${tag}.tar" \ "${app_path}" if [[ $? -ne 0 ]] ; then echo "::error:: ERROR-build: failed ${GITHUB_REPOSITORY}-${app}:${tag} in ${app_path}" rm -f "${workdir}/bareos-${app}-${tag}.tar" + HAS_ERROR=1 fi done < "${workdir}/app_build.txt" @@ -46,7 +49,10 @@ echo ::endgroup:: # Clean & fix perm echo ::group::Clean docker buildx rm -chmod 755 "${workdir}"/bareos-*.tar +if [[ $HAS_ERROR -ne 0 ]]; then + exit 1 +fi +find "${workdir}" -name 'bareos-*.tar' -exec chmod 755 {} + echo ::endgroup:: #EOF diff --git a/.github/actions/prepare-bareos-app/entrypoint.sh b/.github/actions/prepare-bareos-app/entrypoint.sh index dc54de55..99fd2741 100755 --- a/.github/actions/prepare-bareos-app/entrypoint.sh +++ b/.github/actions/prepare-bareos-app/entrypoint.sh @@ -15,6 +15,8 @@ echo "${docker_files}" echo ::endgroup:: mkdir -p "${GITHUB_WORKSPACE}/build" +touch "$build_file" +touch "$tag_file" echo ::group::'Build apps & tags list' for file in $docker_files; do @@ -25,6 +27,10 @@ for file in $docker_files; do app_dir=$(echo "$file" |cut -d'/' -f1) version_dir=$(echo "$file" |cut -d'/' -f2) version=$(echo "$version_dir" |cut -d'-' -f1) + # Skip versions no longer available upstream + if [[ "$version" -le 21 ]]; then + continue + fi base_img=$(echo "$version_dir" |cut -d'-' -f2) [[ $version -ge 20 ]] && default_backend='pgsql' diff --git a/.github/actions/push-bareos-app/entrypoint.sh b/.github/actions/push-bareos-app/entrypoint.sh index 5d1970d0..096a421b 100755 --- a/.github/actions/push-bareos-app/entrypoint.sh +++ b/.github/actions/push-bareos-app/entrypoint.sh @@ -2,10 +2,16 @@ workdir="${GITHUB_WORKSPACE}/build" docker_files=$(find "${workdir}/" -name "bareos-*.tar" 2>/dev/null) +rm_tag="" # Enable experimental feature in Docker export DOCKER_CLI_EXPERIMENTAL="enabled" +# Strip any http/https scheme prefix and trailing slash +registry="${INPUT_REGISTRY#https://}" +registry="${registry#http://}" +registry="${registry%/}" + # Load Dockerfiles echo ::group::Load Dockerfile echo "${docker_files}" @@ -15,7 +21,7 @@ done echo ::endgroup:: # Connect Docker Hub -docker login "${INPUT_REGISTRY}" -u "${INPUT_DOCKER_USER}" -p "${INPUT_DOCKER_PASS}" +docker login "${registry}" -u "${INPUT_DOCKER_USER}" -p "${INPUT_DOCKER_PASS}" # Push tags and manfiests echo ::group::Push build tags @@ -27,35 +33,40 @@ while read line ; do re='^[0-9]+-alpine.*$' if [[ $version =~ $re ]] ; then build_tag="${version}-${arch}" - rm_tag="$rm_tag ${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${build_tag}" + rm_tag="$rm_tag ${registry}/${GITHUB_REPOSITORY}-${app}:${build_tag}" fi - # Push build tags - docker push "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${build_tag}" + # Re-tag local image with registry-qualified name then push + local_name="bareos-${app}:${build_tag}" + remote_name="${registry}/${GITHUB_REPOSITORY}-${app}:${build_tag}" + docker tag "${local_name}" "${remote_name}" + docker push "${remote_name}" done < "${workdir}/app_build.txt" echo ::endgroup:: echo ::group::Push additional tags while read build_app s_tag t_tag ; do - # Push additional tags for Ubuntu + # Push additional tags for Ubuntu if [[ $s_tag =~ ^[a-z0-9]+-ubuntu.*$ ]]; then - docker tag "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}" \ - "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" - docker push "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" + docker tag "${registry}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}" \ + "${registry}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" + docker push "${registry}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" fi # Create and push manifest for Alpine (arm64 + amd64) if [[ $s_tag =~ ^[a-z0-9]+-alpine.*$ ]]; then - docker manifest create "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" \ - "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}-amd64" \ - "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}-arm64" - docker manifest push "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" + docker manifest create "${registry}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" \ + "${registry}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}-amd64" \ + "${registry}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}-arm64" + docker manifest push "${registry}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" fi done < "${workdir}/tag_build.txt" echo ::endgroup:: # Clean Alpine build_tag (amd/arm) echo ::group::Clean -docker run --rm lumir/remove-dockerhub-tag \ - --user "${GITHUB_ACTOR}" --password ${INPUT_DOCKER_PASS} ${rm_tag} +if [[ -n "${rm_tag}" ]]; then + docker run --rm lumir/remove-dockerhub-tag \ + --user "${GITHUB_ACTOR}" --password ${INPUT_DOCKER_PASS} ${rm_tag} +fi echo ::endgroup:: #EOF diff --git a/.github/actions/test-bareos-app/entrypoint.sh b/.github/actions/test-bareos-app/entrypoint.sh index 39f91340..3fee0aa5 100755 --- a/.github/actions/test-bareos-app/entrypoint.sh +++ b/.github/actions/test-bareos-app/entrypoint.sh @@ -14,6 +14,7 @@ echo ::endgroup:: # Test images echo ::group::Test build tags +HAS_ERROR=0 while read app version arch path ; do # If nightly image, don't test re_nightly='^nightly-.*$' @@ -50,12 +51,13 @@ while read app version arch path ; do # Check if Dockerfile exist if [[ ! -f ${workdir}/bareos-${app}-${build_tag}.tar ]] ; then echo ::error::"ERROR-test: $workdir/bareos-${app}-${build_tag}.tar not found" + HAS_ERROR=1 continue fi # Run docker and check version img_version=$(docker run -t --rm ${ARGS} \ - "${INPUT_REGISTRY}/${GITHUB_REPOSITORY}-${app}:${build_tag}" \ + "bareos-${app}:${build_tag}" \ "${CMD[@]}" | tail -1) if [[ $version =~ $re_alpine ]] ; then @@ -73,7 +75,7 @@ while read app version arch path ; do if (( short_img_version != short_version )) ; then echo ::error::"ERROR-test: ${app}:${build_tag} is ${short_img_version}" - exit 1 + HAS_ERROR=1 else echo "OK: ${app}:${build_tag} is Bareos v${short_img_version}" fi @@ -81,4 +83,8 @@ while read app version arch path ; do done < "${workdir}/app_build.txt" echo ::endgroup:: +if [[ $HAS_ERROR -ne 0 ]]; then + exit 1 +fi + #EOF diff --git a/.gitignore b/.gitignore index 14214afa..df945955 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ local/ .env +.claude/grounded-memory.json From 24a98f5987de4596fa4c575b8f43785f2c0aed27 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Mon, 11 May 2026 22:06:37 +0200 Subject: [PATCH 47/54] Fix/ci silent pass on empty build (#32) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(ci/cd): Fix entrypoint.sh for avoid silent failures Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Fix entrypoint.sh for avoid silent failures Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Fix entrypoint.sh for avoid silent failures Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Stop embedding registry URL in build-time image names The old buildx (v0.5.1) paired with a current buildkit rejects registry-qualified names in --output type=docker. Build with a plain local tag (bareos-:), then docker tag + docker push in the push step. This removes the invalid reference format error entirely. * Delete .claude/grounded-memory.json * updated gitignore Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Upgrade docker:stable→docker:27 in action Dockerfiles; add push debug output docker:stable was deprecated ~2020 and pins Docker ~19.03, which may reject otherwise-valid registry references. Upgrading to docker:27 gets current reference parsing. Debug echoes expose raw INPUT_REGISTRY and GITHUB_REPOSITORY so we can confirm values at push time. --------- Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .github/actions/build-bareos-app/Dockerfile | 2 +- .github/actions/push-bareos-app/Dockerfile | 2 +- .github/actions/push-bareos-app/entrypoint.sh | 4 ++++ .github/actions/test-bareos-app/Dockerfile | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-bareos-app/Dockerfile b/.github/actions/build-bareos-app/Dockerfile index afad2c34..2a938326 100644 --- a/.github/actions/build-bareos-app/Dockerfile +++ b/.github/actions/build-bareos-app/Dockerfile @@ -1,4 +1,4 @@ -FROM docker:stable +FROM docker:27 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] diff --git a/.github/actions/push-bareos-app/Dockerfile b/.github/actions/push-bareos-app/Dockerfile index 30822018..6f4f23f6 100644 --- a/.github/actions/push-bareos-app/Dockerfile +++ b/.github/actions/push-bareos-app/Dockerfile @@ -1,4 +1,4 @@ -FROM docker:stable +FROM docker:27 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] diff --git a/.github/actions/push-bareos-app/entrypoint.sh b/.github/actions/push-bareos-app/entrypoint.sh index 096a421b..8b7602b6 100755 --- a/.github/actions/push-bareos-app/entrypoint.sh +++ b/.github/actions/push-bareos-app/entrypoint.sh @@ -12,6 +12,10 @@ registry="${INPUT_REGISTRY#https://}" registry="${registry#http://}" registry="${registry%/}" +echo "DEBUG raw INPUT_REGISTRY=[${INPUT_REGISTRY}]" +echo "DEBUG normalized registry=[${registry}]" +echo "DEBUG GITHUB_REPOSITORY=[${GITHUB_REPOSITORY}]" + # Load Dockerfiles echo ::group::Load Dockerfile echo "${docker_files}" diff --git a/.github/actions/test-bareos-app/Dockerfile b/.github/actions/test-bareos-app/Dockerfile index 30822018..6f4f23f6 100644 --- a/.github/actions/test-bareos-app/Dockerfile +++ b/.github/actions/test-bareos-app/Dockerfile @@ -1,4 +1,4 @@ -FROM docker:stable +FROM docker:27 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] From 1b3bae45e6f88ee2ea5fe6d7d0c14df797ee7135 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Mon, 11 May 2026 22:39:24 +0200 Subject: [PATCH 48/54] Fix/ci silent pass on empty build (#33) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(ci/cd): Fix entrypoint.sh for avoid silent failures Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Fix entrypoint.sh for avoid silent failures Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Fix entrypoint.sh for avoid silent failures Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Stop embedding registry URL in build-time image names The old buildx (v0.5.1) paired with a current buildkit rejects registry-qualified names in --output type=docker. Build with a plain local tag (bareos-:), then docker tag + docker push in the push step. This removes the invalid reference format error entirely. * Delete .claude/grounded-memory.json * updated gitignore Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> * fix(ci/cd): Upgrade docker:stable→docker:27 in action Dockerfiles; add push debug output docker:stable was deprecated ~2020 and pins Docker ~19.03, which may reject otherwise-valid registry references. Upgrading to docker:27 gets current reference parsing. Debug echoes expose raw INPUT_REGISTRY and GITHUB_REPOSITORY so we can confirm values at push time. * fix(ci/cd): Strip trailing whitespace from registry; add %q debug output registry%%[[:space:]] removes newlines/tabs that %/ misses. printf %q will reveal any hidden chars even through GitHub masking. --------- Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .github/actions/push-bareos-app/entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/push-bareos-app/entrypoint.sh b/.github/actions/push-bareos-app/entrypoint.sh index 8b7602b6..a44d2dfb 100755 --- a/.github/actions/push-bareos-app/entrypoint.sh +++ b/.github/actions/push-bareos-app/entrypoint.sh @@ -11,7 +11,9 @@ export DOCKER_CLI_EXPERIMENTAL="enabled" registry="${INPUT_REGISTRY#https://}" registry="${registry#http://}" registry="${registry%/}" +registry="${registry%%[[:space:]]}" +printf 'DEBUG registry bytes: %q\n' "${registry}" echo "DEBUG raw INPUT_REGISTRY=[${INPUT_REGISTRY}]" echo "DEBUG normalized registry=[${registry}]" echo "DEBUG GITHUB_REPOSITORY=[${GITHUB_REPOSITORY}]" From b47b9a0f6692b2d6f0bc0db6c55d00ae1d96a00b Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Tue, 12 May 2026 09:13:22 +0200 Subject: [PATCH 49/54] fix(ci/cd): Add set -x, printf debug, and image_prefix escape hatch set -x traces every command; printf %q before docker tag exposes exact reference strings including hidden chars. IMAGE_PREFIX input lets the user override registry/GITHUB_REPOSITORY if the secret contains a path component that produces an invalid reference. --- .github/actions/push-bareos-app/action.yml | 3 +++ .github/actions/push-bareos-app/entrypoint.sh | 23 +++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/actions/push-bareos-app/action.yml b/.github/actions/push-bareos-app/action.yml index 6b5a4241..cb8d4ee1 100644 --- a/.github/actions/push-bareos-app/action.yml +++ b/.github/actions/push-bareos-app/action.yml @@ -8,6 +8,9 @@ inputs: docker_user: description: 'Registry Username' required: true + image_prefix: + description: 'Full image name prefix (overrides registry/GITHUB_REPOSITORY). E.g. harbor.example.com/project/bareos' + required: false registry: description: 'Registry URL' required: false diff --git a/.github/actions/push-bareos-app/entrypoint.sh b/.github/actions/push-bareos-app/entrypoint.sh index a44d2dfb..48b8742c 100755 --- a/.github/actions/push-bareos-app/entrypoint.sh +++ b/.github/actions/push-bareos-app/entrypoint.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -x workdir="${GITHUB_WORKSPACE}/build" docker_files=$(find "${workdir}/" -name "bareos-*.tar" 2>/dev/null) @@ -36,14 +37,16 @@ while read line ; do version=$(echo $line|awk '{print $2}') arch=$(echo $line|awk '{print $3}') build_tag=${version} + img_prefix="${INPUT_IMAGE_PREFIX:-${registry}/${GITHUB_REPOSITORY}}" re='^[0-9]+-alpine.*$' if [[ $version =~ $re ]] ; then build_tag="${version}-${arch}" - rm_tag="$rm_tag ${registry}/${GITHUB_REPOSITORY}-${app}:${build_tag}" + rm_tag="$rm_tag ${img_prefix}-${app}:${build_tag}" fi # Re-tag local image with registry-qualified name then push local_name="bareos-${app}:${build_tag}" - remote_name="${registry}/${GITHUB_REPOSITORY}-${app}:${build_tag}" + remote_name="${img_prefix}-${app}:${build_tag}" + printf 'DEBUG: docker tag %q %q\n' "${local_name}" "${remote_name}" docker tag "${local_name}" "${remote_name}" docker push "${remote_name}" done < "${workdir}/app_build.txt" @@ -51,18 +54,20 @@ echo ::endgroup:: echo ::group::Push additional tags while read build_app s_tag t_tag ; do + img_prefix="${INPUT_IMAGE_PREFIX:-${registry}/${GITHUB_REPOSITORY}}" # Push additional tags for Ubuntu if [[ $s_tag =~ ^[a-z0-9]+-ubuntu.*$ ]]; then - docker tag "${registry}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}" \ - "${registry}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" - docker push "${registry}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" + printf 'DEBUG: docker tag %q %q\n' "${img_prefix}-${build_app}:${s_tag}" "${img_prefix}-${build_app}:${t_tag}" + docker tag "${img_prefix}-${build_app}:${s_tag}" \ + "${img_prefix}-${build_app}:${t_tag}" + docker push "${img_prefix}-${build_app}:${t_tag}" fi # Create and push manifest for Alpine (arm64 + amd64) if [[ $s_tag =~ ^[a-z0-9]+-alpine.*$ ]]; then - docker manifest create "${registry}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" \ - "${registry}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}-amd64" \ - "${registry}/${GITHUB_REPOSITORY}-${build_app}:${s_tag}-arm64" - docker manifest push "${registry}/${GITHUB_REPOSITORY}-${build_app}:${t_tag}" + docker manifest create "${img_prefix}-${build_app}:${t_tag}" \ + "${img_prefix}-${build_app}:${s_tag}-amd64" \ + "${img_prefix}-${build_app}:${s_tag}-arm64" + docker manifest push "${img_prefix}-${build_app}:${t_tag}" fi done < "${workdir}/tag_build.txt" echo ::endgroup:: From 9c23e277aaf29be2d96d95c76812c6d2106a4a0a Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Tue, 12 May 2026 09:33:16 +0200 Subject: [PATCH 50/54] chore(ci/cd): Remove debug output from push entrypoint Push confirmed working after REGISTRY_URL secret was corrected to bare hostname. Removing set -x and all DEBUG echo/printf lines. --- .github/actions/push-bareos-app/entrypoint.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/actions/push-bareos-app/entrypoint.sh b/.github/actions/push-bareos-app/entrypoint.sh index 48b8742c..2e5f6639 100755 --- a/.github/actions/push-bareos-app/entrypoint.sh +++ b/.github/actions/push-bareos-app/entrypoint.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -set -x workdir="${GITHUB_WORKSPACE}/build" docker_files=$(find "${workdir}/" -name "bareos-*.tar" 2>/dev/null) @@ -14,11 +13,6 @@ registry="${registry#http://}" registry="${registry%/}" registry="${registry%%[[:space:]]}" -printf 'DEBUG registry bytes: %q\n' "${registry}" -echo "DEBUG raw INPUT_REGISTRY=[${INPUT_REGISTRY}]" -echo "DEBUG normalized registry=[${registry}]" -echo "DEBUG GITHUB_REPOSITORY=[${GITHUB_REPOSITORY}]" - # Load Dockerfiles echo ::group::Load Dockerfile echo "${docker_files}" @@ -46,7 +40,6 @@ while read line ; do # Re-tag local image with registry-qualified name then push local_name="bareos-${app}:${build_tag}" remote_name="${img_prefix}-${app}:${build_tag}" - printf 'DEBUG: docker tag %q %q\n' "${local_name}" "${remote_name}" docker tag "${local_name}" "${remote_name}" docker push "${remote_name}" done < "${workdir}/app_build.txt" @@ -57,7 +50,6 @@ while read build_app s_tag t_tag ; do img_prefix="${INPUT_IMAGE_PREFIX:-${registry}/${GITHUB_REPOSITORY}}" # Push additional tags for Ubuntu if [[ $s_tag =~ ^[a-z0-9]+-ubuntu.*$ ]]; then - printf 'DEBUG: docker tag %q %q\n' "${img_prefix}-${build_app}:${s_tag}" "${img_prefix}-${build_app}:${t_tag}" docker tag "${img_prefix}-${build_app}:${s_tag}" \ "${img_prefix}-${build_app}:${t_tag}" docker push "${img_prefix}-${build_app}:${t_tag}" From 715034689e82670e6365f0bae8730df3e2d0afb5 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Tue, 12 May 2026 09:36:33 +0200 Subject: [PATCH 51/54] chore: Document branch protection rule in CLAUDE.md (#35) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Never push directly to master — always branch + PR. Co-authored-by: Claude Sonnet 4.6 --- CLAUDE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 8b221c80..703492ed 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -88,6 +88,8 @@ See `.env.dist` for all required variables. The most important ones for the Dire This repo is a fork. **Always push branches and open PRs against the fork (`origin`), never against the upstream repository.** When using `gh` commands, always pass `--repo` to target the fork explicitly. +**Never bypass branch protection.** Do not push directly to `master` — always use a branch and open a PR. Never use `--force`, `--force-with-lease` on `master`, or any flag that bypasses protection rules. + ## CI/CD GitHub Actions workflows in `.github/workflows/`: From f8f7d86a27a95df0b7bfba5b6e1915a11b76472a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 17:20:59 +0200 Subject: [PATCH 52/54] chore(deps): bump actions/checkout from 4 to 6 (#34) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .github/workflows/build-bareos-packages.yml | 2 +- .github/workflows/ci-api.yml | 8 ++++---- .github/workflows/ci-client.yml | 8 ++++---- .github/workflows/ci-director.yml | 8 ++++---- .github/workflows/ci-storage.yml | 8 ++++---- .github/workflows/ci-webui.yml | 8 ++++---- .github/workflows/push-readme.yml | 2 +- .github/workflows/run-compose.yml | 2 +- .github/workflows/test-n-lint.yml | 4 ++-- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-bareos-packages.yml b/.github/workflows/build-bareos-packages.yml index 0b48d9a1..33d12d69 100644 --- a/.github/workflows/build-bareos-packages.yml +++ b/.github/workflows/build-bareos-packages.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Build ${{ matrix.bareos_branch }} / ${{ matrix.ubuntu_codename }} packages run: | diff --git a/.github/workflows/ci-api.yml b/.github/workflows/ci-api.yml index 257fdba5..edd34be1 100644 --- a/.github/workflows/ci-api.yml +++ b/.github/workflows/ci-api.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Prepare build file uses: ./.github/actions/prepare-bareos-app @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -75,7 +75,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -103,7 +103,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 diff --git a/.github/workflows/ci-client.yml b/.github/workflows/ci-client.yml index abfb1f38..41d7df3b 100644 --- a/.github/workflows/ci-client.yml +++ b/.github/workflows/ci-client.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Prepare build file uses: ./.github/actions/prepare-bareos-app @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -75,7 +75,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -103,7 +103,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 diff --git a/.github/workflows/ci-director.yml b/.github/workflows/ci-director.yml index 5e6742f7..c05b7423 100644 --- a/.github/workflows/ci-director.yml +++ b/.github/workflows/ci-director.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Prepare build file uses: ./.github/actions/prepare-bareos-app @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -75,7 +75,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -103,7 +103,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 diff --git a/.github/workflows/ci-storage.yml b/.github/workflows/ci-storage.yml index 73b15843..cc7741e6 100644 --- a/.github/workflows/ci-storage.yml +++ b/.github/workflows/ci-storage.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Prepare build file uses: ./.github/actions/prepare-bareos-app @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -75,7 +75,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -103,7 +103,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 diff --git a/.github/workflows/ci-webui.yml b/.github/workflows/ci-webui.yml index e485921c..3c4b498e 100644 --- a/.github/workflows/ci-webui.yml +++ b/.github/workflows/ci-webui.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Prepare build file uses: ./.github/actions/prepare-bareos-app @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -75,7 +75,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 @@ -103,7 +103,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Download artifact uses: actions/download-artifact@v8 diff --git a/.github/workflows/push-readme.yml b/.github/workflows/push-readme.yml index 699837c0..9c8f6d91 100644 --- a/.github/workflows/push-readme.yml +++ b/.github/workflows/push-readme.yml @@ -18,7 +18,7 @@ jobs: module: [client, director, storage, webui, api] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Update Docker Hub description uses: peter-evans/dockerhub-description@v5.0.0 diff --git a/.github/workflows/run-compose.yml b/.github/workflows/run-compose.yml index cb7c8dfe..81c462cd 100644 --- a/.github/workflows/run-compose.yml +++ b/.github/workflows/run-compose.yml @@ -23,7 +23,7 @@ jobs: module: [ubuntu-pgsql, alpine-pgsql] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Create required folder run: | diff --git a/.github/workflows/test-n-lint.yml b/.github/workflows/test-n-lint.yml index 317ecdf3..1c9d8306 100644 --- a/.github/workflows/test-n-lint.yml +++ b/.github/workflows/test-n-lint.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install hadolint run: | @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install mardownlint run: | From eae4b68b9871cbb67eb30c37bc6e9eaf0b72f218 Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Tue, 2 Jun 2026 00:13:41 +0200 Subject: [PATCH 53/54] feat: add Bareos 25 Ubuntu images (director, storage, client, webui) (#36) Install from download.bareos.org/current/xUbuntu_24.04/ using the gpg-keyring apt style. Bump latest_ubuntu to 25 so the floating ubuntu/latest tags point to the new images. Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- .../references/upstream-sources.md | 13 +- .../actions/prepare-bareos-app/entrypoint.sh | 2 +- CLAUDE.md | 4 +- README.md | 7 +- client/25-ubuntu/Dockerfile | 51 +++++++ client/25-ubuntu/docker-entrypoint.sh | 33 +++++ director-pgsql/25-ubuntu/Dockerfile | 67 +++++++++ director-pgsql/25-ubuntu/docker-entrypoint.sh | 128 ++++++++++++++++++ director-pgsql/25-ubuntu/webhook-notify | 41 ++++++ storage/25-ubuntu/Dockerfile | 51 +++++++ storage/25-ubuntu/docker-entrypoint.sh | 22 +++ webui/25-ubuntu/Dockerfile | 47 +++++++ webui/25-ubuntu/docker-entrypoint.sh | 25 ++++ 13 files changed, 480 insertions(+), 11 deletions(-) create mode 100644 client/25-ubuntu/Dockerfile create mode 100644 client/25-ubuntu/docker-entrypoint.sh create mode 100644 director-pgsql/25-ubuntu/Dockerfile create mode 100644 director-pgsql/25-ubuntu/docker-entrypoint.sh create mode 100644 director-pgsql/25-ubuntu/webhook-notify create mode 100644 storage/25-ubuntu/Dockerfile create mode 100644 storage/25-ubuntu/docker-entrypoint.sh create mode 100644 webui/25-ubuntu/Dockerfile create mode 100644 webui/25-ubuntu/docker-entrypoint.sh diff --git a/.claude/skills/add-bareos-version/references/upstream-sources.md b/.claude/skills/add-bareos-version/references/upstream-sources.md index ed6fad06..f6980601 100644 --- a/.claude/skills/add-bareos-version/references/upstream-sources.md +++ b/.claude/skills/add-bareos-version/references/upstream-sources.md @@ -1,6 +1,6 @@ # Bareos Upstream Source Table -Last verified: 2026-04-18 +Last verified: 2026-06-01 ## Ubuntu repos @@ -11,7 +11,7 @@ Last verified: 2026-04-18 | 22 | ubuntu:jammy (22.04) | `http://download.bareos.org/current/xUbuntu_22.04/Release.key` | `http://download.bareos.org/current/xUbuntu_22.04/` | ⚠ current/ installs latest Bareos (25.x as of 2026-04) | | 23 | — | — | — | ✗ no versioned repo; current/ does not pin to 23 | | 24 | ubuntu:noble (24.04) | `http://download.bareos.org/current/xUbuntu_24.04/Release.key` | `http://download.bareos.org/current/xUbuntu_24.04/` | ⚠ current/ installs latest Bareos (25.x as of 2026-04) | -| 25 | — | — | — | ✗ no versioned repo; current/ does not pin to 25 | +| 25 | ubuntu:noble (24.04) | `http://download.bareos.org/current/xUbuntu_24.04/Release.key` | `http://download.bareos.org/current/xUbuntu_24.04/` | ⚠ current/ installs latest Bareos (25.x as of 2026-06); 25-ubuntu images built from this | **Note**: For v22+, `current/` always tracks the latest Bareos release. The directory name reflects Ubuntu version, not Bareos version. @@ -59,10 +59,11 @@ curl -sL "https://pypi.org/simple/bareos-restapi/" | grep -Eo 'bareos.restapi-[0 | director-pgsql | 22-ubuntu | ✓ | Ubuntu 22.04 + current/ | | director-pgsql | 24-alpine | ✗ | No Alpine package for Bareos 24 | | director-pgsql | 23-alpine/ubuntu | ✗ | No upstream source | -| director-pgsql | 25-alpine/ubuntu | ✗ | No upstream source | -| storage | same as director-pgsql | same | same | -| client | same as director-pgsql | same | same | -| webui | same as director-pgsql | same | same | +| director-pgsql | 25-ubuntu | ✓ | Ubuntu 24.04 + current/ | +| director-pgsql | 25-alpine | ✗ | No Alpine package for Bareos 25 | +| storage | 25-ubuntu | ✓ | Ubuntu 24.04 + current/ | +| client | 25-ubuntu | ✓ | Ubuntu 24.04 + current/ | +| webui | 25-ubuntu | ✓ | Ubuntu 24.04 + current/ | | api | 20-alpine | ✗ | bareos-restapi<21 not on PyPI | | api | 23-alpine | ✗ | No upstream source | | api | 25-alpine | ✗ | No upstream source | diff --git a/.github/actions/prepare-bareos-app/entrypoint.sh b/.github/actions/prepare-bareos-app/entrypoint.sh index 99fd2741..83638b1a 100755 --- a/.github/actions/prepare-bareos-app/entrypoint.sh +++ b/.github/actions/prepare-bareos-app/entrypoint.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash BUILDX_VER='v0.5.1' -latest_ubuntu='24' +latest_ubuntu='25' latest_alpine='22' latest_api='21' diff --git a/CLAUDE.md b/CLAUDE.md index 703492ed..feba513f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -105,7 +105,7 @@ The CI uses reusable composite actions in `.github/actions/` (prepare, build, pu ## Version Support - Alpine images support `linux/amd64` and `linux/arm64/v8` -- Current active versions: 22 (Ubuntu and Alpine), 24 (Ubuntu) +- Current active versions: 22 (Ubuntu and Alpine), 24 (Ubuntu), 25 (Ubuntu) - MySQL backend was dropped in Bareos 21+; `director-mysql/` only goes up to version 20 ### Upstream package availability @@ -119,7 +119,7 @@ The CI uses reusable composite actions in `.github/actions/` (prepare, build, pu | 22 | `current/` (serves 25.x today) | Alpine 3.18 | | 23 | not published upstream | not published | | 24 | not published upstream | not published | -| 25 | `current/` (latest) | not published | +| 25 | `current/xUbuntu_24.04/` | not published | Use `bareos-packages/` to build `.deb` packages from source for versions 22–24. Once packages are published as GitHub Releases, use the `.claude/skills/add-bareos-version` diff --git a/README.md b/README.md index f4075854..db509ecb 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,8 @@ Weekly image builds run from GitHub Actions. Alpine images are built for | backend | tags | |:--|:--| -| PostgreSQL | `24-ubuntu-pgsql`, `24-ubuntu`, `24`, `ubuntu` | +| PostgreSQL | `25-ubuntu-pgsql`, `25-ubuntu`, `25`, `ubuntu` | +| PostgreSQL | `24-ubuntu-pgsql`, `24-ubuntu`, `24` | | PostgreSQL | `23-ubuntu-pgsql`, `23-ubuntu`, `23` | | PostgreSQL | `22-ubuntu-pgsql`, `22-ubuntu`, `22` | | PostgreSQL | `22-alpine-pgsql`, `22-alpine`, `alpine`, `latest` | @@ -41,7 +42,8 @@ Weekly image builds run from GitHub Actions. Alpine images are built for | base | tags | |:--|:--| -| Ubuntu 24.04 | `24-ubuntu`, `24`, `ubuntu` | +| Ubuntu 24.04 | `25-ubuntu`, `25`, `ubuntu` | +| Ubuntu 24.04 | `24-ubuntu`, `24` | | Ubuntu 22.04 | `23-ubuntu`, `23`, `22-ubuntu`, `22` | | Alpine 3.18 | `22-alpine`, `alpine`, `latest` | | Ubuntu 20.04 | `21-ubuntu`, `21`, `20-ubuntu`, `20` | @@ -61,6 +63,7 @@ PyPI for those versions. | Bareos version | Ubuntu image | Alpine image | Notes | |:--|:--|:--|:--| +| 25 | `25-ubuntu` on Ubuntu 24.04 | not available | Installed from `download.bareos.org/current/` | | 24 | `24-ubuntu` on Ubuntu 24.04 | not available | Installed from GitHub package release | | 23 | `23-ubuntu` on Ubuntu 22.04 | not available | Installed from GitHub package release | | 22 | `22-ubuntu` on Ubuntu 22.04 | `22-alpine` on Alpine 3.18 | Ubuntu uses GitHub package release | diff --git a/client/25-ubuntu/Dockerfile b/client/25-ubuntu/Dockerfile new file mode 100644 index 00000000..96bffb33 --- /dev/null +++ b/client/25-ubuntu/Dockerfile @@ -0,0 +1,51 @@ +# Dockerfile Bareos client/file daemon +FROM ubuntu:noble + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV BAREOS_DAEMON_USER=bareos +ENV BAREOS_DAEMON_GROUP=bareos +ENV DEBIAN_FRONTEND=noninteractive + +ARG BAREOS_KEY=http://download.bareos.org/current/xUbuntu_24.04/Release.key +ARG BAREOS_REPO=http://download.bareos.org/current/xUbuntu_24.04/ + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends curl gnupg ca-certificates \ + && curl -fsSL "${BAREOS_KEY}" | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] ${BAREOS_REPO} /" \ + > /etc/apt/sources.list.d/bareos.list \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + gosu tzdata default-mysql-client postgresql-client \ + bareos-bconsole \ + bareos-common \ + bareos-client \ + bareos-filedaemon \ + bareos-tools \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/bareos.list + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod a+x /docker-entrypoint.sh + +RUN tar czf /bareos-fd.tgz /etc/bareos/bareos-fd.d + +EXPOSE 9102 + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-fd", "-f"] diff --git a/client/25-ubuntu/docker-entrypoint.sh b/client/25-ubuntu/docker-entrypoint.sh new file mode 100644 index 00000000..3b1cbf43 --- /dev/null +++ b/client/25-ubuntu/docker-entrypoint.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +#set -x + +bareos_fd_config="/etc/bareos/bareos-fd.d/director/bareos-dir.conf" + +if [ "${FORCE_ROOT}" = true ]; then + BAREOS_DAEMON_USER='root' + BAREOS_DAEMON_GROUP='root' +fi + +if [ $(id -u) = '0' ]; then + [ -n "${PUID}" ] && usermod -u ${PUID} ${BAREOS_DAEMON_USER} + [ -n "${PGID}" ] && groupmod -g ${PGID} ${BAREOS_DAEMON_GROUP} + + if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-fd.tgz --backup=simple --suffix=.before-control + + # Force client/file daemon password + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' $bareos_fd_config + + # Control file + touch /etc/bareos/bareos-config.control + fi + + # Fix permissions + find /etc/bareos ! -user ${BAREOS_DAEMON_USER} -exec chown ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} {} \; + chown -R ${BAREOS_DAEMON_USER}:${BAREOS_DAEMON_GROUP} /var/lib/bareos /var/log/bareos + + # Gosu + [ "${BAREOS_DAEMON_USER}" != 'root' ] && exec gosu "${BAREOS_DAEMON_USER}" "$BASH_SOURCE" "$@" +fi + +exec "$@" diff --git a/director-pgsql/25-ubuntu/Dockerfile b/director-pgsql/25-ubuntu/Dockerfile new file mode 100644 index 00000000..325a41ca --- /dev/null +++ b/director-pgsql/25-ubuntu/Dockerfile @@ -0,0 +1,67 @@ +# Bareos director Dockerfile +FROM ubuntu:noble + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV DEBIAN_FRONTEND=noninteractive +ENV BAREOS_DPKG_CONF="bareos-database-common bareos-database-common" + +ARG BAREOS_KEY=http://download.bareos.org/current/xUbuntu_24.04/Release.key +ARG BAREOS_REPO=http://download.bareos.org/current/xUbuntu_24.04/ + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends curl gnupg ca-certificates \ + && curl -fsSL "${BAREOS_KEY}" | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] ${BAREOS_REPO} /" \ + > /etc/apt/sources.list.d/bareos.list \ + && echo "${BAREOS_DPKG_CONF}/dbconfig-install boolean false" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/install-error select ignore" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/database-type select pgsql" \ + | debconf-set-selections \ + && echo "${BAREOS_DPKG_CONF}/missing-db-package-error select ignore" \ + | debconf-set-selections \ + && echo 'postfix postfix/main_mailer_type select No configuration' \ + | debconf-set-selections \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + curl tzdata postgresql-client \ + bareos-bconsole \ + bareos-common \ + bareos-director \ + bareos-database-common \ + bareos-database-postgresql \ + bareos-database-tools \ + bareos-tools \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/bareos.list + +RUN tar czf /bareos-dir.tgz /etc/bareos + +COPY webhook-notify /usr/local/bin/webhook-notify +RUN chmod u+x /usr/local/bin/webhook-notify + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +EXPOSE 9101 + +VOLUME /etc/bareos + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-dir", "-u", "bareos", "-f"] diff --git a/director-pgsql/25-ubuntu/docker-entrypoint.sh b/director-pgsql/25-ubuntu/docker-entrypoint.sh new file mode 100644 index 00000000..d82384ef --- /dev/null +++ b/director-pgsql/25-ubuntu/docker-entrypoint.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash + +github_bareos='raw.githubusercontent.com/bareos/bareos' +webui_admin_conf='Release/25.0.3/webui/install/bareos/bareos-dir.d/profile/webui-admin.conf' +admin_conf='Release/25.0.3/webui/install/bareos/bareos-dir.d/console/admin.conf.example' + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xzf /bareos-dir.tgz --backup=simple --suffix=.before-control + + # Download default admin profile config + if [ ! -f /etc/bareos/bareos-dir.d/profile/webui-admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${webui_admin_conf}" \ + --output /etc/bareos/bareos-dir.d/profile/webui-admin.conf + fi + + # Download default webUI admin config + if [ ! -f /etc/bareos/bareos-dir.d/console/admin.conf ]; then + curl --silent --insecure "https://${github_bareos}/${admin_conf}" \ + --output /etc/bareos/bareos-dir.d/console/admin.conf + fi + + # Update bareos-director configs + # Director / mycatalog & mail report + sed -i 's#dbuser = "bareos"#dbuser = '\"${DB_USER}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbpassword = ""#dbpassword = '\"${DB_PASSWORD}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + sed -i 's#dbname = "bareos"#dbname = '\"${DB_NAME}\"'\n dbaddress = '\"${DB_HOST}\"'\n dbport = '\"${DB_PORT}\"'#' \ + /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + [ -n "${SENDER_MAIL}" ] && sed -i "s#<%r#<${SENDER_MAIL}#g" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#/usr/bin/bsmtp -h localhost#/usr/bin/bsmtp -h ${SMTP_HOST}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + sed -i "s#mail = root#mail = ${ADMIN_MAIL}#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + + # Setup webhook + if [ "${WEBHOOK_NOTIFICATION}" = true ]; then + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Daemon.conf + sed -i "s#/usr/bin/bsmtp -h.*#/usr/local/bin/webhook-notify %t %e %c %l %n\"#" \ + /etc/bareos/bareos-dir.d/messages/Standard.conf + fi + + # storage daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_SD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/storage/File.conf + + # client/file daemon + sed -i 's#Address = .*#Address = '\""${BAREOS_FD_HOST}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + sed -i 's#Password = .*#Password = '\""${BAREOS_FD_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/client/bareos-fd.conf + + # webUI + sed -i 's#Password = .*#Password = '\""${BAREOS_WEBUI_PASSWORD}"\"'#' \ + /etc/bareos/bareos-dir.d/console/admin.conf + sed -i "s#}# TlsEnable = false\n}#" \ + /etc/bareos/bareos-dir.d/console/admin.conf + + # MyCatalog Backup + sed -i "s#/var/lib/bareos/bareos.sql#/var/lib/bareos-director/bareos.sql#" \ + /etc/bareos/bareos-dir.d/fileset/Catalog.conf + + # Control file + touch /etc/bareos/bareos-config.control +fi + +if [[ -z ${CI_TEST} ]] ; then + # Waiting Postgresql is up + sqlup=1 + while [ "$sqlup" -ne 0 ] ; do + echo "Waiting for postgresql..." + pg_isready --host="${DB_HOST}" --port="${DB_PORT}" --user="${DB_ADMIN_USER}" + if [ $? -ne 0 ] ; then + sqlup=1 + sleep 5 + else + sqlup=0 + echo "...postgresql is alive" + fi + done +fi + +export PGUSER=${DB_ADMIN_USER} +export PGHOST=${DB_HOST} +export PGPASSWORD=${DB_ADMIN_PASSWORD} +[[ -z "${DB_INIT}" ]] && DB_INIT='false' +[[ -z "${DB_UPDATE}" ]] && DB_UPDATE='false' + +if [ ! -f /etc/bareos/bareos-db.control ] && [ "${DB_INIT}" == 'true' ] ; then + # Init Postgresql DB + echo "Bareos DB init" + echo "Bareos DB init: Create user ${DB_USER}" + psql -c "create user ${DB_USER} with createdb createrole login;" + echo "Bareos DB init: Set user password" + psql -c "alter user ${DB_USER} password '${DB_PASSWORD}';" + /usr/lib/bareos/scripts/create_bareos_database 2>/dev/null + /usr/lib/bareos/scripts/make_bareos_tables 2>/dev/null + /usr/lib/bareos/scripts/grant_bareos_privileges 2>/dev/null + + # Control file + touch /etc/bareos/bareos-db.control +fi + +if [ "${DB_UPDATE}" == 'true' ] ; then + # Try Postgres upgrade + echo "Bareoos DB update" + echo "Bareoos DB update: Update tables" + /usr/lib/bareos/scripts/update_bareos_tables 2>/dev/null + echo "Bareoos DB update: Grant privileges" + /usr/lib/bareos/scripts/grant_bareos_privileges 2>/dev/null +fi + +# Fix permissions +find /etc/bareos ! -user bareos -exec chown bareos {} \; +chown -R bareos:bareos /var/lib/bareos + +# Run Dockerfile CMD +exec "$@" diff --git a/director-pgsql/25-ubuntu/webhook-notify b/director-pgsql/25-ubuntu/webhook-notify new file mode 100644 index 00000000..801e3eaa --- /dev/null +++ b/director-pgsql/25-ubuntu/webhook-notify @@ -0,0 +1,41 @@ +#!/usr/bin/env sh + +job_type=$1 +job_status=$2 +job_client=$3 +job_level=$4 +job_name=$5 +msg_icon="❌" + +if [ "$job_status" = "OK" ] ;then + msg_icon="✅" +fi + +msg_txt="$msg_icon Bareos: $job_type $job_status of $job_client \ +$job_level (${job_name})" + +load_json() +{ + if [ "${WEBHOOK_TYPE}" = "slack" ] ; then + cat < /etc/apt/sources.list.d/bareos.list \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + tzdata mtx scsitools sg3-utils mt-st \ + bareos-common \ + bareos-storage \ + bareos-storage-tape \ + bareos-tools \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/bareos.list + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +RUN tar czf /bareos-sd.tgz /etc/bareos/bareos-sd.d + +EXPOSE 9103 + +VOLUME /etc/bareos +VOLUME /var/lib/bareos/storage + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/bareos-sd", "-u", "bareos", "-f"] diff --git a/storage/25-ubuntu/docker-entrypoint.sh b/storage/25-ubuntu/docker-entrypoint.sh new file mode 100644 index 00000000..a7134011 --- /dev/null +++ b/storage/25-ubuntu/docker-entrypoint.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +bareos_sd_config="/etc/bareos/bareos-sd.d/director/bareos-dir.conf" + +if [ ! -f /etc/bareos/bareos-config.control ]; then + tar xfz /bareos-sd.tgz --backup=simple --suffix=.before-control + + # Update bareos-storage configs + sed -i 's#Password = .*#Password = '\""${BAREOS_SD_PASSWORD}"\"'#' $bareos_sd_config + + # Control file + touch /etc/bareos/bareos-config.control +fi + +# Fix permissions +find /var/lib/bareos ! -user bareos -exec chown bareos {} \; +find /etc/bareos/bareos-sd.d ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/[n]?st[0-9]+" ! -user bareos -exec chown bareos {} \; +find /dev -regex "/dev/tape/.*" ! -user bareos -exec chown bareos {} \; + +# Run Dockerfile CMD +exec "$@" diff --git a/webui/25-ubuntu/Dockerfile b/webui/25-ubuntu/Dockerfile new file mode 100644 index 00000000..aa44edf0 --- /dev/null +++ b/webui/25-ubuntu/Dockerfile @@ -0,0 +1,47 @@ +# Bareos Web-ui Dockerfile +FROM ubuntu:noble + +LABEL maintainer="barcus@tou.nu" + +ARG BUILD_DATE +ARG NAME +ARG VCS_REF +ARG VERSION + +LABEL org.label-schema.schema-version="1.0" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$NAME \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/barcus/bareos" \ + org.label-schema.version=$VERSION + +ENV DEBIAN_FRONTEND=noninteractive + +ARG BAREOS_KEY=http://download.bareos.org/current/xUbuntu_24.04/Release.key +ARG BAREOS_REPO=http://download.bareos.org/current/xUbuntu_24.04/ + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends curl gnupg ca-certificates \ + && curl -fsSL "${BAREOS_KEY}" | gpg --dearmor -o /usr/share/keyrings/bareos.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/bareos.gpg] ${BAREOS_REPO} /" \ + > /etc/apt/sources.list.d/bareos.list \ + && apt-get update -qq \ + && apt-get install -qq -y --no-install-recommends \ + tzdata \ + bareos-webui \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/bareos.list + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod u+x /docker-entrypoint.sh + +RUN tar czf /bareos-webui.tgz /etc/bareos-webui + +EXPOSE 80 + +VOLUME /etc/bareos-webui + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] diff --git a/webui/25-ubuntu/docker-entrypoint.sh b/webui/25-ubuntu/docker-entrypoint.sh new file mode 100644 index 00000000..94b0af54 --- /dev/null +++ b/webui/25-ubuntu/docker-entrypoint.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +if [ ! -f /etc/bareos-webui/bareos-config.control ];then + tar xzf /bareos-webui.tgz --backup=simple --suffix=.before-control + + # Update bareos-webui config + sed -i 's#diraddress.*#diraddress = '\""${BAREOS_DIR_HOST}"\"'#' \ + /etc/bareos-webui/directors.ini + + # Control file + touch /etc/bareos-webui/bareos-config.control +fi + +apache_conf="/etc/apache2/sites-available/000-default.conf" + +# Set document root +sed -i "s#/var/www/html#/usr/share/bareos-webui/public#g" $apache_conf + +# Enable Apache server stats +if [ "${SERVER_STATS}" == "yes" ]; then + sed -i 's!#ServerName.*!Alias /server-status /var/www/dummy!' $apache_conf +fi + +# Run Dockerfile CMD +exec "$@" From 76a7cf95639c797e0c7a9c6177227bf32bdf444f Mon Sep 17 00:00:00 2001 From: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> Date: Sun, 7 Jun 2026 21:58:37 +0200 Subject: [PATCH 54/54] Added notes about dbdriver deprecation in Bareos 23 Signed-off-by: Daniele De Lorenzi <2905124+dark-vex@users.noreply.github.com> --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index db509ecb..aca96bda 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,16 @@ Bareos removed the MySQL catalog backend in version 21. Use `director-mysql/*` only for Bareos 20 or older and migrate existing MySQL catalogs to PostgreSQL before upgrading past Bareos 20. +Bareos 23 removed the `dbdriver` directive from the catalog resource. If you +are upgrading from Bareos 22 or older, remove any `dbdriver = "postgresql"` +line from `/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf` before starting +the Director. Leaving it in place causes a fatal config error: + +``` +bareos-dir: CONFIG ERROR at lib/parse_conf_state_machine.cc:161 +Config error: Keyword "dbdriver" not permitted in this resource. +``` + ## Package Releases `download.bareos.org/current/` tracks the latest Bareos release and does not