BigBlueButton 2-3-dev html5client showing "404 not found" nginx error - bigbluebutton

Lately I have installed bbb 2.3 on my Ubuntu 18.04 VPN server. After a few road-bumps it installed and bbb-conf --status shows no error/warning.
<pre>
root#mydomain:~# bbb-conf --status
default
nginx —————————————————► [✔ - active]
freeswitch ————————————► [✔ - active]
redis-server ——————————► [✔ - active]
bbb-apps-akka —————————► [✔ - active]
bbb-fsesl-akka ————————► [✔ - active]
tomcat8 ———————————————► [✔ - active]
mongod ————————————————► [✔ - active]
bbb-html5 —————————————► [✔ - active]
bbb-webrtc-sfu ————————► [✔ - active]
kurento-media-server ——► [✔ - active]
etherpad ——————————————► [✔ - active]
bbb-web ———————————————► [✔ - active]
root#mydomain:~# bbb-conf --check
default
BigBlueButton Server 2.3.0-beta-3 (1975)
Kernel version: 4.15.0
Distribution: Ubuntu 18.04.5 LTS (64-bit)
Memory: 33554 MB
CPU cores: 8
/etc/bigbluebutton/bbb-web.properties (override for bbb-web)
/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties (bbb-web)
bigbluebutton.web.serverURL: https://bbb.mydomain.com
defaultGuestPolicy: ALWAYS_ACCEPT
svgImagesRequired: true
/etc/nginx/sites-available/bigbluebutton (nginx)
server_name: bbb.mydomain.com
port: 80, [::]:80
port: 443 ssl
/opt/freeswitch/etc/freeswitch/vars.xml (FreeSWITCH)
local_ip_v4: inet
external_rtp_ip: 1xx.xxx.xx.x7
external_sip_ip: 1xx.xxx.xx.x7
/opt/freeswitch/etc/freeswitch/sip_profiles/external.xml (FreeSWITCH)
ext-rtp-ip: $${external_rtp_ip}
ext-sip-ip: $${external_sip_ip}
ws-binding: 1xx.xxx.xx.x7:5066
wss-binding: 1xx.xxx.xx.x7:7443
/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml (record and playback)
playback_host: bbb.mydomain.com
playback_protocol: https
ffmpeg: 4.2.4-1ubuntu0.1bbb2~18.04
/etc/bigbluebutton/nginx/sip.nginx (sip.nginx)
proxy_pass: 1xx.xxx.xx.x7
protocol: http
/usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml (Kurento SFU)
kurento.ip: 1xx.xxx.xx.x7
kurento.url: ws://127.0.0.1:8888/kurento
kurento.sip_ip: 1xx.xxx.xx.x7
localIpAddress: inet
recordScreenSharing: true
recordWebcams: true
codec_video_main: VP8
codec_video_content: VP8
/usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml (HTML5 client)
build: 1588
kurentoUrl: wss://bbb.mydomain.com/bbb-webrtc-sfu
enableListenOnly: true
sipjsHackViaWs: true
/usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml (STUN Server)
stun: stun.l.google.com:19302
/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini (STUN Server)
stun: 172.217.212.127:19302
# Potential problems described below
# Warning: The API demos are installed and accessible from:
#
# https://bbb.mydomain.com
#
# and
#
# https://bbb.mydomain.com/demo/demo1.jsp
#
# These API demos allow anyone to access your server without authentication
# to create/manage meetings and recordings. They are for testing purposes only.
# If you are running a production system, remove them by running:
#
# apt-get purge bbb-demo
</pre>
Calling API is also returning SUCCESS response, but the html5client, when running in browser is showing 404 not found error.
API Response
HTML5CLIENT
I have tried troubleshooting from the bbb docs itself but nothing changed. What could be the possible reason?

