From f6832ee9fccebde3c533bac956210afda9ec1ece Mon Sep 17 00:00:00 2001 From: simatec Date: Sat, 1 Jun 2024 17:56:36 +0200 Subject: [PATCH] (simatec) v0.9.3 --- README.md | 6 +++++- build/Dockerfile | 23 +++++++++++++---------- build/build.conf | 6 +++--- build/start.sh | 24 +++++++++++++++++++++--- piler.conf.example | 4 ++-- 5 files changed, 44 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index e7e40f7..2600c42 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,10 @@ To leave the container on the console you have to execute 2x `exit`. ## Changelog +### 0.9.3 (01.06.2024) +* (simatec) Piler v1.4.5 updated +* (simatec) MariaDB v11.1.2 updated + ### 0.9.2 (19.09.2023) * (simatec) Piler v1.4.4 updated @@ -220,7 +224,7 @@ To leave the container on the console you have to execute 2x `exit`. ## License MIT License -Copyright (c) 2022 - 2023 simatec +Copyright (c) 2022 - 2024 simatec Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/build/Dockerfile b/build/Dockerfile index ab5dda6..df2cbd1 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,35 +1,38 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG PACKAGE +ARG TARGETARCH -LABEL description="piler ubuntu jammy image" \ +LABEL description="piler ubuntu noble image" \ maintainer="Janos SUTO, sj@acts.hu" \ package="${PACKAGE}" ENV DEBIAN_FRONTEND="noninteractive" \ - DISTRO="jammy" \ + DISTRO="noble" \ PILER_USER="piler" \ MYSQL_DATABASE="piler" -COPY ${PACKAGE} / +COPY ${PACKAGE}_${TARGETARCH}.deb / +# hadolint ignore=DL3008 RUN apt-get update && \ apt-get -y --no-install-recommends install \ - wget openssl sysstat php8.1-cli php8.1-cgi php8.1-mysql php8.1-fpm php8.1-zip php8.1-ldap \ - php8.1-gd php8.1-curl php8.1-xml php8.1-memcached catdoc unrtf poppler-utils nginx tnef sudo libzip4 \ - libtre5 cron libmariadb-dev mariadb-client-core-10.6 python3 python3-mysqldb ca-certificates curl && \ + wget openssl sysstat php8.3-cli php8.3-cgi php8.3-mysql php8.3-fpm php8.3-zip php8.3-ldap \ + php8.3-gd php8.3-curl php8.3-xml php8.3-memcached catdoc unrtf poppler-utils nginx tnef sudo libzip4t64 \ + libtre5 cron libmariadb-dev mariadb-client-core python3 python3-mysqldb ca-certificates curl rsyslog gnupg && \ wget https://repo.manticoresearch.com/manticore-repo.noarch.deb && \ dpkg -i manticore-repo.noarch.deb && \ rm -f manticore-repo.noarch.deb && \ apt-get update && \ - apt-get install -y manticore manticore-columnar-lib && \ + apt-get install -y --no-install-recommends manticore manticore-columnar-lib && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ sed -i '/session required pam_loginuid.so/c\#session required pam_loginuid.so' /etc/pam.d/cron && \ - dpkg -i ${PACKAGE} && \ + dpkg -i ${PACKAGE}_${TARGETARCH}.deb && \ touch /etc/piler/MANTICORE && \ ln -sf /etc/piler/piler-nginx.conf /etc/nginx/sites-enabled && \ - rm -f ${PACKAGE} /etc/nginx/sites-enabled/default /etc/piler/piler.key /etc/piler/piler.pem /etc/piler/config-site.php && \ + echo "www-data ALL=NOPASSWD: /etc/init.d/rc.piler reload" > /etc/sudoers.d/piler && \ + rm -f ${PACKAGE}_${TARGETARCH}.deb /etc/nginx/sites-enabled/default /etc/piler/piler.key /etc/piler/piler.pem /etc/piler/config-site.php && \ crontab -u $PILER_USER /usr/share/piler/piler.cron VOLUME ["/etc/piler","/var/piler/store","/var/piler/manticore","/var/piler/imap","/var/piler/stat","/var/spool/cron/crontabs"] diff --git a/build/build.conf b/build/build.conf index 2fd5dec..4ec8486 100644 --- a/build/build.conf +++ b/build/build.conf @@ -1,11 +1,11 @@ # Piler Package -PILER_PACKAGE="piler_1.4.4-jammy-553ebb4f_amd64.deb" +PILER_PACKAGE="piler_1.4.5-jammy-c13432f_amd64.deb" # Piler Version -PILER_VERSION="1.4.4" +PILER_VERSION="1.4.5" # MariaDB Version -MARIA_DB_VERSION="10.6" \ No newline at end of file +MARIA_DB_VERSION="11.1.2" \ No newline at end of file diff --git a/build/start.sh b/build/start.sh index b8d2bf5..20913f3 100644 --- a/build/start.sh +++ b/build/start.sh @@ -13,6 +13,8 @@ PILER_NGINX_CONF="${CONFIG_DIR}/piler-nginx.conf" SPHINX_CONF="${CONFIG_DIR}/manticore.conf" CONFIG_SITE_PHP="${CONFIG_DIR}/config-site.php" PILER_MY_CNF="${CONFIG_DIR}/.my.cnf" +RT="${RT:-0}" +MEMCACHED_HOSTNAME="${MEMCACHED_HOSTNAME:-memcached}" error() { @@ -117,7 +119,7 @@ fix_configs() { echo "\$config['DB_USERNAME'] = '$MYSQL_USER';" echo "\$config['DB_PASSWORD'] = '$MYSQL_PASSWORD';" echo "\$config['ENABLE_MEMCACHED'] = 1;" - echo "\$memcached_server = ['memcached', 11211];" + echo "\$memcached_server = ['$MEMCACHED_HOSTNAME', 11211];" } >> "$CONFIG_SITE_PHP" fi @@ -126,6 +128,21 @@ fix_configs() { -e "s%MYSQL_USERNAME%${MYSQL_USER}%" \ -e "s%MYSQL_PASSWORD%${MYSQL_PASSWORD}%" \ -i "$SPHINX_CONF" + + # Fixes for RT index + + if [[ $RT -eq 1 ]]; then + sed -i "s/define('RT', 0)/define('RT', 1)/" "$SPHINX_CONF" + if ! grep "'RT'" "$CONFIG_SITE_PHP"; then + echo "\$config['RT'] = 1;" >> "$CONFIG_SITE_PHP" + fi + + if ! grep "'SPHINX_MAIN_INDEX'" "$CONFIG_SITE_PHP"; then + echo "\$config['SPHINX_MAIN_INDEX'] = 'piler1';" >> "$CONFIG_SITE_PHP" + fi + + sed -i "s%rtindex=.*%rtindex=1%" "$PILER_CONF" + fi } @@ -171,13 +188,14 @@ create_my_cnf_files() { start_services() { service cron start - service php8.1-fpm start + service php8.3-fpm start service nginx start + rsyslogd } start_piler() { - if [[ ! -f "${VOLUME_DIR}/manticore/main1.spp" ]]; then + if [[ $RT -eq 0 && ! -f "${VOLUME_DIR}/manticore/main1.spp" ]]; then log "main1.spp does not exist, creating index files" su -c "indexer --all --config ${SPHINX_CONF}" "$PILER_USER" fi diff --git a/piler.conf.example b/piler.conf.example index ae98437..1155475 100644 --- a/piler.conf.example +++ b/piler.conf.example @@ -67,8 +67,8 @@ MAILCOW_HOST="mail.example.com" # Piler Version -PILER_VERSION="1.4.4" +PILER_VERSION="1.4.5" # MariaDB Version -MARIA_DB_VERSION="10.6" +MARIA_DB_VERSION="11.1.2"