diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..d3826750d66 --- /dev/null +++ b/.gitignore @@ -0,0 +1,56 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile ~/.gitignore_global + +*.rbc +*.sassc +**.orig +.bundle +.coveralls.yml +.databag_secret +.env +.idea +.powrc +.sass-cache +.zeus.sock +.DS_store +.rspec +.ruby-gemset +.vagrant +.capistrano + +# root files +capybara-*.html +dump.rdb +latest.dump +rerun.txt +Vagrantfile + +# folders +code/upaya/config/application.yml +code/upaya/config/aws.yml +code/upaya/config/database.yml +code/upaya/config/newrelic.yml +code/upaya/config/saml.key.enc +code/upaya/config/secrets.yml +code/upaya/coverage +code/upaya/db/*.sqlite3 +code/upaya/doc/search_stats.csv +code/upaya/fixtures +code/upaya/kitchen/cookbooks +code/upaya/log/* +code/upaya/private_certs/* +code/upaya/public/system +code/upaya/spec/tmp +code/upaya/test +code/upaya/tmp/* +code/upaya/vendor/bundle + +# This is a hack to keep the files that are added to the repo and to prevent git from worrying about +# new (transient) files that may be created in those dirs. +code/upaya/config/deploy/*.rb +code/upaya/kitchen/nodes/*.json +code/upaya/kitchen/data_bags/config/*.yml +code/upaya/kitchen/data_bags/config/databag_secrets.json diff --git a/code/upaya/Gemfile b/code/upaya/Gemfile new file mode 100644 index 00000000000..5aa4a212d8c --- /dev/null +++ b/code/upaya/Gemfile @@ -0,0 +1,93 @@ +source 'https://rubygems.org' + +gem 'rails', '~> 4.2.6' + +gem 'attr_encrypted' +gem 'autoprefixer-rails', '~> 5.2' +gem 'coffee-rails', '~> 4.1.0' +gem 'devise' +gem 'devise_security_extension' +gem 'dotiw' +gem 'figaro' +gem 'jbuilder', '~> 2.0' +gem 'jquery-rails' +gem 'jquery-ui-rails' +gem 'kaminari-bootstrap', '~> 3.0.1' +gem 'letter_opener_web' +gem 'lograge' +gem 'newrelic_rpm' +gem 'omniauth-saml', github: 'amoose/omniauth-saml', branch: 'feature/internal_idp' +gem 'phony_rails' +gem 'pg' +gem 'pundit' +gem 'valid_email' +gem 'rack-attack' +gem 'responders', '~> 2.0' +gem 'resque' +gem 'ruby-saml', github: 'amoose/ruby-saml' +# gem 'nokogiri-xmlsec-me-harder', '~> 0.9.1', require: 'xmlsec' +gem 'saml_idp', github: '18F/saml_idp' +gem 'sass-rails', '~> 5.0' +gem 'secure_headers', '~> 3.0.0' +gem 'simple_form', github: 'amoose/simple_form', branch: 'feature/aria-invalid' +gem 'slim-rails' +gem 'style_guide', git: 'git@github.com:18F/myuscis-style-guide.git', branch: 'no-usps' +gem 'turbolinks' +gem 'twilio-ruby' +gem 'two_factor_authentication', git: 'https://github.com/Houdini/two_factor_authentication' +gem 'uglifier', '>= 1.3.0' +gem 'whenever', require: false +gem 'activerecord-session_store' # TODO[astone] added gem due to CookieOverflow + +group :deploy do + gem 'berkshelf' + gem 'capistrano'#, '~> 3.4' + gem 'capistrano-rails'#, '~> 1.1', require: false + gem 'capistrano-rbenv'#, '~> 2.0', require: false + gem 'capistrano-resque'#, '~> 0.2.1', require: false + gem 'chef', '~> 12.0.1' + gem 'knife-ec2' + gem 'knife-solo', github: 'matschaffer/knife-solo', submodules: true + gem 'knife-solo_data_bag' +end + +group :development do + gem 'aws-sdk', '~> 2.0' + gem 'better_errors' + gem 'derailed' + gem 'binding_of_caller', platforms: [:mri_21] + gem 'guard-rspec', require: false + gem 'quiet_assets' + gem 'rack-mini-profiler' + gem 'rails_layout' + gem 'spring' + gem 'spring-commands-rspec' + gem 'spring-watcher-listen' +end + +group :development, :test do + gem 'pry-byebug' + gem 'rspec-rails', '~> 3.3' + gem 'thin' + gem 'brakeman' + gem 'bullet' + gem 'dawnscanner', require: false +end + +group :test do + gem 'capybara-screenshot' + gem 'codeclimate-test-reporter', require: nil + gem 'database_cleaner' + gem 'email_spec' + gem 'factory_girl_rails' + gem 'faker' + gem 'poltergeist' + gem 'rack_session_access' + gem 'rack-test' + gem 'rspec-activejob' + gem 'rubocop' + gem 'shoulda-matchers', '~> 2.8', require: false + gem 'sms-spec', git: 'https://github.com/monfresh/sms-spec.git', require: 'sms_spec' + gem 'timecop' + gem 'webmock' +end diff --git a/code/upaya/Gemfile.lock b/code/upaya/Gemfile.lock new file mode 100644 index 00000000000..61e196bd446 --- /dev/null +++ b/code/upaya/Gemfile.lock @@ -0,0 +1,966 @@ +GIT + remote: git://github.com/18F/saml_idp.git + revision: afe6e7967fc4db89052c6ee171b5b1c365c1465f + specs: + saml_idp (0.1.1) + activesupport + httparty + nokogiri + uuid + +GIT + remote: git://github.com/amoose/omniauth-saml.git + revision: 06c019e451db4eb769bf40fcba2b092091fe7d4a + branch: feature/internal_idp + specs: + omniauth-saml (1.3.0) + omniauth (~> 1.2) + +GIT + remote: git://github.com/amoose/ruby-saml.git + revision: f2bfac4cbbffba46beb6ad277927edfb46b40084 + specs: + ruby-saml (0.9) + nokogiri (>= 1.5.0) + uuid (~> 2.3) + +GIT + remote: git://github.com/amoose/simple_form.git + revision: 7f70e35f772e0e806407592af260bda48f5f08ea + branch: feature/aria-invalid + specs: + simple_form (3.1.0.rc2) + actionpack (~> 4.0) + activemodel (~> 4.0) + +GIT + remote: git://github.com/matschaffer/knife-solo.git + revision: 3b3fa546f24fcee291ef73315e0e9729894f6500 + submodules: true + specs: + knife-solo (0.5.2) + chef (>= 10.20) + erubis (~> 2.7.0) + net-ssh (>= 2.7, < 4.0) + +GIT + remote: git@github.com:18F/myuscis-style-guide.git + revision: 437325f156c4ae7e3f7a7d0128832e6392a89e72 + branch: no-usps + specs: + style_guide (2.1.61) + autoprefixer-rails (>= 5.1) + block_helpers (~> 0.3) + carmen-rails (~> 1.0) + font-awesome-sass (~> 4.3.0) + httparty + rails (>= 4.1.9) + sass-rails (>= 3.2) + +GIT + remote: https://github.com/Houdini/two_factor_authentication + revision: 675f651929b7a09bb59169bf4206a10895c2b9d9 + specs: + two_factor_authentication (1.1.5) + devise + encryptor + rails (>= 3.1.1) + randexp + rotp + +GIT + remote: https://github.com/monfresh/sms-spec.git + revision: 786238c1924c055d16a4963abb329c9b985ce104 + specs: + sms-spec (0.2.0) + rspec (~> 3.1) + +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.2) + actionmailer (4.2.6) + actionpack (= 4.2.6) + actionview (= 4.2.6) + activejob (= 4.2.6) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.6) + actionview (= 4.2.6) + activesupport (= 4.2.6) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.6) + activesupport (= 4.2.6) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.6) + activesupport (= 4.2.6) + globalid (>= 0.3.0) + activemodel (4.2.6) + activesupport (= 4.2.6) + builder (~> 3.1) + activerecord (4.2.6) + activemodel (= 4.2.6) + activesupport (= 4.2.6) + arel (~> 6.0) + activerecord-session_store (0.1.2) + actionpack (>= 4.0.0, < 5) + activerecord (>= 4.0.0, < 5) + railties (>= 4.0.0, < 5) + activesupport (4.2.6) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.4.0) + arel (6.0.3) + ast (2.2.0) + attr_encrypted (3.0.1) + encryptor (~> 3.0.0) + autoprefixer-rails (5.2.1.3) + execjs + json + aws-sdk (2.2.31) + aws-sdk-resources (= 2.2.31) + aws-sdk-core (2.2.31) + jmespath (~> 1.0) + aws-sdk-resources (2.2.31) + aws-sdk-core (= 2.2.31) + bcrypt (3.1.11) + bcrypt-ruby (3.1.5) + bcrypt (>= 3.1.3) + benchmark-ips (2.5.0) + berkshelf (4.3.1) + addressable (~> 2.3, >= 2.3.4) + berkshelf-api-client (~> 2.0, >= 2.0.2) + buff-config (~> 1.0) + buff-extensions (~> 1.0) + buff-shell_out (~> 0.1) + celluloid (= 0.16.0) + celluloid-io (~> 0.16.1) + cleanroom (~> 1.0) + faraday (~> 0.9) + httpclient (~> 2.7) + minitar (~> 0.5, >= 0.5.4) + octokit (~> 4.0) + retryable (~> 2.0) + ridley (~> 4.5) + solve (~> 2.0) + thor (~> 0.19) + berkshelf-api-client (2.0.2) + faraday (~> 0.9.1) + httpclient (~> 2.7.0) + ridley (~> 4.5) + better_errors (2.1.1) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + block_helpers (0.3.3) + activesupport (>= 2.0) + brakeman (3.2.1) + erubis (~> 2.6) + haml (>= 3.0, < 5.0) + highline (>= 1.6.20, < 2.0) + ruby2ruby (~> 2.3.0) + ruby_parser (~> 3.8.1) + safe_yaml (>= 1.0) + sass (~> 3.0) + slim (>= 1.3.6, < 4.0) + terminal-table (~> 1.4) + buff-config (1.0.1) + buff-extensions (~> 1.0) + varia_model (~> 0.4) + buff-extensions (1.0.0) + buff-ignore (1.1.1) + buff-ruby_engine (0.1.0) + buff-shell_out (0.2.0) + buff-ruby_engine (~> 0.1.0) + builder (3.2.2) + bullet (5.0.0) + activesupport (>= 3.0.0) + uniform_notifier (~> 1.9.0) + byebug (8.2.2) + capistrano (3.4.0) + i18n + rake (>= 10.0.0) + sshkit (~> 1.3) + capistrano-bundler (1.1.4) + capistrano (~> 3.1) + sshkit (~> 1.2) + capistrano-rails (1.1.6) + capistrano (~> 3.1) + capistrano-bundler (~> 1.1) + capistrano-rbenv (2.0.4) + capistrano (~> 3.1) + sshkit (~> 1.3) + capistrano-resque (0.2.2) + capistrano + resque + resque-scheduler + capybara (2.6.2) + addressable + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) + capybara-screenshot (1.0.12) + capybara (>= 1.0, < 3) + launchy + carmen (1.0.2) + activesupport (>= 3.0.0) + carmen-rails (1.0.1) + carmen (~> 1.0.0) + rails + celluloid (0.16.0) + timers (~> 4.0.0) + celluloid-io (0.16.2) + celluloid (>= 0.16.0) + nio4r (>= 1.1.0) + chef (12.0.3) + chef-zero (~> 3.2) + diff-lcs (~> 1.2, >= 1.2.4) + erubis (~> 2.7) + ffi-yajl (~> 1.2) + highline (~> 1.6, >= 1.6.9) + mixlib-authentication (~> 1.3) + mixlib-cli (~> 1.4) + mixlib-config (~> 2.0) + mixlib-log (~> 1.3) + mixlib-shellout (>= 2.0.0.rc.0, < 3.0) + net-ssh (~> 2.6) + net-ssh-multi (~> 1.1) + ohai (~> 8.0) + plist (~> 3.1.0) + pry (~> 0.9) + chef-config (12.8.1) + mixlib-config (~> 2.0) + mixlib-shellout (~> 2.0) + chef-zero (3.2.1) + ffi-yajl (~> 1.1) + hashie (~> 2.0) + mixlib-log (~> 1.3) + rack + uuidtools (~> 2.1) + chronic (0.10.2) + cleanroom (1.0.0) + cliver (0.3.2) + codeclimate-test-reporter (0.5.0) + simplecov (>= 0.7.1, < 1.0.0) + coderay (1.1.1) + coffee-rails (4.1.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + concurrent-ruby (1.0.1) + crack (0.4.3) + safe_yaml (~> 1.0.0) + cvss (0.99.0) + daemons (1.2.3) + data_mapper (1.2.0) + dm-aggregates (~> 1.2.0) + dm-constraints (~> 1.2.0) + dm-core (~> 1.2.0) + dm-migrations (~> 1.2.0) + dm-serializer (~> 1.2.0) + dm-timestamps (~> 1.2.0) + dm-transactions (~> 1.2.0) + dm-types (~> 1.2.0) + dm-validations (~> 1.2.0) + data_objects (0.10.17) + addressable (~> 2.1) + database_cleaner (1.5.1) + dawnscanner (1.6.2) + cvss + data_mapper + dm-sqlite-adapter + haml + justify + logger-colors + ptools + ruby_parser + sqlite3 + sys-uname + terminal-table + debug_inspector (0.0.2) + derailed (0.1.0) + derailed_benchmarks + derailed_benchmarks (1.3.1) + benchmark-ips (~> 2) + get_process_mem (~> 0) + heapy (~> 0) + memory_profiler (~> 0) + rack (>= 1) + rake (> 10, < 12) + thor (~> 0.19) + devise (3.5.6) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 3.2.6, < 5) + responders + thread_safe (~> 0.1) + warden (~> 1.2.3) + devise_security_extension (0.10.0) + devise (>= 3.0.0, < 4.0) + railties (>= 3.2.6, < 5.0) + diff-lcs (1.2.5) + dm-aggregates (1.2.0) + dm-core (~> 1.2.0) + dm-constraints (1.2.0) + dm-core (~> 1.2.0) + dm-core (1.2.1) + addressable (~> 2.3) + dm-do-adapter (1.2.0) + data_objects (~> 0.10.6) + dm-core (~> 1.2.0) + dm-migrations (1.2.0) + dm-core (~> 1.2.0) + dm-serializer (1.2.2) + dm-core (~> 1.2.0) + fastercsv (~> 1.5) + json (~> 1.6) + json_pure (~> 1.6) + multi_json (~> 1.0) + dm-sqlite-adapter (1.2.0) + dm-do-adapter (~> 1.2.0) + do_sqlite3 (~> 0.10.6) + dm-timestamps (1.2.0) + dm-core (~> 1.2.0) + dm-transactions (1.2.0) + dm-core (~> 1.2.0) + dm-types (1.2.2) + bcrypt-ruby (~> 3.0) + dm-core (~> 1.2.0) + fastercsv (~> 1.5) + json (~> 1.6) + multi_json (~> 1.0) + stringex (~> 1.4) + uuidtools (~> 2.1) + dm-validations (1.2.0) + dm-core (~> 1.2.0) + do_sqlite3 (0.10.17) + data_objects (= 0.10.17) + docile (1.1.5) + dotiw (3.1.1) + actionpack (>= 3) + i18n + email_spec (2.0.0) + htmlentities (~> 4.3.3) + launchy (~> 2.1) + mail (~> 2.6.3) + encryptor (3.0.0) + erubis (2.7.0) + eventmachine (1.2.0.1) + excon (0.49.0) + execjs (2.6.0) + factory_girl (4.5.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.6.0) + factory_girl (~> 4.5.0) + railties (>= 3.0.0) + faker (1.6.3) + i18n (~> 0.5) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + fastercsv (1.5.5) + ffi (1.9.10) + ffi-yajl (1.4.0) + ffi (~> 1.5) + libyajl2 (~> 1.2) + figaro (1.1.1) + thor (~> 0.14) + fission (0.5.0) + CFPropertyList (~> 2.2) + fog (1.29.0) + fog-atmos + fog-aws (~> 0.0) + fog-brightbox (~> 0.4) + fog-core (~> 1.27, >= 1.27.4) + fog-ecloud + fog-json + fog-local + fog-powerdns (>= 0.1.1) + fog-profitbricks + fog-radosgw (>= 0.0.2) + fog-riakcs + fog-sakuracloud (>= 0.0.4) + fog-serverlove + fog-softlayer + fog-storm_on_demand + fog-terremark + fog-vmfusion + fog-voxel + fog-xml (~> 0.1.1) + ipaddress (~> 0.5) + nokogiri (~> 1.5, >= 1.5.11) + fog-atmos (0.1.0) + fog-core + fog-xml + fog-aws (0.9.2) + fog-core (~> 1.27) + fog-json (~> 1.0) + fog-xml (~> 0.1) + ipaddress (~> 0.8) + fog-brightbox (0.10.1) + fog-core (~> 1.22) + fog-json + inflecto (~> 0.0.2) + fog-core (1.37.0) + builder + excon (~> 0.45) + formatador (~> 0.2) + fog-ecloud (0.3.0) + fog-core + fog-xml + fog-json (1.0.2) + fog-core (~> 1.0) + multi_json (~> 1.10) + fog-local (0.3.0) + fog-core (~> 1.27) + fog-powerdns (0.1.1) + fog-core (~> 1.27) + fog-json (~> 1.0) + fog-xml (~> 0.1) + fog-profitbricks (0.0.5) + fog-core + fog-xml + nokogiri + fog-radosgw (0.0.5) + fog-core (>= 1.21.0) + fog-json + fog-xml (>= 0.0.1) + fog-riakcs (0.1.0) + fog-core + fog-json + fog-xml + fog-sakuracloud (1.7.5) + fog-core + fog-json + fog-serverlove (0.1.2) + fog-core + fog-json + fog-softlayer (1.1.0) + fog-core + fog-json + fog-storm_on_demand (0.1.1) + fog-core + fog-json + fog-terremark (0.1.0) + fog-core + fog-xml + fog-vmfusion (0.1.0) + fission + fog-core + fog-voxel (0.1.0) + fog-core + fog-xml + fog-xml (0.1.2) + fog-core + nokogiri (~> 1.5, >= 1.5.11) + font-awesome-sass (4.3.2.1) + sass (~> 3.2) + formatador (0.2.5) + get_process_mem (0.2.0) + globalid (0.3.6) + activesupport (>= 4.1.0) + gssapi (1.2.0) + ffi (>= 1.0.1) + guard (2.13.0) + formatador (>= 0.2.4) + listen (>= 2.7, <= 4.0) + lumberjack (~> 1.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.9.12) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-compat (1.2.1) + guard-rspec (4.6.5) + guard (~> 2.1) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) + gyoku (1.3.1) + builder (>= 2.1.2) + haml (4.0.7) + tilt + hashdiff (0.3.0) + hashie (2.1.2) + heapy (0.1.2) + highline (1.7.8) + hitimes (1.2.3) + htmlentities (4.3.4) + httparty (0.13.7) + json (~> 1.8) + multi_xml (>= 0.5.2) + httpclient (2.7.1) + i18n (0.7.0) + inflecto (0.0.2) + ipaddress (0.8.3) + jbuilder (2.4.1) + activesupport (>= 3.0.0, < 5.1) + multi_json (~> 1.2) + jmespath (1.2.3) + json_pure (>= 1.8.1) + jquery-rails (4.1.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (5.0.5) + railties (>= 3.2.16) + json (1.8.3) + json_pure (1.8.3) + justify (1.0.2) + jwt (1.5.4) + kaminari (0.16.3) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) + kaminari-bootstrap (3.0.1) + kaminari (>= 0.13.0) + rails + knife-ec2 (0.12.0) + fog (~> 1.29.0) + knife-windows (~> 1.0) + knife-solo_data_bag (1.1.0) + knife-windows (1.4.0) + winrm (~> 1.7) + launchy (2.4.3) + addressable (~> 2.3) + letter_opener (1.4.1) + launchy (~> 2.2) + letter_opener_web (1.3.0) + actionmailer (>= 3.2) + letter_opener (~> 1.0) + railties (>= 3.2) + libyajl2 (1.2.0) + listen (3.0.6) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9.7) + little-plugger (1.1.4) + logger-colors (1.0.0) + logging (2.1.0) + little-plugger (~> 1.1) + multi_json (~> 1.10) + lograge (0.3.6) + actionpack (>= 3) + activesupport (>= 3) + railties (>= 3) + loofah (2.0.3) + nokogiri (>= 1.5.9) + lumberjack (1.0.10) + macaddr (1.7.1) + systemu (~> 2.6.2) + mail (2.6.4) + mime-types (>= 1.16, < 4) + memory_profiler (0.9.6) + method_source (0.8.2) + mime-types (2.99.1) + mini_portile2 (2.0.0) + minitar (0.5.4) + minitest (5.8.4) + mixlib-authentication (1.4.0) + mixlib-log + rspec-core (~> 3.2) + rspec-expectations (~> 3.2) + rspec-mocks (~> 3.2) + mixlib-cli (1.5.0) + mixlib-config (2.2.1) + mixlib-log (1.6.0) + mixlib-shellout (2.2.6) + molinillo (0.4.4) + mono_logger (1.1.0) + multi_json (1.11.2) + multi_xml (0.5.5) + multipart-post (2.0.0) + nenv (0.3.0) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (2.9.4) + net-ssh-gateway (1.2.0) + net-ssh (>= 2.6.5) + net-ssh-multi (1.2.1) + net-ssh (>= 2.6.5) + net-ssh-gateway (>= 1.2.0) + newrelic_rpm (3.15.1.316) + nio4r (1.2.1) + nokogiri (1.6.7.2) + mini_portile2 (~> 2.0.0.rc2) + nori (2.6.0) + notiffany (0.0.8) + nenv (~> 0.1) + shellany (~> 0.0) + octokit (4.3.0) + sawyer (~> 0.7.0, >= 0.5.3) + ohai (8.4.0) + ffi (~> 1.9) + ffi-yajl (>= 1.1, < 3.0) + ipaddress + mime-types (~> 2.0) + mixlib-cli + mixlib-config (~> 2.0) + mixlib-log + mixlib-shellout (~> 2.0) + rake (~> 10.1) + systemu (~> 2.6.4) + wmi-lite (~> 1.0) + omniauth (1.3.1) + hashie (>= 1.2, < 4) + rack (>= 1.0, < 3) + orm_adapter (0.5.0) + parser (2.3.0.7) + ast (~> 2.2) + pg (0.18.4) + phony (2.15.20) + phony_rails (0.13.1) + activesupport (>= 3.0) + phony (~> 2.12) + plist (3.1.0) + poltergeist (1.9.0) + capybara (~> 2.1) + cliver (~> 0.3.1) + multi_json (~> 1.0) + websocket-driver (>= 0.2.0) + powerpack (0.1.1) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-byebug (3.3.0) + byebug (~> 8.0) + pry (~> 0.10) + ptools (1.3.3) + pundit (1.1.0) + activesupport (>= 3.0.0) + quiet_assets (1.1.0) + railties (>= 3.1, < 5.0) + rack (1.6.4) + rack-attack (4.4.1) + rack + rack-mini-profiler (0.9.9.2) + rack (>= 1.2.0) + rack-protection (1.5.3) + rack + rack-test (0.6.3) + rack (>= 1.0) + rack_session_access (0.1.1) + builder (>= 2.0.0) + rack (>= 1.0.0) + rails (4.2.6) + actionmailer (= 4.2.6) + actionpack (= 4.2.6) + actionview (= 4.2.6) + activejob (= 4.2.6) + activemodel (= 4.2.6) + activerecord (= 4.2.6) + activesupport (= 4.2.6) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.6) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + rails_layout (1.0.29) + railties (4.2.6) + actionpack (= 4.2.6) + activesupport (= 4.2.6) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rainbow (2.1.0) + rake (10.5.0) + randexp (0.1.7) + rb-fsevent (0.9.7) + rb-inotify (0.9.7) + ffi (>= 0.5.0) + redis (3.2.2) + redis-namespace (1.5.2) + redis (~> 3.0, >= 3.0.4) + responders (2.1.2) + railties (>= 4.2.0, < 5.1) + resque (1.26.0) + mono_logger (~> 1.0) + multi_json (~> 1.0) + redis-namespace (~> 1.3) + sinatra (>= 0.9.2) + vegas (~> 0.1.2) + resque-scheduler (4.1.0) + mono_logger (~> 1.0) + redis (~> 3.0) + resque (~> 1.25) + rufus-scheduler (~> 3.0) + retryable (2.0.3) + ridley (4.5.0) + addressable + buff-config (~> 1.0) + buff-extensions (~> 1.0) + buff-ignore (~> 1.1) + buff-shell_out (~> 0.1) + celluloid (~> 0.16.0) + celluloid-io (~> 0.16.1) + chef-config (>= 12.5.0) + erubis + faraday (~> 0.9.0) + hashie (>= 2.0.2, < 4.0.0) + httpclient (~> 2.7) + json (>= 1.7.7) + mixlib-authentication (>= 1.3.0) + retryable (~> 2.0) + semverse (~> 1.1) + varia_model (~> 0.4.0) + rotp (2.1.1) + rspec (3.4.0) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-activejob (0.6.1) + activejob (>= 4.2) + rspec-mocks + rspec-core (3.4.4) + rspec-support (~> 3.4.0) + rspec-expectations (3.4.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-mocks (3.4.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-rails (3.4.2) + actionpack (>= 3.0, < 4.3) + activesupport (>= 3.0, < 4.3) + railties (>= 3.0, < 4.3) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-support (~> 3.4.0) + rspec-support (3.4.1) + rubocop (0.39.0) + parser (>= 2.3.0.7, < 3.0) + powerpack (~> 0.1) + rainbow (>= 1.99.1, < 3.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.7.5) + ruby2ruby (2.3.0) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.8.1) + sexp_processor (~> 4.1) + rubyntlm (0.6.0) + rufus-scheduler (3.2.0) + safe_yaml (1.0.4) + sass (3.4.22) + sass-rails (5.0.4) + railties (>= 4.0.0, < 5.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sawyer (0.7.0) + addressable (>= 2.3.5, < 2.5) + faraday (~> 0.8, < 0.10) + secure_headers (3.0.3) + useragent + semverse (1.2.1) + sexp_processor (4.7.0) + shellany (0.0.1) + shoulda-matchers (2.8.0) + activesupport (>= 3.0.0) + simplecov (0.11.2) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + sinatra (1.4.7) + rack (~> 1.5) + rack-protection (~> 1.4) + tilt (>= 1.3, < 3) + slim (3.0.6) + temple (~> 0.7.3) + tilt (>= 1.3.3, < 2.1) + slim-rails (3.0.1) + actionmailer (>= 3.1, < 5.0) + actionpack (>= 3.1, < 5.0) + activesupport (>= 3.1, < 5.0) + railties (>= 3.1, < 5.0) + slim (~> 3.0) + slop (3.6.0) + solve (2.0.3) + molinillo (~> 0.4.2) + semverse (~> 1.1) + spring (1.6.4) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + spring-watcher-listen (2.0.0) + listen (>= 2.7, < 4.0) + spring (~> 1.2) + sprockets (3.5.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.0.4) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.11) + sshkit (1.9.0) + net-scp (>= 1.1.2) + net-ssh (>= 2.8.0) + stringex (1.5.1) + sys-uname (1.0.2) + ffi (>= 1.0.0) + systemu (2.6.5) + temple (0.7.6) + terminal-table (1.5.2) + thin (1.6.4) + daemons (~> 1.0, >= 1.0.9) + eventmachine (~> 1.0, >= 1.0.4) + rack (~> 1.0) + thor (0.19.1) + thread_safe (0.3.5) + tilt (2.0.2) + timecop (0.8.1) + timers (4.0.4) + hitimes + turbolinks (2.5.3) + coffee-rails + twilio-ruby (4.11.1) + builder (>= 2.1.2) + jwt (~> 1.0) + multi_json (>= 1.3.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (3.0.0) + execjs (>= 0.3.0, < 3) + unicode-display_width (1.0.3) + uniform_notifier (1.9.0) + useragent (0.16.7) + uuid (2.3.8) + macaddr (~> 1.0) + uuidtools (2.1.5) + valid_email (0.0.13) + activemodel + mail (~> 2.6.1) + varia_model (0.4.1) + buff-extensions (~> 1.0) + hashie (>= 2.0.2, < 4.0.0) + vegas (0.1.11) + rack (>= 1.0.0) + warden (1.2.6) + rack (>= 1.0) + webmock (1.24.2) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff + websocket-driver (0.6.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + whenever (0.9.4) + chronic (>= 0.6.3) + winrm (1.7.3) + builder (>= 2.1.2) + gssapi (~> 1.2) + gyoku (~> 1.0) + httpclient (~> 2.2, >= 2.2.0.2) + logging (>= 1.6.1, < 3.0) + nori (~> 2.0) + rubyntlm (~> 0.6.0) + wmi-lite (1.0.0) + xpath (2.0.0) + nokogiri (~> 1.3) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord-session_store + attr_encrypted + autoprefixer-rails (~> 5.2) + aws-sdk (~> 2.0) + berkshelf + better_errors + binding_of_caller + brakeman + bullet + capistrano + capistrano-rails + capistrano-rbenv + capistrano-resque + capybara-screenshot + chef (~> 12.0.1) + codeclimate-test-reporter + coffee-rails (~> 4.1.0) + database_cleaner + dawnscanner + derailed + devise + devise_security_extension + dotiw + email_spec + factory_girl_rails + faker + figaro + guard-rspec + jbuilder (~> 2.0) + jquery-rails + jquery-ui-rails + kaminari-bootstrap (~> 3.0.1) + knife-ec2 + knife-solo! + knife-solo_data_bag + letter_opener_web + lograge + newrelic_rpm + omniauth-saml! + pg + phony_rails + poltergeist + pry-byebug + pundit + quiet_assets + rack-attack + rack-mini-profiler + rack-test + rack_session_access + rails (~> 4.2.6) + rails_layout + responders (~> 2.0) + resque + rspec-activejob + rspec-rails (~> 3.3) + rubocop + ruby-saml! + saml_idp! + sass-rails (~> 5.0) + secure_headers (~> 3.0.0) + shoulda-matchers (~> 2.8) + simple_form! + slim-rails + sms-spec! + spring + spring-commands-rspec + spring-watcher-listen + style_guide! + thin + timecop + turbolinks + twilio-ruby + two_factor_authentication! + uglifier (>= 1.3.0) + valid_email + webmock + whenever + +BUNDLED WITH + 1.11.2 diff --git a/code/upaya/README.rdoc b/code/upaya/README.rdoc new file mode 100644 index 00000000000..dd4e97e22e1 --- /dev/null +++ b/code/upaya/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/code/upaya/Rakefile b/code/upaya/Rakefile new file mode 100644 index 00000000000..ba6b733dd23 --- /dev/null +++ b/code/upaya/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Rails.application.load_tasks diff --git a/code/upaya/app/assets/images/.keep b/code/upaya/app/assets/images/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/assets/javascripts/application.js b/code/upaya/app/assets/javascripts/application.js new file mode 100644 index 00000000000..e07c5a830f7 --- /dev/null +++ b/code/upaya/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require jquery +//= require jquery_ujs +//= require turbolinks +//= require_tree . diff --git a/code/upaya/app/assets/stylesheets/application.css b/code/upaya/app/assets/stylesheets/application.css new file mode 100644 index 00000000000..f9cd5b34830 --- /dev/null +++ b/code/upaya/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/code/upaya/app/controllers/application_controller.rb b/code/upaya/app/controllers/application_controller.rb new file mode 100644 index 00000000000..d83690e1b9a --- /dev/null +++ b/code/upaya/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception +end diff --git a/code/upaya/app/controllers/concerns/.keep b/code/upaya/app/controllers/concerns/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/helpers/application_helper.rb b/code/upaya/app/helpers/application_helper.rb new file mode 100644 index 00000000000..de6be7945c6 --- /dev/null +++ b/code/upaya/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/code/upaya/app/mailers/.keep b/code/upaya/app/mailers/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/models/.keep b/code/upaya/app/models/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/models/concerns/.keep b/code/upaya/app/models/concerns/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/views/layouts/application.html.erb b/code/upaya/app/views/layouts/application.html.erb new file mode 100644 index 00000000000..32554be0e80 --- /dev/null +++ b/code/upaya/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Upaya + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> + <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/code/upaya/bin/bundle b/code/upaya/bin/bundle new file mode 100755 index 00000000000..66e9889e8b4 --- /dev/null +++ b/code/upaya/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/code/upaya/bin/rails b/code/upaya/bin/rails new file mode 100755 index 00000000000..0138d79b751 --- /dev/null +++ b/code/upaya/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/code/upaya/bin/rake b/code/upaya/bin/rake new file mode 100755 index 00000000000..d87d5f57810 --- /dev/null +++ b/code/upaya/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/code/upaya/bin/setup b/code/upaya/bin/setup new file mode 100755 index 00000000000..acdb2c1389c --- /dev/null +++ b/code/upaya/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/code/upaya/bin/spring b/code/upaya/bin/spring new file mode 100755 index 00000000000..7fe232c3aae --- /dev/null +++ b/code/upaya/bin/spring @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) + Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } + gem 'spring', match[1] + require 'spring/binstub' + end +end diff --git a/code/upaya/config.ru b/code/upaya/config.ru new file mode 100644 index 00000000000..bd83b254123 --- /dev/null +++ b/code/upaya/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/code/upaya/config/application.rb b/code/upaya/config/application.rb new file mode 100644 index 00000000000..6573006a568 --- /dev/null +++ b/code/upaya/config/application.rb @@ -0,0 +1,26 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Upaya + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/code/upaya/config/boot.rb b/code/upaya/config/boot.rb new file mode 100644 index 00000000000..6b750f00b1d --- /dev/null +++ b/code/upaya/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/code/upaya/config/database.yml.example b/code/upaya/config/database.yml.example new file mode 100644 index 00000000000..5a09db85374 --- /dev/null +++ b/code/upaya/config/database.yml.example @@ -0,0 +1,25 @@ +mysql: &mysql + adapter: mysql2 + username: root + database: save_ferris_<%= Rails.env %> + +postgresql: &postgresql + adapter: postgresql + username: postgres + encoding: unicode + database: save_ferris_<%= Rails.env %> + +defaults: &defaults + pool: 5 + timeout: 5000 + host: localhost + <<: *<%= ENV['DB'] || "mysql" %> + +development: + <<: *defaults + +test: + <<: *defaults + +production: + <<: *defaults diff --git a/code/upaya/config/environment.rb b/code/upaya/config/environment.rb new file mode 100644 index 00000000000..ee8d90dc651 --- /dev/null +++ b/code/upaya/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/code/upaya/config/environments/development.rb b/code/upaya/config/environments/development.rb new file mode 100644 index 00000000000..b55e2144b6b --- /dev/null +++ b/code/upaya/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/code/upaya/config/environments/production.rb b/code/upaya/config/environments/production.rb new file mode 100644 index 00000000000..5c1b32e4863 --- /dev/null +++ b/code/upaya/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/code/upaya/config/environments/test.rb b/code/upaya/config/environments/test.rb new file mode 100644 index 00000000000..1c19f08b283 --- /dev/null +++ b/code/upaya/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/code/upaya/config/initializers/assets.rb b/code/upaya/config/initializers/assets.rb new file mode 100644 index 00000000000..01ef3e6630a --- /dev/null +++ b/code/upaya/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/code/upaya/config/initializers/backtrace_silencers.rb b/code/upaya/config/initializers/backtrace_silencers.rb new file mode 100644 index 00000000000..59385cdf379 --- /dev/null +++ b/code/upaya/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/code/upaya/config/initializers/cookies_serializer.rb b/code/upaya/config/initializers/cookies_serializer.rb new file mode 100644 index 00000000000..7f70458dee6 --- /dev/null +++ b/code/upaya/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/code/upaya/config/initializers/filter_parameter_logging.rb b/code/upaya/config/initializers/filter_parameter_logging.rb new file mode 100644 index 00000000000..4a994e1e7bb --- /dev/null +++ b/code/upaya/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/code/upaya/config/initializers/inflections.rb b/code/upaya/config/initializers/inflections.rb new file mode 100644 index 00000000000..ac033bf9dc8 --- /dev/null +++ b/code/upaya/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/code/upaya/config/initializers/mime_types.rb b/code/upaya/config/initializers/mime_types.rb new file mode 100644 index 00000000000..dc1899682b0 --- /dev/null +++ b/code/upaya/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/code/upaya/config/initializers/session_store.rb b/code/upaya/config/initializers/session_store.rb new file mode 100644 index 00000000000..2989a6dc4ac --- /dev/null +++ b/code/upaya/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_upaya_session' diff --git a/code/upaya/config/initializers/wrap_parameters.rb b/code/upaya/config/initializers/wrap_parameters.rb new file mode 100644 index 00000000000..33725e95fd2 --- /dev/null +++ b/code/upaya/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/code/upaya/config/locales/devise.en.yml b/code/upaya/config/locales/devise.en.yml new file mode 100644 index 00000000000..62a2145d49f --- /dev/null +++ b/code/upaya/config/locales/devise.en.yml @@ -0,0 +1,76 @@ +# Additional translations at https://github.com/plataformatec/devise/wiki/I18n + +en: + devise: + confirmations: + confirmed: "Your email address has been successfully confirmed." + send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." + failure: + already_authenticated: "You are already signed in." + inactive: "Your account is not activated yet." + invalid: "Invalid email or password." + locked: "Your account is locked." + last_attempt: "You have one more attempt before your account is locked." + not_found_in_database: "Invalid email or password." + timeout: "Your session expired. Please sign in again to continue." + unauthenticated: "You need to sign in or sign up before continuing." + unconfirmed: "You have to confirm your email address before continuing." + mailer: + confirmation_instructions: + subject: "Email confirmation instructions" + reset_password_instructions: + subject: 'Password reset instructions' + password_updated: + subject: 'Password change notification' + account_locked: + subject: 'Your USCIS account has been locked' + omniauth_callbacks: + failure: "Could not authenticate you from %{kind} due to: %{reason}." + success: "Successfully authenticated from %{kind} account." + passwords: + no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." + send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." + send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." + updated: "Your password has been changed successfully. You are now signed in." + updated_not_active: > + Your password has been changed successfully. + Please sign in with your new password. + choose_new_password: "Choose a new password." + token_expired: 'You have taken too long to reset your password. Please try again.' + invalid_token: 'The reset password token is invalid. Please try again.' + registrations: + destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." + signed_up: "Welcome! You have signed up successfully." + signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." + signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." + signed_up_but_unconfirmed: "A USCIS Account confirmation email has been sent to %{email}. Please follow the instructions in the email to confirm your USCIS Account request. If you do not receive the confirmation email within the next 10 minutes, please return to this page and request your confirmation instructions again." + email_update_needs_confirmation: > + You updated your account successfully, but we need to verify your new + email address. Please check your email and follow the confirm link to + confirm your new email address. + mobile_update_needs_confirmation: > + Your request to update your phone number was processed successfully, + but we need to verify your new number first. Please follow the + instructions below. If you do not confirm your new number, we will + keep using your old phone number. + updated: "Your account has been updated successfully." + enabled_twofactor: "Successfully enabled two-factor authentication." + sessions: + signed_in: 'Welcome' + signed_out: "Signed out successfully." + already_signed_out: "Signed out successfully." + errors: + messages: + already_confirmed: "was already confirmed, please try signing in" + confirmation_period_expired: > + You have taken longer than %{period} to confirm your email. + Please click "Resend confirmation instructions." + expired: "has expired, please request a new one" + not_found: "not found" + not_locked: "was not locked" + not_saved: + one: "1 error prohibited this %{resource} from being saved:" + other: "%{count} errors prohibited this %{resource} from being saved:" + requires_mobile: "requires you to enter your mobile number." + max_security_questions_attempts: Sorry, you have exceeded the maximum number of attempts to reset your password. diff --git a/code/upaya/config/locales/devise.security_extension.en.yml b/code/upaya/config/locales/devise.security_extension.en.yml new file mode 100644 index 00000000000..cb54bc8cd0d --- /dev/null +++ b/code/upaya/config/locales/devise.security_extension.en.yml @@ -0,0 +1,14 @@ +en: + errors: + messages: + taken_in_past: "was already taken in the past!" + equal_to_current_password: "must be different from the current password!" + password_format: "must be between 8 and 128 characters, contain at least one upper case letter, at least one lower case letter, at least one number, and at least one \"special\" character. Accepted \"special\" characters are: !\"#$%&'()*+,-.:;<=>?@[]{}/^_~`|" + devise: + invalid_captcha: "The captcha input is not valid!" + password_expired: + updated: "Your new password is saved." + change_required: "Your password is expired. Please renew your password!" + failure: + session_limited: 'Your login credentials were used in another browser. Please sign in again to continue in this browser.' + expired: 'Your account has expired due to inactivity. Please contact the site administrator.' diff --git a/code/upaya/config/locales/devise.two_factor_authentication.en.yml b/code/upaya/config/locales/devise.two_factor_authentication.en.yml new file mode 100644 index 00000000000..88082a32925 --- /dev/null +++ b/code/upaya/config/locales/devise.two_factor_authentication.en.yml @@ -0,0 +1,23 @@ +en: + devise: + errors: + messages: + select_two_factor: You must select a two factor authenticaton preference. + user_not_authenticated: Access denied. Please confirm your one-time password to continue. + + two_factor_authentication: + attempt_failed: Secure one-time password is invalid. Please try again or request a new one-time password. + contact_administrator: Please contact your system administrator. + enter_auth_code: Enter your one-time password + header_text: Enter your one-time password + max_login_attempts_reached: > + Your account is temporarily locked because you have entered the one-time password + incorrectly too many times.

