diff --git a/.gitignore b/.gitignore index 29f6d370..e4486a6a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,20 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' +# Ignore bundler vendor build. +/vendor/bundle + # Ignore bundler config. /.bundle +# Ignore Debian auto-generated files. +/debian/debhelper-build-stamp +/debian/files +/debian/greenlight/** +/debian/*.log +/debian/*.debhelper +/debian/*.substvars + # Ignore the default SQLite database. /db/*.sqlite3 /db/*.sqlite3-journal diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..3dba984f --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +prefix = /opt/greenlight + +BUNDLE = $(HOME)/.gem/ruby/2.5.0/bin/bundle + +all: + [ -x $(BUNDLE) ] || gem install --user-install bundler + $(BUNDLE) config --global frozen 1 + cp -r ../bundle vendor/bundle + #$(BUNDLE) install --deployment --without development:test:assets -j4 --path=vendor/bundle + #rm -rf vendor/bundle/ruby/2.5.0/cache/*.gem + #find vendor/bundle/ruby/2.5.0/gems/ -name "*.c" -delete + #find vendor/bundle/ruby/2.5.0/gems/ -name "*.o" -delete + +install: + cp -r app bin .bundle config config.ru db Gemfile Gemfile.lock greenlight.nginx \ + lib log public Rakefile .rspec .rubocop.yml .ruby-version sample.env \ + scripts spec vendor $(DESTDIR)$(prefix)/ + +clean: + rm -rf vendor/bundle diff --git a/bin/start b/bin/start index c04c5cab..8e4b4c2c 100755 --- a/bin/start +++ b/bin/start @@ -1,5 +1,18 @@ #!/bin/bash +RUBYBIN=$HOME/.gem/ruby/2.5.0/bin +NODEBIN=$PWD/node_modules/.bin +export PATH=$RUBYBIN:$NODEBIN:$PATH +export RAILS_ENV=production +export BUNDLE_APP_CONFIG=$PWD/.bundle + +if ! command -v bundle >/dev/null; then + gem install --user-install bundler +fi +if ! command -v yarn >/dev/null; then + npm install yarn +fi + if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then while ! curl http://$DB_HOST:${DB_PORT:-5432}/ 2>&1 | grep '52' do diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..46c90539 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +greenlight (2.7.19-1) UNRELEASED; urgency=medium + + * Initial release. + + -- Max Erenberg Sat, 20 Feb 2021 20:11:03 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..e1b17f6b --- /dev/null +++ b/debian/control @@ -0,0 +1,41 @@ +Source: greenlight +Maintainer: Max Erenberg +Section: misc +Priority: optional +Standards-Version: 3.9.7 +Build-Depends: + debhelper (>= 9), + build-essential (>= 12.1), + libcurl4-gnutls-dev, + ruby2.5, + ruby2.5-dev, + libpq-dev (>= 9.5), + libsqlite3-dev, + libyaml-dev (>= 0.1.6), + zlib1g-dev (>= 1:1.2), + zlib1g-dev (<< 1:1.3) + +Package: greenlight +Architecture: amd64 +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + libcurl3-gnutls, + ruby2.5, + libpq5, + libsqlite3-0, + libyaml-0-2, + zlib1g (>= 1:1.2), + zlib1g (<< 1:1.3), + tzdata, + nodejs (>= 8), + nodejs (<< 9), + npm +Description: simple end-user interface for BigBlueButton + Greenlight is a simple front-end interface for your BigBlueButton server. + At its heart, Greenlight provides a minimalistic web-based application that allows users to: + * Signup/Login with Google, Office365, OpenID Connect, or through the application itself. + * Manage your account settings and user preferences. + * Create and manage your own personal rooms (BigBlueButton sessions). + * Invite others to your room using a simple URL. + * View recordings and share them with others. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..d8bad63f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,24 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: greenlight +Source: https://github.com/bigbluebutton/greenlight + +Files: * +Copyright: 2021 BigBlueButton Inc. +License: LGPL-3+ + +License: LGPL-3+ + This package is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in "/usr/share/common-licenses/LGPL-3". diff --git a/debian/greenlight.dirs b/debian/greenlight.dirs new file mode 100644 index 00000000..309abc15 --- /dev/null +++ b/debian/greenlight.dirs @@ -0,0 +1,2 @@ +opt +opt/greenlight diff --git a/debian/greenlight.postinst b/debian/greenlight.postinst new file mode 100755 index 00000000..f85685b4 --- /dev/null +++ b/debian/greenlight.postinst @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +# This script was adapted from +# https://salsa.debian.org/utopia-team/network-manager/-/blob/debian/master/debian/network-manager.postinst +# Make sure this script has the following permissions: 0755 + +case "$1" in + configure) + adduser --system --quiet --home /opt/greenlight --group --shell /bin/bash greenlight + chown -R greenlight:greenlight /opt/greenlight + ;; + abort-upgrade|abort-deconfigure|abort-remove) + ;; + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + diff --git a/debian/greenlight.service b/debian/greenlight.service new file mode 100644 index 00000000..dd70efc1 --- /dev/null +++ b/debian/greenlight.service @@ -0,0 +1,15 @@ +[Unit] +Description=Web interface for BigBlueButton +Requires=network.target +After=network.target + +[Service] +Type=simple +User=greenlight +Group=greenlight +WorkingDirectory=/opt/greenlight +EnvironmentFile=/opt/greenlight/.env +ExecStart=/opt/greenlight/bin/start + +[Install] +WantedBy=multi-user.target diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..cbe925d7 --- /dev/null +++ b/debian/rules @@ -0,0 +1,3 @@ +#!/usr/bin/make -f +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/sample.env b/sample.env index 12a76e03..116ebaf8 100644 --- a/sample.env +++ b/sample.env @@ -1,3 +1,6 @@ +# Bind to this port +PORT=5000 + # Create a Secret Key for Rails # # You can generate a secure one through the Greenlight docker image