Last active
December 15, 2022 14:20
-
-
Save gdamjan/7b73125ade203b2cc4535cf6fda9c452 to your computer and use it in GitHub Desktop.
update element-web on spodeli.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nginx snippet | |
server { | |
server_name spodeli.org; # managed by Certbot | |
root /srv/spodeli.org; | |
location /riot/config.spodeli.org.json { | |
alias /srv/spodeli.org/config.spodeli.org.json; | |
} | |
location /riot { | |
alias /srv/spodeli.org/riot-latest; | |
} | |
location /.well-known/matrix { | |
alias /srv/spodeli.org/.well-known/matrix; | |
} | |
location /_matrix { | |
proxy_pass http://localhost:8008; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $host; | |
client_max_body_size 50M; | |
proxy_http_version 1.1; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -eE | |
set -o pipefail | |
[ -z "$1" ] && { echo "Usage: $0 <version>" ; exit 1; } | |
set -u | |
VER=$1 | |
URL=https://github.com/vector-im/element-web/releases/download/$VER/element-$VER.tar.gz | |
DESTDIR=/srv/spodeli.org | |
SYMLINK=$DESTDIR/riot-latest | |
ELEMENT_DIR=$DESTDIR/element-$VER | |
ELEMENT_DIR_PREVIOUS=`readlink $SYMLINK` | |
mkdir $ELEMENT_DIR | |
curl -L "$URL" | tar xvzf - -C $ELEMENT_DIR --strip-components=1 | |
ln -sfT $ELEMENT_DIR $SYMLINK | |
rm -rf "$ELEMENT_DIR_PREVIOUS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
update-riot-web.sh v1.11.16
will get it from github, extract it to $DESTDIR,symlink it to riot-latest, and then remove the directory with the previous version.
To get the latest release, you can use:
curl -s https://github.com/vector-im/element-web/releases/latest -w '%{redirect_url}' | sed 's#.*/##'