Skip to content

bamboofox/bamboofox-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

52df123 · Sep 11, 2020
Dec 14, 2019
Dec 14, 2019
Sep 11, 2020
Jun 28, 2019
Dec 14, 2019
Jun 1, 2017
Dec 13, 2019
Jul 29, 2019
Jun 7, 2018
Jun 1, 2017
Jun 1, 2017
Dec 14, 2019
Jul 29, 2019
Jun 28, 2019
Jun 28, 2019
Dec 14, 2019
Dec 14, 2019
Jun 1, 2017
Jun 30, 2019
Jul 29, 2019
Jun 1, 2017
Dec 14, 2019
Dec 14, 2019

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: no-reply@bamboofox.nctucs.net
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