From b502b95241bc8f0d0ac7d613d6c68ef376940c38 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Thu, 25 Jan 2024 10:58:43 +0100 Subject: [PATCH 1/6] Disallow all robots --- frontend/public/robots.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/public/robots.txt b/frontend/public/robots.txt index 25d7f0e0d6..0424c57780 100644 --- a/frontend/public/robots.txt +++ b/frontend/public/robots.txt @@ -1,6 +1,4 @@ # All robots allowed User-agent: * -Disallow: +Disallow: / -# Sitemap files -Sitemap: https://supplychains.trase.earth/sitemap.xml From 7784cb33a5c1ac3805b74a80286398b164aff525 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Thu, 25 Jan 2024 11:05:12 +0100 Subject: [PATCH 2/6] Removed obsolete deployment scripts --- .standard_todo.yml | 8 -------- config/deploy/demo.rb | 3 --- config/deploy/indonesiademo.rb | 3 --- config/deploy/sandbox.rb | 4 ---- config/deploy/staging.rb | 3 --- 5 files changed, 21 deletions(-) delete mode 100644 config/deploy/demo.rb delete mode 100644 config/deploy/indonesiademo.rb delete mode 100644 config/deploy/sandbox.rb delete mode 100644 config/deploy/staging.rb diff --git a/.standard_todo.yml b/.standard_todo.yml index 2eae9af95e..b038e16b15 100644 --- a/.standard_todo.yml +++ b/.standard_todo.yml @@ -707,16 +707,8 @@ ignore: - config/deploy.rb: - Style/StringLiterals - Style/PercentLiteralDelimiters -- config/deploy/demo.rb: - - Style/PercentLiteralDelimiters -- config/deploy/indonesiademo.rb: - - Style/PercentLiteralDelimiters - config/deploy/production.rb: - Style/PercentLiteralDelimiters -- config/deploy/sandbox.rb: - - Style/PercentLiteralDelimiters -- config/deploy/staging.rb: - - Style/PercentLiteralDelimiters - config/environments/demo.rb: - Style/StringLiterals - Style/GlobalStdStream diff --git a/config/deploy/demo.rb b/config/deploy/demo.rb deleted file mode 100644 index a5acb78438..0000000000 --- a/config/deploy/demo.rb +++ /dev/null @@ -1,3 +0,0 @@ -server "demo.trase.earth", user: "ubuntu", roles: %w{web app db}, primary: true - -set :branch, "develop" diff --git a/config/deploy/indonesiademo.rb b/config/deploy/indonesiademo.rb deleted file mode 100644 index b01c2e412a..0000000000 --- a/config/deploy/indonesiademo.rb +++ /dev/null @@ -1,3 +0,0 @@ -server "indonesiademo.trase.earth", user: "ubuntu", roles: %w{web app db}, primary: true - -set :branch, "develop" diff --git a/config/deploy/sandbox.rb b/config/deploy/sandbox.rb deleted file mode 100644 index 2428642a2d..0000000000 --- a/config/deploy/sandbox.rb +++ /dev/null @@ -1,4 +0,0 @@ -server "sandbox-data.trase.earth", user: "ubuntu", roles: %w{web app db}, primary: true -server "sandbox-web.trase.earth", user: "ubuntu", roles: %w{web app}, primary: false - -set :branch, "develop" diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb deleted file mode 100644 index 9368b09102..0000000000 --- a/config/deploy/staging.rb +++ /dev/null @@ -1,3 +0,0 @@ -server "staging.trase.earth", user: "ubuntu", roles: %w{web app db}, primary: true - -set :branch, "develop" From d7c123bfb32156e96076d711323d5eaa679ec492 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Thu, 25 Jan 2024 11:05:53 +0100 Subject: [PATCH 3/6] Removed obsolete GH workflows --- .github/workflows/auto_deploy_demo.yml | 150 ---------------------- .github/workflows/auto_deploy_develop.yml | 149 --------------------- 2 files changed, 299 deletions(-) delete mode 100644 .github/workflows/auto_deploy_demo.yml delete mode 100644 .github/workflows/auto_deploy_develop.yml diff --git a/.github/workflows/auto_deploy_demo.yml b/.github/workflows/auto_deploy_demo.yml deleted file mode 100644 index ac351f172e..0000000000 --- a/.github/workflows/auto_deploy_demo.yml +++ /dev/null @@ -1,150 +0,0 @@ -env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: trase_test - API_HOST: localhost:3000 - TRASE_LOCAL_MIRROR_SCHEMA: trase_earth - TRASE_LOCAL_SCHEMA: public - TWITTER_CONSUMER_KEY: xxx - TWITTER_CONSUMER_SECRET: xxx - TWITTER_ACCESS_TOKEN: xxx - TWITTER_ACCESS_TOKEN_SECRET: xxx - -name: Deploy demo - -on: - push: - branches: [develop] - workflow_dispatch: - -jobs: - front_end: - name: Front end tests and build - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./frontend - steps: - - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3.1.0 - with: - node-version: 16 - - name: Install modules - run: yarn - - name: Run tests - run: yarn test - - name: Verify build - run: yarn build - rspec: - name: RSpec - runs-on: ubuntu-latest - services: - postgres: - image: postgres:14 - ports: - - 5432:5432 - env: - POSTGRES_USER: ${{ env.POSTGRES_USER }} - POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install PostgreSQL client 🐘 - run: | - sudo apt update - sudo apt-get -yqq install libpq-dev postgresql-client - - - name: Install ruby + gems 💎 - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Install CodeClimate reporter - uses: amancevice/setup-code-climate@v1 - with: - cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }} - - - name: Setup database - env: - PGHOST: localhost - PGUSER: ${{ env.POSTGRES_USER }} - PGPASSWORD: ${{ env.POSTGRES_PASSWORD }} - RAILS_ENV: test - run: | - bundle exec rails db:create RAILS_ENV=test - bundler exec rails db:structure:load RAILS_ENV=test - - - name: Setup code coverage - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - run: cc-test-reporter before-build - - - name: Run tests 🔧 - env: - PGHOST: localhost - PGUSER: ${{ env.POSTGRES_USER }} - PGPASSWORD: ${{ env.POSTGRES_PASSWORD }} - RAILS_ENV: test - run: bundle exec rspec spec --fail-fast - - - name: Publish code coverage 🚀 - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - run: cc-test-reporter after-build - if: ${{ github.event_name != 'pull_request' }} - - demo: - needs: [rspec, front_end] - name: Deploy to demo - runs-on: ubuntu-latest - - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install ruby + gems 💎 - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Deploy 🚀 - uses: miloserdow/capistrano-deploy@master - with: - target: demo - deploy_key: ${{ secrets.DEPLOY_KEY_PASSWORD }} - enc_rsa_key_val: ${{ secrets.DEMO_DEPLOY_ENC_KEY }} - - indonesiademo: - needs: [rspec, front_end] - name: Deploy to indonesiademo - runs-on: ubuntu-latest - - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v4 - - - name: Install ruby + gems 💎 - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Deploy 🚀 - uses: miloserdow/capistrano-deploy@master - with: - target: indonesiademo - deploy_key: ${{ secrets.DEPLOY_KEY_PASSWORD }} - enc_rsa_key_val: ${{ secrets.INDONESIADEMO_DEPLOY_ENC_KEY }} diff --git a/.github/workflows/auto_deploy_develop.yml b/.github/workflows/auto_deploy_develop.yml deleted file mode 100644 index 5355509975..0000000000 --- a/.github/workflows/auto_deploy_develop.yml +++ /dev/null @@ -1,149 +0,0 @@ -env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: trase_test - API_HOST: localhost:3000 - TRASE_LOCAL_MIRROR_SCHEMA: trase_earth - TRASE_LOCAL_SCHEMA: public - TWITTER_CONSUMER_KEY: xxx - TWITTER_CONSUMER_SECRET: xxx - TWITTER_ACCESS_TOKEN: xxx - TWITTER_ACCESS_TOKEN_SECRET: xxx - -name: Deploy develop - -on: - push: - branches: [develop] - workflow_dispatch: - -jobs: - front_end: - name: Front end tests and build - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./frontend - steps: - - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v3.1.0 - with: - node-version: 16 - - name: Install modules - run: yarn - - name: Run tests - run: yarn test - - name: Verify build - run: yarn build - rspec: - name: RSpec - runs-on: ubuntu-latest - services: - postgres: - image: postgres:14 - ports: - - 5432:5432 - env: - POSTGRES_USER: ${{ env.POSTGRES_USER }} - POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v4 - - name: Install PostgreSQL client 🐘 - run: | - sudo apt update - sudo apt-get -yqq install libpq-dev postgresql-client - - - name: Install ruby + gems 💎 - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Install CodeClimate reporter - uses: amancevice/setup-code-climate@v1 - with: - cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }} - - - name: Setup database - env: - PGHOST: localhost - PGUSER: ${{ env.POSTGRES_USER }} - PGPASSWORD: ${{ env.POSTGRES_PASSWORD }} - RAILS_ENV: test - run: | - bundle exec rails db:create RAILS_ENV=test - bundler exec rails db:structure:load RAILS_ENV=test - - - name: Setup code coverage - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - run: cc-test-reporter before-build - - - name: Run tests 🔧 - env: - PGHOST: localhost - PGUSER: ${{ env.POSTGRES_USER }} - PGPASSWORD: ${{ env.POSTGRES_PASSWORD }} - RAILS_ENV: test - run: bundle exec rspec spec --fail-fast - - - name: Publish code coverage 🚀 - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - run: cc-test-reporter after-build - if: ${{ github.event_name != 'pull_request' }} - - staging: - needs: [rspec, front_end] - name: Deploy to staging - runs-on: ubuntu-latest - - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install ruby + gems 💎 - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Deploy 🚀 - uses: miloserdow/capistrano-deploy@master - with: - target: staging - deploy_key: ${{ secrets.DEPLOY_KEY_PASSWORD }} - enc_rsa_key_val: ${{ secrets.STAGING_DEPLOY_ENC_KEY }} - - sandbox: - needs: [rspec, front_end] - name: Deploy to sandbox - runs-on: ubuntu-latest - - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install ruby + gems 💎 - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Deploy 🚀 - uses: miloserdow/capistrano-deploy@master - with: - target: sandbox - deploy_key: ${{ secrets.DEPLOY_KEY_PASSWORD }} - enc_rsa_key_val: ${{ secrets.SANDBOX_DEPLOY_ENC_KEY }} From e1b7d0a34dc63c8a671a5b15f7a9a888d9a77671 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Thu, 25 Jan 2024 11:09:58 +0100 Subject: [PATCH 4/6] Removed obsolete environments --- .standard_todo.yml | 12 ----- config/environments/demo.rb | 79 ---------------------------- config/environments/indonesiademo.rb | 79 ---------------------------- config/environments/sandbox.rb | 79 ---------------------------- config/environments/staging.rb | 79 ---------------------------- 5 files changed, 328 deletions(-) delete mode 100644 config/environments/demo.rb delete mode 100644 config/environments/indonesiademo.rb delete mode 100644 config/environments/sandbox.rb delete mode 100644 config/environments/staging.rb diff --git a/.standard_todo.yml b/.standard_todo.yml index b038e16b15..05b6322670 100644 --- a/.standard_todo.yml +++ b/.standard_todo.yml @@ -709,23 +709,11 @@ ignore: - Style/PercentLiteralDelimiters - config/deploy/production.rb: - Style/PercentLiteralDelimiters -- config/environments/demo.rb: - - Style/StringLiterals - - Style/GlobalStdStream - config/environments/development.rb: - Style/StringLiterals -- config/environments/indonesiademo.rb: - - Style/StringLiterals - - Style/GlobalStdStream - config/environments/production.rb: - Style/StringLiterals - Style/GlobalStdStream -- config/environments/sandbox.rb: - - Style/StringLiterals - - Style/GlobalStdStream -- config/environments/staging.rb: - - Style/StringLiterals - - Style/GlobalStdStream - config/environments/test.rb: - Style/StringLiterals - Layout/ExtraSpacing diff --git a/config/environments/demo.rb b/config/environments/demo.rb deleted file mode 100644 index 3c38f6cb68..0000000000 --- a/config/environments/demo.rb +++ /dev/null @@ -1,79 +0,0 @@ -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 - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' - - # 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 - - # Mount Action Cable outside main process or domain - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = false - - # 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 = [:request_id] - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Use a real queuing backend for Active Job (and separate queues per environment) - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "trase-new-api_#{Rails.env}" - config.action_mailer.perform_caching = false - - # 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 = [I18n.default_locale] - - # 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 - - # Use a different logger for distributed setups. - # require 'syslog/logger' - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - - if ENV['RAILS_LOG_TO_STDOUT'].present? - logger = ActiveSupport::Logger.new(STDOUT) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - end - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false - - config.action_controller.asset_host = '//demo.trase.earth' -end diff --git a/config/environments/indonesiademo.rb b/config/environments/indonesiademo.rb deleted file mode 100644 index 127b2a0324..0000000000 --- a/config/environments/indonesiademo.rb +++ /dev/null @@ -1,79 +0,0 @@ -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 - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' - - # 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 - - # Mount Action Cable outside main process or domain - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = false - - # 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 = [:request_id] - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Use a real queuing backend for Active Job (and separate queues per environment) - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "trase-new-api_#{Rails.env}" - config.action_mailer.perform_caching = false - - # 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 = [I18n.default_locale] - - # 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 - - # Use a different logger for distributed setups. - # require 'syslog/logger' - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - - if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - end - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false - - config.action_controller.asset_host = '//indonesiademo.trase.earth' -end diff --git a/config/environments/sandbox.rb b/config/environments/sandbox.rb deleted file mode 100644 index 43e66afe3c..0000000000 --- a/config/environments/sandbox.rb +++ /dev/null @@ -1,79 +0,0 @@ -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 - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' - - # 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 - - # Mount Action Cable outside main process or domain - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = false - - # 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 = [:request_id] - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Use a real queuing backend for Active Job (and separate queues per environment) - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "trase-new-api_#{Rails.env}" - config.action_mailer.perform_caching = false - - # 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 = [I18n.default_locale] - - # 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 - - # Use a different logger for distributed setups. - # require 'syslog/logger' - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - - if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - end - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false - - config.action_controller.asset_host = '//sandbox.trase.earth' -end diff --git a/config/environments/staging.rb b/config/environments/staging.rb deleted file mode 100644 index 984a0f829a..0000000000 --- a/config/environments/staging.rb +++ /dev/null @@ -1,79 +0,0 @@ -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 - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' - - # 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 - - # Mount Action Cable outside main process or domain - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = false - - # 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 = [:request_id] - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Use a real queuing backend for Active Job (and separate queues per environment) - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "trase-new-api_#{Rails.env}" - config.action_mailer.perform_caching = false - - # 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 = [I18n.default_locale] - - # 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 - - # Use a different logger for distributed setups. - # require 'syslog/logger' - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - - if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - end - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false - - config.action_controller.asset_host = '//staging.trase.earth' -end From a76d65fc4300c8fdeae4c152063e319caeb20fe8 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Thu, 25 Jan 2024 11:14:57 +0100 Subject: [PATCH 5/6] Switched off sitemap generation --- .standard_todo.yml | 2 -- config/deploy/production.rb | 7 ++----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.standard_todo.yml b/.standard_todo.yml index 05b6322670..700cf513c3 100644 --- a/.standard_todo.yml +++ b/.standard_todo.yml @@ -707,8 +707,6 @@ ignore: - config/deploy.rb: - Style/StringLiterals - Style/PercentLiteralDelimiters -- config/deploy/production.rb: - - Style/PercentLiteralDelimiters - config/environments/development.rb: - Style/StringLiterals - config/environments/production.rb: diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 8532ac51d7..b6faf8f8e0 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,7 +1,4 @@ -server "production-data.trase.earth", user: "ubuntu", roles: %w{web app db}, primary: true -server "production-web.trase.earth", user: "ubuntu", roles: %w{web app}, primary: false +server "production-data.trase.earth", user: "ubuntu", roles: %w[web app db], primary: true +# server 'production-web.trase.earth', user: 'ubuntu', roles: %w[web app], primary: false set :branch, "master" - -set :sitemap_roles, :db -after "deploy:finishing", "sitemap:refresh" From 5c244d6ed4e40fc0db3f13535bf4e886a8ef93a3 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Thu, 25 Jan 2024 11:16:23 +0100 Subject: [PATCH 6/6] Switched to retirement domain --- .standard_todo.yml | 8 -------- config/environments/development.rb | 4 ++-- config/environments/production.rb | 6 +++--- config/environments/test.rb | 4 ++-- doc/gh-pages/api/trase_internal_api.oas3.yaml | 6 +++--- doc/gh-pages/api/trase_public_api.oas2.json | 2 +- doc/gh-pages/api/trase_public_api_1.0.oas3.yaml | 8 ++++---- doc/gh-pages/api/trase_public_api_1.1.oas3.yaml | 8 ++++---- frontend/.env.sample | 4 ++-- frontend/.storybook/theme.js | 4 ++-- frontend/config/webpack.config.prod.js | 2 +- frontend/html/includes/_head.ejs | 6 +++--- .../versioning-modal/versioning-modal.component.jsx | 2 +- frontend/scripts/tests/widgets/actions.test.js | 4 ++-- frontend/stories/cards.stories.jsx | 8 ++++---- 15 files changed, 34 insertions(+), 42 deletions(-) diff --git a/.standard_todo.yml b/.standard_todo.yml index 700cf513c3..65f5c6c716 100644 --- a/.standard_todo.yml +++ b/.standard_todo.yml @@ -707,14 +707,6 @@ ignore: - config/deploy.rb: - Style/StringLiterals - Style/PercentLiteralDelimiters -- config/environments/development.rb: - - Style/StringLiterals -- config/environments/production.rb: - - Style/StringLiterals - - Style/GlobalStdStream -- config/environments/test.rb: - - Style/StringLiterals - - Layout/ExtraSpacing - config/initializers/active_admin.rb: - Style/StringLiterals - Layout/CommentIndentation diff --git a/config/environments/development.rb b/config/environments/development.rb index 7a9f6c3a8c..3a1bfb06a1 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -16,13 +16,13 @@ # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. - if Rails.root.join('tmp', 'caching-dev.txt').exist? + if Rails.root.join("tmp", "caching-dev.txt").exist? config.action_controller.perform_caching = true config.action_controller.enable_fragment_cache_logging = true config.cache_store = :memory_store config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{2.days.to_i}" + "Cache-Control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 459e6f1ea9..a2176b575f 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -16,7 +16,7 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' @@ -67,7 +67,7 @@ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) + logger = ActiveSupport::Logger.new($stdout) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end @@ -75,5 +75,5 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - config.action_controller.asset_host = '//supplychains.trase.earth' + config.action_controller.asset_host = "//mongabay.trase.earth" end diff --git a/config/environments/test.rb b/config/environments/test.rb index 93ed4f1b78..fe4da18372 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -19,11 +19,11 @@ # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + "Cache-Control" => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. - config.consider_all_requests_local = true + config.consider_all_requests_local = true config.action_controller.perform_caching = false config.cache_store = :null_store diff --git a/doc/gh-pages/api/trase_internal_api.oas3.yaml b/doc/gh-pages/api/trase_internal_api.oas3.yaml index 27ec67a845..8819f7a8c4 100644 --- a/doc/gh-pages/api/trase_internal_api.oas3.yaml +++ b/doc/gh-pages/api/trase_internal_api.oas3.yaml @@ -4,9 +4,9 @@ info: version: "3.0" contact: name: Trase Public API - url: https://supplychains.trase.earth/ + url: https://mongabay.trase.earth/ email: info@trase.earth - termsOfService: https://supplychains.trase.earth/terms-of-use.html + termsOfService: https://mongabay.trase.earth/terms-of-use.html license: name: MIT License description: Trase Internal API V3 @@ -1896,7 +1896,7 @@ paths: info: $ref: "#/components/schemas/DashboardsMetaInfoNodeValues" servers: - - url: https://supplychains.trase.earth/api/v3 + - url: https://mongabay.trase.earth/api/v3 components: parameters: country_id_query_param: diff --git a/doc/gh-pages/api/trase_public_api.oas2.json b/doc/gh-pages/api/trase_public_api.oas2.json index 9f3f201ebf..1eb43894c5 100644 --- a/doc/gh-pages/api/trase_public_api.oas2.json +++ b/doc/gh-pages/api/trase_public_api.oas2.json @@ -3,7 +3,7 @@ "info": { "title": "Trase Public API", "version": "1.0", - "description": "This is a first version of a public API for [Trase](https://supplychains.trase.earth/).\n\n# Introduction\n\nThe Trase Public API allows to access trade flows data of forest risk commodities.\n\n# Entities\n\nThe API will expose the following entities present in Trase:\n1. attributes: quantitative and qualitative attributes (indicators)\n2. commodities: forest risk commodities\n3. countries: source countries for commodities\n4. flows: models the list of nodes in a supply chain (path) from source to destination\n5. nodes: entities participating in the supply chain. Each has a \"node type\", e.g. MUNICIPALITY, EXPORTER, but they are also grouped in the system by a more generic \"role\":\n\ta. sources: source nodes, such as municipalities in Brazil or departments in Paraguay\n\tb. traders: exporters / importers of commodities\n\tc. destinations: destination nodes, such as importing countries\n6. node types: the roles of nodes at particular positions in supply chains per country / commodity combination\n\n# Discovering node identifiers\n\nWe assume one of the typical scenarios is one where the point of entry into the data will be a source, an exporter, an importer or a destination. All of these entities are nodes, but int Trase we group them by \"role\" in the supply chain.\n\nIn the first step, users would use the sources / exporters / importers / destinations endpoints, which allow to discover the identifiers of entities by searching by name and existing natural identifiers (e.g. iso code). For now we need to work around the fact that nodes in the system don't have standardised identifiers, which would allow to skip this step.\n\nThose endpoints will also allow to discover the availability of indicators. Then in the next step users can use those identifiers to pull data for a particular node.\n\n# Retrieving attribute values\n\nIt is possible to retrieve full flows data using the flows endpoint.\n\nIt is also possible to retrieve data filtered by a particular node, which includes both values of attributes for flows in which the node participates (flow attributes), as well as values of some attributes which are not calculated from flows (node attributes).\n\n# Sample usage - retrieving flow data for country / commodity\n\nUse the commodities endpoint to discover identifiers of available commodities. You can also at the same time retrieve ids of countries from which the commodities are sourced.\n\n/api/public/commodities?include=countries\n\nCountries can be retireved using the countries endpoint.\n\nNow using the attributes endpoint, find out what sttributes are available for Brazil beef:\n\n/api/public/attributes?commodity=BEEF&country=BR\n\nVolume data is available for years 2015-2017. Request flows data for 2016-2017:\n\n/api/public/flows?commodity=BEEF&country=BR&start_year=2016&end_year=2017&page=1\n\nData is paginated.\n\n# Sample usage - retrieving data about a node\n\nDiscover the identifier of the sourcing place.\n\n/api/public/nodes/sources?country=BR&commodity=BEEF&name=SORRISO\n\nData is available for years 2003-2017. Request data for 2017:\n\n/api/public/nodes/{id of SORRISO}/data?year=2017" + "description": "This is a first version of a public API for [Trase](https://mongabay.trase.earth/).\n\n# Introduction\n\nThe Trase Public API allows to access trade flows data of forest risk commodities.\n\n# Entities\n\nThe API will expose the following entities present in Trase:\n1. attributes: quantitative and qualitative attributes (indicators)\n2. commodities: forest risk commodities\n3. countries: source countries for commodities\n4. flows: models the list of nodes in a supply chain (path) from source to destination\n5. nodes: entities participating in the supply chain. Each has a \"node type\", e.g. MUNICIPALITY, EXPORTER, but they are also grouped in the system by a more generic \"role\":\n\ta. sources: source nodes, such as municipalities in Brazil or departments in Paraguay\n\tb. traders: exporters / importers of commodities\n\tc. destinations: destination nodes, such as importing countries\n6. node types: the roles of nodes at particular positions in supply chains per country / commodity combination\n\n# Discovering node identifiers\n\nWe assume one of the typical scenarios is one where the point of entry into the data will be a source, an exporter, an importer or a destination. All of these entities are nodes, but int Trase we group them by \"role\" in the supply chain.\n\nIn the first step, users would use the sources / exporters / importers / destinations endpoints, which allow to discover the identifiers of entities by searching by name and existing natural identifiers (e.g. iso code). For now we need to work around the fact that nodes in the system don't have standardised identifiers, which would allow to skip this step.\n\nThose endpoints will also allow to discover the availability of indicators. Then in the next step users can use those identifiers to pull data for a particular node.\n\n# Retrieving attribute values\n\nIt is possible to retrieve full flows data using the flows endpoint.\n\nIt is also possible to retrieve data filtered by a particular node, which includes both values of attributes for flows in which the node participates (flow attributes), as well as values of some attributes which are not calculated from flows (node attributes).\n\n# Sample usage - retrieving flow data for country / commodity\n\nUse the commodities endpoint to discover identifiers of available commodities. You can also at the same time retrieve ids of countries from which the commodities are sourced.\n\n/api/public/commodities?include=countries\n\nCountries can be retireved using the countries endpoint.\n\nNow using the attributes endpoint, find out what sttributes are available for Brazil beef:\n\n/api/public/attributes?commodity=BEEF&country=BR\n\nVolume data is available for years 2015-2017. Request flows data for 2016-2017:\n\n/api/public/flows?commodity=BEEF&country=BR&start_year=2016&end_year=2017&page=1\n\nData is paginated.\n\n# Sample usage - retrieving data about a node\n\nDiscover the identifier of the sourcing place.\n\n/api/public/nodes/sources?country=BR&commodity=BEEF&name=SORRISO\n\nData is available for years 2003-2017. Request data for 2017:\n\n/api/public/nodes/{id of SORRISO}/data?year=2017" }, "host": "staging.trase.earth", "paths": { diff --git a/doc/gh-pages/api/trase_public_api_1.0.oas3.yaml b/doc/gh-pages/api/trase_public_api_1.0.oas3.yaml index f6e8b3cb62..775f213e57 100644 --- a/doc/gh-pages/api/trase_public_api_1.0.oas3.yaml +++ b/doc/gh-pages/api/trase_public_api_1.0.oas3.yaml @@ -4,13 +4,13 @@ info: version: "1.0" contact: name: Trase Public API - url: https://supplychains.trase.earth/ + url: https://mongabay.trase.earth/ email: info@trase.earth - termsOfService: https://supplychains.trase.earth/terms-of-use.html + termsOfService: https://mongabay.trase.earth/terms-of-use.html license: name: MIT License description: >- - This is a first version of the public API for [Trase](http://supplychains.trase.earth). + This is a first version of the public API for [Trase](http://mongabay.trase.earth). # Introduction @@ -107,7 +107,7 @@ info: /api/public/nodes/11113/data?year=2017 servers: - - url: https://supplychains.trase.earth/api/public + - url: https://mongabay.trase.earth/api/public paths: /countries: get: diff --git a/doc/gh-pages/api/trase_public_api_1.1.oas3.yaml b/doc/gh-pages/api/trase_public_api_1.1.oas3.yaml index 41faaa8dc8..dbb9f17ea7 100644 --- a/doc/gh-pages/api/trase_public_api_1.1.oas3.yaml +++ b/doc/gh-pages/api/trase_public_api_1.1.oas3.yaml @@ -4,13 +4,13 @@ info: version: "1.1" contact: name: Trase Public API - url: https://supplychains.trase.earth/ + url: https://mongabay.trase.earth/ email: info@trase.earth - termsOfService: https://supplychains.trase.earth/terms-of-use.html + termsOfService: https://mongabay.trase.earth/terms-of-use.html license: name: MIT License description: >- - This is a DRAFT version 1.1 of the public API for [Trase](http://supplychains.trase.earth). + This is a DRAFT version 1.1 of the public API for [Trase](http://mongabay.trase.earth). # Introduction @@ -107,7 +107,7 @@ info: /api/public/nodes/11113/data?year=2017 servers: - - url: https://supplychains.trase.earth/api/public + - url: https://mongabay.trase.earth/api/public paths: /countries: get: diff --git a/frontend/.env.sample b/frontend/.env.sample index 4e423c3ab8..2359968e9c 100644 --- a/frontend/.env.sample +++ b/frontend/.env.sample @@ -1,7 +1,7 @@ PORT=3000 NODE_ENV=development -API_V3_URL=//supplychains.trase.earth -UNIT_LAYERS_API_URL=//supplychains.trase.earth +API_V3_URL=//mongabay.trase.earth +UNIT_LAYERS_API_URL=//mongabay.trase.earth UNIT_LAYERS_DATA_ENV=production GOOGLE_ANALYTICS_KEY=G-NVLPKWKFMY diff --git a/frontend/.storybook/theme.js b/frontend/.storybook/theme.js index 9dc6272d37..38b2399fcb 100644 --- a/frontend/.storybook/theme.js +++ b/frontend/.storybook/theme.js @@ -32,6 +32,6 @@ export default create({ inputBorderRadius: 4, brandTitle: 'Trase', - brandUrl: 'https://supplychains.trase.earth', - brandImage: 'https://supplychains.trase.earth/images/logos/logo-trase-nav.png' + brandUrl: 'https://mongabay.trase.earth', + brandImage: 'https://mongabay.trase.earth/images/logos/logo-trase-nav.png' }); diff --git a/frontend/config/webpack.config.prod.js b/frontend/config/webpack.config.prod.js index af2231116d..abb5237321 100644 --- a/frontend/config/webpack.config.prod.js +++ b/frontend/config/webpack.config.prod.js @@ -25,7 +25,7 @@ module.exports = merge(webpackBaseConfig, { }), new webpack.optimize.ModuleConcatenationPlugin(), new SWPrecacheWebpackPlugin({ - cacheId: 'supplychains.trase.earth', + cacheId: 'mongabay.trase.earth', filename: 'service-worker.js', minify: true, staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/, /\.html$/], diff --git a/frontend/html/includes/_head.ejs b/frontend/html/includes/_head.ejs index ca3378dbab..6e9981a07e 100644 --- a/frontend/html/includes/_head.ejs +++ b/frontend/html/includes/_head.ejs @@ -23,12 +23,12 @@ - + - + - + <%= title %> diff --git a/frontend/scripts/react-components/tool/tool-modal/versioning-modal/versioning-modal.component.jsx b/frontend/scripts/react-components/tool/tool-modal/versioning-modal/versioning-modal.component.jsx index 0e4d6bd378..cbe41e5762 100644 --- a/frontend/scripts/react-components/tool/tool-modal/versioning-modal/versioning-modal.component.jsx +++ b/frontend/scripts/react-components/tool/tool-modal/versioning-modal/versioning-modal.component.jsx @@ -58,7 +58,7 @@ function VersioningModal({ data, context }) { SEI-PCS approach to map subnational trade flows can be found for each of the countries and commodities in{' '} ({ describe('test prepareWidget helper function', () => { const someEndpoint = 'someEndpoint'; - const rawEndpoint = 'https://supplychains.trase.earth/data'; + const rawEndpoint = 'https://mongabay.trase.earth/data'; const someKey = 'id0_namesomeName'; const someParams = { id: 0, name: 'someName' }; - const someUrl = 'http://supplychains.trase.earth'; + const someUrl = 'http://mongabay.trase.earth'; const someEndpoints = { [someEndpoint]: { key: someKey diff --git a/frontend/stories/cards.stories.jsx b/frontend/stories/cards.stories.jsx index 0bd85f8017..b5a3d5368e 100644 --- a/frontend/stories/cards.stories.jsx +++ b/frontend/stories/cards.stories.jsx @@ -9,8 +9,8 @@ storiesOf('Card', module).addWithJSX('Card', () => ( title="I'm a default card" subtitle="A cool subtitle" actionName="An action name" - linkUrl="https://supplychains.trase.earth" - imageUrl="https://supplychains.trase.earth/images/logos/new-logo-trase.svg" + linkUrl="https://mongabay.trase.earth" + imageUrl="https://mongabay.trase.earth/images/logos/new-logo-trase.svg" /> )); @@ -22,7 +22,7 @@ storiesOf('Card', module).addWithJSX('New variant', () => ( title="I'm a new card" subtitle="A cool subtitle" actionName="An action name" - linkUrl="https://supplychains.trase.earth" + linkUrl="https://mongabay.trase.earth" /> )); @@ -34,7 +34,7 @@ storiesOf('Card', module).addWithJSX('Dashed variant', () => ( title="I'm a new card" subtitle="A cool subtitle" actionName="An action name" - linkUrl="https://supplychains.trase.earth/images/logos/new-logo-trase.svg" + linkUrl="https://mongabay.trase.earth/images/logos/new-logo-trase.svg" /> ));