check this file to see if BigBlueButtonURL is correct and https:
/var/lib/tomcat8/webapps/demo/bbb_api_conf.jsp
(tomcat7 in the case of tomcat8 doesn't exist)

Related

Home Assistant with MODBUS

Integrating a MODBUS installation with Home Assistant
MODBUS controller in the Gavazzi SH2WEB24
Home Assistant Configiguration.yaml:
modbus:
name: SmartHouse
type: tcp
host: <my_ip_addr>
port: 502
# SmartHouse Functions
switch:
platform: modbus
scan_interval: 10
registers:
- name: test1
hub: SmartHouse
slave: 1
register: 352
command_on: 1
command_off: 0
# SmartHouse Convert to light
light:
- platform: switch
name: Light_test1
entity_id: switch.test1
In the Home Assistant startup logs, we see this error:
Logger: pymodbus.client.sync Source:
/usr/local/lib/python3.8/site-packages/pymodbus/client/sync.py:214
First occurred: 10:40:02 (1 occurrences) Last logged: 10:40:02
Connection to (<my_ip_addr>, 502) failed: [Errno 111] Connection
refused
The modbus controller is working fine when used with the Gavazzi (windows) software.
In that software, only IP and port need to be specified, no other credentials.
So why would there be a "connection refused" error addressing it from Home Assistant?
Got it working.
Key is to enable modes in the SHTOOL software: in project settings / communication enable "Modbus TCP/IP"
Also the modes map must be created:
Modbus / Modbus map: click a bulb, expand it and click the 'v' icon to enable the mapping. You can as well do that with all entities to map all of them to modbus.
Note the "use address" field. This is important, and will be used as "register" value below (see **).
This list can be exported to ckv via "Save modbus as CSV"
Go to Home Assistant
Enable the "File Editor" if you didn't do this already.
See this link for more info
Now ediy the config file: Click "File Editor" in the left pane.
Look for /config/configuration.yaml
Then add these entries:
modbus:
name: SmartHouse
type: tcp
host: <your smart house IP>
port: 502
# SmartHouse Functions
switch:
platform: modbus
scan_interval: 10
registers:
- name: light1
hub: SmartHouse
slave: 1
register: <register as noted above **>
command_on: 1
command_off: 0
# SmartHouse Convert to light
light:
- platform: switch
name: light1
entity_id: light1
That's basically it. Now you can use this light e.g. in the dashboard.
Go the dashboard, edit it and add the light.
You can click it to toggle, and see the status as well.

Is it possible to use Traefik to proxy PostgreSQL over SSL?

Motivations
I am a running into an issue when trying to proxy PostgreSQL with Traefik over SSL using Let's Encrypt.
I did some research but it is not well documented and I would like to confirm my observations and leave a record to everyone who faces this situation.
Configuration
I use latest versions of PostgreSQL v12 and Traefik v2. I want to build a pure TCP flow from tcp://example.com:5432 -> tcp://postgresql:5432 over TLS using Let's Encrypt.
Traefik service is configured as follow:
version: "3.6"
services:
traefik:
image: traefik:latest
restart: unless-stopped
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./configuration/traefik.toml:/etc/traefik/traefik.toml:ro"
- "./configuration/dynamic_conf.toml:/etc/traefik/dynamic_conf.toml"
- "./letsencrypt/acme.json:/acme.json"
networks:
- backend
ports:
- "80:80"
- "443:443"
- "5432:5432"
networks:
backend:
external: true
With the static setup:
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.http]
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"
[entryPoints.websecure]
address = ":443"
[entryPoints.websecure.http]
[entryPoints.websecure.http.tls]
certresolver = "lets"
[entryPoints.postgres]
address = ":5432"
PostgreSQL service is configured as follow:
version: "3.6"
services:
postgresql:
image: postgres:latest
environment:
- POSTGRES_PASSWORD=secret
volumes:
- ./configuration/trial_config.conf:/etc/postgresql/postgresql.conf:ro
- ./configuration/trial_hba.conf:/etc/postgresql/pg_hba.conf:ro
- ./configuration/initdb:/docker-entrypoint-initdb.d
- postgresql-data:/var/lib/postgresql/data
networks:
- backend
#ports:
# - 5432:5432
labels:
- "traefik.enable=true"
- "traefik.docker.network=backend"
- "traefik.tcp.routers.postgres.entrypoints=postgres"
- "traefik.tcp.routers.postgres.rule=HostSNI(`example.com`)"
- "traefic.tcp.routers.postgres.tls=true"
- "traefik.tcp.routers.postgres.tls.certresolver=lets"
- "traefik.tcp.services.postgres.loadBalancer.server.port=5432"
networks:
backend:
external: true
volumes:
postgresql-data:
It seems my Traefik configuration is correct. Everything is OK in the logs and all sections in dashboard are flagged as Success (no Warnings, no Errors). So I am confident with the Traefik configuration above. The complete flow is about:
EntryPoint(':5432') -> HostSNI(`example.com`) -> TcpRouter(`postgres`) -> Service(`postgres#docker`)
But, it may have a limitation at PostgreSQL side.
Debug
The problem is that I cannot connect the PostgreSQL database. I always get a Timeout error.
I have checked PostgreSQL is listening properly (main cause of Timeout error):
# - Connection Settings -
listen_addresses = '*'
port = 5432
And I checked that I can connect PostgreSQL on the host (outside the container):
psql --host 172.19.0.4 -U postgres
Password for user postgres:
psql (12.2 (Ubuntu 12.2-4), server 12.3 (Debian 12.3-1.pgdg100+1))
Type "help" for help.
postgres=#
Thus I know PostgreSQL is listening outside its container, so Traefik should be able to bind the flow.
I also have checked external traefik can reach the server:
sudo tcpdump -i ens3 port 5432
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens3, link-type EN10MB (Ethernet), capture size 262144 bytes
09:02:37.878614 IP x.y-z-w.isp.com.61229 > example.com.postgresql: Flags [S], seq 1027429527, win 64240, options [mss 1452,nop,wscale 8,nop,nop,sackOK], length 0
09:02:37.879858 IP example.com.postgresql > x.y-z-w.isp.com.61229: Flags [S.], seq 3545496818, ack 1027429528, win 64240, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
09:02:37.922591 IP x.y-z-w.isp.com.61229 > example.com.postgresql: Flags [.], ack 1, win 516, length 0
09:02:37.922718 IP x.y-z-w.isp.com.61229 > example.com.postgresql: Flags [P.], seq 1:9, ack 1, win 516, length 8
09:02:37.922750 IP example.com.postgresql > x.y-z-w.isp.com.61229: Flags [.], ack 9, win 502, length 0
09:02:47.908808 IP x.y-z-w.isp.com.61229 > example.com.postgresql: Flags [F.], seq 9, ack 1, win 516, length 0
09:02:47.909578 IP example.com.postgresql > x.y-z-w.isp.com.61229: Flags [P.], seq 1:104, ack 10, win 502, length 103
09:02:47.909754 IP example.com.postgresql > x.y-z-w.isp.com.61229: Flags [F.], seq 104, ack 10, win 502, length 0
09:02:47.961826 IP x.y-z-w.isp.com.61229 > example.com.postgresql: Flags [R.], seq 10, ack 104, win 0, length 0
So, I am wondering why the connection cannot succeed. Something must be wrong between Traefik and PostgreSQL.
SNI incompatibility?
Even when I remove the TLS configuration, the problem is still there, so I don't expect the TLS to be the origin of this problem.
Then I searched and I found few posts relating similar issue:
Introducing SNI in TLS handshake for SSL connections
Traefik 2.0 TCP routing for multiple DBs;
As far as I understand it, the SSL protocol of PostgreSQL is a custom one and does not support SNI for now and might never support it. If it is correct, it will confirm that Traefik cannot proxy PostgreSQL for now and this is a limitation.
By writing this post I would like to confirm my observations and at the same time leave a visible record on Stack Overflow to anyone who faces the same problem and seek for help. My question is then: Is it possible to use Traefik to proxy PostgreSQL?
Update
Intersting observation, if using HostSNI('*') and Let's Encrypt:
labels:
- "traefik.enable=true"
- "traefik.docker.network=backend"
- "traefik.tcp.routers.postgres.entrypoints=postgres"
- "traefik.tcp.routers.postgres.rule=HostSNI(`*`)"
- "traefik.tcp.routers.postgres.tls=true"
- "traefik.tcp.routers.postgres.tls.certresolver=lets"
- "traefik.tcp.services.postgres.loadBalancer.server.port=5432"
Everything is flagged as success in Dashboard but of course Let's Encrypt cannot perform the DNS Challenge for wildcard *, it complaints in logs:
time="2020-08-12T10:25:22Z" level=error msg="Unable to obtain ACME certificate for domains \"*\": unable to generate a wildcard certificate in ACME provider for domain \"*\" : ACME needs a DNSChallenge" providerName=lets.acme routerName=postgres#docker rule="HostSNI(`*`)"
When I try the following configuration:
labels:
- "traefik.enable=true"
- "traefik.docker.network=backend"
- "traefik.tcp.routers.postgres.entrypoints=postgres"
- "traefik.tcp.routers.postgres.rule=HostSNI(`*`)"
- "traefik.tcp.routers.postgres.tls=true"
- "traefik.tcp.routers.postgres.tls.domains[0].main=example.com"
- "traefik.tcp.routers.postgres.tls.certresolver=lets"
- "traefik.tcp.services.postgres.loadBalancer.server.port=5432"
The error vanishes from logs and in both setups the dashboard seems ok but traffic is not routed to PostgreSQL (time out). Anyway, removing SSL from the configuration makes the flow complete (and unsecure):
labels:
- "traefik.enable=true"
- "traefik.docker.network=backend"
- "traefik.tcp.routers.postgres.entrypoints=postgres"
- "traefik.tcp.routers.postgres.rule=HostSNI(`*`)"
- "traefik.tcp.services.postgres.loadBalancer.server.port=5432"
Then it is possible to connect PostgreSQL database:
time="2020-08-12T10:30:52Z" level=debug msg="Handling connection from x.y.z.w:58389"
I'm using Traefik to proxy PostgreSQL, so answer is yes. But I'm not using TLS, because my setup is a bit different. First of all, if PostgreSQL doesn't support SNI, then I would suggest to try to modify labels, especially HostSNI rule to this:
"traefik.tcp.routers.postgres.rule=HostSNI(`*`)"
That says: ignore SNI and just take any name from specified entrypoint as valid.
SNI routing for postgres with STARTTLS has been added to Traefik in this PR. Now Treafik will listen to the initial bytes sent by postgres and if its going to initiate a TLS handshake (Note that postgres TLS requests are created as non-TLS first and then upgraded to TLS requests), Treafik will handle the handshake and then is able to receive the TLS headers from postgres, which contains the SNI information that it needs to route the request properly. This means that you can use HostSNI("example.com") along with tls to expose postgres databases under different subdomains.
As of writing this answer, I was able to get this working with the v3.0.0-beta2 image (Reference)

