-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
212 lines (190 loc) · 6.64 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#!/bin/bash
MATRIX_PATH=/opt/matrix
MATRIX_VERSION=`cat $MATRIX_PATH/version`
NODEJS_VERSION=16.19.0
NPM=/root/.nvm/versions/node/v$NODEJS_VERSION/bin/npm
case $2 in
install)
clean="rm -rf python/ lib/ lib64 bin/ local/"
install="python -m venv ."
;;
*)
clean=""
install=""
;;
esac
case $1 in
deploy)
echo Update Server Deploy
cd $MATRIX_PATH
chmod 777 -R $MATRIX_PATH/.git/
git fetch origin
git reset --hard origin/main
chmod 777 *.sh -R
cd $MATRIX_PATH/www/about
git reset --hard origin/master
git pull origin master
systemctl reload nginx.service
chmod 777 $MATRIX_PATH/services/ -R
systemctl restart matrix_livekit.service
systemctl restart matrix_livekit_auth.service
#systemctl restart matrix_syncv3.service
;;
synapse)
echo Update Matrix Synapse
cd $MATRIX_PATH
$clean; \
$install; \
source bin/activate; \
pip install --upgrade pip; \
pip install --upgrade setuptools; \
pip install --upgrade matrix-synapse; \
pip install --upgrade git+https://git.3dns.eu/3DNS/matrix-synapse-rest-password-provider; \
pip install --upgrade matrix-http-rendezvous-synapse; \
pip install --upgrade matrix-synapse[oidc]; \
pip install --upgrade Jinja2; \
pip install --upgrade psycopg2-binary; \
pip install --upgrade hiredis; \
pip install --upgrade 'lxml>=3.5.0'; \
pip install --upgrade txredisapi; \
pip install --upgrade treq; \
pip install --upgrade twisted
echo restart Services
/opt/matrix/cli.sh restart
;;
sydent)
echo "Update Identify Service Sydent"
cd $MATRIX_PATH/services/sydent/
$clean; $install
source bin/activate;
pip install --upgrade matrix-sydent
systemctl restart matrix_identity.service
;;
sygnal)
echo "Update Sygnal Push Gateway"
cd $MATRIX_PATH/services/sygnal/
$clean; $install; \
source $MATRIX_PATH/services/sygnal/bin/activate; \
pip install --upgrade pip; \
pip install --upgrade setuptools; \
pip install --upgrade opentracing; \
pip install --upgrade ./ --use-pep517
systemctl restart matrix_sygnal.service
;;
webhooks)
echo Update Webhook Appservice
cd $MATRIX_PATH/appservices/webhooks
rm -rf node_modules
sudo -u matrix git fetch; git reset --hard origin/master; /usr/bin/npm install sqlite3; /usr/bin/npm install db-migrate-sqlite3 --unsafe-perm=true --allow-root; /usr/bin/npm install
systemctl restart matrix_webhooks.service
;;
bot)
echo Update Bot
cd $MATRIX_PATH/bots/own
$clean; $install; \
source bin/activate; \
pip install --upgrade pip; \
pip install --upgrade setuptools; \
pip install --upgrade requests; \
pip install --upgrade pythonping; \
pip install --upgrade https://git.3dns.eu/Matrix/simplematrixbotlib/archive/master.tar.gz
systemctl restart matrix_bot.service
;;
maubot)
echo Update Mautrix Maubot
cd $MATRIX_PATH/bots/maubot
$clean; $install; \
source bin/activate; \
pip install --upgrade pip; \
pip install --upgrade setuptools; \
pip install --upgrade feedparser; \
pip install --upgrade psycopg2-binary; \
cd $MATRIX_PATH/bots/maubot/src/; git pull origin master; pip install --upgrade .
cd $MATRIX_PATH/bots/maubot/src/maubot/management/frontend; yarn; yarn build
systemctl restart matrix_maubot.service
;;
whatsapp)
echo Update WhatsApp Appservice
cd $MATRIX_PATH/appservices/whatsapp/
git fetch origin
git reset --hard origin/master
go clean
go get
go build
systemctl restart matrix_whatsapp.service
;;
skype)
echo Update Skype Appservice
cd $MATRIX_PATH/appservices/skype/
git fetch origin
git reset --hard origin/master
./build.sh
systemctl restart matrix_skype restart
;;
discord)
echo Update Discord Appservice
cd $MATRIX_PATH/appservices/discord/
git fetch origin
git reset --hard origin/main
go clean
go get
go build
systemctl restart matrix_discord.service
;;
facebook)
echo Update Facebook Appservice
cd $MATRIX_PATH/appservices/facebook/
$clean; $install; source bin/activate; pip install --upgrade pip; pip install --upgrade setuptools; pip install --upgrade ffmpeg; pip install --upgrade https://github.com/mautrix/facebook/tarball/master#egg=mautrix-facebook[all]
systemctl restart matrix_facebook.service
;;
telegram)
echo Update Telegram Appservice
cd $MATRIX_PATH/appservices/telegram/
$clean; $install; source bin/activate; pip install --upgrade pip; pip install --upgrade setuptools; pip install --upgrade ffmpeg; pip install --upgrade https://github.com/mautrix/telegram/tarball/master#egg=mautrix-telegram[all]
systemctl restart matrix_telegram.service
;;
instagram)
echo Update Instagram Appservice
cd $MATRIX_PATH/appservices/instagram/
$clean; $install; source bin/activate; pip install --upgrade pip; pip install --upgrade setuptools; pip install --upgrade ffmpeg; pip install --upgrade https://github.com/mautrix/instagram/tarball/master#egg=mautrix-instagram[all]
systemctl restart matrix_instagram.service
;;
irc)
echo Update IRC Appservice
cd $MATRIX_PATH/appservices/irc/
rm -rf node_modules
git fetch origin; git reset --hard origin/develop; /root/.nvm/versions/node/v18.16.0/bin/npm install; /root/.nvm/versions/node/v18.16.0/bin/npm run build
systemctl restart matrix_irc.service
;;
steam)
echo Update Steam Appservice
cd $MATRIX_PATH/appservices/steam/
nvm use v12.22.12
rm -rf node_modules; git fetch origin; git reset --hard origin/master; /root/.nvm/versions/node/v12.22.12/bin/npm install; /root/.nvm/versions/node/v12.22.12/bin/npm run build
systemctl restart matrix_steam.service
;;
signal)
echo Update Signal Appservice
cd $MATRIX_PATH/appservices/signal/
$clean; $install
source bin/activate; pip install --upgrade pip; pip install --upgrade setuptools; pip install --upgrade ffmpeg; pip install --upgrade https://github.com/mautrix/signal/tarball/master#egg=mautrix-signal[all]
systemctl restart matrix_signal.service
;;
linkedin)
echo "Update linkedin Appservice"
cd $MATRIX_PATH/appservices/linkedin/
$clean; $install
source bin/activate; pip install --upgrade setuptools; pip install --upgrade linkedin-matrix
systemctl restart matrix_linkedin.service
;;
chatgpt)
echo Update ChatGPT Bot
cd $MATRIX_PATH/bots/chatgpt/
rm -rf node_modules
git fetch origin; git reset --hard origin/main; yarn install; yarn build
systemctl restart matrix_chatgpt.service
;;
*)
echo "Command is missing"
;;
esac