From 0dba45909fea1bf94a048f560e458938a139cf1a Mon Sep 17 00:00:00 2001 From: Rob Smith Date: Thu, 15 Sep 2016 21:19:27 -0700 Subject: [PATCH 1/3] Minor Contributing documentation updates. These are small things I had to change to have the vagrant environtment work correctly. --- CONTRIBUTING.md | 6 +++--- config/environments/development.rb | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fceb365b..02be9484 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ # Request for contributions -We are always looking for contributions to OSEM. Read this guide on how to do that. +We are always looking for contributions to OSEM. Read this guide on how to do that. In particular, this community seeks the following types of contributions: @@ -10,7 +10,7 @@ In particular, this community seeks the following types of contributions: ### Runing OSEM for development We are using [Vagrant](https://www.vagrantup.com/) to create our development environments. -1. Install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). Both tools support Linux, MacOS and Windows. +1. Install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox 5.0.10](https://www.virtualbox.org/wiki/Download_Old_Builds_5_0). Both tools support Linux, MacOS and Windows. 2. Install [vagrant-exec](https://github.com/p0deje/vagrant-exec): @@ -33,7 +33,7 @@ We are using [Vagrant](https://www.vagrantup.com/) to create our development env 5. Start your OSEM rails app: ``` - vagrant exec rails server -b 0.0.0.0 + vagrant exec /vagrant/bin/rails server -b 0.0.0.0 ``` 6. Check out your OSEM rails app: diff --git a/config/environments/development.rb b/config/environments/development.rb index 61d9fd57..597c0c07 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,6 +1,9 @@ Osem::Application.configure do # Settings specified here will take precedence over those in config/application.rb + # Allow the web console from the vagrant host ip + config.web_console.whitelisted_ips = '10.0.2.2' + # Use letter_opener_web for Vagrant (launchy won't work) config.action_mailer.delivery_method = ENV['USER'] == 'vagrant' ? :letter_opener_web : :letter_opener From 6f260d14fa9543fe74ce41190aad105d7de54776 Mon Sep 17 00:00:00 2001 From: Rob Smith Date: Sat, 17 Sep 2016 19:26:34 -0700 Subject: [PATCH 2/3] Fix shared directory mounting on provisioning Due to how the opensuse/openSUSE-42.1-x86_64 box is, there is no vagrant group by default. When the shared folder is attemtped to mount, it fails with the following ``` ==> default: Mounting shared folders... default: /vagrant => /Users/kormoc/Projects/osem Vagrant was unable to mount VirtualBox shared folders. This is usually because the filesystem "vboxsf" is not available. This filesystem is made available via the VirtualBox Guest Additions and kernel module. Please verify that these guest additions are properly installed in the guest. This is not a bug in Vagrant and is usually caused by a faulty Vagrant box. For context, the command attemped was: set -e mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant The error output from the command was: No such file or directory ``` This change will fix this issue to allow a single `vagrant up` to work correctly To test this, you can run `vagrant destroy;vagrant up`. This will destroy your current environment and rebuild it from scratch. --- Vagrantfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 827cb8ed..e2faad9d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -39,6 +39,17 @@ Vagrant.configure(2) do |config| # argument is a set of non-required options. # config.vm.synced_folder "../data", "/vagrant_data" + # When using the default settings, we will attempt to mount this share + # as the vagrant user and the vagrant group. Alas, box opensuse/openSUSE-42.1-x86_64 + # does not have the vagrant group created, so this share fails and + # requires manual mounting for the vagrant setup to continue. Setting + # to the hardcoded numbers will allow the mount to successfully + # mount without working about the group mismatch + VAGRANT_UID = 1000 # User vagrant + VAGRANT_GID = 100 # Group users + config.vm.synced_folder ".", "/vagrant", + owner: VAGRANT_UID, group: VAGRANT_GID + # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. # Example for VirtualBox: From c4366b102a633d3f11c16751f6f6636f92008c70 Mon Sep 17 00:00:00 2001 From: Rob Smith Date: Sat, 17 Sep 2016 19:34:25 -0700 Subject: [PATCH 3/3] Add another place where rails is called without a full path to the binary --- bootstrap.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 9bebd04d..42766366 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -24,11 +24,11 @@ if [ ! -f /vagrant/config/database.yml ] && [ -f /vagrant/config/database.yml.ex else echo -e "\n\nWARNING: You have already have a development/test database." echo -e "WARNING: Please make sure this database works in this vagrant box!\n\n" - fi + fi else - echo -e "\nnWARNING: You have already configured your database in config/database.yml." - echo -e "WARNING: Please make sure this configuration works in this vagrant box!\n\n" + echo -e "\nnWARNING: You have already configured your database in config/database.yml." + echo -e "WARNING: Please make sure this configuration works in this vagrant box!\n\n" fi echo -e "\nProvisioning of your OSEM rails app done!" -echo -e "To start your development OSEM run: vagrant exec rails server -b 0.0.0.0\n" +echo -e "To start your development OSEM run: vagrant exec /vagrant/bin/rails server -b 0.0.0.0\n"