Skip to content

Commit

Permalink
Update Wallabag version (#9)
Browse files Browse the repository at this point in the history
* update wallabag to v2.6.0

* update actions

* update wallabag download url

* update version and try automatic update

* run updates via console

* start using mailer_dsn

---------

Co-authored-by: root <[email protected]>
  • Loading branch information
coostax and root authored Jan 4, 2024
1 parent 47f96a9 commit 1b2e311
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 48 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/check-new-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Check Wallabag Version

# yamllint disable-line rule:truthy
on:
schedule:
- cron: '0 0 * * *' # Run daily at 00:00
workflow_dispatch:

jobs:
check_updates:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check for new version and update Dockerfile
id: check_version
run: |
n_vers=$(curl --silent "https://api.github.com/repos/wallabag/wallabag/releases/latest" | jq -r .tag_name)
echo "new_version=$n_vers" >> $GITHUB_OUTPUT
echo "version is $n_vers"
- name: Update Dockerfile
run: |
grep "ENV WALLABAG_VERSION=" wallabag/Dockerfile | cut -d= -f2
sed -i "s/ENV WALLABAG_VERSION=.*/ENV WALLABAG_VERSION=${{ steps.check_version.outputs.new_version }}/" wallabag/Dockerfile

Check warning on line 27 in .github/workflows/check-new-version.yml

View workflow job for this annotation

GitHub Actions / workflows / YAMLLint

line too long
- name: Check if Dockerfile has changed
uses: tj-actions/verify-changed-files@v17
id: verify_changed_files
with:
files: |
wallabag/Dockerfile
- name: Create PR
if: steps.verify_changed_files.outputs.files_changed == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.DISPATCH_TOKEN }}
commit-message: "update wallabag to version ${{ steps.check_version.outputs.new_version }}"
branch: "new_wallabag_version_${{ steps.check_version.outputs.new_version }}"
delete-branch: true
base: "main"
title: "Update Wallabag version"
body: "Update Wallabag to version ${{ steps.check_version.outputs.new_version }}"
labels: "enhancement"
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ name: CI
# yamllint disable-line rule:truthy
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
types:
- opened
- reopened
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ jobs:
secrets:
CAS_API_KEY: ${{ secrets.CAS_API_KEY }}
DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}

publish:
uses: coostax/ghactions-workflows/.github/workflows/ha-addon-publish.yaml@main
with:
add_on: "wallabag"
secrets:
DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
49 changes: 25 additions & 24 deletions wallabag/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FROM $BUILD_FROM

# Default ENV
ENV \
NODE_VERSION=16 \
WALLABAG_VERSION=2.5.2
NODE_VERSION=18 \
WALLABAG_VERSION=2.6.6
# Setup base
# hadolint ignore=DL3008,DL4006
RUN \
Expand All @@ -22,30 +22,30 @@ RUN \
# Prepare install of nodeJS
&& curl 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key' | apt-key add - \
&& echo "deb https://deb.nodesource.com/node_${NODE_VERSION}.x $(lsb_release -cs) main" > /etc/apt/sources.list.d/nodesource.list \
#Install and config PHP 8.1
#Install and config PHP 8.2
&& curl -J -L -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg \
&& echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
php8.1-bcmath \
php8.1-cli \
php8.1-curl \
php8.1-fpm \
php8.1-gd \
php8.1-intl \
php8.1-mbstring \
php8.1-opcache \
php8.1-gettext \
php8.1-iconv \
php8.1-mysql \
php8.1-sockets \
php8.1-tidy \
php8.1-zip \
php8.1-redis \
php8.1-imagick \
php8.1-xdebug \
php8.1-xml \
php8.1 \
php8.2-bcmath \
php8.2-cli \
php8.2-curl \
php8.2-fpm \
php8.2-gd \
php8.2-intl \
php8.2-mbstring \
php8.2-opcache \
php8.2-gettext \
php8.2-iconv \
php8.2-mysql \
php8.2-sockets \
php8.2-tidy \
php8.2-zip \
php8.2-redis \
php8.2-imagick \
php8.2-xdebug \
php8.2-xml \
php8.2 \
imagemagick \
nodejs \
# remove unecessary packages
Expand All @@ -56,7 +56,8 @@ RUN \
# Copy Wallabag sources
WORKDIR /var/www
# hadolint ignore=SC2086
RUN curl -L -o wb_latest.tgz https://static.wallabag.org/releases/wallabag-release-${WALLABAG_VERSION}.tar.gz && tar xvf wb_latest.tgz \
RUN curl -L -o wb_latest.tgz https://github.com/wallabag/wallabag/releases/download/${WALLABAG_VERSION}/wallabag-${WALLABAG_VERSION}.tar.gz \
&& tar xvf wb_latest.tgz \
&& rm -f wb_latest.tgz && mv wallabag-${WALLABAG_VERSION} wallabag

