diff --git a/README.md b/README.md index 130a38d..13354af 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Install the package and PyJWT into `FUNKWHALE_PLUGINS_PATH` (default `/srv/funkw ```sh pip install --target /srv/funkwhale/plugins \ - https://gitea.eom.dev/DevOps/funkwhale-oidc/archive/v0.2.0.tar.gz + https://gitea.eom.dev/DevOps/funkwhale-oidc/archive/v0.2.1.tar.gz ``` In containers, run this as an init step into a shared volume. `tests/compose.yaml` shows how. diff --git a/funkwhale_oidc/__init__.py b/funkwhale_oidc/__init__.py index 693162a..b1ee809 100644 --- a/funkwhale_oidc/__init__.py +++ b/funkwhale_oidc/__init__.py @@ -1,4 +1,4 @@ # SPDX-License-Identifier: AGPL-3.0-or-later """OpenID Connect login for Funkwhale, as a Funkwhale plugin.""" -__version__ = "0.2.0" +__version__ = "0.2.1" diff --git a/funkwhale_oidc/front/inject.sh b/funkwhale_oidc/front/inject.sh index 593ee5f..6f963c7 100755 --- a/funkwhale_oidc/front/inject.sh +++ b/funkwhale_oidc/front/inject.sh @@ -23,3 +23,12 @@ if ! grep -q 'location /accounts/' "$conf"; then grep -q 'location /accounts/' "$conf" || { echo "funkwhale-oidc: could not add /accounts/ to $conf" >&2; exit 1; } echo "funkwhale-oidc: /accounts/ proxied to the API" fi + +# The web app's service worker precaches index.html by the revision in its +# manifest; without a new revision, returning visitors keep the old page. +sw=/usr/share/nginx/html/serviceWorker.js +if [ -f "$sw" ]; then + rev=$(md5sum "$index" | cut -c1-32) + sed -i "s|\"revision\":\"[0-9a-f]*\",\"url\":\"index.html\"|\"revision\":\"$rev\",\"url\":\"index.html\"|" "$sw" + grep -q "\"revision\":\"$rev\",\"url\":\"index.html\"" "$sw" && echo "funkwhale-oidc: service worker revision for index.html set to $rev" +fi