diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..5ead21540 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.github +Dockerfile +README.md +coverage +docs +log +node_modules +spec +test +tmp +vendor/bundle diff --git a/Gemfile b/Gemfile index 5cb170d0e..80b842074 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,5 @@ source "https://rubygems.org" -ruby File.read(".ruby-version").strip - gem "rails", "6.1.6.1" gem "audited" diff --git a/Gemfile.lock b/Gemfile.lock index 78a8e8daa..5454480f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,94 +60,108 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) - audited (5.0.1) - activerecord (>= 5.0, < 6.2) + audited (5.4.3) + activerecord (>= 5.0, < 7.2) + request_store (~> 1.2) + base64 (0.2.0) + bigdecimal (3.1.6) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - brakeman (5.4.1) + brakeman (6.1.2) + racc builder (3.2.4) byebug (11.1.3) - cancancan (3.3.0) - capybara (3.35.3) + cancancan (3.5.0) + capybara (3.40.0) addressable + matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) coderay (1.1.3) - concurrent-ruby (1.2.2) - connection_pool (2.2.5) - crack (0.4.5) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + crack (1.0.0) + bigdecimal rexml crass (1.0.6) - database_cleaner (2.0.1) - database_cleaner-active_record (~> 2.0.0) - database_cleaner-active_record (2.0.1) + database_cleaner (2.0.2) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.1.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - date (3.3.3) - debug_inspector (1.1.0) - diff-lcs (1.4.4) + date (3.3.4) + debug_inspector (1.2.0) + diff-lcs (1.5.1) docile (1.4.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.6) - dotenv-rails (2.7.6) - dotenv (= 2.7.6) - railties (>= 3.2) - e2mmap (0.1.0) + domain_name (0.6.20240107) + dotenv (3.0.2) + dotenv-rails (3.0.2) + dotenv (= 3.0.2) + railties (>= 6.1) elasticsearch (7.9.0) elasticsearch-api (= 7.9.0) elasticsearch-transport (= 7.9.0) elasticsearch-api (7.9.0) multi_json - elasticsearch-model (7.1.1) + elasticsearch-model (7.2.1) activesupport (> 3) - elasticsearch (> 1) + elasticsearch (~> 7) hashie - elasticsearch-rails (7.1.1) + elasticsearch-rails (7.2.1) elasticsearch-transport (7.9.0) faraday (~> 1) multi_json erubi (1.12.0) - et-orbi (1.2.4) + et-orbi (1.2.7) tzinfo - execjs (2.8.1) - factory_bot (6.2.0) + execjs (2.9.1) + factory_bot (6.4.6) activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) railties (>= 5.0.0) - faraday (1.4.2) + faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - multipart-post (>= 1.2, < 3) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) faraday-net_http (1.0.1) - faraday-net_http_persistent (1.1.0) - ffi (1.15.3) - fugit (1.5.0) - et-orbi (~> 1.1, >= 1.1.8) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + ffi (1.16.3) + fugit (1.9.0) + et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) - gds-api-adapters (71.6.0) + gds-api-adapters (93.0.0) addressable link_header null_logger plek (>= 1.9.0) rest-client (~> 2.0) - gds-sso (17.1.1) + gds-sso (19.0.0) oauth2 (~> 2.0) omniauth (~> 2.1) omniauth-oauth2 (~> 1.8) @@ -155,10 +169,19 @@ GEM rails (>= 6) warden (~> 1.2) warden-oauth2 (~> 0.0.1) - globalid (1.0.0) - activesupport (>= 5.0) - govuk_app_config (7.1.0) + globalid (1.2.1) + activesupport (>= 6.1) + google-protobuf (3.25.3-aarch64-linux) + google-protobuf (3.25.3-arm64-darwin) + google-protobuf (3.25.3-x86_64-darwin) + google-protobuf (3.25.3-x86_64-linux) + googleapis-common-protos-types (1.12.0) + google-protobuf (~> 3.18) + govuk_app_config (9.9.1) logstasher (~> 2.1) + opentelemetry-exporter-otlp (>= 0.25, < 0.27) + opentelemetry-instrumentation-all (>= 0.39.1, < 0.57.0) + opentelemetry-sdk (~> 1.2) plek (>= 4, < 6) prometheus_exporter (~> 2.0) puma (>= 5.6, < 7.0) @@ -170,34 +193,33 @@ GEM govuk_frontend_toolkit (>= 6.0.2) rails (>= 4.1.0) sass (>= 3.2.0) - govuk_frontend_toolkit (9.0.0) + govuk_frontend_toolkit (9.0.1) railties (>= 3.1.0) - sass (>= 3.2.0) - govuk_sidekiq (5.0.0) + govuk_sidekiq (7.1.5) gds-api-adapters (>= 19.1.0) govuk_app_config (>= 1.1) redis-namespace (~> 1.6) - sidekiq (>= 5, < 6) - sidekiq-logging-json (~> 0.0) - sidekiq-statsd (>= 2.1) + sidekiq (~> 6.5, >= 6.5.12) govuk_template (0.26.0) rails (>= 3.1) - hashdiff (1.0.1) - hashie (4.1.0) + hashdiff (1.1.0) + hashie (5.0.0) http-accept (1.7.0) - http-cookie (1.0.4) + http-cookie (1.0.5) domain_name (~> 0.5) - i18n (1.13.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) iconv (1.0.8) - jbuilder (2.11.2) + jbuilder (2.11.5) + actionview (>= 5.0.0) activesupport (>= 5.0.0) - jquery-rails (4.4.0) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.5.1) - jwt (2.7.0) + json (2.7.1) + jwt (2.8.0) + base64 kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -210,11 +232,12 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) + language_server-protocol (3.17.0.3) link_header (0.0.8) - listen (3.5.1) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - lograge (0.11.2) + lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) @@ -223,38 +246,43 @@ GEM logstasher (2.1.5) activesupport (>= 5.2) request_store - loofah (2.20.0) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp marcel (1.0.2) matrix (0.4.2) method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0225) - mini_mime (1.1.2) - minitest (5.18.0) + mime-types-data (3.2024.0206) + mini_mime (1.1.5) + minitest (5.22.2) multi_json (1.15.0) multi_xml (0.6.0) - multipart-post (2.1.1) - net-imap (0.3.4) + multipart-post (2.4.0) + net-imap (0.4.10) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0.1) net-protocol netrc (0.11.0) - nio4r (2.5.9) - nokogiri (1.14.3-aarch64-linux) + nio4r (2.7.0) + nokogiri (1.16.2-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.14.3-x86_64-darwin) + nokogiri (1.16.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.3-x86_64-linux) + nokogiri (1.16.2-x86_64-linux) racc (~> 1.4) null_logger (0.0.1) oauth2 (2.0.9) @@ -264,40 +292,236 @@ GEM rack (>= 1.2, < 4) snaky_hash (~> 2.0) version_gem (~> 1.1) - omniauth (2.1.1) + omniauth (2.1.2) hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection omniauth-oauth2 (1.8.0) oauth2 (>= 1.4, < 3) omniauth (~> 2.0) - parallel (1.23.0) - parser (3.2.2.1) + opentelemetry-api (1.2.4) + opentelemetry-common (0.20.1) + opentelemetry-api (~> 1.0) + opentelemetry-exporter-otlp (0.26.3) + google-protobuf (~> 3.14) + googleapis-common-protos-types (~> 1.3) + opentelemetry-api (~> 1.1) + opentelemetry-common (~> 0.20) + opentelemetry-sdk (~> 1.2) + opentelemetry-semantic_conventions + opentelemetry-instrumentation-action_pack (0.9.0) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-rack (~> 0.21) + opentelemetry-instrumentation-action_view (0.7.0) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-active_support (~> 0.1) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-active_job (0.7.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-active_model_serializers (0.20.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-active_record (0.7.0) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + ruby2_keywords + opentelemetry-instrumentation-active_support (0.5.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-all (0.56.0) + opentelemetry-instrumentation-active_model_serializers (~> 0.20.1) + opentelemetry-instrumentation-aws_sdk (~> 0.5.0) + opentelemetry-instrumentation-bunny (~> 0.21.0) + opentelemetry-instrumentation-concurrent_ruby (~> 0.21.1) + opentelemetry-instrumentation-dalli (~> 0.25.0) + opentelemetry-instrumentation-delayed_job (~> 0.22.0) + opentelemetry-instrumentation-ethon (~> 0.21.1) + opentelemetry-instrumentation-excon (~> 0.22.0) + opentelemetry-instrumentation-faraday (~> 0.23.1) + opentelemetry-instrumentation-grape (~> 0.1.3) + opentelemetry-instrumentation-graphql (~> 0.27.0) + opentelemetry-instrumentation-gruf (~> 0.1.0) + opentelemetry-instrumentation-http (~> 0.23.1) + opentelemetry-instrumentation-http_client (~> 0.22.1) + opentelemetry-instrumentation-koala (~> 0.20.1) + opentelemetry-instrumentation-lmdb (~> 0.22.1) + opentelemetry-instrumentation-mongo (~> 0.22.1) + opentelemetry-instrumentation-mysql2 (~> 0.25.0) + opentelemetry-instrumentation-net_http (~> 0.22.1) + opentelemetry-instrumentation-pg (~> 0.26.0) + opentelemetry-instrumentation-que (~> 0.7.0) + opentelemetry-instrumentation-racecar (~> 0.3.0) + opentelemetry-instrumentation-rack (~> 0.24.0) + opentelemetry-instrumentation-rails (~> 0.30.0) + opentelemetry-instrumentation-rake (~> 0.2.1) + opentelemetry-instrumentation-rdkafka (~> 0.4.0) + opentelemetry-instrumentation-redis (~> 0.25.1) + opentelemetry-instrumentation-resque (~> 0.5.0) + opentelemetry-instrumentation-restclient (~> 0.22.1) + opentelemetry-instrumentation-ruby_kafka (~> 0.21.0) + opentelemetry-instrumentation-sidekiq (~> 0.25.0) + opentelemetry-instrumentation-sinatra (~> 0.23.1) + opentelemetry-instrumentation-trilogy (~> 0.58.0) + opentelemetry-instrumentation-aws_sdk (0.5.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-base (0.22.3) + opentelemetry-api (~> 1.0) + opentelemetry-registry (~> 0.1) + opentelemetry-instrumentation-bunny (0.21.2) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-concurrent_ruby (0.21.2) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-dalli (0.25.0) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-delayed_job (0.22.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-ethon (0.21.3) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-excon (0.22.0) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-faraday (0.23.4) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-grape (0.1.6) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-rack (~> 0.21) + opentelemetry-instrumentation-graphql (0.27.0) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-gruf (0.1.1) + opentelemetry-api (>= 1.0.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-http (0.23.2) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-http_client (0.22.3) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-koala (0.20.2) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-lmdb (0.22.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-mongo (0.22.2) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-mysql2 (0.25.0) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-net_http (0.22.4) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-pg (0.26.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-que (0.7.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-racecar (0.3.0) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-rack (0.24.0) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-rails (0.30.0) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-action_pack (~> 0.9.0) + opentelemetry-instrumentation-action_view (~> 0.7.0) + opentelemetry-instrumentation-active_job (~> 0.7.0) + opentelemetry-instrumentation-active_record (~> 0.7.0) + opentelemetry-instrumentation-active_support (~> 0.5.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-rake (0.2.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-rdkafka (0.4.2) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-redis (0.25.3) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-resque (0.5.1) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-restclient (0.22.3) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-ruby_kafka (0.21.0) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-sidekiq (0.25.2) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-sinatra (0.23.2) + opentelemetry-api (~> 1.0) + opentelemetry-common (~> 0.20.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-instrumentation-rack (~> 0.21) + opentelemetry-instrumentation-trilogy (0.58.0) + opentelemetry-api (~> 1.0) + opentelemetry-instrumentation-base (~> 0.22.1) + opentelemetry-semantic_conventions (>= 1.8.0) + opentelemetry-registry (0.3.0) + opentelemetry-api (~> 1.1) + opentelemetry-sdk (1.4.0) + opentelemetry-api (~> 1.1) + opentelemetry-common (~> 0.20) + opentelemetry-registry (~> 0.2) + opentelemetry-semantic_conventions + opentelemetry-semantic_conventions (1.10.0) + opentelemetry-api (~> 1.0) + parallel (1.24.0) + parser (3.3.0.5) ast (~> 2.4.1) - pg (1.5.3) + racc + pg (1.5.5) plek (5.0.0) - prometheus_exporter (2.0.8) + prometheus_exporter (2.1.0) webrick - pry (0.14.1) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.8.0) + pry-byebug (3.10.1) byebug (~> 11.0) - pry (~> 0.10) + pry (>= 0.13, < 0.15) pry-rails (0.3.9) pry (>= 0.10.4) pry-stack_explorer (0.6.1) binding_of_caller (~> 1.0) pry (~> 0.13) - public_suffix (4.0.6) - puma (6.3.1) + public_suffix (5.0.4) + puma (6.4.2) nio4r (~> 2.0) raabro (1.4.0) - racc (1.6.2) - rack (2.2.7) - rack-protection (2.2.0) - rack - rack-proxy (0.7.6) + racc (1.7.3) + rack (2.2.8) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-proxy (0.7.7) rack rack-test (2.1.0) rack (>= 1.3) @@ -316,11 +540,13 @@ GEM bundler (>= 1.15.0) railties (= 6.1.6.1) sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) railties (6.1.6.1) actionpack (= 6.1.6.1) activesupport (= 6.1.6.1) @@ -328,76 +554,81 @@ GEM rake (>= 12.2) thor (~> 1.0) rainbow (3.1.1) - rake (13.0.6) - rb-fsevent (0.11.0) + rake (13.1.0) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - redis (4.5.1) - redis-namespace (1.8.1) - redis (>= 3.0.4) - regexp_parser (2.8.0) - request_store (1.5.1) + redis (4.8.1) + redis-namespace (1.11.0) + redis (>= 4) + regexp_parser (2.9.0) + request_store (1.6.0) rack (>= 1.4) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.5) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rexml (3.2.6) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (5.0.1) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.10.2) - rubocop (1.44.1) + rspec-support (~> 3.13.0) + rspec-rails (6.1.1) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) + rspec-support (3.13.0) + rubocop (1.60.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-capybara (2.18.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.20.0) rubocop (~> 1.41) - rubocop-govuk (4.10.0) - rubocop (= 1.44.1) - rubocop-ast (= 1.24.1) - rubocop-rails (= 2.17.4) + rubocop-factory_bot (2.25.1) + rubocop (~> 1.41) + rubocop-govuk (4.14.0) + rubocop (= 1.60.2) + rubocop-ast (= 1.30.0) + rubocop-rails (= 2.23.1) rubocop-rake (= 0.6.0) - rubocop-rspec (= 2.18.1) - rubocop-rails (2.17.4) + rubocop-rspec (= 2.26.1) + rubocop-rails (2.23.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.18.1) - rubocop (~> 1.33) + rubocop-rspec (2.26.1) + rubocop (~> 1.40) rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) - ruby2_keywords (0.0.4) - rubyzip (2.3.0) - rufus-scheduler (3.7.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + rufus-scheduler (3.9.1) fugit (~> 1.1, >= 1.1.6) sass (3.7.4) sass-listen (~> 4.0.0) @@ -414,35 +645,26 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sentry-rails (5.9.0) + sentry-rails (5.16.1) railties (>= 5.0) - sentry-ruby (~> 5.9.0) + sentry-ruby (~> 5.16.1) sentry-raven (3.1.2) faraday (>= 1.0) - sentry-ruby (5.9.0) + sentry-ruby (5.16.1) concurrent-ruby (~> 1.0, >= 1.0.2) - sentry-sidekiq (5.9.0) - sentry-ruby (~> 5.9.0) + sentry-sidekiq (5.16.1) + sentry-ruby (~> 5.16.1) sidekiq (>= 3.0) - sidekiq (5.2.10) - connection_pool (~> 2.2, >= 2.2.2) + sidekiq (6.5.12) + connection_pool (>= 2.2.5, < 3) rack (~> 2.0) - rack-protection (>= 1.5.0) - redis (~> 4.5, < 4.6.0) - sidekiq-limit_fetch (3.4.0) - sidekiq (>= 4) - sidekiq-logging-json (0.0.19) - sidekiq (>= 3) - sidekiq-scheduler (3.1.0) - e2mmap - redis (>= 3, < 5) + redis (>= 4.5.0, < 5) + sidekiq-limit_fetch (4.4.1) + sidekiq (>= 6) + sidekiq-scheduler (5.0.3) rufus-scheduler (~> 3.2) - sidekiq (>= 3) - thwait + sidekiq (>= 6, < 8) tilt (>= 1.4.0) - sidekiq-statsd (2.1.0) - activesupport - sidekiq (>= 3.3.1) simplecov (0.17.1) docile (~> 1.1) json (>= 1.8, < 3) @@ -451,25 +673,23 @@ GEM snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) - spring (2.1.1) + spring (4.1.3) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - spring-watcher-listen (2.0.1) + spring-watcher-listen (2.1.0) listen (>= 2.7, < 4.0) - spring (>= 1.2, < 3.0) - sprockets (4.1.1) + spring (>= 4) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) statsd-ruby (1.5.0) - thor (1.2.1) - thwait (0.2.0) - e2mmap - tilt (2.0.10) - timeout (0.3.2) + thor (1.3.0) + tilt (2.3.0) + timeout (0.4.1) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -477,33 +697,31 @@ GEM concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.7) - unicode-display_width (2.4.2) - version_gem (1.1.2) + unicode-display_width (2.5.0) + version_gem (1.1.3) warden (1.2.9) rack (>= 2.0.9) warden-oauth2 (0.0.1) warden - webmock (3.13.0) - addressable (>= 2.3.6) + webmock (3.20.0) + addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) webrick (1.8.1) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - whois (5.0.2) - whois-parser (1.2.0) + whois (5.1.1) + whois-parser (2.0.0) activesupport (>= 4) - whois (>= 4.0.7) + whois (>= 4.1.0) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.8) + zeitwerk (2.6.13) PLATFORMS aarch64-linux + arm64-darwin-23 x86_64-darwin-21 x86_64-linux @@ -561,8 +779,5 @@ DEPENDENCIES webmock whois-parser -RUBY VERSION - ruby 3.2.0p0 - BUNDLED WITH - 2.4.12 + 2.5.6 diff --git a/Procfile b/Procfile deleted file mode 100644 index cb6510924..000000000 --- a/Procfile +++ /dev/null @@ -1,3 +0,0 @@ -release: bin/rails db:migrate search:reindex -web: bin/rails server -p $PORT -e $RAILS_ENV -worker: bin/sidekiq diff --git a/app/models/datafile.rb b/app/models/datafile.rb index b10f6edb3..f6bea4433 100644 --- a/app/models/datafile.rb +++ b/app/models/datafile.rb @@ -35,7 +35,8 @@ def compute_date(date_type) return monthly_date(date_type) if dataset.monthly? return quarterly_date(date_type) if dataset.quarterly? return yearly_date(date_type) if dataset.annually? - return financial_yearly_date(date_type) if dataset.financial_yearly? + + financial_yearly_date(date_type) if dataset.financial_yearly? end def daily_date diff --git a/app/workers/ckan/v26/ckan_org_sync_worker.rb b/app/workers/ckan/v26/ckan_org_sync_worker.rb index 449e6825e..b563c0700 100644 --- a/app/workers/ckan/v26/ckan_org_sync_worker.rb +++ b/app/workers/ckan/v26/ckan_org_sync_worker.rb @@ -20,7 +20,7 @@ def create_update_organisations(organisation_ids) def delete_old_organisations(organisation_ids) organisations = Organisation.where(name: organisation_ids) - Dataset.where(organisation: organisations).each(&:unpublish) + Dataset.where(organisation: organisations).find_each(&:unpublish) organisations.destroy_all end end diff --git a/config/production/nginx.conf b/config/production/nginx.conf deleted file mode 100755 index 3c4365688..000000000 --- a/config/production/nginx.conf +++ /dev/null @@ -1,294 +0,0 @@ -limit_req_zone $limited_bot zone=botzone:10m rate=30r/m; -limit_req_zone $limited_geo zone=one:10m rate=3r/s; - -geo $ckan_internal { - ranges; - default 1; - 46.43.41.10-46.43.41.30 0; - 127.0.0.1-127.0.0.1 0; -} - -map $ckan_internal $limited_geo { - 1 $binary_remote_addr; - 0 ""; -} - -map $http_user_agent $limited_bot { - "~Baiduspider" 1; - "~OtherSpider" 2; - default ""; -} - -upstream contractsfinder { - server 34.249.103.20; -} - -upstream varnish { - server 127.0.0.1:6081; -} - -server { - listen 80; - - server_name www.data.gov.uk; - - return 301 $scheme://data.gov.uk$request_uri; -} - -server { - listen 443 ssl; - - server_name www.data.gov.uk; - - ssl_certificate /etc/nginx/ssl/server.crt; - ssl_certificate_key /etc/nginx/ssl/server.key; - - return 301 $scheme://data.gov.uk$request_uri; -} - -server { - listen 80; - - server_name data.gov.uk; - server_name co-prod3.dh.bytemark.co.uk; - server_name localhost; - - location /csw { - try_files $uri @ckan; - } - - location / { - rewrite ^/(.*)$ https://data.gov.uk/$1 permanent; - } -} - -server { - listen 443 ssl default_server; - - server_name data.gov.uk; - server_name localhost; - - ssl_certificate /etc/nginx/ssl/server.crt; - ssl_certificate_key /etc/nginx/ssl/server.key; - ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"; - ssl_dhparam /etc/ssl/certs/dhparam.pem; - ssl_prefer_server_ciphers on; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_session_timeout 5m; - - add_header Strict-Transport-Security "max-age=31536000"; - add_header X-Frame-Options SAMEORIGIN; - - charset utf-8; - client_max_body_size 50M; - limit_req_status 429; - port_in_redirect off; - - gzip on; - gzip_proxied any; - gzip_buffers 16 8k; - gzip_types *; - - # Set the resolver so Nginx knows how to lookup domain names. - resolver 8.8.8.8; - - # Set the eventual URL as a variable so that Nginx will resolve the name - # each time, rather than just at startup. - set $find_backend "https://find-data-beta.cloudapps.digital"; - set $geoserver_backend "http://osinspiremappingprod.ordnancesurvey.co.uk/geoserver/"; - - if ($http_transfer_encoding ~* chunked) { - return 444; - } - - location @404 { - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Real-IP $remote_addr; - - proxy_pass $find_backend/404; - } - - location @500 { - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Real-IP $remote_addr; - - proxy_pass $find_backend/500; - } - - location @ckan { - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Real-IP $remote_addr; - - proxy_intercept_errors on; - proxy_pass http://varnish; - proxy_redirect off; - - error_page 404 = @404; - error_page 500 502 503 504 = @500; - - rewrite ^/accessibility-statement/?$ /accessibility permanent; - rewrite ^/contact/?$ /support permanent; - rewrite ^/cookies-policy/?$ /cookies permanent; - rewrite ^/dataset/?$ /search permanent; - rewrite ^/faq/?$ /about permanent; - rewrite ^/technical-details/?$ /about permanent; - rewrite ^/terms-and-conditions/?$ /terms permanent; - - rewrite ^/apps(.*)$ /site-changes permanent; - rewrite ^/comments(.*)$ /site-changes permanent; - rewrite ^/dataset/(.*)_slug/issues/(.*)_issue$ /site-changes permanent; - rewrite ^/forum(.*)$ /site-changes permanent; - rewrite ^/node(.*)$ /site-changes permanent; - rewrite ^/reply(.*)$ /site-changes permanent; - rewrite ^/glossary(.*)$ /site-changes permanent; - rewrite ^/search/everything/?(.*)$ /search?q=$1 permanent; - - rewrite ^/blog(.*)$ https://data.blog.gov.uk permanent; - rewrite ^/guidance(.*)$ http://guidance.data.gov.uk$1 permanent; - rewrite ^/sib_knowledge_box(.*)$ https://www.gov.uk/guidance/social-impact-bonds permanent; - rewrite ^/social_investment(.*)$ http://webarchive.nationalarchives.gov.uk/https://data.gov.uk/social_investment$1 permanent; - } - - location @contracts_archive { - proxy_set_header Host contractsfinder; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Script-Name /contracts-archive; # Must be the same as the location - - proxy_pass http://contractsfinder; - } - - location @find { - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - proxy_intercept_errors on; - proxy_pass $find_backend; - proxy_redirect off; - - recursive_error_pages on; - - error_page 404 = @ckan; - error_page 500 502 503 504 = @ckan; - - if ($arg_legacy) { - return 404; - } - } - - location / { - deny 78.238.200.47; - - limit_req zone=botzone burst=20; - - try_files $uri @find; - } - - location /api { - - location /api/1/util/snippet/api_info.html { - return 404; - } - - location /api/action/user_list { - return 404; - } - - location /api/action/user_show { - return 404; - } - - location /api/util/markdown { - return 404; - } - - try_files $uri @ckan; - } - - location /assets { - alias /vagrant/src/shared_dguk_assets/assets; - gzip on; - gzip_types *; - } - - location /data/preview_proxy { - try_files $uri @ckan; - } - - location /contracts-archive { - try_files $uri @contracts_archive; - } - - location /data/dumps { - autoindex on; - autoindex_exact_size off; - - alias /mnt/shared/ckan_dumps/; - } - - location /data/dump_analysis { - autoindex on; - autoindex_exact_size off; - - alias /mnt/shared/ckan_dump_analysis/; - } - - location /data/reports/mi { - autoindex on; - autoindex_exact_size off; - - alias /mnt/shared/mi_reports/; - } - - location /data/resource { - autoindex on; - autoindex_exact_size off; - - alias /mnt/shared/ckan_resource_store/; - } - - location /education-standards { - proxy_set_header Host isb; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Real-IP $remote_addr; - - proxy_pass https://dfe-app1.codeenigma.net/; - proxy_redirect http://isb/ http://$host/; - } - - location ~ "^/find-assets/.+-([0-9a-f]{32}|[0-9a-f]{64})\..+" { - gzip_static on; - expires max; - add_header Cache-Control public; - add_header ETag ""; - - try_files $uri @find; - } - - location /geoserver { - proxy_pass $geoserver_backend; - } - - location /nginx_status { - stub_status on; # activate stub_status module - access_log off; - allow 127.0.0.1; # restrict access to local only - deny all; - } - - location /services { - try_files $uri @ckan; - } - - location /user { - try_files $uri @ckan; - } - - location /xmlrpc.php { - return 403; - } -} diff --git a/config/sidekiq.yml b/config/sidekiq.yml index 997a9697d..14cf14d6d 100644 --- a/config/sidekiq.yml +++ b/config/sidekiq.yml @@ -8,37 +8,41 @@ import: <%= ENV.fetch('RAILS_MAX_THREADS') { 5 } - 1 %> development: - :schedule: - ckan_v26_package_sync: - class: CKAN::V26::PackageSyncWorker - cron: '*/10 * * * *' - ckan_v26_ckan_org_sync: - class: CKAN::V26::CKANOrgSyncWorker - cron: '*/10 * * * *' + :scheduler: + :schedule: + ckan_v26_package_sync: + class: CKAN::V26::PackageSyncWorker + cron: '*/10 * * * *' + ckan_v26_ckan_org_sync: + class: CKAN::V26::CKANOrgSyncWorker + cron: '*/10 * * * *' integration: - :schedule: - ckan_v26_package_sync: - class: CKAN::V26::PackageSyncWorker - cron: '*/10 * * * *' - ckan_v26_ckan_org_sync: - class: CKAN::V26::CKANOrgSyncWorker - cron: '0 0 * * *' + :scheduler: + :schedule: + ckan_v26_package_sync: + class: CKAN::V26::PackageSyncWorker + cron: '*/10 * * * *' + ckan_v26_ckan_org_sync: + class: CKAN::V26::CKANOrgSyncWorker + cron: '0 0 * * *' staging: - :schedule: - ckan_v26_package_sync: - class: CKAN::V26::PackageSyncWorker - cron: '*/10 * * * *' - ckan_v26_ckan_org_sync: - class: CKAN::V26::CKANOrgSyncWorker - cron: '0 0 * * *' + :scheduler: + :schedule: + ckan_v26_package_sync: + class: CKAN::V26::PackageSyncWorker + cron: '*/10 * * * *' + ckan_v26_ckan_org_sync: + class: CKAN::V26::CKANOrgSyncWorker + cron: '0 0 * * *' production: - :schedule: - ckan_v26_package_sync: - class: CKAN::V26::PackageSyncWorker - cron: '*/10 * * * *' - ckan_v26_ckan_org_sync: - class: CKAN::V26::CKANOrgSyncWorker - cron: '0 0 * * *' + :scheduler: + :schedule: + ckan_v26_package_sync: + class: CKAN::V26::PackageSyncWorker + cron: '*/10 * * * *' + ckan_v26_ckan_org_sync: + class: CKAN::V26::CKANOrgSyncWorker + cron: '0 0 * * *' diff --git a/config/staging/nginx.ckan.conf b/config/staging/nginx.ckan.conf deleted file mode 100644 index 9282ce4f4..000000000 --- a/config/staging/nginx.ckan.conf +++ /dev/null @@ -1,307 +0,0 @@ -limit_req_zone $limited_bot zone=botzone:10m rate=30r/m; -limit_req_zone $limited_geo zone=one:10m rate=3r/s; - -geo $ckan_internal { - ranges; - default 1; - 46.43.41.10-46.43.41.30 0; - 127.0.0.1-127.0.0.1 0; -} - -map $ckan_internal $limited_geo { - 1 $binary_remote_addr; - 0 ""; -} - -map $http_user_agent $limited_bot { - "~Baiduspider" 1; - "~OtherSpider" 2; - default ""; -} - -upstream contractsfinder { - server 34.249.103.20; -} - -upstream varnish { - server 127.0.0.1:6081; -} - -server { - listen 80; - - server_name www.staging.data.gov.uk; - - return 301 $scheme://staging.data.gov.uk$request_uri; -} - -server { - listen 443 ssl; - - server_name www.staging.data.gov.uk; - - ssl_certificate /etc/nginx/ssl/dgu-server.crt; - ssl_certificate_key /etc/nginx/ssl/dgu-server.key; - - return 301 $scheme://staging.data.gov.uk$request_uri; -} - -server { - listen 80; - - server_name staging.data.gov.uk; - server_name co-prod2.dh.bytemark.co.uk; - server_name localhost; - - location /csw { - try_files $uri @ckan; - } - - location / { - rewrite ^/(.*)$ https://staging.data.gov.uk/$1 permanent; - } -} - -server { - listen 443 ssl default_server; - - server_name staging.data.gov.uk; - server_name localhost; - - ssl_certificate /etc/nginx/ssl/dgu-server.crt; - ssl_certificate_key /etc/nginx/ssl/dgu-server.key; - ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"; - ssl_dhparam /etc/ssl/certs/dhparam.pem; - ssl_prefer_server_ciphers on; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_session_timeout 5m; - - add_header Strict-Transport-Security "max-age=31536000"; - add_header X-Frame-Options SAMEORIGIN; - - charset utf-8; - client_max_body_size 50M; - port_in_redirect off; - - gzip on; - gzip_proxied any; - gzip_buffers 16 8k; - gzip_types *; - - # Set the resolver so Nginx knows how to lookup domain names. - resolver 8.8.8.8; - - # Set the eventual URL as a variable so that Nginx will resolve the name - # each time, rather than just at startup. - set $find_backend "https://find-data-beta-staging.cloudapps.digital"; - set $geoserver_backend "http://osinspiremappingprod.ordnancesurvey.co.uk/geoserver/"; - - if ($http_transfer_encoding ~* chunked) { - return 444; - } - - location @404 { - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Real-IP $remote_addr; - - proxy_pass $find_backend/404; - } - - location @500 { - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Real-IP $remote_addr; - - proxy_pass $find_backend/500; - } - - location @ckan { - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Real-IP $remote_addr; - - proxy_intercept_errors on; - proxy_pass http://varnish; - proxy_redirect off; - - error_page 404 = @404; - error_page 500 502 503 504 = @500; - - rewrite ^/accessibility-statement/?$ /accessibility permanent; - rewrite ^/contact/?$ /support permanent; - rewrite ^/cookies-policy/?$ /cookies permanent; - # rewrite ^/dataset/?$ /search permanent; - rewrite ^/faq/?$ /about permanent; - rewrite ^/page/publisher-tools/?$ /dashboard/datasets permanent; - rewrite ^/technical-details/?$ /about permanent; - rewrite ^/terms-and-conditions/?$ /terms permanent; - - rewrite ^/apps(.*)$ /site-changes permanent; - rewrite ^/comments(.*)$ /site-changes permanent; - rewrite ^/data/map-based-search/?(.*)$ /search permanent; - rewrite ^/dataset/(.*)_slug/issues/(.*)_issue$ /site-changes permanent; - rewrite ^/forum(.*)$ /site-changes permanent; - rewrite ^/glossary(.*)$ /site-changes permanent; - rewrite ^/node(.*)$ /site-changes permanent; - rewrite ^/reply(.*)$ /site-changes permanent; - rewrite ^/search/everything/?(.*)$ /search?q=$1 permanent; - - rewrite ^/blog(.*)$ https://data.blog.gov.uk permanent; - rewrite ^/guidance(.*)$ http://guidance.data.gov.uk$1 permanent; - rewrite ^/sib_knowledge_box(.*)$ https://www.gov.uk/guidance/social-impact-bonds permanent; - rewrite ^/social_investment(.*)$ http://webarchive.nationalarchives.gov.uk/https://data.gov.uk/social_investment$1 permanent; - } - - location @contracts_archive { - proxy_set_header Host contractsfinder; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Script-Name /contracts-archive; # Must be the same as the location - - proxy_pass http://contractsfinder; - } - - location @find { - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Real-IP $remote_addr; - - proxy_intercept_errors on; - proxy_pass $find_backend; - proxy_redirect off; - - recursive_error_pages on; - - error_page 404 = @ckan; - error_page 500 502 503 504 = @ckan; - - if ($arg_legacy) { - return 404; - } - - if ($http_cookie ~* "auth_tkt=([^;]+)(?:;|$)") { - return 404; - } - } - - location / { - auth_basic "restricted access"; - auth_basic_user_file /etc/apache2/.htpasswd; - - deny 78.238.200.47; - - limit_req zone=botzone burst=20; - - try_files $uri @find; - } - - location /api { - location /api/1/util/snippet/api_info.html { - return 404; - } - - location /api/action/user_list { - return 404; - } - - location /api/action/user_show { - return 404; - } - - location /api/util/markdown { - return 404; - } - - try_files $uri @ckan; - } - - location /assets { - alias /vagrant/src/shared_dguk_assets/assets; - gzip on; - gzip_types *; - } - - location /contracts-archive { - try_files $uri @contracts_archive; - } - - location /dashboard { - try_files $uri @ckan; - } - - location /data/dumps { - autoindex on; - autoindex_exact_size off; - - alias /mnt/shared/ckan_dumps/; - } - - location /data/dump_analysis { - autoindex on; - autoindex_exact_size off; - - alias /mnt/shared/ckan_dump_analysis/; - } - - location /data/reports/mi { - autoindex on; - autoindex_exact_size off; - - alias /mnt/shared/mi_reports/; - } - - location /data/resource { - autoindex on; - autoindex_exact_size off; - - alias /mnt/shared/ckan_resource_store/; - } - - location /education-standards { - proxy_set_header Host isb; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Real-IP $remote_addr; - - proxy_pass https://dfe-app1.codeenigma.net/; - proxy_redirect http://isb/ http://$host/; - } - - location ~ "^/find-assets/.+-([0-9a-f]{32}|[0-9a-f]{64})\..+" { - gzip_static on; - expires max; - add_header Cache-Control public; - add_header ETag ""; - - try_files $uri @find; - } - - location /geoserver { - proxy_pass $geoserver_backend; - } - - location /nginx_status { - stub_status on; # activate stub_status module - access_log off; - allow 127.0.0.1; # restrict access to local only - deny all; - } - - location /services { - try_files $uri @ckan; - } - - location /user { - try_files $uri @ckan; - } - - location /xmlrpc.php { - return 403; - } -} diff --git a/docker/Dockerfile b/docker/Dockerfile index fe4509ee8..acef67e48 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,23 +1,22 @@ -FROM ruby:3.2.2 +ARG ruby_version=3.2 +ARG base_image=ghcr.io/alphagov/govuk-ruby-base:$ruby_version +ARG builder_image=ghcr.io/alphagov/govuk-ruby-builder:$ruby_version -WORKDIR /srv/app/datagovuk_publish +FROM $builder_image AS builder -RUN apt-get update -RUN apt-get install -y nodejs postgresql postgresql-contrib +WORKDIR $APP_HOME +COPY Gemfile* ./ +RUN bundle install +COPY . ./ -# To allow tests to be run with the test database -ENV DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL true -ENV DATAGOVUK_HOME /srv/app/datagovuk_publish +FROM $base_image -# Create datagovuk user -RUN useradd -r -u 900 -m -c "datagovuk account" -d $DATAGOVUK_HOME -s /bin/false datagovuk +WORKDIR $APP_HOME +COPY --from=builder $BUNDLE_PATH $BUNDLE_PATH +COPY --from=builder $APP_HOME . -COPY ./ $DATAGOVUK_HOME +USER app +CMD ["sidekiq"] -RUN gem install bundler && bundle install - -RUN chown -R datagovuk:datagovuk $DATAGOVUK_HOME -USER datagovuk - -# TODO: check if we really need the datagovuk user to own DATAGOVUK_HOME +LABEL org.opencontainers.image.source=https://github.com/alphagov/datagovuk_publish diff --git a/integration-worker-manifest.yml b/integration-worker-manifest.yml deleted file mode 100644 index e7d3dbe3d..000000000 --- a/integration-worker-manifest.yml +++ /dev/null @@ -1,16 +0,0 @@ -applications: -- name: publish-beta-integration-worker - memory: 1G - buildpack: https://github.com/cloudfoundry/ruby-buildpack.git#v1.10.4 - stack: cflinuxfs3 - command: bundle exec rake db:migrate db:seed && bundle exec sidekiq - env: - RAILS_ENV: integration - RACK_ENV: integration - services: - - publish-integration-secrets - - publish-beta-integration-pg-12 - - publish-beta-integration-redis-6 - - logit-ssl-drain - - opensearch-integration - health-check-type: process diff --git a/lib/tasks/update_organogram_filenames.rb b/lib/tasks/update_organogram_filenames.rb index a5925809e..710e235ff 100644 --- a/lib/tasks/update_organogram_filenames.rb +++ b/lib/tasks/update_organogram_filenames.rb @@ -28,7 +28,7 @@ def replace_urls if @old_urls.empty? "No urls to process" else - Link.where("url LIKE 'https://s3-eu-west-1.amazonaws.com%'").each do |link| + Link.where("url LIKE 'https://s3-eu-west-1.amazonaws.com%'").find_each do |link| next unless link.url.include? "-posts-" index = @old_urls.index(link.url) diff --git a/production-worker-manifest.yml b/production-worker-manifest.yml deleted file mode 100644 index a6399f7a2..000000000 --- a/production-worker-manifest.yml +++ /dev/null @@ -1,16 +0,0 @@ -applications: -- name: publish-beta-production-worker - memory: 1G - buildpack: https://github.com/cloudfoundry/ruby-buildpack.git#v1.10.4 - stack: cflinuxfs3 - command: bundle exec rake db:migrate db:seed && bundle exec sidekiq - env: - RAILS_ENV: production - RACK_ENV: production - services: - - publish-production-secrets - - publish-beta-production-pg-12 - - publish-beta-production-redis-6 - - logit-ssl-drain - - opensearch-production - health-check-type: process diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 915fe0e49..28869dbc5 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -8,7 +8,6 @@ Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |f| require f } -Sidekiq::Logging.logger = Rails.logger Sidekiq::Testing.inline! SimpleCov.start ActiveRecord::Migration.maintain_test_schema! diff --git a/staging-worker-manifest.yml b/staging-worker-manifest.yml deleted file mode 100644 index 11af1aec3..000000000 --- a/staging-worker-manifest.yml +++ /dev/null @@ -1,16 +0,0 @@ -applications: -- name: publish-beta-staging-worker - memory: 1G - buildpack: https://github.com/cloudfoundry/ruby-buildpack.git#v1.10.4 - stack: cflinuxfs3 - command: bundle exec rake db:migrate db:seed && bundle exec sidekiq - env: - RAILS_ENV: staging - RACK_ENV: staging - services: - - publish-staging-secrets - - publish-beta-staging-pg-12 - - publish-beta-staging-redis-6 - - logit-ssl-drain - - opensearch-staging - health-check-type: process