Skip to content

bamboofox/bamboofox-website

Repository files navigation

bamboofox-website

build status Rawsec's CyberSecurity Inventory GitHub stars GitHub license

Features

  • Admin panel at admin/ url
  • Multiple OAuth provider supported
  • Multi-course design
  • Material upload or by remote url
  • Rank by course or in all

Requirements

sudo apt install imagemagick
sudo apt install libmysqlclient-dev

Ruby and Rails versions

Ruby 2.4.0 or newer Rails 5.2.0 or newer

Installation

bundle install
rake db:migrate

Running

rails server

See on http://localhost:3000

First registered user will be admin

Deploy

Setup application config

Remove config/credentials.yml.enc

Reference config/credentials.yml.example and run rails credentials:edit to edit your application config

rm config/credentials.yml.enc
rails credentials:edit

Example config

# rake secret
secret_key_base: 73fd0783500cc42096f163859b5062376ccb90416a9bf920c89e43981986493029d20b58e088fc04444d571829381aa5e246ce364b9c16830128eb10757e65a9
host: bamboofox.nctucs.net
mailer_sender: [email protected]
password: password
facebook_id: facebook_id
facebook_secret: facebook_secret
github_id: github_id
github_secret: github_secret
google_id: google_id
google_secret: google_secret
nctu_id: nctu_id
nctu_secret: nctu_secret

Setup seed data and compile assets

bundle install
RAILS_ENV=production rake db:reset DISABLE_DATABASE_ENVIRONMENT_CHECK=1
RAILS_ENV=production rake assets:precompile

Tests

Run RuboCop

rake rubocop

Auto-correct RuboCop offenses

rake rubocop:auto_correct

Run Rails Best Practice

rake rails_best_practices

Format erb files

find . -name '*.erb' | xargs htmlbeautifier