+ Please try again in %{time_remaining}. + otp_setup: 'Every time you log in, you will be given a one-time password. How would you prefer to receive one-time passwords?' + otp_sms_disclaimer: If you select to receive text messaging notification to a U.S. mobile phone number listed in your account and accept these terms and conditions, you acknowledge that Standard Messaging Rates or other charges related to these notifications may apply. + please_confirm: Your two-factor authentication method has been set. Please confirm that it works. + select_two_factor: One-time Password Preferences + success: Two factor authentication successful. + user: + new_otp_sent: A new one-time password has been sent. diff --git a/code/upaya/config/locales/en.yml b/code/upaya/config/locales/en.yml new file mode 100644 index 00000000000..5ef7e468f9f --- /dev/null +++ b/code/upaya/config/locales/en.yml @@ -0,0 +1,271 @@ +en: + elis: + alerts: + caution: Caution! + app_settings_caution: > + These settings affect the functionality of the application. + Take caution in updating any of the following settings. + errors: + not_authorized: 'You are not authorized to perform this action.' + cannot_change_account_type: 'You cannot change account type after creating an account.' + no_account_type: 'Please choose an account type to continue.' + duplicate_questions: 'Please select five unique password reset questions.' + invalid_authenticity_token: 'Oops, something went wrong. Please sign in again.' + must_setup_security_questions: 'You must setup your security questions to continue.' + cannot_reset_user_account: > + You cannot reset the account for the user with email "%{email}" because + they have not set up their security questions yet. Please walk them + through the process of resetting their password via the website's + "Forgot your password?" link. Then, ask them to sign in and set up + their security questions. + forms: + buttons: + continue_browsing: Continue Browsing + resend_confirmation: Resend confirmation instructions + new_account: Create a new account + no_accounts: Not accepting new accounts + required_field: Indicates a required field. + registration: + email_field: Your email address is used to log in to your Upaya Account. All Upaya email communications will be sent to this address. + mobile_field: 'If you wish to have your secure one-time password sent to your mobile phone, enter the number here.' + email_html: > + By signing up, I agree to the ______ Consent + and Upaya Privacy Act Statement. + contact_info: Contact information + already_have_account_html: Already have an account? + need_password: we need your current password to confirm your changes + two_factor: + code: Secure one-time password + make_selection: Please choose at least one delivery method. + confirmation: + show_hdr: Create a Password + show_instructions: Your password must be at least 8 characters in length and contain at least one upper case letter, at least one lower case letter, at least one number, and at least one special character. + session: + need: > + You need to create a new account if you want to: + need_list_html: | +
  • File an application, petition, or request online
  • +
  • Access information about your case and you received either a Case Passcode + from your attorney or accredited representative or + an Account Acceptance Notice from Upaya
  • + advantage: > + Advantages of a Upaya online account: + advantage_list_html: > +
  • File an application, petition, or request with Upaya
  • +
  • Check your case status
  • +
  • Pay the Upaya Immigrant Fee
  • +
  • Check your Upaya Immigrant Fee payment status
  • +
  • Change your U.S. mailing address
  • + notices: + app_setting_created: AppSetting was successfully created. + app_setting_updated: AppSetting was successfully updated. + account_created: > + You have successfully created your account. Upaya password policy + requires you to change your password at least once every 365 days. + Your current password will expire on %{date}. + password_reset: 'You will receive an email with instructions on how to reset your password in a few minutes.' + secret_questions_created: 'You have successfully created your secret questions.' + user_email_changed_by_admin: > + The customer needs to confirm their email (%{email}) before it can be + changed. Please ask the customer to follow the instructions in the + email that was just sent to her or him. + session_timedout: "For your safety, we signed you out after being idle for %{session_timeout}. Please sign in again." + session_timeout_warning: "We noticed you haven't been very active, hence we will sign you out in %{time_left_in_session}. Please click '%{continue_text}' to remain signed in." + titles: + app_settings: + edit: Editing %{app_setting} + index: Application Settings + new: New App Setting + show: Viewing %{app_setting} + confirmations: + new: Resend confirmation instructions for your Upaya Account + show: Create a Password for your Upaya Account + dashboard: Your Upaya Account + enter_2fa_code: Enter the secure one-time password to log in to your Upaya Account + account_locked: Account Locked + enter_auth_code: Enter the authenticaton code for your Upaya Account + faqs: + edit: Editing FAQ + index: Frequently Asked Questions + new: Create a new FAQ + show: Viewing FAQ + passwords: + change: Change your password for your Upaya Account + forgot: Reset your password for your Upaya Account + update: Update your password for your Upaya Account + registrations: + account: Choose an account type + edit: Edit your Upaya Account + new: Sign up for a Upaya Account + confirm_type: Confirm that you are a representative + security_questions: + confirm: Verify Your Identity + new: Provide Password Reset Answers + select_two_factor: One-time Password Preference + sign_in: Sign in to your Upaya Account + tech_support: + index: Tech Support + show: Tech Support + users: + edit: Editing User - %{user} + index: Manage Users + show: User - %{user} + visitors: + index: Welcome to US Citizenship and Immigration Services + + headings: + admin: + index: Admin Interface + app_settings: + edit: Editing %{app_setting} + index: Application Settings + new: New App Setting + confirmations: + new: Resend confirmation instructions + show: "Instructions: Enter your password" + dashboard: + index: My Services + faqs: + edit: Editing FAQ + index: Frequently Asked Questions + new: New FAQ + log_in: Sign In + log_out: Sign Out + passwords: + change: Change your password + forgot: Forgot your password? + update: Update your password + registrations: + account: Account Type + edit: My Profile + new: Sign Up + search: Search for a user + session_timeout_warning: Session Timeout + tech_support: + index: Tech Support + show: Tech Support + users: + edit: Edit User + index: Users + show: User Details + visitors: + index: Upaya + new_account: Create a new account + + mailer: + password_expires_soon: + subject: Password Expiration Notice + + activerecord: + attributes: + user: + account_types: + label: "Choose an account type" + default: "-- Select One --" + errors: + models: + app_setting: + attributes: + value: + cannot_disable_2fa_in_prod: 'Two-factor Authentication cannot be disabled in production' + invalid: "Value must be '1' or '0'" + user: + attributes: + current_password: + invalid: "Your password must match your current password." + password_confirmation: + confirmation: "does not match password" + mobile: + improbable_phone: "Mobile number is invalid. Please make sure you enter a 10-digit phone number." + second_factors: + blank: 'Please choose at least one Two-Factor Authentication method' + valid_email: + validations: + email: + invalid: 'Please enter a valid email in the format of user@domain.com' + idp: + errors: + account_type: Only the applicant can verify their identity + service_unavailable: > + We are having trouble connecting to the Upaya identity verification service. + Please try again. + titles: + welcome: Verify your identity + question: Identity Quiz + fail: Identity verification unsuccessful + hardfail: We cannot verify your identity + complete: Identity verification complete + inprogress: Identity Quiz Incomplete + resume_quiz: Resume Identity Quiz + headings: + questions: Identity Quiz + index: We need to confirm your identity. + sorry: Sorry, we could not confirm your identity. + thanks: Thanks for confirming your identity. + inprogress: Continue your identity quiz? + resume_quiz: Resume your identity quiz? + generating: Generating Quiz + body: + index_intro_html: > +

    To protect your information, we need to confirm that you are who you say you are. + Only you, the immigrant receiving a Green Card, + are allowed to create a Upaya online account.

    +

    Attorneys, accredited representatives, preparers, interpreters, or notaries cannot create a + Upaya online account for you. If you are not the immigrant who will receive the Green Card, + please click Cancel to exit this screen.

    + index_info_html: > + Once you click Get Started, + we will ask you a series of questions to confirm your identity. + You may find it helpful to refer to the following documents before you begin: + fail_html: > + You may take this quiz again.

    + Before you take the quiz, you may find it helpful to refer to the following documents: + documents: + - Your passport(s) + - A copy of your visa application(s) + - Your Immigrant Data Summary Sheet + time_limit: You will have 60 minutes to complete the quiz. + hardfail_html: > + Until we can verify your identity, you cannot use a Upaya online account to change your U.S. + mailing address or view your case history. However, you can still track the status of your + Green Card through Case Status Online. + You will need your Upaya Receipt Number to get the status of your case. The receipt number + will begin with the letters "IOE." You can also change your address with Upaya by visiting + the Change of Address + website. + hardfail_kicker_html: > + Please contact the Customer Contact Center + by filling out the online help form if you need further assistance. + inprogress: > + It appears you have not successfully completed an identity quiz. + Do you want to continue confirming your identity? + generating: This can take up to a minute. We will start your quiz when it is ready. + resume_quiz: > + We were not able to retrieve your question. Would you like to try again? + complete: > + You can now access your Upaya online account to get status updates, update your online + account profile, and change your U.S. mailing address. + misc: + index_kicker: Are you ready to start? + no_more_questions: Not enough questions could be generated for the quiz. + timeout_alert: You have exceeded the 60 minutes allowed for the quiz. + too_many_times: You have attempted the quiz too many times + labels: + start: Get started! + next: "Next " + again: Take the Identity Verification Quiz again + continue: Continue + retry_quiz: Retry Quiz + hide_finder: "Hide document" + hide_finder_hidden: " sample displayed below" + where_find: "Where do I find this?" + where_find_hidden: "– Display document sample below" + resume_quiz: Resume Quiz + links: + no_thanks: Cancel + exit_quiz_now: Exit + home: Go back + accessibility: + next: Next question + start: Get started with the identity quiz + no_thanks: Cancel quiz diff --git a/code/upaya/config/locales/security_questions.en.yml b/code/upaya/config/locales/security_questions.en.yml new file mode 100644 index 00000000000..c94ff4c964f --- /dev/null +++ b/code/upaya/config/locales/security_questions.en.yml @@ -0,0 +1,5 @@ +en: + devise: + security_questions: + user: + invalid_token: Invalid password reset token. Please try again. diff --git a/code/upaya/config/locales/simple_form.en.yml b/code/upaya/config/locales/simple_form.en.yml new file mode 100644 index 00000000000..9e4147d8670 --- /dev/null +++ b/code/upaya/config/locales/simple_form.en.yml @@ -0,0 +1,38 @@ +en: + simple_form: + "yes": 'Yes' + "no": 'No' + required: + text: 'This field is required' + mark: '*' + # You can uncomment the line below if you need to overwrite the whole required html. + # When using html, text and mark won't be used. + # html: '*' + error_notification: + default_message: "Please review the problems below:" + + labels: + user: + account_type: "Select an account type:" + + options: + user: + account_type: + # TODO move this markup into template(s) + self: | +

    + + I am a Customer.

    +

    + I am submitting an application, petition, or request for myself or a family member. +

    + representative: | +

    + + I am a Legal Representative.

    +

    + I am an attorney eligible to practice law in the United States. +

    +

    + I am a representative of a qualified organization that is recognized by the Board of Immigration Appeals (BIA). +

    diff --git a/code/upaya/config/routes.rb b/code/upaya/config/routes.rb new file mode 100644 index 00000000000..3f66539d543 --- /dev/null +++ b/code/upaya/config/routes.rb @@ -0,0 +1,56 @@ +Rails.application.routes.draw do + # The priority is based upon order of creation: first created -> highest priority. + # See how all your routes lay out with "rake routes". + + # You can have the root of your site routed with "root" + # root 'welcome#index' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/code/upaya/config/secrets.yml.example b/code/upaya/config/secrets.yml.example new file mode 100644 index 00000000000..4e9e703304d --- /dev/null +++ b/code/upaya/config/secrets.yml.example @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: e1dfd52b4cf2ce7d416cd5c99b1344c7bf56a44567f5230836e4089faf6f099cefc3d761430de52f63bdf1365f6b2ac948f467ecb1f731d74bf72ed5aae82dd9 + +test: + secret_key_base: 1b6ae780463cf5b6aaf4b9ea4c865b5b56ab53bb114d212b8b3272a874d6edcfc6b1dfc4f75c6a732b6c4d6cc670d0cfcac585df2b5f98b2e96407e6b41fda1c + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/code/upaya/db/migrate/20160405212342_add_initial_schema.rb b/code/upaya/db/migrate/20160405212342_add_initial_schema.rb new file mode 100644 index 00000000000..7af9bfc36fc --- /dev/null +++ b/code/upaya/db/migrate/20160405212342_add_initial_schema.rb @@ -0,0 +1,153 @@ +class InitialSchema < ActiveRecord::Migration + def change + create_table "app_settings", force: :cascade do |t| + t.string "name", limit: 255 + t.string "value", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "app_settings", ["name"], name: "index_app_settings_on_name", using: :btree + + create_table "authorizations", force: :cascade do |t| + t.string "provider", limit: 255 + t.string "uid", limit: 255 + t.integer "user_id", limit: 4 + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "authorized_at" + end + + add_index "authorizations", ["provider", "uid"], name: "index_authorizations_on_provider_and_uid", using: :btree + add_index "authorizations", ["user_id"], name: "index_authorizations_on_user_id", using: :btree + + create_table "identities", force: :cascade do |t| + t.string "service_provider", limit: 255 + t.string "authn_context", limit: 255 + t.datetime "last_authenticated_at" + t.integer "user_id", limit: 4 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "session_index", limit: 4 + t.string "session_uuid", limit: 255 + t.boolean "quiz_started", default: false + end + + add_index "identities", ["service_provider", "authn_context"], name: "index_identities_on_service_provider_and_authn_context", using: :btree + add_index "identities", ["session_uuid"], name: "index_identities_on_session_uuid", unique: true, using: :btree + add_index "identities", ["user_id"], name: "index_identities_on_user_id", using: :btree + + create_table "old_passwords", force: :cascade do |t| + t.string "encrypted_password", limit: 255, null: false + t.string "password_salt", limit: 255 + t.string "password_archivable_type", limit: 255, null: false + t.integer "password_archivable_id", limit: 4, null: false + t.datetime "created_at" + end + + add_index "old_passwords", ["password_archivable_type", "password_archivable_id"], name: "index_password_archivable", using: :btree + + create_table "second_factors", force: :cascade do |t| + t.string "name", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "second_factors", ["name"], name: "index_second_factors_on_name", unique: true, using: :btree + + create_table "second_factors_users", id: false, force: :cascade do |t| + t.integer "user_id", limit: 4, null: false + t.integer "second_factor_id", limit: 4, null: false + end + + add_index "second_factors_users", ["user_id", "second_factor_id"], name: "index_second_factors_users_on_user_id_and_second_factor_id", unique: true, using: :btree + + create_table "security_answers", force: :cascade do |t| + t.integer "question_id", limit: 4 + t.integer "user_id", limit: 4 + t.datetime "created_at" + t.datetime "updated_at" + t.string "encrypted_text", limit: 255 + t.string "encrypted_text_iv", limit: 255 + t.string "encrypted_text_salt", limit: 255 + t.integer "security_question_id", limit: 4 + end + + add_index "security_answers", ["question_id", "user_id"], name: "index_security_answers_on_question_id_and_user_id", unique: true, using: :btree + add_index "security_answers", ["security_question_id", "user_id"], name: "index_security_answers_on_security_question_id_and_user_id", unique: true, using: :btree + add_index "security_answers", ["security_question_id"], name: "index_security_answers_on_security_question_id", using: :btree + add_index "security_answers", ["user_id"], name: "index_security_answers_on_user_id", using: :btree + + create_table "security_questions", force: :cascade do |t| + t.text "question", limit: 65535, null: false + t.boolean "active", default: true, null: false + t.integer "old_index", limit: 4, default: 0 + end + + create_table "sessions", force: :cascade do |t| + t.string "session_id", limit: 255, null: false + t.text "data", limit: 65535 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", unique: true, using: :btree + add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree + + create_table "users", force: :cascade do |t| + t.string "email", limit: 255, default: "", null: false + t.string "encrypted_password", limit: 255, default: "" + t.string "reset_password_token", limit: 255 + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.integer "sign_in_count", limit: 4, default: 0, null: false + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip", limit: 255 + t.string "last_sign_in_ip", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + t.string "confirmation_token", limit: 255 + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.string "unconfirmed_email", limit: 255 + t.integer "role", limit: 4 + t.string "otp_secret_key", limit: 255 + t.integer "second_factor_attempts_count", limit: 4, default: 0 + t.string "mobile", limit: 255 + t.string "uuid", limit: 255, null: false + t.datetime "password_changed_at" + t.datetime "second_factor_confirmed_at" + t.integer "security_question_attempts_count", limit: 4, default: 0 + t.datetime "security_questions_answered_at" + t.datetime "reset_requested_at" + t.datetime "second_factor_locked_at" + t.datetime "locked_at" + t.integer "failed_attempts", limit: 4, default: 0 + t.string "unlock_token", limit: 255 + t.integer "account_type", limit: 4 + t.datetime "mobile_confirmed_at" + t.string "unconfirmed_mobile", limit: 255 + t.integer "ial", limit: 4, default: 0, null: false + t.string "ial_token", limit: 255 + t.boolean "idp_hard_fail", default: false + t.string "encrypted_otp_secret_key", limit: 255 + t.string "encrypted_otp_secret_key_iv", limit: 255 + t.string "encrypted_otp_secret_key_salt", limit: 255 + end + + add_index "users", ["account_type"], name: "index_users_on_account_type", using: :btree + add_index "users", ["uuid"], name: "index_users_on_uuid", unique: true, using: :btree + add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree + add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree + add_index "users", ["encrypted_otp_secret_key"], name: "index_users_on_encrypted_otp_secret_key", unique: true, using: :btree + add_index "users", ["ial_token"], name: "index_users_on_ial_token", unique: true, using: :btree + add_index "users", ["mobile"], name: "index_users_on_mobile", using: :btree + add_index "users", ["otp_secret_key"], name: "index_users_on_otp_secret_key", unique: true, using: :btree + add_index "users", ["password_changed_at"], name: "index_users_on_password_changed_at", using: :btree + add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree + add_index "users", ["unconfirmed_email"], name: "index_users_on_unconfirmed_email", using: :btree + add_index "users", ["unconfirmed_mobile"], name: "index_users_on_unconfirmed_mobile", using: :btree + add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", using: :btree + end +end diff --git a/code/upaya/db/schema.rb b/code/upaya/db/schema.rb new file mode 100644 index 00000000000..51a39ab70b0 --- /dev/null +++ b/code/upaya/db/schema.rb @@ -0,0 +1,169 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20160405212342) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "app_settings", force: :cascade do |t| + t.string "name", limit: 255 + t.string "value", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "app_settings", ["name"], name: "index_app_settings_on_name", using: :btree + + create_table "authorizations", force: :cascade do |t| + t.string "provider", limit: 255 + t.string "uid", limit: 255 + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "authorized_at" + end + + add_index "authorizations", ["provider", "uid"], name: "index_authorizations_on_provider_and_uid", using: :btree + add_index "authorizations", ["user_id"], name: "index_authorizations_on_user_id", using: :btree + + create_table "identities", force: :cascade do |t| + t.string "service_provider", limit: 255 + t.string "authn_context", limit: 255 + t.datetime "last_authenticated_at" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "session_index" + t.string "session_uuid", limit: 255 + t.boolean "quiz_started", default: false + end + + add_index "identities", ["service_provider", "authn_context"], name: "index_identities_on_service_provider_and_authn_context", using: :btree + add_index "identities", ["session_uuid"], name: "index_identities_on_session_uuid", unique: true, using: :btree + add_index "identities", ["user_id"], name: "index_identities_on_user_id", using: :btree + + create_table "old_passwords", force: :cascade do |t| + t.string "encrypted_password", limit: 255, null: false + t.string "password_salt", limit: 255 + t.string "password_archivable_type", limit: 255, null: false + t.integer "password_archivable_id", null: false + t.datetime "created_at" + end + + add_index "old_passwords", ["password_archivable_type", "password_archivable_id"], name: "index_password_archivable", using: :btree + + create_table "second_factors", force: :cascade do |t| + t.string "name", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "second_factors", ["name"], name: "index_second_factors_on_name", unique: true, using: :btree + + create_table "second_factors_users", id: false, force: :cascade do |t| + t.integer "user_id", null: false + t.integer "second_factor_id", null: false + end + + add_index "second_factors_users", ["user_id", "second_factor_id"], name: "index_second_factors_users_on_user_id_and_second_factor_id", unique: true, using: :btree + + create_table "security_answers", force: :cascade do |t| + t.integer "question_id" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "encrypted_text", limit: 255 + t.string "encrypted_text_iv", limit: 255 + t.string "encrypted_text_salt", limit: 255 + t.integer "security_question_id" + end + + add_index "security_answers", ["question_id", "user_id"], name: "index_security_answers_on_question_id_and_user_id", unique: true, using: :btree + add_index "security_answers", ["security_question_id", "user_id"], name: "index_security_answers_on_security_question_id_and_user_id", unique: true, using: :btree + add_index "security_answers", ["security_question_id"], name: "index_security_answers_on_security_question_id", using: :btree + add_index "security_answers", ["user_id"], name: "index_security_answers_on_user_id", using: :btree + + create_table "security_questions", force: :cascade do |t| + t.text "question", null: false + t.boolean "active", default: true, null: false + t.integer "old_index", default: 0 + end + + create_table "sessions", force: :cascade do |t| + t.string "session_id", limit: 255, null: false + t.text "data" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", unique: true, using: :btree + add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree + + create_table "users", force: :cascade do |t| + t.string "email", limit: 255, default: "", null: false + t.string "encrypted_password", limit: 255, default: "" + t.string "reset_password_token", limit: 255 + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.integer "sign_in_count", default: 0, null: false + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip", limit: 255 + t.string "last_sign_in_ip", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + t.string "confirmation_token", limit: 255 + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.string "unconfirmed_email", limit: 255 + t.integer "role" + t.string "otp_secret_key", limit: 255 + t.integer "second_factor_attempts_count", default: 0 + t.string "mobile", limit: 255 + t.string "uuid", limit: 255, null: false + t.datetime "password_changed_at" + t.datetime "second_factor_confirmed_at" + t.integer "security_question_attempts_count", default: 0 + t.datetime "security_questions_answered_at" + t.datetime "reset_requested_at" + t.datetime "second_factor_locked_at" + t.datetime "locked_at" + t.integer "failed_attempts", default: 0 + t.string "unlock_token", limit: 255 + t.integer "account_type" + t.datetime "mobile_confirmed_at" + t.string "unconfirmed_mobile", limit: 255 + t.integer "ial", default: 0, null: false + t.string "ial_token", limit: 255 + t.boolean "idp_hard_fail", default: false + t.string "encrypted_otp_secret_key", limit: 255 + t.string "encrypted_otp_secret_key_iv", limit: 255 + t.string "encrypted_otp_secret_key_salt", limit: 255 + end + + add_index "users", ["account_type"], name: "index_users_on_account_type", using: :btree + add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree + add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree + add_index "users", ["encrypted_otp_secret_key"], name: "index_users_on_encrypted_otp_secret_key", unique: true, using: :btree + add_index "users", ["ial_token"], name: "index_users_on_ial_token", unique: true, using: :btree + add_index "users", ["mobile"], name: "index_users_on_mobile", using: :btree + add_index "users", ["otp_secret_key"], name: "index_users_on_otp_secret_key", unique: true, using: :btree + add_index "users", ["password_changed_at"], name: "index_users_on_password_changed_at", using: :btree + add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree + add_index "users", ["unconfirmed_email"], name: "index_users_on_unconfirmed_email", using: :btree + add_index "users", ["unconfirmed_mobile"], name: "index_users_on_unconfirmed_mobile", using: :btree + add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", using: :btree + add_index "users", ["uuid"], name: "index_users_on_uuid", unique: true, using: :btree + +end diff --git a/code/upaya/db/seeds.rb b/code/upaya/db/seeds.rb new file mode 100644 index 00000000000..5ee82698253 --- /dev/null +++ b/code/upaya/db/seeds.rb @@ -0,0 +1,12 @@ +require "#{Rails.root}/db/data/faq_importer" +require "#{Rails.root}/lib/security_question_populator" +include SecurityQuestionPopulator + +# create second factors (email and sms) +%w(Email Mobile).collect { |factor| SecondFactor.find_or_create_by!(name: factor) } + +AppSetting.find_or_create_by!(name: 'RegistrationsEnabled') do |setting| + setting.value = '1' +end + +# populate_security_questions unless Rails.env.test? diff --git a/code/upaya/lib/assets/.keep b/code/upaya/lib/assets/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/lib/tasks/.keep b/code/upaya/lib/tasks/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/log/.keep b/code/upaya/log/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/public/404.html b/code/upaya/public/404.html new file mode 100644 index 00000000000..b612547fc21 --- /dev/null +++ b/code/upaya/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
    +
    +

    The page you were looking for doesn't exist.

    +

    You may have mistyped the address or the page may have moved.

    +
    +

    If you are the application owner check the logs for more information.

    +
    + + diff --git a/code/upaya/public/422.html b/code/upaya/public/422.html new file mode 100644 index 00000000000..a21f82b3bdb --- /dev/null +++ b/code/upaya/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
    +
    +

    The change you wanted was rejected.

    +

    Maybe you tried to change something you didn't have access to.

    +
    +

    If you are the application owner check the logs for more information.

    +
    + + diff --git a/code/upaya/public/500.html b/code/upaya/public/500.html new file mode 100644 index 00000000000..061abc587dc --- /dev/null +++ b/code/upaya/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
    +
    +

    We're sorry, but something went wrong.

    +
    +

    If you are the application owner check the logs for more information.

    +
    + + diff --git a/code/upaya/public/favicon.ico b/code/upaya/public/favicon.ico new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/public/robots.txt b/code/upaya/public/robots.txt new file mode 100644 index 00000000000..3c9c7c01f30 --- /dev/null +++ b/code/upaya/public/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-agent: * +# Disallow: / diff --git a/code/upaya/test/controllers/.keep b/code/upaya/test/controllers/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/test/fixtures/.keep b/code/upaya/test/fixtures/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/test/helpers/.keep b/code/upaya/test/helpers/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/test/integration/.keep b/code/upaya/test/integration/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/test/mailers/.keep b/code/upaya/test/mailers/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/test/models/.keep b/code/upaya/test/models/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/test/test_helper.rb b/code/upaya/test/test_helper.rb new file mode 100644 index 00000000000..92e39b2d78c --- /dev/null +++ b/code/upaya/test/test_helper.rb @@ -0,0 +1,10 @@ +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/code/upaya/vendor/assets/javascripts/.keep b/code/upaya/vendor/assets/javascripts/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/vendor/assets/stylesheets/.keep b/code/upaya/vendor/assets/stylesheets/.keep new file mode 100644 index 00000000000..e69de29bb2d