Obsolute_Server_setup_memo_for_Binaurl_meet
2024.3.19
google Auth2
credentials.json should not be save in Github.
Login File
Login File should not be save in Github
2022.01.07
Todo
JVB1-2の切り替え
JVB用インストールスクリプトは
jvb4はスクリプトの修正を兼ねてインストールしていたので、何かしらのBugがでるかもしれません。
jvb5は何事にもなくスクリプトを走らせたので。
2021.12.23
code: ufwの設定
SSH ALLOW Anywhere
80/tcp ALLOW Anywhere
443 ALLOW Anywhere
8801 ALLOW Anywhere
8080/tcp ALLOW 131.112.248.48/28
4096 ALLOW 131.112.248.48/28
81/tcp ALLOW Anywhere
SSH (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
8801 (v6) ALLOW Anywhere (v6)
81/tcp (v6) ALLOW Anywhere (v6)
131.112.248.52: titech.binaural.me
131.112.248.55: jvb1.titech.binaural.me
131.112.248.56: jvb2.titech.binaural.me
131.112.248.57: jvb3.titech.binaural.me
58 jvb4
59 jvb5
60 jvb6
61 jvb7
62 jvb8
...63 jvb9で終わり
52 --> main
53 --> relay
54 --> app
55 --> jvb1
...
58 --> jvb4
code:bash
# hostname of main server
# ドメイン名の修正が必要かも
BM_DOMAIN=titech.binaural.me
...
function getHostnameNew() {
hostname=hostname -f
ipaddr=host -ta ${hostname}
}
function getHostname() {
ipaddr=
for i in {1..20} ; do
hostname=jvb${i}.${BM_DOMAIN}
ipaddr=host -ta ${hostname}
ipaddr=${ipaddr##* }
# AWSではないので、修正が必要と思います
if [ "$ipaddr" = "curl 169.254.169.254/latest/meta-data/public-ipv4" ]; then break; fi
ipaddr=
done
done
}
...
sudo apt-get -y update
#rm /var/lib/dpkg/lock-frontend #sudo apt-get -y install emacs sudo debconf-set-selections <<< "jitsi-videobridge2 jitsi-videobridge/jvb-hostname text ${BM_DOMAIN}"
# Versionを選ぶ必要あり
sudo apt-get -y install jitsi-videobridge2=2.1-570-gb802be83-1
sudo apt-get -y install nginx
sudo apt-get -y install unzip
#sudo apt-get -y install wget # AWSではないので、メタデータはないです。$ipaddrで行きます。
# SED="sed -e s/BM_THIS_HOST_PRIVATE_ADDRESS/curl 169.254.169.254/latest/meta-data/local-ipv4/g -e s/BM_THIS_HOST_PUBLIC_ADDRESS/curl 169.254.169.254/latest/meta-data/public-ipv4/g -e s/BM_THIS_HOST_NAME/$hostname/g"
SED="sed -e s/BM_THIS_HOST_PRIVATE_ADDRESS/$ipaddr/g -e s/BM_THIS_HOST_PUBLIC_ADDRESS/$ipaddr/g -e s/BM_THIS_HOST_NAME/$hostname/g"
Problems
Debian 11 do not have openjdk-8 in its standard repository.
Publickey for adding Jitsi repository
snap are not installed by default
sed script bug
2021.6.14
Timeouts for internet connection cut off
Client side
code:config.js
xmppPing: {
interval: 1000,
timeout: 5000
},
Firstly find the failure of communication (on the websocket to Prosody)
Server side
Ningx proxy_read_timeout
Websocket without communcation less than this period is cutted off. So, must be longer than xmppPing interval.
code: /etc/nginx/site-enabled/binaural-meet.conf
location = /xmpp-websocket {
tcp_nodelay on;
proxy_read_timeout 5; # timeout for proxy. This decide server side timeout.
}
Prosody
Setting up timeout
code: /etc/prosody/prosody.cfg.lua
network_settings = {
read_timeout = 5; -- TCP read timeout
}
"mod_smacks" cleanups up presence after cut off and wait the hibernation time.
websocket is needed and timeout must be short.
code: /etc/prosody/conf.d/binaural.me.cfg.lua
c2s_close_timeout = 5; -- timeout for websocket
smacks_max_unacked_stanzas = 0; --??
-- smacks_max_ack_delay = 30; -- No effect ?
smacks_hibernation_time = 1; -- timeout until removing presence.
smacks_max_hibernated_sessions = 10;
smacks_max_old_sessions = 10;
other settings
JVB
websocket is needed
Nginx
code: /etc/nginx/site-enabled/binaural.me.conf
location / {
root /usr/share/BinauralMeet;
# /XXxx is treatead as room name
}
# BOSH is not used
location = /http-bind {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Access-Control-Allow-Origin' '*';
}
# xmpp websockets
location = /xmpp-websocket {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
tcp_nodelay on;
add_header Access-Control-Allow-Origin '*';
}
# colibri (JVB) websockets for jvb0
location ~ ^/colibri-ws/default-id/(.*) {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
tcp_nodelay on;
}
location ~ ^/colibri-ws/jvb1/(.*) {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
tcp_nodelay on;
}
location ~ ^/colibri-ws/jvb2/(.*) {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
tcp_nodelay on;
}