diff --git a/.rubocop.yml b/.rubocop.yml index 44cb2a0e4..8a4435dc8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -84,8 +84,11 @@ Layout/EmptyLines: Layout/EmptyLineAfterGuardClause: Enabled: false +# FIXME: private should not be a column name on TypeDeChamp Layout/EmptyLinesAroundAccessModifier: Enabled: true + Exclude: + - "spec/factories/type_de_champ.rb" Layout/EmptyLinesAroundArguments: Enabled: true diff --git a/Gemfile b/Gemfile index 3b09033c4..791180e2c 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem 'turbolinks' # Enable deep clone of active record models gem 'deep_cloneable' -gem 'warden', git: 'https://github.com/hassox/warden.git', branch: 'master' +gem 'warden' # Use Puma as the app server gem 'puma' @@ -55,8 +55,8 @@ gem 'clamav-client', require: 'clamav/client' gem 'carrierwave' gem 'carrierwave-i18n' gem 'copy_carrierwave_file' -gem 'fog' gem 'fog-openstack' +gem 'activestorage-openstack', git: 'https://github.com/fredZen/activestorage-openstack.git', branch: 'frederic/bump-fog-openstack' gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index a1653a099..80ace7c9b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,13 @@ GIT - remote: https://github.com/hassox/warden.git - revision: 5b3cbd5bef67cbe399bb7007537bc4841bbee772 - branch: master + remote: https://github.com/fredZen/activestorage-openstack.git + revision: 8b64c113223e9ec431b220c9350866c4147b88c3 + branch: frederic/bump-fog-openstack specs: - warden (1.2.8) - rack (>= 1.0) + activestorage-openstack (0.5.0) + fog-openstack (~> 1.0) + marcel + mime-types + rails (~> 5.2.0) GIT remote: https://github.com/mina-deploy/mina.git @@ -17,7 +20,6 @@ GIT GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.3.6) aasm (5.0.1) concurrent-ruby (~> 1.0) actioncable (5.2.1) @@ -46,7 +48,7 @@ GEM active_link_to (1.0.5) actionpack addressable - active_model_serializers (0.10.7) + active_model_serializers (0.10.8) actionpack (>= 4.1, < 6) activemodel (>= 4.1, < 6) case_transform (>= 0.2) @@ -129,12 +131,10 @@ GEM capybara-selenium (0.0.6) capybara selenium-webdriver - carrierwave (0.11.2) - activemodel (>= 3.2.0) - activesupport (>= 3.2.0) - json (>= 1.7) + carrierwave (1.2.3) + activemodel (>= 4.0.0) + activesupport (>= 4.0.0) mime-types (>= 1.16) - mimemagic (>= 0.3.0) carrierwave-i18n (0.2.0) case_transform (0.2) activesupport @@ -151,7 +151,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.0.5) + concurrent-ruby (1.1.3) copy_carrierwave_file (1.3.0) carrierwave (>= 0.9) crack (0.4.3) @@ -214,169 +214,28 @@ GEM faraday (0.12.2) multipart-post (>= 1.2, < 3) ffi (1.9.25) - fission (0.5.0) - CFPropertyList (~> 2.2) flipflop (2.4.0) activesupport (>= 4.0) - fog (1.42.0) - fog-aliyun (>= 0.1.0) - fog-atmos - fog-aws (>= 0.6.0) - fog-brightbox (~> 0.4) - fog-cloudatcost (~> 0.1.0) - fog-core (~> 1.45) - fog-digitalocean (>= 0.3.0) - fog-dnsimple (~> 1.0) - fog-dynect (~> 0.0.2) - fog-ecloud (~> 0.1) - fog-google (<= 0.1.0) - fog-internet-archive - fog-joyent - fog-json - fog-local - fog-openstack - fog-ovirt - fog-powerdns (>= 0.1.1) - fog-profitbricks - fog-rackspace - fog-radosgw (>= 0.0.2) - fog-riakcs - fog-sakuracloud (>= 0.0.4) - fog-serverlove - fog-softlayer - fog-storm_on_demand - fog-terremark - fog-vmfusion - fog-voxel - fog-vsphere (>= 0.4.0) - fog-xenserver - fog-xml (~> 0.1.1) - ipaddress (~> 0.5) - json (~> 2.0) - fog-aliyun (0.2.0) - fog-core (~> 1.27) - fog-json (~> 1.0) - ipaddress (~> 0.8) - xml-simple (~> 1.1) - fog-atmos (0.1.0) - fog-core - fog-xml - fog-aws (2.0.0) - fog-core (~> 1.38) - fog-json (~> 1.0) - fog-xml (~> 0.1) - ipaddress (~> 0.8) - fog-brightbox (0.14.0) - fog-core (~> 1.22) - fog-json - inflecto (~> 0.0.2) - fog-cloudatcost (0.1.2) - fog-core (~> 1.36) - fog-json (~> 1.0) - fog-xml (~> 0.1) - ipaddress (~> 0.8) - fog-core (1.45.0) + fog-core (2.1.2) builder excon (~> 0.58) formatador (~> 0.2) - fog-digitalocean (0.3.0) - fog-core (~> 1.42) - fog-json (>= 1.0) - fog-xml (>= 0.1) - ipaddress (>= 0.5) - fog-dnsimple (1.0.0) - fog-core (~> 1.38) - fog-json (~> 1.0) - fog-dynect (0.0.3) - fog-core - fog-json - fog-xml - fog-ecloud (0.3.0) - fog-core - fog-xml - fog-google (0.1.0) - fog-core - fog-json - fog-xml - fog-internet-archive (0.0.1) - fog-core - fog-json - fog-xml - fog-joyent (0.0.1) - fog-core (~> 1.42) - fog-json (>= 1.0) + mime-types fog-json (1.2.0) fog-core multi_json (~> 1.10) - fog-local (0.4.0) - fog-core (~> 1.27) - fog-openstack (0.1.27) - fog-core (~> 1.45.0) + fog-openstack (1.0.6) + fog-core (~> 2.1) fog-json (>= 1.0) ipaddress (>= 0.8) - fog-ovirt (0.1.3) - fog-core (~> 1.45) - fog-json - fog-xml (~> 0.1.1) - rbovirt (~> 0.1.5) - fog-powerdns (0.1.1) - fog-core (~> 1.27) - fog-json (~> 1.0) - fog-xml (~> 0.1) - fog-profitbricks (4.1.1) - fog-core (~> 1.42) - fog-json (~> 1.0) - fog-rackspace (0.1.5) - fog-core (>= 1.35) - fog-json (>= 1.0) - fog-xml (>= 0.1) - ipaddress (>= 0.8) - fog-radosgw (0.0.5) - fog-core (>= 1.21.0) - fog-json - fog-xml (>= 0.0.1) - fog-riakcs (0.1.0) - fog-core - fog-json - fog-xml - fog-sakuracloud (1.7.5) - fog-core - fog-json - fog-serverlove (0.1.2) - fog-core - fog-json - fog-softlayer (1.1.4) - fog-core - fog-json - fog-storm_on_demand (0.1.1) - fog-core - fog-json - fog-terremark (0.1.0) - fog-core - fog-xml - fog-vmfusion (0.1.0) - fission - fog-core - fog-voxel (0.1.0) - fog-core - fog-xml - fog-vsphere (1.13.1) - fog-core - rbvmomi (~> 1.9) - fog-xenserver (0.3.0) - fog-core - fog-xml - fog-xml (0.1.3) - fog-core - nokogiri (>= 1.5.11, < 2.0.0) font-awesome-rails (4.7.0.4) railties (>= 3.2, < 6.0) formatador (0.2.5) globalid (0.4.1) activesupport (>= 4.2.0) - groupdate (4.0.2) + groupdate (4.1.0) activesupport (>= 4.2) - guard (2.14.2) + guard (2.15.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) lumberjack (>= 1.0.12, < 2.0) @@ -426,7 +285,6 @@ GEM httpclient (2.8.3) i18n (1.1.1) concurrent-ruby (~> 1.0) - inflecto (0.0.2) ipaddress (0.8.3) jaro_winkler (1.5.1) jquery-rails (4.3.3) @@ -482,10 +340,10 @@ GEM rest-client marcel (0.3.2) mimemagic (~> 0.3.2) - method_source (0.9.0) - mime-types (3.1) + method_source (0.9.2) + mime-types (3.2.2) mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) + mime-types-data (3.2018.0812) mimemagic (0.3.2) mini_mime (1.0.1) mini_portile2 (2.3.0) @@ -534,7 +392,7 @@ GEM json orm_adapter (0.5.0) parallel (1.12.1) - parser (2.5.1.2) + parser (2.5.3.0) ast (~> 2.4.0) pdf-core (0.7.0) pg (1.1.3) @@ -552,7 +410,7 @@ GEM premailer-rails (1.10.2) actionmailer (>= 3, < 6) premailer (~> 1.7, >= 1.7.9) - pry (0.11.3) + pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-byebug (3.6.0) @@ -560,7 +418,7 @@ GEM pry (~> 0.10) public_suffix (3.0.2) puma (3.12.0) - rack (2.0.5) + rack (2.0.6) rack-handlers (0.7.3) rack rack-mini-profiler (1.0.0) @@ -599,7 +457,7 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) - rails-i18n (5.1.1) + rails-i18n (5.1.2) i18n (>= 0.7, < 2) railties (>= 5.0, < 6) railties (5.2.1) @@ -617,14 +475,6 @@ GEM ffi rbnacl-libsodium (1.0.16) rbnacl (>= 3.0.1) - rbovirt (0.1.5) - nokogiri - rest-client (> 1.7.0) - rbvmomi (1.11.6) - builder (~> 3.0) - json (>= 1.8) - nokogiri (~> 1.5) - trollop (~> 2.1) request_store (1.4.1) rack (>= 1.4) responders (2.4.0) @@ -647,13 +497,13 @@ GEM rspec-mocks (~> 3.8.0) rspec-core (3.8.0) rspec-support (~> 3.8.0) - rspec-expectations (3.8.1) + rspec-expectations (3.8.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) rspec-mocks (3.8.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) - rspec-rails (3.8.0) + rspec-rails (3.8.1) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) @@ -664,14 +514,14 @@ GEM rspec-support (3.8.0) rspec_junit_formatter (0.4.1) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.59.2) + rubocop (0.60.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.5, != 2.5.1.1) powerpack (~> 0.1) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) - unicode-display_width (~> 1.0, >= 1.0.1) + unicode-display_width (~> 1.4.0) rubocop-rspec-focused (1.0.0) rubocop (>= 0.51) ruby-progressbar (1.10.0) @@ -718,9 +568,9 @@ GEM rack (~> 2.0) rack-protection (= 2.0.3) tilt (~> 2.0) - skylight (3.0.0) - skylight-core (= 3.0.0) - skylight-core (3.0.0) + skylight (3.1.1) + skylight-core (= 3.1.1) + skylight-core (3.1.1) activesupport (>= 4.2.0) smart_listing (1.2.2) coffee-rails @@ -748,16 +598,15 @@ GEM httpclient (>= 2.4) sysexits (1.2.0) temple (0.8.0) - thor (0.20.0) + thor (0.20.3) thread_safe (0.3.6) tilt (2.0.8) timecop (0.9.1) - trollop (2.1.2) ttfunk (1.5.1) turbolinks (5.2.0) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - typhoeus (1.3.0) + typhoeus (1.3.1) ethon (>= 0.9.0) tzinfo (1.2.5) thread_safe (~> 0.1) @@ -772,6 +621,8 @@ GEM activemodel (>= 3.0.0) addressable vcr (4.0.0) + warden (1.2.8) + rack (>= 2.0.6) web-console (3.7.0) actionview (>= 5.0) activemodel (>= 5.0) @@ -791,7 +642,6 @@ GEM websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) - xml-simple (1.1.5) xpath (3.0.0) nokogiri (~> 1.8) xray-rails (0.3.1) @@ -805,6 +655,7 @@ DEPENDENCIES aasm active_link_to active_model_serializers + activestorage-openstack! administrate after_party axlsx (~> 3.0.0.pre) @@ -836,7 +687,6 @@ DEPENDENCIES draper factory_bot flipflop - fog fog-openstack font-awesome-rails groupdate @@ -892,7 +742,7 @@ DEPENDENCIES turbolinks typhoeus vcr - warden! + warden web-console webmock webpacker (>= 4.0.x) @@ -900,4 +750,4 @@ DEPENDENCIES zxcvbn-ruby BUNDLED WITH - 1.16.6 + 1.17.1 diff --git a/app/uploaders/piece_justificative_uploader.rb b/app/uploaders/piece_justificative_uploader.rb index 83d277c8f..f4fb1ce67 100644 --- a/app/uploaders/piece_justificative_uploader.rb +++ b/app/uploaders/piece_justificative_uploader.rb @@ -33,10 +33,6 @@ class PieceJustificativeUploader < BaseUploader filename end - def original_filename - model.original_filename - end - private def secure_token diff --git a/config/env.example b/config/env.example index 815202e99..fdfef28c6 100644 --- a/config/env.example +++ b/config/env.example @@ -18,7 +18,8 @@ BASIC_AUTH_PASSWORD="" FOG_OPENSTACK_TENANT="" FOG_OPENSTACK_API_KEY="" FOG_OPENSTACK_USERNAME="" -FOG_OPENSTACK_AUTH_URL="" +FOG_OPENSTACK_URL="" +FOG_OPENSTACK_IDENTITY_API_VERSION="" FOG_OPENSTACK_REGION="" FOG_DIRECTORY="" FOG_ENABLED="" diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index a3dd7d654..73298442a 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -1,9 +1,28 @@ +module Fog + module ServicesMixin + private + + def require_service_provider_library(service, provider) + # Monkey patch to fix https://github.com/fog/fog/issues/4014 + + # This method exists in fog to load legacy providers that have not yet been extracted to + # their own gem. + # fog-openstack has been extracted to its own gem and does not need this method. + # Furthermore, fog-openstack has recently been refactored in a way that breaks this method. + # + # Therefore, until either fog or fog-openstack fixes the problem, we have to neuter the method. + end + end +end + CarrierWave.configure do |config| # These permissions will make dir and files available only to the user running # the servers config.permissions = 0664 config.directory_permissions = 0775 + config.fog_provider = 'fog/openstack' + if ENV['FOG_ENABLED'] == 'enabled' config.fog_credentials = { provider: 'OpenStack', @@ -11,7 +30,8 @@ CarrierWave.configure do |config| openstack_api_key: Rails.application.secrets.fog[:openstack_api_key], openstack_username: Rails.application.secrets.fog[:openstack_username], openstack_auth_url: Rails.application.secrets.fog[:openstack_auth_url], - openstack_region: Rails.application.secrets.fog[:openstack_region] + openstack_region: Rails.application.secrets.fog[:openstack_region], + openstack_identity_api_version: Rails.application.secrets.fog[:oopenstack_identity_api_version] } end diff --git a/config/secrets.yml b/config/secrets.yml index 5c4ad5598..ab96f8c0b 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -37,7 +37,8 @@ defaults: &defaults openstack_tenant: <%= ENV['FOG_OPENSTACK_TENANT'] %> openstack_api_key: <%= ENV['FOG_OPENSTACK_API_KEY'] %> openstack_username: <%= ENV['FOG_OPENSTACK_USERNAME'] %> - openstack_auth_url: <%= ENV['FOG_OPENSTACK_AUTH_URL'] %> + openstack_auth_url: <%= ENV['FOG_OPENSTACK_URL'] %> + openstack_identity_api_version: "<%= ENV['FOG_OPENSTACK_IDENTITY_API_VERSION'] %>" openstack_region: <%= ENV['FOG_OPENSTACK_REGION'] %> directory: <%= ENV['FOG_DIRECTORY'] %> carrierwave: diff --git a/config/storage.yml b/config/storage.yml index 80f0cf275..f3370122c 100644 --- a/config/storage.yml +++ b/config/storage.yml @@ -9,3 +9,14 @@ clever_cloud: access_key_id: <%= ENV['CLEVER_CLOUD_ACCESS_KEY_ID'] %> secret_access_key: <%= ENV['CLEVER_CLOUD_SECRET_ACCESS_KEY'] %> bucket: <%= ENV['CLEVER_CLOUD_BUCKET'] %> +openstack: + service: OpenStack + container: "<%= ENV['FOG_DIRECTORY'] %>" + credentials: + openstack_tenant: "<%= ENV['FOG_OPENSTACK_TENANT'] %>" + openstack_api_key: "<%= ENV['FOG_OPENSTACK_API_KEY'] %>" + openstack_username: "<%= ENV['FOG_OPENSTACK_USERNAME'] %>" + openstack_auth_url: "<%= ENV['FOG_OPENSTACK_URL'] %>" + openstack_identity_api_version: "<%= ENV['FOG_OPENSTACK_IDENTITY_API_VERSION'] %>" + openstack_region: "<%= ENV['FOG_OPENSTACK_REGION'] %>" + openstack_temp_url_key: "<%= ENV['FOG_OPENSTACK_TEMP_URL_KEY'] %>" diff --git a/public/500.html b/public/500.html index 061abc587..94a21f21b 100644 --- a/public/500.html +++ b/public/500.html @@ -1,66 +1,53 @@ - + - We're sorry, but something went wrong (500) - + + + + + + Erreur 500 · demarches-simplifiees.fr + - - -
-
-

We're sorry, but something went wrong.

+
+
+
+
+ +
+
+
+
+

Une erreur est survenue

+
+ Nos équipes ont été averties. Si le problème persiste ou si vous voulez nous donner des détails concernant l'erreur qui vient de se produire, vous pouvez nous contacter à l'adresse contact@demarches-simplifiees.fr. +
-

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

diff --git a/public/fonts/muli-bold/Muli-Regular.woff b/public/fonts/muli-bold/Muli-Regular.woff new file mode 100644 index 000000000..f61ecf832 Binary files /dev/null and b/public/fonts/muli-bold/Muli-Regular.woff differ diff --git a/public/logo-ds.svg b/public/logo-ds.svg new file mode 100644 index 000000000..3fb67e18a --- /dev/null +++ b/public/logo-ds.svg @@ -0,0 +1 @@ + \ No newline at end of file