Traefik redirect frontend service doesn't work

I have problem with my traefik configuration ...
I would like frontend redirect regex for https services but in my docker-compose the following configuration seems not working (and not appear on trafik GUI).
In log (debug level) nothing interesting.
My labels :
- traefik.http.port=80
- traefik.http.frontend.entryPoints=http
- traefik.https.port=443
- traefik.https.frontend.entryPoints=https
- traefik.https.protocol=https
- traefik.backend.loadbalancer.stickiness=true
- traefik.frontend.rule=HostRegexp:{subdomain:[a-zA-Z0-9-_]+}.mydomain.com
- traefik.https.frontend.redirect.permanent=true
- traefik.https.frontend.redirect.regex=^https://(.*)/$$"
- traefik.https.frontend.redirect.remplacement=https://$${1}/myapp/

Running selenium tests on Virtual box guest

So i am trying to run Selenium tests written in Java through Eclipse on my guest machine.
My host machine is Windows 7 and I am running Windows 7 guest machine. I have set 2 network adapter NAT and Host only. I am farily new to the whole Selenium testing so I am still exploring all the stuff.
I already run hub and node on my guest with next commands:
java -jar selenium-2.39/selenium-server-standalone-2.39.0.jar -role hub -port 4444 -host 192.168.56.1
and node with:
java -jar selenium-2.39/selenium-server-standalone-2.39.0.jar -role node -port 5555 -hub http://10.0.2.15:4444/grid/register -browser "browserName=internet explorer,version=11,platform=WINDOWS" -host 192.168.56.1
from Eclipse i am trying to access hub on http://192.168.56.1:5555/wd/hub and http://192.168.56.1:4444/wd/hub but in both cases i get an error:
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'
System info: host: 'xxxxx', ip: '192.168.xxx.xxx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_31'
...
I do not know if I am using the correct IP addresses in both cases, if i go into my browser on guest machine i can access the console from hub
Thank you in advance.
OK.
So after long playing with the setting I finaly made this working. First thing is I disabled the Host-Only networking and left only NAT and I've set up a port 4444 forwarding from my host (127.0.0.1) to guest (10.0.2.15).
I've run hub with
java -jar selenium-2.39/selenium-server-standalone-2.39.0.jar -role hub
And node with
java -jar selenium-2.39/selenium-server-standalone-2.39.0.jar -role node -port 5555 -hub http://localhost:4444/grid/register -browser "browserName=iexplorer,version=11,platform=WINDOWS" -Dwebdriver.ie.driver=selenium-2.39/IEDriverServer.exe
Later on in Eclipse under Debug Configurations under Environment tab i set new property (notice: it is custom property in this case)
xx.xxxxxxxxxxxxxxx.selenium.properties.remoteUrl with value http://localhost:4444/wd/hub
After running tests I could reach my remote hub.

