Giter VIP home page Giter VIP logo

mygov-account's Introduction

Build Status

MyUSA

MyUSA is a platform for citizen identity.

Getting Started

To get your Rails development environment setup, here's the steps to follow. We assume that you have MySQL installed. If you don't, Google it and figure it out. We also assume you have git installed, if you don't, install it here: https://help.github.com/articles/set-up-git

1.  Install RVM

    curl -L https://get.rvm.io | bash -s stable --ruby

  Note: you may need to have previously installed
  MacPorts/Homebrew and other dependencies for rvm/ruby (on OS X at least)
  prior to running this command

2.  Install the Ruby 1.9.3 rvm instance

    rvm install ruby-1.9.3

3.  Clone the mygov project

  In some directory where you want to store your development files, do the following:

    git clone https://github.com/GSA/mygov-account.git

4.  bundle install

  Change into the directory (it would be 'cd mygov-account' from wherever you executed the above command) and do the following:

    bundle install

  Note: MySQL must be previously installed for the mysql gem install to work

5.  Create your configuration files

  cp config/database.yml.example config/database.yml
  cp config/twilio.yml.example config/twilio.yml
  cp config/resque.yml.example config/resque.yml
  cp config/initializers/01_mygov.rb.example config/initializers/01_mygov.rb
  (check these configuration files to ensure they look correct for your environment)
  rake secret
  (copy the result of the above rake command to the RAILS_SECRET_TOKEN variable in config/initializers/01_mygov.rb)

6.  Create the development and test databases

  Make sure you have MySQL running.  By default, the development environment looks to connect to MySQL using the root MySQL user with no password.

    bundle exec rake db:create
    bundle exec rake db:schema:load
    bundle exec rake db:create RAILS_ENV=test
    bundle exec rake db:schema:load RAILS_ENV=test

  Seed the development database

    bundle exec rake db:seed

That should be it! You are ready to develop.

Running the app locally

Make sure you have MySQL running. By default, the development environment looks to connect to MySQL using the root MySQL user with no password.

From the command line in the Rails root, do the following:

rails server

You can also do:

rails s

('s' is short for server).

Then, open your favorite web browser (if your favorite web browser is not Chrome, reexamine your life) and visit:

http://localhost:3000/

Hopefully you now have the site running. However, to be practical, you must perform one additional step with the current code base. You need to approve yourself as a user. Utilize the site to sign up with an email that you want to use. Click on the confirmation link presented to you. Then execute in MySQL in the mygov_development database:

 update beta_signups set is_approved = 1 where id=1;

(assuming that you are id # 1 in the beta_signups table.)

That's it! Use the app just as you would any other web application.

Developing

Check out the Rails documentation for information regarding creating models, controllers, views, etc.

Before developing a new feature, it's a good idea to check out a branch to do all your work in:

git checkout -b myfeature

When you're done developing something, make sure all the tests still pass by doing the following (from the Rails root):

bundle exec rake spec

If specific tests are failing and you want to save time and zero in on just those tests, do:

bundle exec rspec spec/models/model_name.rb

When you have finished working on a feature, make your commit locally with git:

git add <your files>
git commit -m"My commit message"

If you did the right thing and did your work in a branch, you should rebase on master after you commit, and then merge your changes into master:

git checkout master
git pull origin master
git checkout myfeature
git rebase -i master
(squish if you want; it's a good idea)
git checkout master
git merge myfeature

Then push your commit up to the github server so other developers can pull it down:

git push origin master

If you're really done with your feature, clean up your local branch:

git branch -d myfeature

For more information on how to properly develop with git and feature branches, see:

http://blog.hasmanythrough.com/2008/12/18/agile-git-and-the-story-branch-pattern

mygov-account's People

Contributors

greggersh avatar dannychapman avatar adam-at-mobomo avatar amoose avatar mikefab avatar jgrevich avatar phirefly avatar benbalter avatar arowla avatar philipashlock avatar ryanrusnak avatar robertlread avatar dlapiduz avatar qizwiz avatar

Stargazers

 avatar  avatar Meghana Khandekar avatar  avatar Hulk Fu avatar  avatar  avatar juno suárez avatar  avatar  avatar

Watchers

 avatar  avatar  avatar James Cloos avatar  avatar William Kautter avatar Brian Lacey avatar  avatar Juri Grabowski avatar Ken Fang avatar John Felleman avatar William Kautter avatar  avatar  avatar  avatar  avatar  avatar  avatar

mygov-account's Issues

my.usa.gov SSL cert issues

I've run into issues making the omniauth-myusa Ruby client work out of the box due to SSL issues with the my.usa.gov domain. However, it seems like the issue might be wider than just the Ruby client, since I also see similar SSL errors via curl and openssl command line tools (but oddly no issues access the HTTPS site in my browsers). I was able to make omniauth-myusa work by disabling SSL verification, but that obviously isn't ideal. Has something maybe changed with the SSL setup on my.usa.gov?

Here's a basic curl test that is unable to connect over HTTPS:

$ curl -v "https://my.usa.gov/"
...
* Peer's certificate issuer is not recognized: 'CN=Go Daddy Secure Certificate Authority - G2,OU=http://certs.godaddy.com/repository/,O="GoDaddy.com, Inc.",L=Scottsdale,ST=Arizona,C=US'
* NSS error -8179
* Closing connection #0
* Peer certificate cannot be authenticated with known CA certificates
curl: (60) Peer certificate cannot be authenticated with known CA certificates

Even when pointing curl at a fresh CA cert bundle from curl.haxx.se, I get the same errors.

A similar OpenSSL test also reports errors:

$ openssl s_client -connect my.usa.gov:443 -showcerts
CONNECTED(00000003)
depth=0 OU = Domain Control Validated, CN = *.usa.gov
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 OU = Domain Control Validated, CN = *.usa.gov
verify error:num=27:certificate not trusted
verify return:1
depth=0 OU = Domain Control Validated, CN = *.usa.gov
verify error:num=21:unable to verify the first certificate
verify return:1
…

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.