From bdcc677d10485b6e245a21e0e1ad4f2596ca3c7a Mon Sep 17 00:00:00 2001 From: Milan Ihl Date: Wed, 15 May 2024 12:04:42 +0200 Subject: [PATCH 1/5] add synapse update script (without worker support) even tho it's not complicated and there are multiple correct ways, i think it's better if we have one common update strategy to avoid conflicts or other errors in the future. this shall be expanded for worker support in the future. --- updates/synapse.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 updates/synapse.sh diff --git a/updates/synapse.sh b/updates/synapse.sh new file mode 100644 index 0000000..16daca0 --- /dev/null +++ b/updates/synapse.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +activate="$HOME/synapse/env/bin/activate" + +if [ ! -f $activate ]; +then + echo ">>> FATAL: Synapse env not detected. Stopping. Please adjust the script." + exit 1 +fi + +source $activate + +pip install --upgrade 'matrix-synapse[postgres]' pip + +systemctl --user restart synapse + +sleep 2 +echo +echo ">>> Synapse has been restarted and" +echo ">>> is now reporting this version:" +curl -s localhost:8008/_synapse/admin/v1/server_version|jq +echo + +systemctl --user status synapse \ No newline at end of file From 07b6e24576883f1135ae0ce514a2f1a70a7db4a0 Mon Sep 17 00:00:00 2001 From: Milan Ihl Date: Wed, 15 May 2024 13:21:46 +0200 Subject: [PATCH 2/5] reliability adjustments for updates/synapse.sh --- updates/synapse.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/updates/synapse.sh b/updates/synapse.sh index 16daca0..3a0e4ee 100644 --- a/updates/synapse.sh +++ b/updates/synapse.sh @@ -1,7 +1,9 @@ #!/bin/bash set -e +export XDG_RUNTIME_DIR=/run/user/$UID activate="$HOME/synapse/env/bin/activate" +domain=`ls $HOME/doms/` if [ ! -f $activate ]; then @@ -19,7 +21,7 @@ sleep 2 echo echo ">>> Synapse has been restarted and" echo ">>> is now reporting this version:" -curl -s localhost:8008/_synapse/admin/v1/server_version|jq +curl -s "https://$domain/_synapse/admin/v1/server_version"|jq echo systemctl --user status synapse \ No newline at end of file From 319e05a3c262af9f82f33fdaa9dd3d1fbebd26e3 Mon Sep 17 00:00:00 2001 From: Milan Ihl Date: Thu, 23 May 2024 14:33:15 +0200 Subject: [PATCH 3/5] add updates/sliding-sync.sh --- updates/sliding-sync.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 updates/sliding-sync.sh diff --git a/updates/sliding-sync.sh b/updates/sliding-sync.sh new file mode 100644 index 0000000..5959282 --- /dev/null +++ b/updates/sliding-sync.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e +export XDG_RUNTIME_DIR=/run/user/$UID + +release=`curl -L https://api.github.com/repos/matrix-org/sliding-sync/releases/latest -s | jq -r '.tag_name'` + +echo ">>> stopping to avoid binary being busy" +echo +systemctl stop --user syncv3 + +wget --show-progress -q -O $HOME/bin/syncv3 https://github.com/matrix-org/sliding-sync/releases/download/$release/syncv3_linux_amd64 + +echo +echo ">>> starting...." +systemctl start --user syncv3 +sleep 2 +systemctl status --user syncv3 \ No newline at end of file From 791bea4d121ea395dacc1986c18258ebc1eaf036 Mon Sep 17 00:00:00 2001 From: Milan Ihl Date: Thu, 18 Jul 2024 16:38:49 +0200 Subject: [PATCH 4/5] updates/nextcloud.sh: bump php version --- updates/nextcloud.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updates/nextcloud.sh b/updates/nextcloud.sh index 2e93ea8..87272f5 100644 --- a/updates/nextcloud.sh +++ b/updates/nextcloud.sh @@ -4,7 +4,7 @@ set -e # +x does not apply # use correct order – eg: sudo -u www-data php=php8.2 ... if [ -z ${php} ]; then - php="php8.1" + php="php8.2" fi [ -f cron.log ] && rm -v cron.log && echo "logfiles should not be here and upset the updater. consider the data directory." From 070d7a07889e056ef3e44bba216eaa69ff1dc9d1 Mon Sep 17 00:00:00 2001 From: Milan Ihl Date: Mon, 21 Oct 2024 14:54:33 +0200 Subject: [PATCH 5/5] nextcloud rollback: add missing php variable --- rollback/nextcloud/config.env | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rollback/nextcloud/config.env b/rollback/nextcloud/config.env index fa9bcaf..343f302 100644 --- a/rollback/nextcloud/config.env +++ b/rollback/nextcloud/config.env @@ -2,4 +2,7 @@ pac=xyz00 user= db=${pac}_${user} dbuser=$db -dump=$HOME/var/db/nextcloud.dump \ No newline at end of file +dump=$HOME/var/db/nextcloud.dump +# optional version control, if default or configured one is too old +# do not comment this +php=php \ No newline at end of file