WhatsApp/Signal/Formstack/admin updates
This commit is contained in:
parent
bcecf61a46
commit
d0cc5a21de
451 changed files with 16139 additions and 39623 deletions
|
|
@ -1,40 +1,124 @@
|
|||
ARG ZAMMAD_VERSION=6.3.1
|
||||
ARG ZAMMAD_VERSION=6.5.2
|
||||
|
||||
FROM node:22-slim as node
|
||||
FROM node:22-slim AS node
|
||||
|
||||
FROM zammad/zammad-docker-compose:${ZAMMAD_VERSION} AS builder
|
||||
USER root
|
||||
|
||||
# Copy Node.js from node image
|
||||
COPY --from=node /opt /opt
|
||||
COPY --from=node /usr/local/bin /usr/local/bin
|
||||
COPY --from=node /usr/local/lib /usr/local/lib
|
||||
COPY --from=node /usr/lib /usr/lib
|
||||
|
||||
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
|
||||
|
||||
# Install pnpm for package management
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm --version
|
||||
|
||||
ENV ZAMMAD_DIR=/opt/zammad
|
||||
WORKDIR ${ZAMMAD_DIR}
|
||||
|
||||
# Copy addons and installation scripts
|
||||
RUN mkdir -p /opt/zammad/contrib/link/addons
|
||||
COPY addons contrib/link/addons
|
||||
COPY setup.rb contrib/link/setup.rb
|
||||
COPY install.rb contrib/link/install.rb
|
||||
|
||||
USER root
|
||||
RUN sed -i '/script\/build\/cleanup\.sh/d' contrib/docker/setup.sh
|
||||
RUN contrib/docker/setup.sh builder
|
||||
ARG EMBEDDED=false
|
||||
RUN if [ "$EMBEDDED" = "true" ] ; then sed -i '/location \/ {/i \
|
||||
\ \n\
|
||||
\ location /link {\n\
|
||||
\ proxy_pass http://link:3000;\n\
|
||||
\ proxy_set_header Host $host;\n\
|
||||
\ proxy_set_header X-Real-IP $remote_addr;\n\
|
||||
\ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\
|
||||
\ proxy_set_header X-Forwarded-Proto https;\n\
|
||||
\ }\n' ${ZAMMAD_DIR}/contrib/nginx/zammad.conf; fi
|
||||
RUN sed -i '/^[[:space:]]*# es config/a\
|
||||
echo "about to reinstall..."\n\
|
||||
bundle exec rails runner /opt/zammad/contrib/link/setup.rb\n\
|
||||
bundle exec rake zammad:package:migrate\n\
|
||||
' /docker-entrypoint.sh
|
||||
RUN ZAMMAD_SAFE_MODE=1 DATABASE_URL=postgresql://zammad:/zammad bundle exec rails runner /opt/zammad/contrib/link/install.rb
|
||||
RUN ZAMMAD_SAFE_MODE=1 DATABASE_URL=postgresql://zammad:/zammad bundle exec rake assets:precompile
|
||||
# Install system dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM zammad/zammad-docker-compose:${ZAMMAD_VERSION} as runner
|
||||
USER ${ZAMMAD_USER}
|
||||
COPY --from=builder --chown=zammad:zammad ${ZAMMAD_DIR} ${ZAMMAD_DIR}
|
||||
COPY --from=builder /usr/local/bundle /usr/local/bundle
|
||||
# Install Ruby gems (they should already be installed in the base image)
|
||||
RUN bundle check || bundle install --jobs 8
|
||||
|
||||
# Install Node packages
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# CRITICAL: Install addons
|
||||
# This extracts addon files including CoffeeScript, Vue components, TypeScript, and CSS
|
||||
RUN ruby contrib/link/install.rb
|
||||
|
||||
# Fix OpenSearch compatibility: Replace 'flattened' with 'flat_object'
|
||||
# Elasticsearch uses 'flattened' but OpenSearch uses 'flat_object'
|
||||
# Without this fix, search index creation fails with:
|
||||
# [o.o.c.m.MetadataCreateIndexService] failed on parsing mappings on index creation
|
||||
# org.opensearch.index.mapper.MapperParsingException: Failed to parse mapping [_doc]:
|
||||
# No handler for type [flattened] declared on field [preferences]
|
||||
# See: https://github.com/zammad/zammad/blob/bfd2f5befc3aec3fe607a5b6146788ec9af461e4/lib/search_index_backend.rb#L896
|
||||
RUN sed -i "s/'flattened'/'flat_object'/g" /opt/zammad/lib/search_index_backend.rb
|
||||
|
||||
# Precompile assets with addon CoffeeScript files included
|
||||
# Use ZAMMAD_SAFE_MODE=1 and dummy DATABASE_URL to avoid needing real database
|
||||
RUN touch db/schema.rb && \
|
||||
ZAMMAD_SAFE_MODE=1 DATABASE_URL=postgresql://zammad:/zammad bundle exec rake assets:precompile
|
||||
|
||||
# Run additional setup for addons
|
||||
RUN bundle exec rails runner /opt/zammad/contrib/link/setup.rb || true
|
||||
|
||||
# Clean up build artifacts
|
||||
RUN rm -rf tmp/cache node_modules/.cache
|
||||
ARG EMBEDDED=false
|
||||
ARG LINK_HOST=http://link:3000
|
||||
# Add nginx proxy configuration for embedded mode
|
||||
# Insert location block before the final closing brace
|
||||
RUN if [ "$EMBEDDED" = "true" ] ; then \
|
||||
sed -i '$ d' /opt/zammad/contrib/nginx/zammad.conf && \
|
||||
echo "" >> /opt/zammad/contrib/nginx/zammad.conf && \
|
||||
echo " location /link {" >> /opt/zammad/contrib/nginx/zammad.conf && \
|
||||
echo " proxy_pass ${LINK_HOST};" >> /opt/zammad/contrib/nginx/zammad.conf && \
|
||||
echo " proxy_set_header Host \$host;" >> /opt/zammad/contrib/nginx/zammad.conf && \
|
||||
echo " proxy_set_header X-Real-IP \$remote_addr;" >> /opt/zammad/contrib/nginx/zammad.conf && \
|
||||
echo " proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;" >> /opt/zammad/contrib/nginx/zammad.conf && \
|
||||
echo " proxy_set_header X-Forwarded-Proto https;" >> /opt/zammad/contrib/nginx/zammad.conf && \
|
||||
echo " }" >> /opt/zammad/contrib/nginx/zammad.conf && \
|
||||
echo "}" >> /opt/zammad/contrib/nginx/zammad.conf; \
|
||||
fi
|
||||
|
||||
FROM zammad/zammad-docker-compose:${ZAMMAD_VERSION} AS runner
|
||||
USER root
|
||||
|
||||
# Install Node.js and npm in runner for asset compilation at runtime
|
||||
# Using Node from Debian repository for simplicity
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends nodejs npm && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
npm install -g pnpm
|
||||
|
||||
# Copy only the modified/added files from builder
|
||||
# Copy addon files that were installed
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/frontend/apps/desktop/pages/ticket/components/TicketDetailView/ /opt/zammad/app/frontend/apps/desktop/pages/ticket/components/TicketDetailView/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/frontend/shared/entities/ticket-article/action/plugins/ /opt/zammad/app/frontend/shared/entities/ticket-article/action/plugins/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/db/addon/ /opt/zammad/db/addon/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/assets/ /opt/zammad/app/assets/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/controllers/*cdr* /opt/zammad/app/controllers/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/jobs/*cdr* /opt/zammad/app/jobs/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/models/channel/driver/*cdr* /opt/zammad/app/models/channel/driver/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/models/ticket/article/*cdr* /opt/zammad/app/models/ticket/article/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/policies/controllers/*cdr* /opt/zammad/app/policies/controllers/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/config/initializers/*cdr* /opt/zammad/config/initializers/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/config/routes/*cdr* /opt/zammad/config/routes/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/lib/cdr* /opt/zammad/lib/
|
||||
# CRITICAL: Copy modified search_index_backend.rb with OpenSearch fix
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/lib/search_index_backend.rb /opt/zammad/lib/search_index_backend.rb
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/public/assets/images/icons/*cdr* /opt/zammad/public/assets/images/icons/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/views/mailer/ticket_create/ /opt/zammad/app/views/mailer/ticket_create/
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/public/assets/images/logo* /opt/zammad/public/assets/images/
|
||||
|
||||
# Copy the nginx config if embedded mode was used
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/contrib/nginx/zammad.conf /opt/zammad/contrib/nginx/zammad.conf
|
||||
|
||||
# Copy the link setup scripts and addons
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/contrib/link/ /opt/zammad/contrib/link/
|
||||
|
||||
# CRITICAL: Copy compiled assets that include our CoffeeScript changes
|
||||
# The builder stage compiles assets at line 47, we must copy them to runner
|
||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/public/assets/ /opt/zammad/public/assets/
|
||||
|
||||
# Copy the modified entrypoint script
|
||||
COPY --from=builder /docker-entrypoint.sh /docker-entrypoint.sh
|
||||
|
||||
USER zammad
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
require 'base64'
|
||||
|
||||
ROOT = '/opt/zammad'
|
||||
|
||||
def _read_file(file, fullpath: false)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# uninstall
|
||||
package_names = %w[Hardening Leafcutter Bridge]
|
||||
package_names = %w[Hardening Bridge]
|
||||
|
||||
package_names.each do |name|
|
||||
puts "Attempting to uninstall #{name} package..."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue