Selaa lähdekoodia

primer commit al repo

master
Ignacio Falco 4 vuotta sitten
commit
7d2494c696
6 muutettua tiedostoa jossa 210 lisäystä ja 0 poistoa
  1. 78
    0
      bigbluebutton
  2. 3
    0
      greenlight-redirect.nginx
  3. 27
    0
      greenlight.nginx
  4. 14
    0
      scalelite.yml
  5. 21
    0
      scalelite_batch_import.sh
  6. 67
    0
      scalelite_post_publish.rb

+ 78
- 0
bigbluebutton Näytä tiedosto

@@ -0,0 +1,78 @@
1
+server {
2
+  listen 80;
3
+  listen [::]:80;
4
+  server_name aulavirtual.digitalcse.com;
5
+  if ($http_x_forwarded_proto = "http") {
6
+      return 301 https://$server_name$request_uri;
7
+  }
8
+
9
+
10
+  listen 443 ssl;
11
+  listen [::]:443 ssl;
12
+
13
+    ssl_certificate /etc/letsencrypt/live/aulavirtual.digitalcse.com/fullchain.pem;
14
+    ssl_certificate_key /etc/letsencrypt/live/aulavirtual.digitalcse.com/privkey.pem;
15
+    ssl_session_cache shared:SSL:10m;
16
+    ssl_session_timeout 10m;
17
+    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
18
+    ssl_ciphers "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS:!AES256";
19
+    ssl_prefer_server_ciphers on;
20
+    ssl_dhparam /etc/nginx/ssl/dhp-4096.pem;
21
+
22
+  access_log  /var/log/nginx/bigbluebutton.access.log;
23
+
24
+   # Handle RTMPT (RTMP Tunneling).  Forwards requests
25
+   # to Red5 on port 5080
26
+  location ~ (/open/|/close/|/idle/|/send/|/fcs/) {
27
+    proxy_pass         http://127.0.0.1:5080;
28
+    proxy_redirect     off;
29
+    proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
30
+
31
+    client_max_body_size       10m;
32
+    client_body_buffer_size    128k;
33
+
34
+    proxy_connect_timeout      90;
35
+    proxy_send_timeout         90;
36
+    proxy_read_timeout         90;
37
+
38
+    proxy_buffering            off;
39
+    keepalive_requests         1000000000;
40
+  }
41
+
42
+  # Handle desktop sharing tunneling.  Forwards
43
+  # requests to Red5 on port 5080.
44
+  location /deskshare {
45
+     proxy_pass         http://127.0.0.1:5080;
46
+     proxy_redirect     default;
47
+     proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
48
+     client_max_body_size       10m;
49
+     client_body_buffer_size    128k;
50
+     proxy_connect_timeout      90;
51
+     proxy_send_timeout         90;
52
+     proxy_read_timeout         90;
53
+     proxy_buffer_size          4k;
54
+     proxy_buffers              4 32k;
55
+     proxy_busy_buffers_size    64k;
56
+     proxy_temp_file_write_size 64k;
57
+     include    fastcgi_params;
58
+  }
59
+
60
+  # BigBlueButton landing page.
61
+  location / {
62
+    root   /var/www/bigbluebutton-default;
63
+    index  index.html index.htm;
64
+    expires 1m;
65
+  }
66
+
67
+  # Include specific rules for record and playback
68
+  include /etc/bigbluebutton/nginx/*.nginx;
69
+
70
+  #error_page  404  /404.html;
71
+
72
+  # Redirect server error pages to the static page /50x.html
73
+  #
74
+  error_page   500 502 503 504  /50x.html;
75
+  location = /50x.html {
76
+    root   /var/www/nginx-default;
77
+  }
78
+}

+ 3
- 0
greenlight-redirect.nginx Näytä tiedosto

@@ -0,0 +1,3 @@
1
+location = / {
2
+  return 307 https://$host/b;
3
+}

+ 27
- 0
greenlight.nginx Näytä tiedosto

@@ -0,0 +1,27 @@
1
+# Routes requests to Greenlight based on the '/b' prefix.
2
+# Use this file to route '/b' paths on your BigBlueButton server
3
+# to the Greenlight application. If you are using a different
4
+# subpath, you should change it here.
5
+
6
+location /b {
7
+  proxy_pass          http://127.0.0.1:5000;
8
+  proxy_set_header    Host              $host;
9
+  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
10
+  proxy_set_header    X-Forwarded-Ssl on;
11
+  proxy_set_header    X-Forwarded-Proto $scheme;
12
+  proxy_http_version  1.1;
13
+}
14
+
15
+location /b/cable {
16
+  proxy_pass          http://127.0.0.1:5000;
17
+  proxy_set_header    Host              $host;
18
+  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
19
+  proxy_set_header    X-Forwarded-Proto $scheme;
20
+  proxy_set_header    Upgrade           $http_upgrade;
21
+  proxy_set_header    Connection        "Upgrade";
22
+  proxy_http_version  1.1;
23
+  proxy_read_timeout  6h;
24
+  proxy_send_timeout  6h;
25
+  client_body_timeout 6h;
26
+  send_timeout        6h;
27
+}

+ 14
- 0
scalelite.yml Näytä tiedosto

@@ -0,0 +1,14 @@
1
+# Directory for temporary storage of working files
2
+work_dir: /var/bigbluebutton/recording/scalelite
3
+#
4
+# Directory to place recording files for scalelite to import
5
+# If you are using a shared filesystem, this should be the local mountpoint on the BigBlueButton server.
6
+spool_dir: /mnt/storage01/spool/
7
+# If you are using rsync over ssh, this should be of the form [USER@]HOST:DEST
8
+#spool_dir: scalelite-spool@scalelite-import.example.com:/var/bigbluebutton/spool
9
+# If you are using an rsync daemon, this should be of the form [USER@]HOST::DEST or rsync://[USER@]HOST/DEST
10
+#spool_dir: rsync://scalelite-spool@scalelite-import.example.com/spool
11
+#
12
+# Extra rsync command-line options
13
+# You can use this to set up unusual configurations, like rsync daemon over ssh
14
+extra_rsync_opts: []

+ 21
- 0
scalelite_batch_import.sh Näytä tiedosto

@@ -0,0 +1,21 @@
1
+#!/bin/bash
2
+
3
+status_dir=/var/bigbluebutton/recording/status/published
4
+scripts_dir=/usr/local/bigbluebutton/core/scripts
5
+
6
+if ! sudo -n -u bigbluebutton true; then
7
+    echo "Unable to run commands as the bigbluebutton user, try running this script as root"
8
+    exit 1
9
+fi
10
+
11
+prev_record_id=
12
+for done_file in "$status_dir"/*.done; do
13
+    record_id="${done_file##*/}"
14
+    record_id="${record_id%-*.done}"
15
+    if [[ $record_id = $prev_record_id ]]; then continue; fi
16
+
17
+    prev_record_id="$record_id"
18
+    echo "$record_id"
19
+    ( cd "$scripts_dir" && sudo -n -u bigbluebutton ./post_publish/scalelite_post_publish.rb -m 6ca54fd83558eb5af468fa0c9a80ce0d6406884c-1590172366578 )
20
+    break
21
+done

+ 67
- 0
scalelite_post_publish.rb Näytä tiedosto

@@ -0,0 +1,67 @@
1
+#!/usr/bin/ruby
2
+# frozen_string_literal: true
3
+
4
+# Scalelite recording transfer script
5
+# Copyright © 2020 Blindside Networks
6
+#
7
+# This program is free software: you can redistribute it and/or modify
8
+# it under the terms of the GNU Affero General Public License as
9
+# published by the Free Software Foundation, either version 3 of the
10
+# License, or (at your option) any later version.
11
+#
12
+# This program is distributed in the hope that it will be useful,
13
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+# GNU Affero General Public License for more details.
16
+#
17
+# You should have received a copy of the GNU Affero General Public License
18
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
19
+
20
+require 'optparse'
21
+require 'psych'
22
+require 'fileutils'
23
+
24
+meeting_id = nil
25
+OptionParser.new do |opts|
26
+  opts.on('-m', '--meeting-id MEETING_ID', 'Internal Meeting ID') do |v|
27
+    meeting_id = v
28
+  end
29
+end.parse!
30
+raise 'Meeting ID was not provided' unless meeting_id
31
+
32
+props = Psych.load_file(File.join(__dir__, '../bigbluebutton.yml'))
33
+published_dir = props['published_dir'] || raise('Unable to determine published_dir from bigbluebutton.yml')
34
+scalelite_props = Psych.load_file(File.join(__dir__, '../scalelite.yml'))
35
+work_dir = scalelite_props['work_dir'] || raise('Unable to determine work_dir from scalelite.yml')
36
+spool_dir = scalelite_props['spool_dir'] || raise('Unable to determine spool_dir from scalelite.yml')
37
+extra_rsync_opts = scalelite_props['extra_rsync_opts'] || []
38
+
39
+puts("Transferring recording for #{meeting_id} to Scalelite")
40
+format_dirs = []
41
+FileUtils.cd(published_dir) do
42
+  format_dirs = Dir.glob("*/#{meeting_id}")
43
+end
44
+if format_dirs.empty?
45
+  puts('No published recording formats found')
46
+  exit
47
+end
48
+
49
+format_dirs.each do |format_dir|
50
+  puts("Found recording format: #{format_dir}")
51
+end
52
+
53
+archive_file = "#{work_dir}/#{meeting_id}.tar"
54
+begin
55
+  puts('Creating recording archive')
56
+  FileUtils.mkdir_p(work_dir)
57
+  FileUtils.cd(published_dir) do
58
+    system('tar', '--create', '--file', archive_file, *format_dirs) \
59
+      || raise('Failed to create recording archive')
60
+  end
61
+
62
+  puts("Transferring recording archive to #{spool_dir}")
63
+  system('cp', archive_file, spool_dir) \
64
+    || raise('Failed to transfer recording archive')
65
+ensure
66
+  FileUtils.rm_f(archive_file)
67
+end

Loading…
Peruuta
Tallenna