From b20c2e7a7b9e7d050488b2fa17e9f448478a7d20 Mon Sep 17 00:00:00 2001 From: Dave Conroy Date: Thu, 28 Feb 2019 08:02:34 -0800 Subject: [PATCH] 1.1 Release --- CHANGELOG.md | 8 + Dockerfile | 118 ++--- LICENSE | 2 +- README.md | 13 +- install/etc/cont-init.d/10-loolwsd | 17 +- zabbix_templates/zabbix_agent_container.xml | 515 ++++++++++++++++++++ 6 files changed, 608 insertions(+), 65 deletions(-) create mode 100644 zabbix_templates/zabbix_agent_container.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 625e07a..ae1ae79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.1 2019-02-28 + +* Switch back to Debian Stretch +* Collabora Office 5.3.61 +* Libre office online 3.4.2.1 +* Add Zabbix Checks +* Add Custom Assets overwrite support + ## 1.0 2018-09-15 * Switch to Ubuntu 16.04 diff --git a/Dockerfile b/Dockerfile index db73d83..d8f6be8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,44 +1,38 @@ -FROM tiredofit/ubuntu:16.04 as builder +FROM registry.selfdesign.org/docker/debian/stretch as builder LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" ### Set Environment Variables ENV LIBREOFFICE_BRANCH=master \ - ## 6.0.6.2 - LIBREOFFICE_COMMIT=0857a8f6d8dd1b5b9114e9e0c1e1b6b98394434f \ + ## cp-5.3.61 + LIBREOFFICE_COMMIT=cd2475c52a096b001a7e3179f02e11cbc8a5615f \ LOOL_BRANCH=master \ - ## 3.2.0.4 - LOOL_COMMIT=9927458251fd069e11efc8e83c78449497cc2048 \ + ## 3.4.2.1 + LOOL_COMMIT=d02d1983e164b322dc3f46753433bcb23c871ce6 \ MAX_CONNECTIONS=5000 \ ## Uses Approximately 20mb per document open - MAX_DOCUMENTS=5000 + MAX_DOCUMENTS=5000 \ + POCO_VERSION=1.9.0 ### Get Updates -RUN apt-get update && \ - apt-get -y install apt-transport-https && \ - echo "deb https://collaboraoffice.com/repos/Poco/ /" >> /etc/apt/sources.list.d/poco.list && \ - echo "deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted" >> /etc/apt/sources.list && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D && \ +RUN set -x && \ +### Add Repositories + echo "deb http://ftp.us.debian.org/debian/ jessie-backports main" >>/etc/apt/sources.list && \ + echo "deb-src http://ftp.us.debian.org/debian/ jessie-backports main" >>/etc/apt/sources.list && \ + echo "deb http://deb.debian.org/debian stretch contrib" >> /etc/apt/sources.list && \ curl -sL https://deb.nodesource.com/setup_6.x | bash - && \ \ - ## Install Poco Libs - apt-get -y install \ - libpoco-dev \ - libpocodata60 \ - libpocofoundation60 \ - libpocojson60 \ - libpocodataodbc60 \ - libpococrypto60 \ - libpoconet60 \ - libpoconetssl60 \ - libpocoutil60 \ - libpocoxml60 \ - libpocozip60 \ - && \ +### Downgrade LibSSL + echo "Package: openssl libssl1.0.0 libssl-dev libssl-doc" >> /etc/apt/preferences.d/00_ssl && \ + echo "Pin: release a=jessie-backports" >> /etc/apt/preferences.d/00_ssl && \ + echo "Pin-Priority: 1001" >> /etc/apt/preferences.d/00_ssl && \ + apt-get install openssl libssl-dev locales -y --allow-downgrades && \ + \ +### Setup Distribution + echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ \ mkdir -p /home/lool && \ useradd lool -G sudo && \ chown lool:lool /home/lool -R && \ - echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ \ ## Add Build Dependencies apt-get install -y \ @@ -48,6 +42,7 @@ RUN apt-get update && \ libghc-zlib-dev \ libpam0g-dev \ libtool \ + nasm \ nodejs \ python-polib \ sudo \ @@ -60,6 +55,17 @@ RUN apt-get update && \ libreoffice \ && \ \ + ### Build and Install Poco Libraries + mkdir -p /usr/src/poco && \ + curl -sSL https://pocoproject.org/releases/poco-${POCO_VERSION}/poco-${POCO_VERSION}-all.tar.gz | tar xvfz - --strip 1 -C /usr/src/poco && \ + cd /usr/src/poco && \ + ./configure \ + --no-samples \ + --no-tests \ + --prefix=/opt/poco \ + && \ + make install && \ + \ ### Build Fetch LibreOffice - This will take a while.. git clone -b ${LIBREOFFICE_BRANCH} https://github.com/LibreOffice/core.git /usr/src/libreoffice-core && \ cd /usr/src/libreoffice-core && \ @@ -105,6 +111,7 @@ RUN apt-get update && \ --with-system-dicts \n\ --with-system-zlib \n\ --with-theme=galaxy \n\ +#--with-system-xmlsec \n\ --without-branding \n\ --without-help \n\ --without-java \n\ @@ -121,7 +128,8 @@ RUN apt-get update && \ --prefix=/opt/libreoffice \n\ " > /usr/src/libreoffice-core/distro-configs/LibreOfficeOnline.conf && \ ./autogen.sh --with-distro="LibreOfficeOnline" && \ - rm -rf /usr/src/libreoffice-core/translations /usr/src/lobreoffice-core/dictionaries && \ + cd /usr/src/libreoffice-core && \ + sed -i "s/export XMLSEC_TARBALL := xmlsec1-1.2.26.tar.gz/export XMLSEC_TARBALL := xmlsec1-1.2.25.tar.gz/g" download.lst && \ chown -R lool /usr/src/libreoffice-core && \ sudo -u lool make && \ cd /usr/src/libreoffice-core && \ @@ -129,7 +137,6 @@ RUN apt-get update && \ chown -R lool /opt/libreoffice && \ sudo -u lool make install && \ cp -R /usr/src/libreoffice-core/instdir/* /opt/libreoffice/ && \ - cd /usr/src && \ \ ### Build LibreOffice Online (Not as long as above) git clone -b ${LOOL_BRANCH} https://github.com/LibreOffice/online.git /usr/src/libreoffice-online && \ @@ -148,13 +155,14 @@ RUN apt-get update && \ uglify-js \ && \ \ - cd /usr/src/libreoffice-online && \ ./autogen.sh && \ ./configure --enable-silent-rules \ --with-lokit-path=/usr/src/libreoffice-online/bundled/include \ --with-lo-path=/opt/libreoffice \ --with-max-connections=${MAX_CONNECTIONS} \ --with-max-documents=${MAX_DOCUMENTS} \ + --with-poco-includes=/opt/poco/include \ + --with-poco-libs=/opt/poco/lib \ --with-logfile=/var/log/lool/lool.log \ --prefix=/opt/lool \ --sysconfdir=/etc \ @@ -168,8 +176,7 @@ RUN apt-get update && \ cp -R loolwsd.xml /opt/lool/ && \ cp -R loolkitconfig.xcu /opt/lool && \ make install && \ - cd /usr/src && \ - \ + cd / && \ apt-get autoremove -y && \ apt-get clean && \ ### Cleanup @@ -180,7 +187,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* && \ rm -rf /var/log/* -FROM tiredofit/ubuntu:16.04 +FROM registry.selfdesign.org/docker/debian/stretch LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" ### Set Defaults @@ -195,11 +202,23 @@ ENV ADMIN_USER=admin \ COPY --from=builder /opt/ /opt/ ### Install Dependencies -RUN adduser --quiet --system --group --home /opt/lool lool && \ +RUN set -x && \ + adduser --quiet --system --group --home /opt/lool lool && \ + \ +### Add Repositories + echo "deb http://ftp.us.debian.org/debian/ jessie-backports main" >>/etc/apt/sources.list && \ + echo "deb-src http://ftp.us.debian.org/debian/ jessie-backports main" >>/etc/apt/sources.list && \ + echo "deb http://deb.debian.org/debian stretch contrib" >> /etc/apt/sources.list && \ + curl -sL https://deb.nodesource.com/setup_6.x | bash - && \ + \ +### Downgrade LibSSL + echo "Package: openssl libssl1.0.0 libssl-dev libssl-doc" >> /etc/apt/preferences.d/00_ssl && \ + echo "Pin: release a=jessie-backports" >> /etc/apt/preferences.d/00_ssl && \ + echo "Pin-Priority: 1001" >> /etc/apt/preferences.d/00_ssl && \ + apt-get install openssl libssl-dev locales -y --allow-downgrades && \ \ - apt-get update && \ - apt-get upgrade -y && \ echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ + apt-get upgrade -y && \ apt-get install -y\ adduser \ apt-transport-https \ @@ -207,12 +226,17 @@ RUN adduser --quiet --system --group --home /opt/lool lool && \ findutils \ fonts-droid-fallback \ fonts-noto-cjk \ + hunspell \ + hunspell-en-us \ + hunspell-en-gb \ + libcap2-bin \ libcups2 \ libfontconfig1 \ libfreetype6 \ libgl1-mesa-glx \ libpam0g \ - libpng12-0 \ + libpng16-16 \ + libsm6 \ libxcb-render0 \ libxcb-shm0 \ libxinerama1 \ @@ -224,22 +248,6 @@ RUN adduser --quiet --system --group --home /opt/lool lool && \ ttf-mscorefonts-installer \ && \ \ - echo "deb https://collaboraoffice.com/repos/Poco/ /" >> /etc/apt/sources.list.d/poco.list && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D && \ - apt-get update && \ - apt-get -y install \ - libpocodata60 \ - libpocofoundation60 \ - libpocojson60 \ - libpocodataodbc60 \ - libpococrypto60 \ - libpoconet60 \ - libpoconetssl60 \ - libpocoutil60 \ - libpocoxml60 \ - libpocozip60 \ - && \ - \ ### Setup Directories and Permissions mkdir -p /etc/loolwsd && \ mv /opt/lool/loolwsd.xml /etc/loolwsd/ && \ @@ -250,7 +258,7 @@ RUN adduser --quiet --system --group --home /opt/lool lool && \ mkdir -p /var/cache/loolwsd && \ chown -R lool /var/cache/loolwsd && \ setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /opt/lool/bin/loolforkit && \ - setcap cap_sys_admin=ep /opt/lool/bin/loolmount && \ +# setcap cap_sys_admin=ep /opt/lool/bin/loolmount && \ mkdir -p /usr/share/hunspell && \ mkdir -p /usr/share/hyphen && \ mkdir -p /usr/share/mythes && \ @@ -266,8 +274,9 @@ RUN adduser --quiet --system --group --home /opt/lool lool && \ rm -rf /usr/share/man && \ rm -rf /var/lib/apt/lists/* && \ rm -rf /var/log/* && \ + rm -rf /tmp/* && \ mkdir -p /var/log/lool && \ - touch /var/log/lool/lool.log && \ + touch /var/log/lool/loolwsd.log && \ chown -R lool /var/log/lool ### Networking Configuration @@ -275,4 +284,3 @@ EXPOSE 9980 ### Assets ADD install / - diff --git a/LICENSE b/LICENSE index 90cb01a..6a30d48 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Dave Conroy +Copyright (c) 2019 Dave Conroy 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/README.md b/README.md index 0e77aaa..315bf9c 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,13 @@ [![Build Status](https://img.shields.io/docker/build/tiredofit/libreoffice-online.svg)](https://hub.docker.com/r/tiredofit/libreoffice-online) [![Docker Pulls](https://img.shields.io/docker/pulls/tiredofit/libreoffice-online.svg)](https://hub.docker.com/r/tiredofit/libreoffice-online) [![Docker Stars](https://img.shields.io/docker/stars/tiredofit/libreoffice-online.svg)](https://hub.docker.com/r/tiredofit/libreoffice-online) -[![Docker -Layers](https://images.microbadger.com/badges/image/tiredofit/libreoffice-online.svg)](https://microbadger.com/images/tiredofit/libreoffice-online) +[![Docker Layers](https://images.microbadger.com/badges/image/tiredofit/libreoffice-online.svg)](https://microbadger.com/images/tiredofit/libreoffice-online) # Introduction This will build a container for [LibreOffice Online](https://libreoffice.org/) for editing documents in a browser from supported applications -* This Container uses a [customized Ubuntu Linux base](https://hub.docker.com/r/tiredofit/ubuntu) which includes [s6 overlay](https://github.com/just-containers/s6-overlay) enabled for PID 1 Init capabilities, [zabbix-agent](https://zabbix.org) for individual container monitoring, Cron also installed along with other tools (bash,curl, less, logrotate, nano, vim) for easier management. +* This Container uses a [customized Debian Linux base](https://hub.docker.com/r/tiredofit/debian) which includes [s6 overlay](https://github.com/just-containers/s6-overlay) enabled for PID 1 Init capabilities, [zabbix-agent](https://zabbix.org) for individual container monitoring, Cron also installed along with other tools (bash,curl, less, logrotate, nano, vim) for easier management. * Configurable Concurrent User and Document Limit (set to generarous values by default) * Zabbix Monitoring of Active Documents, Users, Memory Consumed @@ -56,7 +55,7 @@ docker pull tiredofit/libreoffice-online The following image tags are available: -* `latest` - Libreoffice 6.0.6.2 with Collabora Office Online 3.2.0.4 +* `latest` - Collabora Libreoffice 5.3.61 with Collabora Office Online 3.4.2.1 # Quick Start @@ -74,11 +73,11 @@ The following directories should be mapped for persistent storage in order to ut | Folder | Description | |-----------|-------------| -| `/var/log/lool` | Log files - +| `/var/log/loolwsd` | Log files +| `/assets/custom` | If you want to update the theme of LibreOffice online, dropping files in here will overwrite /opt/lool/share on startup | ### Environment Variables -Along with the Environment Variables from the [Base image](https://hub.docker.com/r/tiredofit/ubuntu), below is the complete list of available options that can be used to customize your installation. +Along with the Environment Variables from the [Base image](https://hub.docker.com/r/tiredofit/debian), below is the complete list of available options that can be used to customize your installation. | Parameter | Description | |-----------|-------------| diff --git a/install/etc/cont-init.d/10-loolwsd b/install/etc/cont-init.d/10-loolwsd index ba480a8..db9c718 100755 --- a/install/etc/cont-init.d/10-loolwsd +++ b/install/etc/cont-init.d/10-loolwsd @@ -1,12 +1,25 @@ #!/usr/bin/with-contenv bash +### Set Debug Mode +if [ "$DEBUG_MODE" = "TRUE" ] || [ "$DEBUG_MODE" = "true" ]; then + set -x +fi +echo "** [libreoffice-online] Setting configuration" + mkdir -p /var/log/lool -touch /var/log/lool/lool.log +touch /var/log/lool/loolwsd.log chown -R lool /var/log/lool rm /opt/lool/systemplate/etc/resolv.conf ln -s /etc/resolv.conf /opt/lool/systemplate/etc/resolv.conf +### Custom File Support + if [ -d /assets/custom ] ; then + echo "** [libreoffice-online] Custom Files Found, Copying over top of Master.." + cp -R /assets/custom/* /opt/lool/share/ + chown -R lool. /opt/lool/share/ + fi + if test "${DONT_GEN_SSL_CERT-set}" == set; then # Generate new SSL certificate instead of using the default @@ -32,7 +45,7 @@ rm -rf /tmp/ssl fi # Replace Configureation directives -perl -pi -e "s/.*<\/allowed_languages>/${LANGUAGES}<\/allowed_languages>/" /etc/loolwsd/loolwsd.xml +perl -pi -e "s/.*<\/allowed_languages>/${DICTIONARIES}<\/allowed_languages>/" /etc/loolwsd/loolwsd.xml perl -pi -e "s/.*<\/level>/${LOG_LEVEL}<\/level>/" /etc/loolwsd/loolwsd.xml perl -pi -e "s/localhost<\/host>/${ALLOWED_HOSTS}<\/host>/g" /etc/loolwsd/loolwsd.xml perl -pi -e "s/localhost<\/host>/${ALLOWED_HOSTS}<\/host>/g" /etc/loolwsd/loolwsd.xml diff --git a/zabbix_templates/zabbix_agent_container.xml b/zabbix_templates/zabbix_agent_container.xml new file mode 100644 index 0000000..9532a0e --- /dev/null +++ b/zabbix_templates/zabbix_agent_container.xml @@ -0,0 +1,515 @@ + + + 3.4 + 2018-02-02T19:04:27Z + + + Discovered Containers + + + Templates + + + + + + + + + {Service - ICMP:icmpping.max(3m)}=3 + 0 + + Cannot be pinged + 0 + + + 0 + 5 + + 0 + 0 + + + + + {Service - ICMP:icmppingloss.min(10m)}>50 + 0 + + Ping loss is too high + 0 + + + 0 + 4 + + 0 + 0 + + + Cannot be pinged + {Service - ICMP:icmpping.max(3m)}=3 + + + + + + + {Service - ICMP:icmppingsec.avg(2m)}>100 + 0 + + Ping Response time is too high + 0 + + + 0 + 4 + + 1 + 0 + + + Cannot be pinged + {Service - ICMP:icmpping.max(3m)}=3 + + + + + + + {Zabbix - Container Agent:packages.upgradable.last()}>0 + 0 + + Upgraded Packages in Container Available + 0 + + + 0 + 1 + + 0 + 0 + + + + + {Zabbix - Container Agent:agent.ping.nodata(3m)}=1 + 0 + + Zabbix agent is unreachable + 0 + + + 0 + 5 + + 0 + 0 + + + + + + + Service state + + + 0 + Down + + + 1 + Up + + + + + Zabbix agent ping status + + + 1 + Up + + + + +