From beb7aa882fa53b848e3f8302b659e5d8c9ac6e04 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 4 Mar 2022 20:50:46 +0100 Subject: [PATCH] update authelia element-web --- README.MD | 2 +- ressources/authelia/authelia | 34 +++++++++++------- ressources/element-web/element-web | 36 +++++++++++-------- .../doc/element-web/apache2-element-web.conf | 4 +-- .../usr/{lib => share}/element-web/.gitkeep | 0 5 files changed, 46 insertions(+), 30 deletions(-) rename ressources/element-web/rootfs/usr/{lib => share}/element-web/.gitkeep (100%) diff --git a/README.MD b/README.MD index 8a817f5..0d17c0e 100644 --- a/README.MD +++ b/README.MD @@ -23,7 +23,7 @@ debmaker_chroot cache/joplin ### packages available in shared repository - - [adguardhome](#adguardhome) ([site](https://adguard.com/fr/adguard-home/overview.html)) + - [adguardhome](#adguardhome) ([site](https://adguard.com/fr/adguard-home/overview.html)) ([src](https://github.com/AdguardTeam/AdguardHome)) - [authelia](#authelia) ([site](https://www.authelia.com/)) - [element-web](#element-web) ([site](https://element.io/)) - [gotify](#gotify) ([site](https://gotify.net/)) diff --git a/ressources/authelia/authelia b/ressources/authelia/authelia index 7fe6d7f..ea79119 100755 --- a/ressources/authelia/authelia +++ b/ressources/authelia/authelia @@ -1,28 +1,38 @@ #!/bin/bash +VERSION=4.34.2 +RELEASE=1 + [ -e ./lib/function.sh ] && source ./lib/function.sh APP=authelia -VERSION=4.33.2 -GIT_VERSION=v$VERSION -DEB_VERSION=$VERSION-4 +GIT_VERSION=v${VERSION} +DEB_VERSION=${VERSION}-${RELEASE} DEBIAN_VERSION_CODENAME=bullseye IMAGE_SIZE=4 STEP="envinit prebuild build makedeb" envinit() { - apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot - wget -qO - https://deb.nodesource.com/setup_16.x | bash - apt-get update - apt-get install -y nodejs - wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz - wget -qO - https://get.pnpm.io/install.sh | sh - + if [ $(dpkg -l | grep -e 'ii nodejs ' | wc -l) -eq 1 ]; + then + apt-get update + apt-get dist-upgrade -y + else + apt install -y --no-install-recommends git wget ca-certificates dpkg fakeroot + wget -qO - https://deb.nodesource.com/setup_16.x | bash + apt-get update + apt-get install -y nodejs + wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz + wget -qO - https://get.pnpm.io/install.sh | sh - + fi } prebuild(){ - GIT_VERSION=$1 - git clone --depth 1 -b ${GIT_VERSION} https://github.com/authelia/authelia.git /tmp/authelia + [ -e /tmp/git ] && rm -fr /tmp/git + [ -e /tmp/element-web ] || mkdir /tmp/element-web + git clone --depth 1 -b ${GIT_VERSION} https://github.com/authelia/authelia.git /tmp/git + cp -r /tmp/git/. /tmp/authelia } build() { @@ -32,8 +42,6 @@ build() { } makedeb(){ - GIT_VERSION=$1 - DEB_VERSION=$2 PATH_DEB=/tmp/src/rootfs cp /tmp/authelia/dist/authelia ${PATH_DEB}/usr/bin/authelia diff --git a/ressources/element-web/element-web b/ressources/element-web/element-web index dcd2fae..9c82884 100755 --- a/ressources/element-web/element-web +++ b/ressources/element-web/element-web @@ -1,28 +1,38 @@ #!/bin/bash +VERSION=1.10.6 +RELEASE=3 + [ -e ./lib/function.sh ] && source ./lib/function.sh APP=element-web -VERSION=1.10.6 -GIT_VERSION=v$VERSION -DEB_VERSION=$VERSION-1 +GIT_VERSION=v${VERSION} +DEB_VERSION=${VERSION}-${RELEASE} DEBIAN_VERSION_CODENAME=bullseye IMAGE_SIZE=4 STEP="envinit prebuild build makedeb" envinit() { - apt install -y --no-install-recommends build-essential git python wget ca-certificates dpkg fakeroot - wget -qO - https://deb.nodesource.com/setup_16.x | bash - wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg - echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list - apt-get update - apt-get install -y yarn nodejs + if [ $(dpkg -l | grep -e 'ii nodejs ' | wc -l) -eq 1 ]; + then + apt-get update + apt-get dist-upgrade -y + else + apt install -y --no-install-recommends git wget ca-certificates dpkg fakeroot + wget -qO - https://deb.nodesource.com/setup_16.x | bash + wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg + echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list + apt-get update + apt-get install -y yarn nodejs + fi } prebuild(){ - GIT_VERSION=$1 - git clone --depth 1 -b ${GIT_VERSION} https://github.com/vector-im/element-web.git /tmp/element-web + [ -e /tmp/git ] && rm -fr /tmp/git + [ -e /tmp/element-web ] || mkdir /tmp/element-web + git clone --depth 1 -b ${GIT_VERSION} https://github.com/vector-im/element-web.git /tmp/git + cp -r /tmp/git/. /tmp/element-web } build() { @@ -32,11 +42,9 @@ build() { } makedeb(){ - GIT_VERSION=$1 - DEB_VERSION=$2 PATH_DEB=/tmp/src/rootfs - tar -zxf /tmp/element-web/dist/element-${GIT_VERSION}-dirty.tar.gz --strip-components=1 -C ${PATH_DEB}/usr/lib/element-web/ + tar -zxf /tmp/element-web/dist/element-${GIT_VERSION}-dirty.tar.gz --strip-components=1 -C ${PATH_DEB}/usr/share/element-web/ cp /tmp/element-web/config.sample.json ${PATH_DEB}/etc/element-web/config.json sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist diff --git a/ressources/element-web/rootfs/usr/share/doc/element-web/apache2-element-web.conf b/ressources/element-web/rootfs/usr/share/doc/element-web/apache2-element-web.conf index 18b1cfa..ae5d9ed 100644 --- a/ressources/element-web/rootfs/usr/share/doc/element-web/apache2-element-web.conf +++ b/ressources/element-web/rootfs/usr/share/doc/element-web/apache2-element-web.conf @@ -3,7 +3,7 @@ ServerAlias second.domaine.com ServerAlias third.domaine.com - DocumentRoot /usr/lib/element-web + DocumentRoot /usr/share/element-web Protocols h2c http/1.1 #default config ie first and third domaine @@ -12,7 +12,7 @@ #config for second domaine Alias /config.second.domaine.com.json /etc/element-web/config.second.domaine.com.json - + Options none AllowOverride None Require all granted diff --git a/ressources/element-web/rootfs/usr/lib/element-web/.gitkeep b/ressources/element-web/rootfs/usr/share/element-web/.gitkeep similarity index 100% rename from ressources/element-web/rootfs/usr/lib/element-web/.gitkeep rename to ressources/element-web/rootfs/usr/share/element-web/.gitkeep