summaryrefslogtreecommitdiff
path: root/usr/local
diff options
context:
space:
mode:
authorMiquel Lionel <lionel@les-miquelots.net>2021-05-22 17:36:01 +0100
committerMiquel Lionel <lionel@les-miquelots.net>2021-05-22 17:36:01 +0100
commite0e590be90f1fba904ee0de997a5cf7f72c5a29c (patch)
tree2a34bf4857ccfb8eddaeb056343063a42dea16f1 /usr/local
downloadxmpp_guide_files-e0e590be90f1fba904ee0de997a5cf7f72c5a29c.tar.gz
xmpp_guide_files-e0e590be90f1fba904ee0de997a5cf7f72c5a29c.zip
let's start with the template files
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/sbin/maj_prosodymods.sh10
-rwxr-xr-xusr/local/sbin/update_conversejs.sh36
2 files changed, 46 insertions, 0 deletions
diff --git a/usr/local/sbin/maj_prosodymods.sh b/usr/local/sbin/maj_prosodymods.sh
new file mode 100755
index 0000000..c7ffaed
--- /dev/null
+++ b/usr/local/sbin/maj_prosodymods.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+MODDIR="/usr/lib/prosody/modules/"
+
+if test -d $MODDIR; then
+ cd $MODDIR
+ hg pull --update
+else
+ mkdir -p /usr/lib/prosody
+ hg clone https://hg.prosody.im/prosody-modules/ $MODDIR
+fi
diff --git a/usr/local/sbin/update_conversejs.sh b/usr/local/sbin/update_conversejs.sh
new file mode 100755
index 0000000..971d980
--- /dev/null
+++ b/usr/local/sbin/update_conversejs.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+TEMPDIR="$(mktemp -d)"
+LOG=/var/log/update_conversejs.log
+WWWDIR='/var/www/chat.exemple.fr'
+WWWUSER='www-data' # this value will differ on the
+ # distro you're using: it'll be 'http' on
+ # Arch Linux nginx for example.
+
+mkdir -p $WWWDIR/dist
+cd $TEMPDIR
+printf "\n\n$(date) - INFO - Starting updating conversejs..." | tee -a $LOG
+CURL_ERR=$(curl -s \ # let's grab latest release tarball of converse.js
+ https://api.github.com/repos/conversejs/converse.js/releases/latest | \
+ grep -o "https://.*\.tgz" | \
+ grep converse\.js- | \
+ xargs curl -fsOJL) || \
+ (printf "\n$(date) - ERR - Updating conversejs failed." | tee -a $LOG && exit)
+
+# we download the OMEMO library to use it in converse
+if test -e "$WWWDIR/dist/libsignal-protocol.min.js"; then
+ printf "\n$(date) - TOK - Libsignal already installed, skipping." | tee -a $LOG
+else
+ curl -fsOJL \
+ https://cdn.conversejs.org/3rdparty/libsignal-protocol.min.js || \
+ (printf "\n$(date) - ERR - Updating libsignal-protocol-javascript failed." | \
+ tee -a $LOG)
+ cp libsignal*.js $WWWDIR/dist/
+fi
+
+tar xzf *.tgz
+cp -rf package/dist $WWWDIR/
+sed "s/fullscreen\.html/index\.html/g" package/manifest.json > $WWWDIR/manifest.json
+chown $WWWUSER:$WWWUSER -R $WWWDIR/
+chmod 755 -R $WWWDIR/
+rm -rf $TEMPDIR
+printf "\n$(date) - TOK - Done." | tee -a $LOG