Skip to content

Instantly share code, notes, and snippets.

@gdamjan
Last active December 15, 2022 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdamjan/7b73125ade203b2cc4535cf6fda9c452 to your computer and use it in GitHub Desktop.
Save gdamjan/7b73125ade203b2cc4535cf6fda9c452 to your computer and use it in GitHub Desktop.
update element-web on spodeli.org
# 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;
}
}
#! /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"
@gdamjan
Copy link
Author

gdamjan commented Feb 19, 2020

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#.*/##'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment