Skip to content

Commit

Permalink
Merge pull request #20 from mconf/fix-qol-dev
Browse files Browse the repository at this point in the history
Fix qol dev
  • Loading branch information
LLCarlos authored Apr 29, 2021
2 parents a8c1d6f + 18d6755 commit e7c7e5c
Show file tree
Hide file tree
Showing 26 changed files with 188 additions and 286 deletions.
Empty file added .env
Empty file.
13 changes: 13 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
RAILS_ENV=development

# Database configurations
MCONF_DATABASE_DEV_HOST=dev_db
MCONF_DATABASE_DEV_NAME=mconf_web_dev
MCONF_DATABASE_DEV_USERNAME=mconf
MCONF_DATABASE_DEV_PASSWORD=mconf

# Redis
MCONF_REDIS_HOST=dev_redis
MCONF_REDIS_PASSWORD=XYqZihWYGeAIOZo2VN2LcNJxC2R4UcQE
# MCONF_REDIS_PORT='6379'
# MCONF_REDIS_DB='0'
Empty file added .env.development.local
Empty file.
4 changes: 4 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MCONF_DATABASE_PROD_ADAPTER='mysql2'
MCONF_DATABASE_PROD='mconf_web_production'
MCONF_DATABASE_PROD_USERNAME='root'
MCONF_DATABASE_PROD_PASSWORD=''
9 changes: 9 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
RAILS_ENV=test

MCONF_DATABASE_TEST_HOST=test_db
MCONF_DATABASE_TEST_NAME=mconf_web_ufrgs_test
MCONF_DATABASE_TEST_USERNAME=mconf
MCONF_DATABASE_TEST_PASSWORD=mconf

MCONF_REDIS_HOST=test_redis
MCONF_REDIS_PASSWORD=XYqZihWYGeAIOZo2VN2LcNJxC2R4UcQE
4 changes: 4 additions & 0 deletions .env.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MCONF_DATABASE_ADAPTER='mysql2'
MCONF_DATABASE='mconf_test'
MCONF_DATABASE_USERNAME='travis'
MCONF_DATABASE_PASSWORD=''
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ private/uploads/*
app/assets/images/tmp/*
public/images/tmp/*
*~
config/setup_conf.yml
config/deploy/conf.yml
db/*.sqlite3*
tmp/*
Expand All @@ -15,10 +14,12 @@ db/data.yml
pids/*
doc/app/*
.sass-cache/
config/analytics_conf.yml
public/assets/*
public/uploads/*
.bundle/
public/capybara.html
.vagrant/
cookbooks/
.env.development.local
.env.test.local
.env.production.local
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ RUN apt-get update && \
ENV app /usr/src/app

# Create app directory
RUN mkdir -p $app
WORKDIR $app

# Install app dependencies
ENV BUNDLE_PATH /usr/src/bundle
COPY Gemfile* $app/
RUN bundle install --path /usr/src/bundle --jobs 4

# Bundle app source
COPY . $app

# Install app dependencies
RUN bundle install

# dumb-init
ADD dumb-init_1.2.0 /usr/bin/dumb-init
RUN chmod +x /usr/bin/dumb-init
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ gem 'rmagick', '~> 2.16.0'
gem 'mini_magick', '~> 3.8.1'

# global configurations
gem 'configatron', '~> 2.13.0'
gem 'dotenv-rails'

# for bootstrap
gem 'less-rails'
Expand Down
9 changes: 5 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ GEM
sass (~> 3.2.5)
compass-rails (2.0.0)
compass (>= 0.12.2)
configatron (2.13.0)
yamler (>= 0.1.0)
crack (0.4.2)
safe_yaml (~> 1.0.0)
css_parser (1.3.5)
Expand All @@ -181,6 +179,10 @@ GEM
devise (>= 2.1.0)
diff-lcs (1.2.5)
docile (1.1.5)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
dotiw (2.0)
actionpack (>= 3)
i18n
Expand Down Expand Up @@ -535,7 +537,6 @@ GEM
rails (>= 3.1.0)
ya2yaml (0.31)
yajl-ruby (1.2.1)
yamler (0.1.0)
yui-compressor (0.12.0)
zip-zip (0.3)
rubyzip (>= 1.0.0)
Expand Down Expand Up @@ -565,11 +566,11 @@ DEPENDENCIES
coffee-rails (~> 4.0.0)
compass (~> 0.13.alpha)
compass-rails (~> 2.0)
configatron (~> 2.13.0)
database_cleaner
devise (~> 3.5.4)
devise-async
devise-encryptable
dotenv-rails
dotiw
epic-editor-rails
exception_notification (~> 4.0.0)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def webconf_room!

# Returns the translation for of a locale given its acronym (e.g. "en")
def locale_i18n(acronym)
configatron.locales.names[acronym.to_sym]
Rails.application.config.locale_names[acronym.to_sym]
end

# The payload is used by lograge. We add more information to it here so that it is saved
Expand Down
1 change: 0 additions & 1 deletion config/.gitignore

This file was deleted.

18 changes: 18 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,23 @@ class Application < Rails::Application
# to force a different conference server URL in join calls
# used when there's a proxy in front the API calls
config.server_url_for_join = nil

config.locale_names =
{
bg: "Български",
de: "Deutsch",
en: "English",
"es-419": "Español",
"pt-br": "Português",
ru: "Pусский"
}

# Redis configurations. Defaults to a localhost instance.
config.redis_host = ENV['MCONF_REDIS_HOST'] || 'localhost'
config.redis_port = ENV['MCONF_REDIS_PORT'] || 6379
config.redis_db = ENV['MCONF_REDIS_DB'] || 0
config.redis_password = ENV['MCONF_REDIS_PASSWORD'] || nil


end
end
50 changes: 0 additions & 50 deletions config/configatron/defaults.rb

This file was deleted.

25 changes: 25 additions & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.

development:
adapter: <%= ENV['MCONF_DATABASE_DEV_ADAPTER'] || 'mysql2' %>
host: <%= ENV['MCONF_DATABASE_DEV_HOST'] || '127.0.0.1' %>
database: <%= ENV['MCONF_DATABASE_DEV_NAME'] || 'mconf_web_dev' %>
username: <%= ENV['MCONF_DATABASE_DEV_USERNAME'] %>
password: <%= ENV['MCONF_DATABASE_DEV_PASSWORD'] %>
socket: <%= ENV['MCONF_DATABASE_DEV_SOCKET'] || '/var/run/mysqld/mysqld.sock' %>

test:
adapter: <%= ENV['MCONF_DATABASE_TEST_ADAPTER'] || 'mysql2' %>
host: <%= ENV['MCONF_DATABASE_TEST_HOST'] || '127.0.0.1' %>
database: <%= ENV['MCONF_DATABASE_TEST_NAME'] || 'mconf_web_ufrgs_test' %>
username: <%= ENV['MCONF_DATABASE_TEST_USERNAME'] %>
password: <%= ENV['MCONF_DATABASE_TEST_PASSWORD'] %>
socket: <%= ENV['MCONF_DATABASE_TEST_SOCKET'] || '/var/run/mysqld/mysqld.sock' %>

production:
adapter: <%= ENV['MCONF_DATABASE_PROD_ADAPTER'] || 'mysql2' %>
host: <%= ENV['MCONF_DATABASE_PROD_HOST'] || '127.0.0.1' %>
database: <%= ENV['MCONF_DATABASE_PROD_NAME'] || 'mconf_web_production' %>
username: <%= ENV['MCONF_DATABASE_PROD_USERNAME'] %>
password: <%= ENV['MCONF_DATABASE_PROD_PASSWORD'] %>
socket: <%= ENV['MCONF_DATABASE_PROD_SOCKET'] || '/var/run/mysqld/mysqld.sock' %>
25 changes: 0 additions & 25 deletions config/database.yml.example

This file was deleted.

22 changes: 0 additions & 22 deletions config/database.yml.sqlite.example

This file was deleted.

5 changes: 0 additions & 5 deletions config/database.yml.travis

This file was deleted.

8 changes: 0 additions & 8 deletions config/initializers/configatron.rb

This file was deleted.

8 changes: 4 additions & 4 deletions config/initializers/resque.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
#Resque.logger.level = Logger::DEBUG

attrs = {
host: configatron.redis.host,
port: configatron.redis.port,
db: configatron.redis.db
host: Rails.application.config.redis_host,
port: Rails.application.config.redis_port,
db: Rails.application.config.redis_db
}
attrs[:password] = configatron.redis.password unless configatron.redis.password.blank?
attrs[:password] = Rails.application.config.redis_password unless Rails.application.config.redis_password.blank?
Resque.redis = Redis.new(attrs)

# If you want to be able to dynamically change the schedule,
Expand Down
33 changes: 33 additions & 0 deletions config/seeds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

#
# This file is used to seed the database after it is created
# (by `rake db:reset` or `rake db:seed`).
#

# The first admin you will use to login and setup the application.
admin:
username: "admin"
email: "fake-email@mconf.org"
password: "admin"

# The first, only and default Site model with general configurations for the website.
# You can add here any attribute available in the model Site.
site:
name: "Mconf Dev"
description: "Mconf Development Website"
domain: "localhost:3000"
smtp_login: ""
smtp_password: ""
smtp_server: ""
smtp_domain: "localhost"
smtp_sender: "fake-email@mconf.org"
smtp_use_tls: false
smtp_auto_tls: false
smtp_auth_type: ""
smtp_port: 1025

# The first and default webconference server.
webconf_server:
name: "Default Server"
url: "http://test-install.blindsidenetworks.com/bigbluebutton/api"
secret: "8cd8ef52e8e101574e400365b55e11a6"
Loading

0 comments on commit e7c7e5c

Please sign in to comment.