From e2cf756d2f183f356482a1e0180b32573db472cd Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 21 Jun 2019 18:44:20 +0200 Subject: Update Docker to Ubuntu 19.04 --- Docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Docker') diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 661543724..f773d30aa 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.10 +FROM ubuntu:19.04 ENV TZ UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -- cgit v1.2.3 From 99e78166863b3420db2f61d1236006e57f9678ae Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 21 Jun 2019 18:46:14 +0200 Subject: Update Docker Alpine to 3.10 --- Docker/Dockerfile-Alpine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Docker') diff --git a/Docker/Dockerfile-Alpine b/Docker/Dockerfile-Alpine index 589d266e5..798a57de1 100644 --- a/Docker/Dockerfile-Alpine +++ b/Docker/Dockerfile-Alpine @@ -1,4 +1,4 @@ -FROM alpine:3.9 +FROM alpine:3.10 ENV TZ UTC -- cgit v1.2.3 From bc7935974802d54e861114f2f727ed651013accb Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Thu, 4 Jul 2019 20:46:25 +0200 Subject: Don't delete lists directory, small nitpick (#2435) --- Docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Docker') diff --git a/Docker/Dockerfile b/Docker/Dockerfile index f773d30aa..e5581efe7 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -9,9 +9,9 @@ RUN apt update && \ apache2 libapache2-mod-php \ php-curl php-intl php-mbstring php-xml php-zip \ php-sqlite3 php-mysql php-pgsql && \ - rm -rf /var/lib/apt/lists/ + rm -rf /var/lib/apt/lists/* -RUN mkdir -p /var/www/FreshRSS /run/apache2/ +RUN mkdir -p /var/www/FreshRSS/ /run/apache2/ WORKDIR /var/www/FreshRSS COPY . /var/www/FreshRSS -- cgit v1.2.3 From 68cc039bc76dad419fda0c7e37f7da3980ada881 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 6 Jul 2019 14:52:50 +0200 Subject: A few more badges https://shields.io/ --- Docker/README.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Docker') diff --git a/Docker/README.md b/Docker/README.md index 9bf20c8c2..cdb6a0a4e 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -1,3 +1,8 @@ +![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/freshrss/freshrss.svg) +![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/freshrss/freshrss.svg) +![MicroBadger Size](https://img.shields.io/microbadger/image-size/freshrss/freshrss.svg) +![Docker Pulls](https://img.shields.io/docker/pulls/freshrss/freshrss.svg) + # Deploy FreshRSS with Docker * See also https://hub.docker.com/r/freshrss/freshrss/ -- cgit v1.2.3 From dcb090dcd779581c1eddb20b4860848b02139145 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 7 Jul 2019 00:15:13 +0200 Subject: Docker build for ARM (Raspberry Pi) (#2436) * Docker build for ARM (Raspberry Pi) Inspired by https://github.com/stas-demydiuk/domoticz-docker * Execution rights * Readme typo * Move QEMU higher up * Change tar command * Try to fix COPY error * Fix path bug --- Docker/Dockerfile-QEMU-ARM | 46 ++++++++++++++++++++++++++++++++++++++++++++++ Docker/README.md | 5 +++-- Docker/hooks/pre_build | 12 ++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 Docker/Dockerfile-QEMU-ARM create mode 100755 Docker/hooks/pre_build (limited to 'Docker') diff --git a/Docker/Dockerfile-QEMU-ARM b/Docker/Dockerfile-QEMU-ARM new file mode 100644 index 000000000..889be2cb8 --- /dev/null +++ b/Docker/Dockerfile-QEMU-ARM @@ -0,0 +1,46 @@ +# Only relevant for Docker Hub or QEMU multi-architecture builds. +# Prefer the normal `Dockerfile` if you are building manually on the targeted architecture. + +FROM arm32v7/ubuntu:19.04 + +# Requires ./hooks/* +COPY ./Docker/qemu-* /usr/bin/ + +ENV TZ UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt update && \ + apt install --no-install-recommends -y \ + ca-certificates cron \ + apache2 libapache2-mod-php \ + php-curl php-intl php-mbstring php-xml php-zip \ + php-sqlite3 php-mysql php-pgsql && \ + rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /var/www/FreshRSS/ /run/apache2/ +WORKDIR /var/www/FreshRSS + +COPY . /var/www/FreshRSS +COPY ./Docker/*.Apache.conf /etc/apache2/sites-available/ + +RUN a2dismod -f alias autoindex negotiation status && \ + a2enmod deflate expires headers mime setenvif && \ + a2disconf '*' && \ + a2dissite '*' && \ + a2ensite 'FreshRSS*' + +RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.conf && \ + sed -r -i "/^\s*Listen /s/^/#/" /etc/apache2/ports.conf && \ + touch /var/www/FreshRSS/Docker/env.txt && \ + echo "17,47 * * * * . /var/www/FreshRSS/Docker/env.txt; \ + su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ + 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - + +ENV COPY_SYSLOG_TO_STDERR On +ENV CRON_MIN '' +ENTRYPOINT ["./Docker/entrypoint.sh"] + +EXPOSE 80 +CMD ([ -z "$CRON_MIN" ] || cron) && \ + . /etc/apache2/envvars && \ + exec apache2 -D FOREGROUND diff --git a/Docker/README.md b/Docker/README.md index cdb6a0a4e..c2db38fb5 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -37,6 +37,7 @@ sudo docker run -d --restart unless-stopped --log-opt max-size=10m \ -p 80:80 \ -p 443:443 \ --name traefik traefik --docker \ + --loglevel=info \ --entryPoints='Name:http Address::80 Compress:true Redirect.EntryPoint:https' \ --entryPoints='Name:https Address::443 Compress:true TLS TLS.MinVersion:VersionTLS12 TLS.SniStrict:true TLS.CipherSuites:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA' \ --defaultentrypoints=http,https --keeptrailingslash=true \ @@ -51,7 +52,7 @@ See [more information about Docker and Let’s Encrypt in Træfik](https://docs. Example using the built-in refresh cron job (see further below for alternatives). You must first chose a domain (DNS) or sub-domain, e.g. `freshrss.example.net`. -> **N.B.:** For platforms other than x64 (Intel, AMD), such as ARM (e.g. Raspberry Pi), see the section *Build Docker image* further below. +> **N.B.:** Default images are for x64 (Intel, AMD) platforms. For ARM (e.g. Raspberry Pi), use the `*-arm` tags. For other platforms, see the section *Build Docker image* further below. ```sh sudo docker volume create freshrss-data @@ -137,7 +138,7 @@ The tags correspond to FreshRSS branches and versions: * `:x.y.z` are specific FreshRSS releases ### Linux: Ubuntu vs. Alpine -Our default image is based on [Ubuntu](https://www.ubuntu.com/server). We offer an alternative based on [Alpine](https://alpinelinux.org/) (with the `-alpine` tag suffix). +Our default image is based on [Ubuntu](https://www.ubuntu.com/server). We offer an alternative based on [Alpine](https://alpinelinux.org/) (with the `*-alpine` tag suffix). In [our tests](https://github.com/FreshRSS/FreshRSS/pull/2205), Ubuntu is ~3 times faster, while Alpine is ~2.5 times [smaller on disk](https://hub.docker.com/r/freshrss/freshrss/tags) (and much faster to build). diff --git a/Docker/hooks/pre_build b/Docker/hooks/pre_build new file mode 100755 index 000000000..f6c8211c0 --- /dev/null +++ b/Docker/hooks/pre_build @@ -0,0 +1,12 @@ +#!/bin/bash + +if [[ "$DOCKERFILE_PATH" == *-ARM ]]; +then + # https://github.com/balena-io/qemu + # Download a local copy of QEMU on Docker Hub build machine + curl -LSs 'https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz' | tar -xzv --strip-components=1 --wildcards '*/qemu-*' + + # https://github.com/multiarch/qemu-user-static + # Register qemu-*-static for all supported processors except the current one, but also remove all registered binfmt_misc before + docker run --rm --privileged multiarch/qemu-user-static:register --reset +fi -- cgit v1.2.3 From 8c2cf1b4dd3a6c79d77f9dc1a256e9d4a8db6a68 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 7 Jul 2019 20:07:01 +0200 Subject: Docker healthcheck+ labels (#2438) * Add Docker labels And try to fix the platform metadata for ARM, and add health check * Execution rights * Remove experimental features not supported by Docker Hub "--squash" is only supported on a Docker daemon with experimental features enabled. build hook failed! (1) * Fix paths --- Docker/Dockerfile | 21 ++++++++++++++++++++- Docker/Dockerfile-Alpine | 20 ++++++++++++++++++++ Docker/Dockerfile-QEMU-ARM | 26 ++++++++++++++++++++++++-- Docker/hooks/build | 22 ++++++++++++++++++++++ Docker/hooks/pre_build | 4 +++- app/install.php | 1 + 6 files changed, 90 insertions(+), 4 deletions(-) create mode 100755 Docker/hooks/build (limited to 'Docker') diff --git a/Docker/Dockerfile b/Docker/Dockerfile index e5581efe7..eea2ea49c 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -5,7 +5,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt update && \ apt install --no-install-recommends -y \ - ca-certificates cron \ + ca-certificates cron curl \ apache2 libapache2-mod-php \ php-curl php-intl php-mbstring php-xml php-zip \ php-sqlite3 php-mysql php-pgsql && \ @@ -17,6 +17,22 @@ WORKDIR /var/www/FreshRSS COPY . /var/www/FreshRSS COPY ./Docker/*.Apache.conf /etc/apache2/sites-available/ +ARG FRESHRSS_VERSION +ARG SOURCE_BRANCH +ARG SOURCE_COMMIT + +LABEL \ + org.opencontainers.image.authors="Alkarex" \ + org.opencontainers.image.description="A self-hosted RSS feed aggregator" \ + org.opencontainers.image.documentation="https://freshrss.github.io/FreshRSS/" \ + org.opencontainers.image.licenses="AGPL-3.0" \ + org.opencontainers.image.revision="${SOURCE_BRANCH}.${SOURCE_COMMIT}" \ + org.opencontainers.image.source="https://github.com/FreshRSS/FreshRSS" \ + org.opencontainers.image.title="FreshRSS" \ + org.opencontainers.image.url="https://freshrss.org/" \ + org.opencontainers.image.vendor="FreshRSS" \ + org.opencontainers.image.version="$FRESHRSS_VERSION" + RUN a2dismod -f alias autoindex negotiation status && \ a2enmod deflate expires headers mime setenvif && \ a2disconf '*' && \ @@ -38,3 +54,6 @@ EXPOSE 80 CMD ([ -z "$CRON_MIN" ] || cron) && \ . /etc/apache2/envvars && \ exec apache2 -D FOREGROUND + +HEALTHCHECK --start-period=8s --interval=67s --timeout=5s --retries=3 \ + CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1 diff --git a/Docker/Dockerfile-Alpine b/Docker/Dockerfile-Alpine index 798a57de1..4078ad0cb 100644 --- a/Docker/Dockerfile-Alpine +++ b/Docker/Dockerfile-Alpine @@ -3,6 +3,7 @@ FROM alpine:3.10 ENV TZ UTC RUN apk add --no-cache \ + curl \ apache2 php7-apache2 \ php7 php7-curl php7-gmp php7-intl php7-mbstring php7-xml php7-zip \ php7-ctype php7-dom php7-fileinfo php7-iconv php7-json php7-session php7-simplexml php7-xmlreader php7-zlib \ @@ -14,6 +15,22 @@ WORKDIR /var/www/FreshRSS COPY . /var/www/FreshRSS COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/ +ARG FRESHRSS_VERSION +ARG SOURCE_BRANCH +ARG SOURCE_COMMIT + +LABEL \ + org.opencontainers.image.authors="Alkarex" \ + org.opencontainers.image.description="A self-hosted RSS feed aggregator" \ + org.opencontainers.image.documentation="https://freshrss.github.io/FreshRSS/" \ + org.opencontainers.image.licenses="AGPL-3.0" \ + org.opencontainers.image.revision="${SOURCE_BRANCH}.${SOURCE_COMMIT}" \ + org.opencontainers.image.source="https://github.com/FreshRSS/FreshRSS" \ + org.opencontainers.image.title="FreshRSS" \ + org.opencontainers.image.url="https://freshrss.org/" \ + org.opencontainers.image.vendor="FreshRSS" \ + org.opencontainers.image.version="$FRESHRSS_VERSION" + RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \ /etc/apache2/conf.d/status.conf /etc/apache2/conf.d/userdir.conf && \ sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" \ @@ -34,3 +51,6 @@ ENTRYPOINT ["./Docker/entrypoint.sh"] EXPOSE 80 CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \ exec httpd -D FOREGROUND + +HEALTHCHECK --start-period=8s --interval=67s --timeout=5s --retries=3 \ + CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1 diff --git a/Docker/Dockerfile-QEMU-ARM b/Docker/Dockerfile-QEMU-ARM index 889be2cb8..926bac98e 100644 --- a/Docker/Dockerfile-QEMU-ARM +++ b/Docker/Dockerfile-QEMU-ARM @@ -4,14 +4,14 @@ FROM arm32v7/ubuntu:19.04 # Requires ./hooks/* -COPY ./Docker/qemu-* /usr/bin/ +COPY ./Docker/qemu-arm-* /usr/bin/ ENV TZ UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt update && \ apt install --no-install-recommends -y \ - ca-certificates cron \ + ca-certificates cron curl \ apache2 libapache2-mod-php \ php-curl php-intl php-mbstring php-xml php-zip \ php-sqlite3 php-mysql php-pgsql && \ @@ -23,6 +23,22 @@ WORKDIR /var/www/FreshRSS COPY . /var/www/FreshRSS COPY ./Docker/*.Apache.conf /etc/apache2/sites-available/ +ARG FRESHRSS_VERSION +ARG SOURCE_BRANCH +ARG SOURCE_COMMIT + +LABEL \ + org.opencontainers.image.authors="Alkarex" \ + org.opencontainers.image.description="A self-hosted RSS feed aggregator" \ + org.opencontainers.image.documentation="https://freshrss.github.io/FreshRSS/" \ + org.opencontainers.image.licenses="AGPL-3.0" \ + org.opencontainers.image.revision="${SOURCE_BRANCH}.${SOURCE_COMMIT}" \ + org.opencontainers.image.source="https://github.com/FreshRSS/FreshRSS" \ + org.opencontainers.image.title="FreshRSS" \ + org.opencontainers.image.url="https://freshrss.org/" \ + org.opencontainers.image.vendor="FreshRSS" \ + org.opencontainers.image.version="$FRESHRSS_VERSION" + RUN a2dismod -f alias autoindex negotiation status && \ a2enmod deflate expires headers mime setenvif && \ a2disconf '*' && \ @@ -36,6 +52,9 @@ RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.co su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - +# Useful with the `--squash` build option +RUN rm /usr/bin/qemu-* + ENV COPY_SYSLOG_TO_STDERR On ENV CRON_MIN '' ENTRYPOINT ["./Docker/entrypoint.sh"] @@ -44,3 +63,6 @@ EXPOSE 80 CMD ([ -z "$CRON_MIN" ] || cron) && \ . /etc/apache2/envvars && \ exec apache2 -D FOREGROUND + +HEALTHCHECK --start-period=8s --interval=67s --timeout=5s --retries=3 \ + CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1 diff --git a/Docker/hooks/build b/Docker/hooks/build new file mode 100755 index 000000000..73bc90e74 --- /dev/null +++ b/Docker/hooks/build @@ -0,0 +1,22 @@ +#!/bin/bash + +cd .. +FRESHRSS_VERSION=`grep "'FRESHRSS_VERSION'" constants.php | cut -d "'" -f4` +echo "$FRESHRSS_VERSION" + +if [[ "$DOCKERFILE_PATH" == *-ARM ]] +then + #TODO: Add --squash --platform arm options when Docker Hub deamon supports them + docker build \ + --build-arg FRESHRSS_VERSION="$FRESHRSS_VERSION" \ + --build-arg SOURCE_BRANCH="$SOURCE_BRANCH" \ + --build-arg SOURCE_COMMIT="$SOURCE_COMMIT" \ + -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" . +else + #TODO: Add --squash option when Docker Hub deamon supports it + docker build \ + --build-arg FRESHRSS_VERSION="$FRESHRSS_VERSION" \ + --build-arg SOURCE_BRANCH="$SOURCE_BRANCH" \ + --build-arg SOURCE_COMMIT="$SOURCE_COMMIT" \ + -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" . +fi diff --git a/Docker/hooks/pre_build b/Docker/hooks/pre_build index f6c8211c0..32074059c 100755 --- a/Docker/hooks/pre_build +++ b/Docker/hooks/pre_build @@ -1,6 +1,8 @@ #!/bin/bash -if [[ "$DOCKERFILE_PATH" == *-ARM ]]; +cp README.md ../ + +if [[ "$DOCKERFILE_PATH" == *-ARM ]] then # https://github.com/balena-io/qemu # Download a local copy of QEMU on Docker Hub build machine diff --git a/app/install.php b/app/install.php index e5142628d..c3aff3826 100644 --- a/app/install.php +++ b/app/install.php @@ -724,6 +724,7 @@ case 5: + <?php echo _t('install.title'); ?> -- cgit v1.2.3 From af8b39a20444b16365c144c10ae5e58d08857bc0 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 8 Jul 2019 13:10:51 +0200 Subject: Changelog, credits https://github.com/FreshRSS/FreshRSS/issues/2429 https://github.com/FreshRSS/FreshRSS/pull/2431 https://github.com/FreshRSS/FreshRSS/issues/2437 https://github.com/FreshRSS/FreshRSS/pull/2439 --- CHANGELOG.md | 4 ++++ CREDITS.md | 2 ++ Docker/README.md | 2 ++ 3 files changed, 8 insertions(+) (limited to 'Docker') diff --git a/CHANGELOG.md b/CHANGELOG.md index 332d7ba3e..f548bc86b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Security * Allow `@-` as valid characters in usernames (i.e. allow most e-mails) [#2391](https://github.com/FreshRSS/FreshRSS/issues/2391) * Bug fixing + * Fix wrong mark-as-read limit [#2429](https://github.com/FreshRSS/FreshRSS/issues/2429) * Fix API call for removing a category [#2411](https://github.com/FreshRSS/FreshRSS/issues/2411) * Fix refresh icon in Swage theme [#2375](https://github.com/FreshRSS/FreshRSS/issues/2375) * Fix message banner in Swage theme [#2379](https://github.com/FreshRSS/FreshRSS/issues/2379) @@ -12,8 +13,11 @@ * New configuration page for each category [#2369](https://github.com/FreshRSS/FreshRSS/issues/2369) * Update shortcut configuration page [#2405](https://github.com/FreshRSS/FreshRSS/issues/2405) * CSS style for printing [#2149](https://github.com/FreshRSS/FreshRSS/issues/2149) + * Do not hide multiple `
` tags [#2437](https://github.com/FreshRSS/FreshRSS/issues/2437) * Updated to jQuery 3.4.1 [#2424](https://github.com/FreshRSS/FreshRSS/pull/2424) * Deployment + * Docker: Add automatic health check [#2438](https://github.com/FreshRSS/FreshRSS/pull/2438) + * Docker: Add a version for ARM achitecture such as for Raspberry Pi [#2436](https://github.com/FreshRSS/FreshRSS/pull/2436) * Docker: Ubuntu image updated to 19.04 with PHP 7.2.19 and Apache 2.4.38 [#2422](https://github.com/FreshRSS/FreshRSS/pull/2422) * Docker: Alpine image updated to 3.10 with PHP 7.3.6 and Apache 2.4.39 [#2238](https://github.com/FreshRSS/FreshRSS/pull/2238) * I18n diff --git a/CREDITS.md b/CREDITS.md index c1dd4f502..727fe64b6 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -61,6 +61,8 @@ People are sorted by name so please keep this order. * [Quentin Pagès](https://github.com/Quenty31): [contributions](https://github.com/FreshRSS/documentation/commits?author=Quenty31) * [Ramón Cutanda](https://github.com/rcutanda): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:rcutanda) * [romibi](https://github.com/romibi): [contributions](https://github.com/FreshRSS/FreshRSS/commits/dev?author=romibi) +* [Rosemary Le Faive](https://github.com/rosiel): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:rosiel) +* [Sandro Jäckel](https://github.com/SuperSandro2000): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:SuperSandro2000), [Web](https://supersandro.de/) * [sirideain](https://github.com/sirideain): [contributions](https://github.com/FreshRSS/FreshRSS/commits/dev?author=sirideain) * [Sp3r4z](https://github.com/Sp3r4z): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:Sp3r4z) * [subic](https://github.com/subic): [contributions](https://github.com/FreshRSS/documentation/commits?author=subic) diff --git a/Docker/README.md b/Docker/README.md index c2db38fb5..c93178ff7 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -75,6 +75,7 @@ sudo docker run -d --restart unless-stopped --log-opt max-size=10m \ `--label traefik.frontend.rule='Host:freshrss.example.net;PathPrefixStrip:/FreshRSS/' \` * You may remove the `--label traefik.*` lines if you do not use Træfik. * Add `-p 8080:80 \` if you want to expose FreshRSS locally, e.g. on port `8080`. +* Replace `freshrss/freshrss` by a more specific tag (see below) such as `freshrss/freshrss:dev` for the development version, or `freshrss/freshrss:arm` for a Raspberry Pi version. This already works with a built-in **SQLite** database (easiest), but more powerful databases are supported: @@ -136,6 +137,7 @@ The tags correspond to FreshRSS branches and versions: * `:latest` (default) is the `master` branch, more stable * `:dev` is the `dev` branch, rolling release * `:x.y.z` are specific FreshRSS releases +* `:arm` or `:*-arm` are the ARM versions (e.g. for Raspberry Pi) ### Linux: Ubuntu vs. Alpine Our default image is based on [Ubuntu](https://www.ubuntu.com/server). We offer an alternative based on [Alpine](https://alpinelinux.org/) (with the `*-alpine` tag suffix). -- cgit v1.2.3 From 93bef33e1f5493c95c81c9d44f34aed70880768f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 8 Jul 2019 15:17:31 +0200 Subject: Fix ARM ca-certs (#2440) Workaround strange bug: When building on Docker Hub with QEMU, the symlinks for the CA certificates are not created properly, although it is the case when building for ARM locally. Manually calling `update-ca-certificates -f` fixes the problem. Note for later: Maybe we should call this update in our entrypoint.sh. --- Docker/Dockerfile-QEMU-ARM | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Docker') diff --git a/Docker/Dockerfile-QEMU-ARM b/Docker/Dockerfile-QEMU-ARM index 926bac98e..fb136e34e 100644 --- a/Docker/Dockerfile-QEMU-ARM +++ b/Docker/Dockerfile-QEMU-ARM @@ -52,8 +52,11 @@ RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.co su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - +# Seems needed for arm32v7/ubuntu on Docker Hub +RUN update-ca-certificates -f + # Useful with the `--squash` build option -RUN rm /usr/bin/qemu-* +RUN rm /usr/bin/qemu-* /var/www/FreshRSS/Docker/qemu-* ENV COPY_SYSLOG_TO_STDERR On ENV CRON_MIN '' -- cgit v1.2.3 From a394d7ab10dbaaca78cc8ca3c6536d7a808d7931 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 13 Jul 2019 15:19:39 +0200 Subject: Docker Hub readme (#2441) * Docker Hub readme Try to use anothe readme. And update info for https://alpinelinux.org/posts/Alpine-3.10.1-released.html * Test another variant * /tmp/ did not work --- CHANGELOG.md | 2 +- Docker/hooks/post_checkout | 4 ++++ Docker/hooks/pre_build | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 Docker/hooks/post_checkout (limited to 'Docker') diff --git a/CHANGELOG.md b/CHANGELOG.md index f548bc86b..4b734e22f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ * Docker: Add automatic health check [#2438](https://github.com/FreshRSS/FreshRSS/pull/2438) * Docker: Add a version for ARM achitecture such as for Raspberry Pi [#2436](https://github.com/FreshRSS/FreshRSS/pull/2436) * Docker: Ubuntu image updated to 19.04 with PHP 7.2.19 and Apache 2.4.38 [#2422](https://github.com/FreshRSS/FreshRSS/pull/2422) - * Docker: Alpine image updated to 3.10 with PHP 7.3.6 and Apache 2.4.39 [#2238](https://github.com/FreshRSS/FreshRSS/pull/2238) + * Docker: Alpine image updated to 3.10 with PHP 7.3.7 and Apache 2.4.39 [#2238](https://github.com/FreshRSS/FreshRSS/pull/2238) * I18n * Improve Occitan [#2358](https://github.com/FreshRSS/FreshRSS/pull/2358) * Misc. diff --git a/Docker/hooks/post_checkout b/Docker/hooks/post_checkout new file mode 100644 index 000000000..b33c941e5 --- /dev/null +++ b/Docker/hooks/post_checkout @@ -0,0 +1,4 @@ +#!/bin/bash + +mv ../README.md ../README.en.md +mv README.md ../ diff --git a/Docker/hooks/pre_build b/Docker/hooks/pre_build index 32074059c..5946b045b 100755 --- a/Docker/hooks/pre_build +++ b/Docker/hooks/pre_build @@ -1,7 +1,5 @@ #!/bin/bash -cp README.md ../ - if [[ "$DOCKERFILE_PATH" == *-ARM ]] then # https://github.com/balena-io/qemu -- cgit v1.2.3 From 0a297addc060692f163c2614aa9989f5840f494a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 21 Jul 2019 12:49:29 +0200 Subject: Add php-gmp for API in Ubuntu 32-bit (#2450) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And adjust slightly the HEALTHCHECK parameters for faster start in Træfik --- CHANGELOG.md | 1 + Docker/Dockerfile | 4 ++-- Docker/Dockerfile-Alpine | 2 +- Docker/Dockerfile-QEMU-ARM | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'Docker') diff --git a/CHANGELOG.md b/CHANGELOG.md index a29ea841c..ade2b2438 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * Make CGI Authorization configuration for API more compatible [#2446](https://github.com/FreshRSS/FreshRSS/issues/2446) * Fix refresh icon in Swage theme [#2375](https://github.com/FreshRSS/FreshRSS/issues/2375) * Fix message banner in Swage theme [#2379](https://github.com/FreshRSS/FreshRSS/issues/2379) + * Docker: Add `php-gmp` for API support in Ubuntu 32-bit [#2450](https://github.com/FreshRSS/FreshRSS/pull/2450) * UI * New configuration page for each category [#2369](https://github.com/FreshRSS/FreshRSS/issues/2369) * Update shortcut configuration page [#2405](https://github.com/FreshRSS/FreshRSS/issues/2405) diff --git a/Docker/Dockerfile b/Docker/Dockerfile index eea2ea49c..1eac3687b 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -7,7 +7,7 @@ RUN apt update && \ apt install --no-install-recommends -y \ ca-certificates cron curl \ apache2 libapache2-mod-php \ - php-curl php-intl php-mbstring php-xml php-zip \ + php-curl php-gmp php-intl php-mbstring php-xml php-zip \ php-sqlite3 php-mysql php-pgsql && \ rm -rf /var/lib/apt/lists/* @@ -55,5 +55,5 @@ CMD ([ -z "$CRON_MIN" ] || cron) && \ . /etc/apache2/envvars && \ exec apache2 -D FOREGROUND -HEALTHCHECK --start-period=8s --interval=67s --timeout=5s --retries=3 \ +HEALTHCHECK --start-period=20s --interval=37s --timeout=5s --retries=3 \ CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1 diff --git a/Docker/Dockerfile-Alpine b/Docker/Dockerfile-Alpine index 4078ad0cb..1715ff778 100644 --- a/Docker/Dockerfile-Alpine +++ b/Docker/Dockerfile-Alpine @@ -52,5 +52,5 @@ EXPOSE 80 CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \ exec httpd -D FOREGROUND -HEALTHCHECK --start-period=8s --interval=67s --timeout=5s --retries=3 \ +HEALTHCHECK --start-period=20s --interval=37s --timeout=5s --retries=3 \ CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1 diff --git a/Docker/Dockerfile-QEMU-ARM b/Docker/Dockerfile-QEMU-ARM index fb136e34e..87a807350 100644 --- a/Docker/Dockerfile-QEMU-ARM +++ b/Docker/Dockerfile-QEMU-ARM @@ -13,7 +13,7 @@ RUN apt update && \ apt install --no-install-recommends -y \ ca-certificates cron curl \ apache2 libapache2-mod-php \ - php-curl php-intl php-mbstring php-xml php-zip \ + php-curl php-gmp php-intl php-mbstring php-xml php-zip \ php-sqlite3 php-mysql php-pgsql && \ rm -rf /var/lib/apt/lists/* @@ -67,5 +67,5 @@ CMD ([ -z "$CRON_MIN" ] || cron) && \ . /etc/apache2/envvars && \ exec apache2 -D FOREGROUND -HEALTHCHECK --start-period=8s --interval=67s --timeout=5s --retries=3 \ +HEALTHCHECK --start-period=20s --interval=37s --timeout=5s --retries=3 \ CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1 -- cgit v1.2.3 From 71270e4d5c7f0645a31a8dc7ccc56cea6a9711b0 Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Mon, 22 Jul 2019 15:26:55 +0200 Subject: Replace curl healthcheck with pure php, apply haodlint suggestions (#2455) Closes #2453 --- Docker/Dockerfile | 9 +++++---- Docker/Dockerfile-Alpine | 5 ++--- Docker/Dockerfile-QEMU-ARM | 9 +++++---- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'Docker') diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 1eac3687b..11a44797f 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -1,11 +1,12 @@ FROM ubuntu:19.04 ENV TZ UTC +SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN apt update && \ - apt install --no-install-recommends -y \ - ca-certificates cron curl \ +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + ca-certificates cron \ apache2 libapache2-mod-php \ php-curl php-gmp php-intl php-mbstring php-xml php-zip \ php-sqlite3 php-mysql php-pgsql && \ @@ -56,4 +57,4 @@ CMD ([ -z "$CRON_MIN" ] || cron) && \ exec apache2 -D FOREGROUND HEALTHCHECK --start-period=20s --interval=37s --timeout=5s --retries=3 \ - CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1 + CMD (php -r "readfile('http://localhost/i/');" | grep -q 'jsonVars') || exit 1 diff --git a/Docker/Dockerfile-Alpine b/Docker/Dockerfile-Alpine index 1715ff778..32671c4ae 100644 --- a/Docker/Dockerfile-Alpine +++ b/Docker/Dockerfile-Alpine @@ -1,9 +1,8 @@ FROM alpine:3.10 ENV TZ UTC - +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] RUN apk add --no-cache \ - curl \ apache2 php7-apache2 \ php7 php7-curl php7-gmp php7-intl php7-mbstring php7-xml php7-zip \ php7-ctype php7-dom php7-fileinfo php7-iconv php7-json php7-session php7-simplexml php7-xmlreader php7-zlib \ @@ -53,4 +52,4 @@ CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \ exec httpd -D FOREGROUND HEALTHCHECK --start-period=20s --interval=37s --timeout=5s --retries=3 \ - CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1 + CMD (php -r "readfile('http://localhost/i/');" | grep -q 'jsonVars') || exit 1 diff --git a/Docker/Dockerfile-QEMU-ARM b/Docker/Dockerfile-QEMU-ARM index 87a807350..ad3243b23 100644 --- a/Docker/Dockerfile-QEMU-ARM +++ b/Docker/Dockerfile-QEMU-ARM @@ -7,11 +7,12 @@ FROM arm32v7/ubuntu:19.04 COPY ./Docker/qemu-arm-* /usr/bin/ ENV TZ UTC +SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN apt update && \ - apt install --no-install-recommends -y \ - ca-certificates cron curl \ +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + ca-certificates cron \ apache2 libapache2-mod-php \ php-curl php-gmp php-intl php-mbstring php-xml php-zip \ php-sqlite3 php-mysql php-pgsql && \ @@ -68,4 +69,4 @@ CMD ([ -z "$CRON_MIN" ] || cron) && \ exec apache2 -D FOREGROUND HEALTHCHECK --start-period=20s --interval=37s --timeout=5s --retries=3 \ - CMD curl -fsS 'http://localhost/i/' | grep -q 'jsonVars' || exit 1 + CMD (php -r "readfile('http://localhost/i/');" | grep -q 'jsonVars') || exit 1 -- cgit v1.2.3 From ad92518fe44279b69308aaf0a757469f5bf42910 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Mon, 22 Jul 2019 16:07:40 +0200 Subject: [CI] Run shellcheck and shfmt (#2454) * [CI] Run shellcheck and shfmt Cf. https://github.com/FreshRSS/FreshRSS/pull/2436#discussion_r305640019 * rename * no need for disable anymore * also remove leftover indentation flags even if it makes no difference to syntax checking * define colors and reset before exit for local use --- .travis.yml | 1 + Docker/entrypoint.sh | 11 +++++++---- Docker/hooks/build | 5 ++--- Docker/hooks/pre_build | 3 +-- p/themes/Ansum/sass.sh | 1 + p/themes/Mapco/sass.sh | 1 + tests/shellchecks.sh | 29 +++++++++++++++++++++++++++++ 7 files changed, 42 insertions(+), 9 deletions(-) create mode 100755 tests/shellchecks.sh (limited to 'Docker') diff --git a/.travis.yml b/.travis.yml index 078a91109..ee510ee84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ script: - phpenv rehash - find . -not -path "./lib/JSON.php" -name \*.php -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null 2>php-l-results - if [ -s php-l-results ]; then cat php-l-results; exit 1; fi + - bash tests/shellchecks.sh - | if [[ $VALIDATE_STANDARD == yes ]]; then COMPOSER_BIN=$(composer global config --absolute bin-dir) diff --git a/Docker/entrypoint.sh b/Docker/entrypoint.sh index b7a961569..bb0e1bde0 100755 --- a/Docker/entrypoint.sh +++ b/Docker/entrypoint.sh @@ -1,15 +1,18 @@ #!/bin/sh -php -f ./cli/prepare.php > /dev/null +php -f ./cli/prepare.php >/dev/null chown -R :www-data . chmod -R g+r . && chmod -R g+w ./data/ -find /etc/php*/ -name php.ini -exec sed -r -i "\#^;?date.timezone#s#^.*#date.timezone = $TZ#" {} \; +find /etc/php*/ -name php.ini -exec sed -r -i "\\#^;?date.timezone#s#^.*#date.timezone = $TZ#" {} \; if [ -n "$CRON_MIN" ]; then - (echo "export TZ=$TZ" ; echo "export COPY_SYSLOG_TO_STDERR=$COPY_SYSLOG_TO_STDERR") > /var/www/FreshRSS/Docker/env.txt - crontab -l | sed -r "\#FreshRSS#s#^[^ ]+ #$CRON_MIN #" | crontab - + ( + echo "export TZ=$TZ" + echo "export COPY_SYSLOG_TO_STDERR=$COPY_SYSLOG_TO_STDERR" + ) >/var/www/FreshRSS/Docker/env.txt + crontab -l | sed -r "\\#FreshRSS#s#^[^ ]+ #$CRON_MIN #" | crontab - fi exec "$@" diff --git a/Docker/hooks/build b/Docker/hooks/build index 73bc90e74..84e759a80 100755 --- a/Docker/hooks/build +++ b/Docker/hooks/build @@ -1,11 +1,10 @@ #!/bin/bash cd .. -FRESHRSS_VERSION=`grep "'FRESHRSS_VERSION'" constants.php | cut -d "'" -f4` +FRESHRSS_VERSION=$(grep "'FRESHRSS_VERSION'" constants.php | cut -d "'" -f4) echo "$FRESHRSS_VERSION" -if [[ "$DOCKERFILE_PATH" == *-ARM ]] -then +if [[ $DOCKERFILE_PATH == *-ARM ]]; then #TODO: Add --squash --platform arm options when Docker Hub deamon supports them docker build \ --build-arg FRESHRSS_VERSION="$FRESHRSS_VERSION" \ diff --git a/Docker/hooks/pre_build b/Docker/hooks/pre_build index 5946b045b..b2cda0e48 100755 --- a/Docker/hooks/pre_build +++ b/Docker/hooks/pre_build @@ -1,7 +1,6 @@ #!/bin/bash -if [[ "$DOCKERFILE_PATH" == *-ARM ]] -then +if [[ $DOCKERFILE_PATH == *-ARM ]]; then # https://github.com/balena-io/qemu # Download a local copy of QEMU on Docker Hub build machine curl -LSs 'https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz' | tar -xzv --strip-components=1 --wildcards '*/qemu-*' diff --git a/p/themes/Ansum/sass.sh b/p/themes/Ansum/sass.sh index a653acace..6c65128ea 100644 --- a/p/themes/Ansum/sass.sh +++ b/p/themes/Ansum/sass.sh @@ -1 +1,2 @@ +#!/bin/sh sass --watch ansum.scss:ansum.css diff --git a/p/themes/Mapco/sass.sh b/p/themes/Mapco/sass.sh index 316d04cf2..c0b3d47df 100644 --- a/p/themes/Mapco/sass.sh +++ b/p/themes/Mapco/sass.sh @@ -1 +1,2 @@ +#!/bin/sh sass --watch mapco.scss:mapco.css diff --git a/tests/shellchecks.sh b/tests/shellchecks.sh new file mode 100755 index 000000000..648f2766e --- /dev/null +++ b/tests/shellchecks.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# Based on https://github.com/koreader/koreader/blob/master/.ci/helper_shellchecks.sh + +ANSI_RED="\\033[31;1m" +ANSI_GREEN="\\033[32;1m" +ANSI_RESET="\\033[0m" + +mapfile -t shellscript_locations < <({ git grep -lE '^#!(/usr)?/bin/(env )?(bash|sh)' && git ls-files ./*.sh; } | sort | uniq) + +SHELLSCRIPT_ERROR=0 + +for shellscript in "${shellscript_locations[@]}"; do + echo -e "${ANSI_GREEN}Running shellcheck on ${shellscript}" + shellcheck "${shellscript}" || SHELLSCRIPT_ERROR=1 + echo -e "${ANSI_GREEN}Running shfmt on ${shellscript}" + if ! shfmt "${shellscript}" >/dev/null 2>&1; then + echo -e "${ANSI_RED}Warning: ${shellscript} contains the following problem:" + shfmt "${shellscript}" || SHELLSCRIPT_ERROR=1 + continue + fi + if [ "$(cat "${shellscript}")" != "$(shfmt "${shellscript}")" ]; then + echo -e "${ANSI_RED}Warning: ${shellscript} does not abide by coding style, diff for expected style:" + shfmt "${shellscript}" | diff "${shellscript}" - || SHELLSCRIPT_ERROR=1 + fi +done + +echo -ne "${ANSI_RESET}" + +exit "${SHELLSCRIPT_ERROR}" -- cgit v1.2.3 From 4e0acf5296d23899d0aa4a09ce758aae840ad116 Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Mon, 22 Jul 2019 21:52:25 +0200 Subject: Ignore JSON notation --- Docker/Dockerfile | 1 + Docker/Dockerfile-Alpine | 1 + Docker/Dockerfile-QEMU-ARM | 1 + 3 files changed, 3 insertions(+) (limited to 'Docker') diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 11a44797f..8693bb0f7 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -52,6 +52,7 @@ ENV CRON_MIN '' ENTRYPOINT ["./Docker/entrypoint.sh"] EXPOSE 80 +# hadolint ignore=DL3025 CMD ([ -z "$CRON_MIN" ] || cron) && \ . /etc/apache2/envvars && \ exec apache2 -D FOREGROUND diff --git a/Docker/Dockerfile-Alpine b/Docker/Dockerfile-Alpine index 32671c4ae..ac5d74a43 100644 --- a/Docker/Dockerfile-Alpine +++ b/Docker/Dockerfile-Alpine @@ -48,6 +48,7 @@ ENV CRON_MIN '' ENTRYPOINT ["./Docker/entrypoint.sh"] EXPOSE 80 +# hadolint ignore=DL3025 CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \ exec httpd -D FOREGROUND diff --git a/Docker/Dockerfile-QEMU-ARM b/Docker/Dockerfile-QEMU-ARM index ad3243b23..4d81a23f0 100644 --- a/Docker/Dockerfile-QEMU-ARM +++ b/Docker/Dockerfile-QEMU-ARM @@ -64,6 +64,7 @@ ENV CRON_MIN '' ENTRYPOINT ["./Docker/entrypoint.sh"] EXPOSE 80 +# hadolint ignore=DL3025 CMD ([ -z "$CRON_MIN" ] || cron) && \ . /etc/apache2/envvars && \ exec apache2 -D FOREGROUND -- cgit v1.2.3