Nginx can't access a uWSGI unix socket on CentOS 7

I have configured uWSGI to serve my Django app on a unix socket, and Nginx as a proxy to this socket. The server is running CentOS 7. I think I have configured Nginx so that it has permission to read and write to uWSGI's socket, but I'm still getting a permission denied error. Why can't Nginx access the uWSGI socket on CentOS 7?
[uwsgi]
socket=/socket/uwsgi.sock
virtualenv=/home/site/virtsite/
chdir=/home/site/wsgitest/
module=wsgitest.wsgi:application
vhost = true
master=True
workers=8
chmod-socket=666
pidfile=/home/site/wsgitest/uwsgi-master.pid
max-requests=5000
chown-socket=nginx:nginx
uid = nginx
gid = nginx
listen.owner = nginx
listen.group = nginx
server {
listen 80;
location / {
uwsgi_pass unix:///home/site/wsgitest/uwsgi.sock;
include uwsgi_params;
}
}
uwsgi --ini uwsgi.ini (as root)
ls -l /home/site/wsgitest/uwsgi.sock
srwxrwxrwx. 1 nginx nginx 0 Oct 13 10:05 uwsgi.sock
2014/10/12 19:01:44 [crit] 19365#0: *10 connect() to unix:///socket/uwsgi.sock failed (13: Permission denied) while connecting to upstream, client: 2.191.102.217, server: , request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///socket/uwsgi.sock:", host: "179.227.126.222"
The Nginx and uWSGI configurations are correct. The problem is that SELinux denied Nginx access to the socket. This results in a generic access denied error in Nginx's log. The important messages are actually in SELinux's audit log.
# show the new rules to be generated
grep nginx /var/log/audit/audit.log | audit2allow
# show the full rules to be applied
grep nginx /var/log/audit/audit.log | audit2allow -m nginx
# generate the rules to be applied
grep nginx /var/log/audit/audit.log | audit2allow -M nginx
# apply the rules
semodule -i nginx.pp
You may need to generate the rules multiple times, trying to access the site after each pass, since the first SELinux error might not be the only one that can be generated. Always inspect the policy that audit2allow suggests creating.
These steps were taken from this blog post which contains more details about how to investigate and what output you'll get.
Configure your uwsgi.ini with uid and gid user.
#uwsgi.ini
uid = nginx
gid = nginx
Regards,
I wished I could comment :(
Everything looks fine from here except unix socket path
unix:///socket/uwsgi.sock failed (2: No such file or directory)
Docs says it has just one slash
uwsgi_pass unix:/tmp/uwsgi.socket;