# S6-Overlay
Expand Down Expand Up @@ -94,4 +95,4 @@ LABEL \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}

ENTRYPOINT ["/init"]
ENTRYPOINT ["/init"]
8 changes: 4 additions & 4 deletions wallabag/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
build_from:
armv7: "ghcr.io/hassio-addons/debian-base/armv7:5.3.1"
aarch64: "ghcr.io/hassio-addons/debian-base/aarch64:5.3.1"
amd64: "ghcr.io/hassio-addons/debian-base/amd64:5.3.1"
i386: "ghcr.io/hassio-addons/debian-base/i386:5.3.1"
armv7: "ghcr.io/hassio-addons/debian-base/armv7:7.1.0"
aarch64: "ghcr.io/hassio-addons/debian-base/aarch64:7.1.0"
amd64: "ghcr.io/hassio-addons/debian-base/amd64:7.1.0"
i386: "ghcr.io/hassio-addons/debian-base/i386:7.1.0"
4 changes: 4 additions & 0 deletions wallabag/rootfs/etc/cont-init.d/wallabag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ bashio::log.info "Runnning Wallabag install script"

php /var/www/wallabag/bin/console wallabag:install --env=prod --no-interaction

bashio::log.info "checking if version updates are required"
php /var/www/wallabag/bin/console doctrine:migrations:migrate --no-interaction --env=prod
php /var/www/wallabag/bin/console cache:clear --env=prod

bashio::log.info "correcting owner settings on app folders"
chown -R www-data:www-data /var/www/wallabag/app
chown -R www-data:www-data /var/www/wallabag/var
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
; Pid file
; Note: the default prefix is /var
; Default Value: none
; pid = /run/php/php8.1-fpm.pid
; pid = /run/php/php8.2-fpm.pid

; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
Expand Down Expand Up @@ -122,4 +122,4 @@ error_log = /proc/self/fd/1
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - /usr otherwise
include=/etc/php/8.1/fpm/pool.d/*.conf
include=/etc/php/8.2/fpm/pool.d/*.conf
14 changes: 9 additions & 5 deletions wallabag/rootfs/etc/services.d/nginx/finish
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/usr/bin/execlineb -S0
#!/usr/bin/env bashio
# ==============================================================================
# Home Assistant Community Add-on: Firefly III
# Home Assistant Add-on: Wallabag
# Take down the S6 supervision tree when Nginx fails
# s6-overlay docs: https://github.com/just-containers/s6-overlay
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }

s6-svscanctl -t /var/run/s6/services
if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt add-on"
exec /run/s6/basedir/bin/halt
fi

bashio::log.info "Service restart after closing"
14 changes: 9 additions & 5 deletions wallabag/rootfs/etc/services.d/php-fpm/finish
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/usr/bin/execlineb -S0
#!/usr/bin/env bashio
# ==============================================================================
# Home Assistant Community Add-on: Firefly III
# Home Assistant Add-on: Wallabag
# Take down the S6 supervision tree when PHP FPM fails
# s6-overlay docs: https://github.com/just-containers/s6-overlay
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }

s6-svscanctl -t /var/run/s6/services
if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt add-on"
exec /run/s6/basedir/bin/halt
fi

bashio::log.info "Service restart after closing"
2 changes: 1 addition & 1 deletion wallabag/rootfs/etc/services.d/php-fpm/run
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ fi

bashio::log.info "Starting PHP-FPM..."

exec php-fpm8.1 --nodaemonize
exec php-fpm8.2 --nodaemonize
8 changes: 1 addition & 7 deletions wallabag/rootfs/opt/wallabag/config/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ parameters:
domain_name: ${DOMAIN_NAME}
server_name: ${SERVER_NAME}

mailer_transport: smtp
mailer_user: null
mailer_password: null
mailer_host: 127.0.0.1
mailer_port: 25
mailer_encryption: null
mailer_auth_mode: null
mailer_dsn: smtp://127.0.0.1

locale: ${APP_LOCALE}

Expand Down

0 comments on commit 1b2e311

Please sign in to comment.