From b1e284b3b674e709b54aaa8b4ad1cb14b6d1809a Mon Sep 17 00:00:00 2001 From: redfast00 Date: Wed, 25 Jul 2018 16:36:59 +0200 Subject: [PATCH 1/4] Prepare for herbert --- Gemfile | 4 ++-- config/deploy.rb | 4 ++-- config/deploy/production.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 9248a80..dd25269 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .coffee assets and views -gem 'coffee-rails' +gem 'coffee-rails' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby @@ -87,7 +87,7 @@ group :test do end group :production do - gem 'mysql2', '~> 0.3.0' + gem 'mysql2', '< 0.6.0', '>= 0.4.4' end gem 'high_voltage', '~> 2.4.0' diff --git a/config/deploy.rb b/config/deploy.rb index 13c1bfa..f712a86 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -2,9 +2,9 @@ # lock '3.1.0' set :application, 'Tab' -set :repo_url, 'git@github.com:ZeusWPI/Tab.git' +set :repo_url, 'https://github.com/ZeusWPI/Tab.git' -set :branch, 'master' +set :branch, 'herbert' set :deploy_to, '/home/tab/production' # Default branch is :master diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 4224ad9..7f1a392 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,4 +1,4 @@ -server 'zeus.ugent.be', user: 'tab', roles: %w{web app db}, ssh_options: { +server 'tab.zeus.gent', user: 'tab', roles: %w{web app db}, ssh_options: { forward_agent: true, auth_methods: ['publickey'], port: 2222 @@ -7,4 +7,4 @@ server 'zeus.ugent.be', user: 'tab', roles: %w{web app db}, ssh_options: { set :rails_env, 'production' set :rbenv_type, :system set :rbenv_ruby, File.read('.ruby-version').strip -set :default_env, 'RAILS_RELATIVE_URL_ROOT' => '/tab' +set :default_env, 'RAILS_RELATIVE_URL_ROOT' => '/' From ed8b870739ef98f8c86787ac5e4bf1172033fa91 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Wed, 25 Jul 2018 16:42:27 +0200 Subject: [PATCH 2/4] Updated Gemfile.lock --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 297dd50..d59574f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -174,7 +174,7 @@ GEM multi_json (1.13.1) multi_xml (0.6.0) multipart-post (2.0.0) - mysql2 (0.3.21) + mysql2 (0.5.2) net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (5.0.1) @@ -344,7 +344,7 @@ DEPENDENCIES jquery-datatables-rails jquery-rails listen - mysql2 (~> 0.3.0) + mysql2 (>= 0.4.4, < 0.6.0) omniauth-oauth2 (~> 1.3.1) purecss-rails rails (= 5.2.0) @@ -361,4 +361,4 @@ DEPENDENCIES web-console BUNDLED WITH - 1.16.2 + 1.16.3 From 000ee333dc7858fda9921cb66ead52863afd4dad Mon Sep 17 00:00:00 2001 From: redfast00 Date: Wed, 25 Jul 2018 20:37:49 +0200 Subject: [PATCH 3/4] Update high_voltage version and stop capistrano from complaining --- Capfile | 4 ++++ Gemfile | 2 +- Gemfile.lock | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Capfile b/Capfile index d3f8bb5..ac5f4b6 100644 --- a/Capfile +++ b/Capfile @@ -4,6 +4,10 @@ require 'capistrano/setup' # Includes default deployment tasks require 'capistrano/deploy' +# Stop Capistrano from complaining +require "capistrano/scm/git" +install_plugin Capistrano::SCM::Git + require 'capistrano/rails' require 'capistrano/rbenv' diff --git a/Gemfile b/Gemfile index dd25269..14d6106 100644 --- a/Gemfile +++ b/Gemfile @@ -90,7 +90,7 @@ group :production do gem 'mysql2', '< 0.6.0', '>= 0.4.4' end -gem 'high_voltage', '~> 2.4.0' +gem 'high_voltage', '~> 3.1' # Errors on errbit gem 'airbrake' diff --git a/Gemfile.lock b/Gemfile.lock index d59574f..732e0bd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -133,7 +133,7 @@ GEM html2haml (>= 1.0.1) railties (>= 4.0.1) hashie (3.5.7) - high_voltage (2.4.0) + high_voltage (3.1.0) html2haml (2.2.0) erubis (~> 2.7.0) haml (>= 4.0, < 6) @@ -339,7 +339,7 @@ DEPENDENCIES faker friendly_id (~> 5.1.0) haml-rails - high_voltage (~> 2.4.0) + high_voltage (~> 3.1) jbuilder (~> 2.0) jquery-datatables-rails jquery-rails From f8dbcb7041b88e0eab2c641c547978f7032f6151 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Thu, 26 Jul 2018 21:01:48 +0200 Subject: [PATCH 4/4] More detailed README --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 5017edd..224b59a 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ # [Tab](https://zeus.ugent.be/tab) [![Analytics](https://ga-beacon.appspot.com/UA-25444917-6/ZeusWPI/Tab/README.md?pixel)](https://github.com/igrigorik/ga-beacon) [![Code Climate](https://codeclimate.com/github/ZeusWPI/Tab/badges/gpa.svg)](https://codeclimate.com/github/ZeusWPI/Tab) [![Coverage Status](https://coveralls.io/repos/ZeusWPI/Tab/badge.svg?branch=master&service=github)](https://coveralls.io/github/ZeusWPI/Tab?branch=master) [![Build Status](https://travis-ci.org/ZeusWPI/Tab.png?branch=master)](https://travis-ci.org/ZeusWPI/Tab) + +## Deploy + +Just run `cap production deploy`. You might need to edit some config files +on the server. + +## Adding clients + +A client can see and modify balances of other users. + +To add a client, connect +to the server, `cd production/current`, then run `RAILS_ENV=production bundle exec rails console`. +Then you can add clients with `client = Client.create name: "Tap"`. + +If you want the client to be able to make transactions, run: `client.add_role :create_transactions` in the console.