diff --git a/Gemfile b/Gemfile index f2f6845..bb6413b 100644 --- a/Gemfile +++ b/Gemfile @@ -9,17 +9,9 @@ gem 'rails', '~> 5.2.0' gem 'pg', '>= 0.18', '< 2.0' # Use Puma as the app server gem 'puma', '~> 3.11' -# Use SCSS for stylesheets -gem 'sass-rails', '~> 5.0' -# Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 1.3.0' - -# Use CoffeeScript for .coffee assets and views -gem 'coffee-rails', '~> 4.2' -# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks -gem 'turbolinks', '~> 5' + # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem 'jbuilder', '~> 2.5' +# gem 'jbuilder', '~> 2.5' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false @@ -81,8 +73,6 @@ group :development, :test do end group :development do - # Access an interactive console on exception pages or by calling 'console' anywhere in the code. - gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' @@ -90,12 +80,6 @@ group :development do end group :test do - # Adds support for Capybara system testing and selenium driver - gem 'capybara', '>= 2.15', '< 4.0' - gem 'selenium-webdriver' - # Easy installation and use of chromedriver to run system tests with Chrome - gem 'chromedriver-helper' - # mock http request gem 'webmock', '~> 3.4', '>= 3.4.2' gem 'codecov', :require => false diff --git a/Gemfile.lock b/Gemfile.lock index 28d010b..b057be7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,32 +49,17 @@ GEM tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - archive-zip (0.11.0) - io-like (~> 0.3.0) arel (9.0.0) ast (2.4.0) awesome_print (1.8.0) - bindex (0.5.0) bitcoin-secp256k1 (0.4.0) ffi (>= 1.9.10) bootsnap (1.3.2) msgpack (~> 1.0) builder (3.2.3) byebug (10.0.2) - capybara (3.7.2) - addressable - mini_mime (>= 0.1.3) - nokogiri (~> 1.8) - rack (>= 1.6.0) - rack-test (>= 0.6.3) - xpath (~> 3.1) case_transform (0.2) activesupport - childprocess (0.9.0) - ffi (~> 1.0, >= 1.0.11) - chromedriver-helper (2.1.0) - archive-zip (~> 0.10) - nokogiri (~> 1.8) ciri-crypto (0.1.1) bitcoin-secp256k1 (~> 0.4.0) ciri-utils (~> 0.2.0) @@ -85,13 +70,6 @@ GEM simplecov url coderay (1.1.2) - coffee-rails (4.2.2) - coffee-script (>= 2.2.0) - railties (>= 4.0.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) concurrent-ruby (1.0.5) crack (0.4.3) safe_yaml (~> 1.0.0) @@ -109,7 +87,6 @@ GEM ethereum.rb (2.2) activesupport (>= 4.0) digest-sha3 (~> 1.1) - execjs (2.7.0) factory_bot (4.11.1) activesupport (>= 3.0.0) factory_bot_rails (4.11.1) @@ -126,11 +103,7 @@ GEM railties (>= 5.0) i18n (1.1.0) concurrent-ruby (~> 1.0) - io-like (0.3.0) jaro_winkler (1.5.1) - jbuilder (2.7.0) - activesupport (>= 4.2.0) - multi_json (>= 1.2) json (2.1.0) jsonapi-renderer (0.2.0) kaminari (1.1.1) @@ -170,7 +143,6 @@ GEM mini_portile2 (2.3.0) minitest (5.11.3) msgpack (1.2.4) - multi_json (1.13.1) multipart-post (2.0.0) nio4r (2.3.1) nokogiri (1.8.5) @@ -254,22 +226,7 @@ GEM unicode-display_width (~> 1.0, >= 1.0.1) ruby-progressbar (1.10.0) ruby_dep (1.5.0) - rubyzip (1.2.2) safe_yaml (1.0.4) - sass (3.6.0) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) - selenium-webdriver (3.14.0) - childprocess (~> 0.5) - rubyzip (~> 1.2) simplecov (0.16.1) docile (~> 1.1) json (>= 1.8, < 3) @@ -289,21 +246,10 @@ GEM sprockets (>= 3.0.0) thor (0.20.0) thread_safe (0.3.6) - tilt (2.0.8) - turbolinks (5.2.0) - turbolinks-source (~> 5.2) - turbolinks-source (5.2.0) tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (4.1.19) - execjs (>= 0.3.0, < 3) unicode-display_width (1.4.0) url (0.3.2) - web-console (3.7.0) - actionview (>= 5.0) - activemodel (>= 5.0) - bindex (>= 0.4.0) - railties (>= 5.0) webmock (3.4.2) addressable (>= 2.3.6) crack (>= 0.3.2) @@ -311,8 +257,6 @@ GEM websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) - xpath (3.1.0) - nokogiri (~> 1.8) yard (0.9.16) yard-activesupport-concern (0.0.1) yard (>= 0.8) @@ -325,11 +269,8 @@ DEPENDENCIES awesome_print bootsnap (>= 1.1.0) byebug - capybara (>= 2.15, < 4.0) - chromedriver-helper ciri-crypto (= 0.1.1) codecov - coffee-rails (~> 4.2) daemons (~> 1.2, >= 1.2.6) database_cleaner dotenv-rails @@ -338,7 +279,6 @@ DEPENDENCIES faraday (~> 0.15.2) google-protobuf (~> 3.6) health_check (~> 3.0) - jbuilder (~> 2.5) kaminari (~> 1.1, >= 1.1.1) listen (>= 3.0.5, < 3.2) mina @@ -354,15 +294,10 @@ DEPENDENCIES ransack (~> 2.0, >= 2.0.1) rspec-rails (~> 3.7) rubocop (~> 0.59) - sass-rails (~> 5.0) - selenium-webdriver simplecov spring spring-watcher-listen (~> 2.0.0) - turbolinks (~> 5) tzinfo-data - uglifier (>= 1.3.0) - web-console (>= 3.3.0) webmock (~> 3.4, >= 3.4.2) yard (~> 0.9.14) yard-activesupport-concern diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js deleted file mode 100644 index b16e53d..0000000 --- a/app/assets/config/manifest.js +++ /dev/null @@ -1,3 +0,0 @@ -//= link_tree ../images -//= link_directory ../javascripts .js -//= link_directory ../stylesheets .css diff --git a/app/assets/images/.keep b/app/assets/images/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/javascripts/api/blocks.coffee b/app/assets/javascripts/api/blocks.coffee deleted file mode 100644 index 24f83d1..0000000 --- a/app/assets/javascripts/api/blocks.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/api/statistics.coffee b/app/assets/javascripts/api/statistics.coffee deleted file mode 100644 index 24f83d1..0000000 --- a/app/assets/javascripts/api/statistics.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/api/transactions.coffee b/app/assets/javascripts/api/transactions.coffee deleted file mode 100644 index 24f83d1..0000000 --- a/app/assets/javascripts/api/transactions.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js deleted file mode 100644 index 82e6f0f..0000000 --- a/app/assets/javascripts/application.js +++ /dev/null @@ -1,16 +0,0 @@ -// 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, 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. JavaScript code in this file should be added after the last require_* statement. -// -// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require rails-ujs -//= require activestorage -//= require turbolinks -//= require_tree . diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js deleted file mode 100644 index 739aa5f..0000000 --- a/app/assets/javascripts/cable.js +++ /dev/null @@ -1,13 +0,0 @@ -// Action Cable provides the framework to deal with WebSockets in Rails. -// You can generate new channels where WebSocket features live using the `rails generate channel` command. -// -//= require action_cable -//= require_self -//= require_tree ./channels - -(function() { - this.App || (this.App = {}); - - App.cable = ActionCable.createConsumer(); - -}).call(this); diff --git a/app/assets/javascripts/channels/.keep b/app/assets/javascripts/channels/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/stylesheets/api/blocks.scss b/app/assets/stylesheets/api/blocks.scss deleted file mode 100644 index a32c1d3..0000000 --- a/app/assets/stylesheets/api/blocks.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the api::blocks controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/api/statistics.scss b/app/assets/stylesheets/api/statistics.scss deleted file mode 100644 index 0621247..0000000 --- a/app/assets/stylesheets/api/statistics.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the api::statistics controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/api/transactions.scss b/app/assets/stylesheets/api/transactions.scss deleted file mode 100644 index ef0e990..0000000 --- a/app/assets/stylesheets/api/transactions.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the api::transactions controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css deleted file mode 100644 index d05ea0f..0000000 --- a/app/assets/stylesheets/application.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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, 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 other CSS/SCSS - * files in this directory. Styles in this file should be added after the last require_* statement. - * It is generally better to create a new file per style scope. - * - *= require_tree . - *= require_self - */ diff --git a/app/helpers/api/blocks_helper.rb b/app/helpers/api/blocks_helper.rb deleted file mode 100644 index 2b7d55a..0000000 --- a/app/helpers/api/blocks_helper.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -module Api::BlocksHelper -end diff --git a/app/helpers/api/statistics_helper.rb b/app/helpers/api/statistics_helper.rb deleted file mode 100644 index 212220f..0000000 --- a/app/helpers/api/statistics_helper.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -module Api::StatisticsHelper -end diff --git a/app/helpers/api/transactions_helper.rb b/app/helpers/api/transactions_helper.rb deleted file mode 100644 index 0958639..0000000 --- a/app/helpers/api/transactions_helper.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -module Api::TransactionsHelper -end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb deleted file mode 100644 index 15b06f0..0000000 --- a/app/helpers/application_helper.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -module ApplicationHelper -end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index 7d3a297..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - - - - ReBirth - <%= csrf_meta_tags %> - <%= csp_meta_tag %> - - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> - <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> - - - - <%= yield %> - - diff --git a/bin/setup b/bin/setup index 94fd4d7..a334d86 100755 --- a/bin/setup +++ b/bin/setup @@ -17,9 +17,6 @@ chdir APP_ROOT do system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') - # Install JavaScript dependencies if using Yarn - # system('bin/yarn') - # puts "\n== Copying sample files ==" # unless File.exist?('config/database.yml') # cp 'config/database.yml.sample', 'config/database.yml' diff --git a/bin/update b/bin/update index 58bfaed..67d0d49 100755 --- a/bin/update +++ b/bin/update @@ -17,9 +17,6 @@ chdir APP_ROOT do system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') - # Install JavaScript dependencies if using Yarn - # system('bin/yarn') - puts "\n== Updating database ==" system! 'bin/rails db:migrate' diff --git a/bin/yarn b/bin/yarn deleted file mode 100755 index 460dd56..0000000 --- a/bin/yarn +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env ruby -APP_ROOT = File.expand_path('..', __dir__) -Dir.chdir(APP_ROOT) do - begin - exec "yarnpkg", *ARGV - rescue Errno::ENOENT - $stderr.puts "Yarn executable was not detected in the system." - $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" - exit 1 - end -end diff --git a/config/application.rb b/config/application.rb index 336b6d6..042acb7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,6 +1,18 @@ require_relative 'boot' -require 'rails/all' +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +require "active_storage/engine" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "action_cable/engine" +# require "sprockets/railtie" +require "rails/test_unit/railtie" + # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. @@ -16,6 +28,11 @@ class Application < Rails::Application # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. + # Only loads a smaller set of middleware suitable for API only apps. + # Middleware like session, flash, cookies can be added back manually. + # Skip views, helpers and assets when generating a new resource. + config.api_only = true + # cors config config.middleware.insert_before 0, Rack::Cors do allow do diff --git a/config/deploy.rb b/config/deploy.rb index 0f98a9a..5c9f4c6 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -63,7 +63,6 @@ task :setup do # command %{rbenv install 2.3.0 --skip-existing} command %[touch "#{fetch(:shared_path)}/config/puma.rb"] - command %[touch "#{fetch(:shared_path)}/config/master.key"] command %[touch "#{fetch(:shared_path)}/.env.local"] comment color_str("Be sure to edit config files") end @@ -79,7 +78,7 @@ invoke :'deploy:link_shared_paths' invoke :'bundle:install' invoke :'rails:db_migrate' - invoke :'rails:assets_precompile' + # invoke :'rails:assets_precompile' invoke :'deploy:cleanup' on :launch do diff --git a/config/environments/development.rb b/config/environments/development.rb index 1311e3e..ee2a416 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -44,14 +44,6 @@ # Highlight code that triggered database queries in logs. config.active_record.verbose_query_logs = true - # 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 - - # Suppress logger output for asset requests. - config.assets.quiet = true - # Raises error for missing translations # config.action_view.raise_on_missing_translations = true diff --git a/config/environments/production.rb b/config/environments/production.rb index aefcf79..1c3703b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -22,15 +22,6 @@ # Apache or NGINX already handles this. config.public_file_server.enabled = 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 - - # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb deleted file mode 100644 index 4b828e8..0000000 --- a/config/initializers/assets.rb +++ /dev/null @@ -1,14 +0,0 @@ -# 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 -# Add Yarn node_modules folder to the asset load path. -Rails.application.config.assets.paths << Rails.root.join('node_modules') - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb deleted file mode 100644 index d3bcaa5..0000000 --- a/config/initializers/content_security_policy.rb +++ /dev/null @@ -1,25 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Define an application-wide content security policy -# For further information see the following documentation -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy - -# Rails.application.config.content_security_policy do |policy| -# policy.default_src :self, :https -# policy.font_src :self, :https, :data -# policy.img_src :self, :https, :data -# policy.object_src :none -# policy.script_src :self, :https -# policy.style_src :self, :https - -# # Specify URI for violation reports -# # policy.report_uri "/csp-violation-report-endpoint" -# end - -# If you are using UJS then enable automatic nonce generation -# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } - -# Report CSP violations to a specified URI -# For further information see the following documentation: -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only -# Rails.application.config.content_security_policy_report_only = true diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb deleted file mode 100644 index 5a6a32d..0000000 --- a/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Specify a serializer for the signed and encrypted cookie jars. -# Valid options are :json, :marshal, and :hybrid. -Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/package.json b/package.json deleted file mode 100644 index 3f301e9..0000000 --- a/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "re-birth", - "private": true, - "dependencies": {} -} diff --git a/public/404.html b/public/404.html deleted file mode 100644 index 2be3af2..0000000 --- a/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - 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/public/422.html b/public/422.html deleted file mode 100644 index c08eac0..0000000 --- a/public/422.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - 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/public/500.html b/public/500.html deleted file mode 100644 index 78a030a..0000000 --- a/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - 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/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png deleted file mode 100644 index e69de29..0000000 diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png deleted file mode 100644 index e69de29..0000000 diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index e69de29..0000000