Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
Keep vm.rb and canonical instructions for it in this repo
Browse files Browse the repository at this point in the history
  • Loading branch information
decklin committed Jan 6, 2017
1 parent 122dbca commit 47829f0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -67,6 +67,12 @@ There are a few extra scripts in the VM that you can use during the workshop:
* `showargs` can be used to explain how command-line arguments work.
* `vagrant` prints a message explaining that you're in the VM and should exit if you want to run a Vagrant command.

## Additional Files

Some files are not installed in the VM:

* `vm.rb`: this is a Rails application template that students can apply to their app so that they don't have to pass `-b 0.0.0.0` to `rails server`. Copy it to the downloads site alongside the VM images, and have students apply it with `rake rails:template LOCATION=http://downloads.railsbridge.org/vm.rb`.

## Tests

TODO: There should be some kind of automated test for the output (i.e. can you start the VM, log in, clone a test Rails app, and run it).
22 changes: 22 additions & 0 deletions vm.rb
@@ -0,0 +1,22 @@
# RailsBridge VM application template for running inside VirtualBox
#
# The VirtualBox NAT interface (which connects the guest to the host) is
# probably 10.0.2.15, but just in case something changes in the future,
# listen on all interfaces, and whitelist all 10.* networks.

environment "config.web_console.whitelisted_ips = '10.0.0.0/8'", env: 'development'

append_file 'config/boot.rb', <<EOF
# Configure server for VirtualBox (added by RailsBridge VM)
require 'rails/commands/server'
module Rails
class Server
def default_options
super.merge(Host: '*', Port: 3000)
end
end
end
EOF

0 comments on commit 47829f0

Please sign in to comment.