statik / stowaway

Rails app designed to facilitate storage scenarios between humans.

Home Page:stowaway.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stowaway.co

This application was generated with the rails_apps_composer gem provided by the RailsApps Project.

Diagnostics

This application was built with recipes that are known to work together.

This application was built with preferences that are NOT known to work together.

If the application doesn’t work as expected, please report an issue and include these diagnostics:

We’d also like to know if you’ve found combinations of recipes or preferences that do work together.

Recipes:
[“apps4”, “controllers”, “core”, “email”, “extras”, “frontend”, “gems”, “git”, “init”, “models”, “prelaunch”, “railsapps”, “readme”, “routes”, “saas”, “setup”, “testing”, “views”]

Preferences:
{:git=>true, :apps4=>"none", :dev_webserver=>"unicorn", :prod_webserver=>"unicorn", :database=>"postgresql", :templates=>"haml", :unit_test=>"rspec", :integration=>"cucumber", :continuous_testing=>"none", :fixtures=>"factory_girl", :frontend=>"none", :email=>"mandrill", :authentication=>"devise", :devise_modules=>"invitable", :authorization=>"cancan", :form_builder=>"simple_form", :starter_app=>"admin_app", :rvmrc=>false, :quiet_assets=>true, :better_errors=>true}

Ruby on Rails

This application requires:

  • Ruby version 2.0.0
  • Rails version 4.0.0

Database

This application uses PostgreSQL with ActiveRecord.

Development

Email & Configuration

The application is configured to send email using a Mandrill account. Configuration is done via the figaro gem, which provides heroku-like abstraction of config variables.

Getting Started

You can use rvm or rbenv and Postgres.app and just run bundle and rails server, along with the various rake tasks. Or, if you want the full monty automatic setup luxury, use Vagrant.

1. Install Vagrant
2. Install Virtualbox
3. Install the vagrant-omnibus plugin using `vagrant plugin install vagrant-omnibus`
4. Install the vagrant-vbguest plugin using `vagrant plugin install vagrant-vbguest`
5. Run `vagrant up`. The first time this will download 500MB for the base box, after that it is cached for re-use.
6. `vagrant ssh-config —host stowaway_development >> ~/.ssh/config`
7. 1. Run `cap development deploy:setup deploy:migrations`
8. View the site running in the VM .

Installing a real server

1. Provision a fresh server (Digital Ocean, EC2, fresh OS install, etc).
2. Add your SSH key to the server using `ssh-copy-id root@stowaway.com`. On OS X the ssh-copy-id command can be installed from homebrew using `brew install ssh-copy-id`.
3. Install chef-solo from the omnibus package

ssh root@stowaway.com “curl -L https://www.opscode.com/chef/install.sh | bash”

4. Get the encrypted data bag secret from LastPass and copy it into `chef/.chef/encrypted_data_bag_secret`. This file must never be added to git (it is listed in .gitignore) because this file is used to decrypt the passwords used for the database server and other sensitive data such as SSL private keys.

This was originally created using the command `openssl rand -base64 512 | tr -d ‘\r\n’ > chef/.chef/encrypted_data_bag_secret`.

To change the postgres password or otherwise edit encrypted secrets, `cd chef` and `knife solo data bag edit custom secrets`. To convert an SSL certificate private key into a one-line blob that may be pasted into the encrypted data bag, use: `ruby -e ‘p ARGF.read’ `

4. Rsync the chef recipes to the machine and run chef-solo

./provision-server-with-chef-solo

At this point you should see chef run to completion and give you a fully configured server. Any chef recipe attributes that need to be overriden to tweak the server in a different way than the Vagrant machine can be specified in `chef/roles/server.rb`, otherwise things should be identical to the Vagrant machine. In order to make changes, you can work locally and change the recipe files, then test them out with `vagrant provision`. Once you are happy with the changes you can apply them to the server by re-running step 4.

5. Run `cap staging deploy:setup deploy:migrations`

6. Run `cap production deploy:setup deploy:migrations`

7. Look at the production or staging site.

8. SSL certificates are managed by chef-solo.

Deploying the application

Portions of capistrano tasks were based on https://github.com/smartlogic/chef-cap-demo/

0. In order to have email notifications of deploys sent out, set up sendmail/postfix
1. To deploy the current code from GitHub, run `cap production deploy`. Repeat as needed to try new versions of the application.
2. TODO: set up a staging version of the application as well
3. After a deploy, visit the production server .

Running Tests

  • rake cucumber
  • rake spec

Continuous integration tests are run in Travis CI

Security scans are done by Code Climate

TODO: https://coveralls.io/r/stowawayco/stowaway

Documentation and Support

This is the only documentation.

Contributing

If you make improvements to this application, please share with others.

  • Fork the project on GitHub.
  • Make your feature addition or bug fix.
  • Commit with Git.
  • Send the author a pull request.

Credits

Jay Collins, Johann Sabbath, Patrick Kenney, Elliot Murphy

License

Apache V2.0

About

Rails app designed to facilitate storage scenarios between humans.

stowaway.co

License:Apache License 2.0


Languages

Language:Ruby 56.3%Language:CSS 16.7%Language:HTML 13.7%Language:ApacheConf 3.9%Language:JavaScript 3.4%Language:CoffeeScript 2.8%Language:Shell 2.5%Language:Perl 0.5%Language:Gherkin 0.2%