diff --git a/Dockerfile b/Dockerfile index 9d33bd0fb492b07d7fcc86a6fbbe4f1df04d63b2..946667f5fb32c242a9465dd39f5c7acb544e5c69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,13 @@ FROM ruby:3.1.0 ENV BUNDLER_VERSION=2.3.26 -RUN gem install bundler -v 2.3.26 WORKDIR /app COPY Gemfile Gemfile.lock ./ +RUN gem install bundler -v 2.3.26 + RUN apt update && \ apt install -y libarchive13 nodejs @@ -18,7 +19,6 @@ RUN bundle config build.nokogiri --use-system-libraries # Only install if Gemfile not satisfied RUN bundle check || bundle install - COPY . ./ ENTRYPOINT ["./entrypoints/docker-entrypoint.sh"] diff --git a/Gemfile b/Gemfile index bb639a56af932a488291be40fbbde06ba813d90a..d7baa563f5dc6bb415b611acaf351e45221bee5b 100644 --- a/Gemfile +++ b/Gemfile @@ -187,4 +187,5 @@ gem 'multipart-post', '~> 2.0' gem 'faraday-multipart', '~> 1.0', '>= 1.0.4' gem 'tzinfo-data' - +#AWS S3 +gem "aws-sdk-s3" diff --git a/Gemfile.lock b/Gemfile.lock index f327c42d0b54edc63bd8cae5e0775f232f03a3df..071b9f76dbb34ae53d441a52c9cb3803fc0f5562 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,10 +12,10 @@ GIT GIT remote: https://github.com/kreeti/kt-paperclip.git - revision: 11abf222dc31bff71160a1d138b445214f434b2b + revision: 743979bb57f5a680d9bc17399149a759d1e0b873 branch: master specs: - kt-paperclip (7.1.1) + kt-paperclip (7.2.0) activemodel (>= 4.2.0) activesupport (>= 4.2.0) marcel (~> 1.0.1) @@ -24,10 +24,10 @@ GIT GIT remote: https://github.com/lynndylanhurley/devise_token_auth.git - revision: 30b6d30037ea646646e58ba2ec5ff4682b654f2c + revision: eeed6422a025813010ac1dcb922661d05266e36e branch: master specs: - devise_token_auth (1.2.1) + devise_token_auth (1.2.2) bcrypt (~> 3.0) devise (> 3.5.2, < 5) rails (>= 4.2.0, < 7.1) @@ -35,47 +35,47 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.1) - actionpack (= 7.0.4.1) - activesupport (= 7.0.4.1) + actioncable (7.0.7.2) + actionpack (= 7.0.7.2) + activesupport (= 7.0.7.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.1) - actionpack (= 7.0.4.1) - activejob (= 7.0.4.1) - activerecord (= 7.0.4.1) - activestorage (= 7.0.4.1) - activesupport (= 7.0.4.1) + actionmailbox (7.0.7.2) + actionpack (= 7.0.7.2) + activejob (= 7.0.7.2) + activerecord (= 7.0.7.2) + activestorage (= 7.0.7.2) + activesupport (= 7.0.7.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.1) - actionpack (= 7.0.4.1) - actionview (= 7.0.4.1) - activejob (= 7.0.4.1) - activesupport (= 7.0.4.1) + actionmailer (7.0.7.2) + actionpack (= 7.0.7.2) + actionview (= 7.0.7.2) + activejob (= 7.0.7.2) + activesupport (= 7.0.7.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.1) - actionview (= 7.0.4.1) - activesupport (= 7.0.4.1) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.7.2) + actionview (= 7.0.7.2) + activesupport (= 7.0.7.2) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.1) - actionpack (= 7.0.4.1) - activerecord (= 7.0.4.1) - activestorage (= 7.0.4.1) - activesupport (= 7.0.4.1) + actiontext (7.0.7.2) + actionpack (= 7.0.7.2) + activerecord (= 7.0.7.2) + activestorage (= 7.0.7.2) + activesupport (= 7.0.7.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.1) - activesupport (= 7.0.4.1) + actionview (7.0.7.2) + activesupport (= 7.0.7.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -85,49 +85,66 @@ GEM activemodel (>= 4.1, < 7.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.0.4.1) - activesupport (= 7.0.4.1) + activejob (7.0.7.2) + activesupport (= 7.0.7.2) globalid (>= 0.3.6) - activemodel (7.0.4.1) - activesupport (= 7.0.4.1) - activerecord (7.0.4.1) - activemodel (= 7.0.4.1) - activesupport (= 7.0.4.1) - activerecord-import (1.4.1) + activemodel (7.0.7.2) + activesupport (= 7.0.7.2) + activerecord (7.0.7.2) + activemodel (= 7.0.7.2) + activesupport (= 7.0.7.2) + activerecord-import (1.5.0) activerecord (>= 4.2) - activestorage (7.0.4.1) - actionpack (= 7.0.4.1) - activejob (= 7.0.4.1) - activerecord (= 7.0.4.1) - activesupport (= 7.0.4.1) + activestorage (7.0.7.2) + actionpack (= 7.0.7.2) + activejob (= 7.0.7.2) + activerecord (= 7.0.7.2) + activesupport (= 7.0.7.2) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.1) + activesupport (7.0.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - acts_as_list (1.0.4) + acts_as_list (1.1.0) activerecord (>= 4.2) - addressable (2.8.1) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) annotate (3.2.0) activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) ansi (1.5.0) ast (2.4.2) + aws-eventstream (1.2.0) + aws-partitions (1.816.0) + aws-sdk-core (3.181.0) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.5) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.71.0) + aws-sdk-core (~> 3, >= 3.177.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.134.0) + aws-sdk-core (~> 3, >= 3.181.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.6) + aws-sigv4 (1.6.0) + aws-eventstream (~> 1, >= 1.0.2) axiom-types (0.1.1) descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) - bcrypt (3.1.18) - benchmark-ips (2.10.0) + base64 (0.1.1) + bcrypt (3.1.19) + benchmark-ips (2.12.0) better_errors (2.8.3) coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) bindex (0.8.1) - brakeman (5.4.0) + brakeman (6.0.1) builder (3.2.4) bullet (7.0.7) activesupport (>= 3.0.0) @@ -141,29 +158,30 @@ GEM coderay (1.1.3) coercible (1.0.0) descendants_tracker (~> 0.0.1) - concurrent-ruby (1.1.10) - connection_pool (2.3.0) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) crass (1.0.6) curb (1.0.5) cvss (0.99.0) - dalli (3.2.3) - database_cleaner (2.0.1) - database_cleaner-active_record (~> 2.0.0) - database_cleaner-active_record (2.0.1) + dalli (3.2.5) + 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) - dawnscanner (1.6.9) + dawnscanner (2.2.0) cvss haml justify logger-colors + psych ptools ruby_parser - sqlite3 sys-uname terminal-table + thor dead_end (4.0.0) derailed_benchmarks (2.1.2) benchmark-ips (~> 2) @@ -179,7 +197,7 @@ GEM thor (>= 0.19, < 2) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (4.8.1) + devise (4.9.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -187,15 +205,14 @@ GEM warden (~> 1.2.3) diff-lcs (1.5.0) docile (1.4.0) - elastic-transport (8.2.1) + elastic-transport (8.2.3) faraday (< 3) multi_json - elasticsearch (8.7.0) + elasticsearch (8.9.0) elastic-transport (~> 8) - elasticsearch-api (= 8.7.0) - elasticsearch-api (8.7.0) + elasticsearch-api (= 8.9.0) + elasticsearch-api (8.9.0) multi_json - equalizer (0.0.11) erubi (1.12.0) execjs (2.8.1) factory_bot (6.2.1) @@ -203,9 +220,9 @@ GEM factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) - faker (3.1.0) + faker (3.2.1) i18n (>= 1.8.11, < 2) - faraday (2.7.3) + faraday (2.7.10) faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-multipart (1.0.4) @@ -219,12 +236,12 @@ GEM ffi-libarchive (1.1.3) ffi (~> 1.0) flamegraph (0.9.5) - flay (2.13.0) + flay (2.13.1) erubi (~> 1.10) path_expander (~> 1.0) ruby_parser (~> 3.0) sexp_processor (~> 4.0) - flog (4.6.6) + flog (4.7.0) path_expander (~> 1.0) ruby_parser (~> 3.1, > 3.1.0) sexp_processor (~> 4.8) @@ -233,9 +250,9 @@ GEM gitlab (4.19.0) httparty (~> 0.20) terminal-table (>= 1.5.1) - globalid (1.0.1) - activesupport (>= 5.0) - haml (6.1.1) + globalid (1.2.0) + activesupport (>= 6.1) + haml (6.1.2) temple (>= 0.8.2) thor tilt @@ -245,23 +262,25 @@ GEM httparty (0.21.0) mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) ice_nine (0.11.2) immigrant (0.3.6) activerecord (>= 3.0) + jmespath (1.6.2) json (2.6.3) jsonapi-renderer (0.2.2) justify (1.0.2) - jwt (2.6.0) + jwt (2.7.1) kwalify (0.7.2) + language_server-protocol (3.17.0.3) launchy (2.5.2) addressable (~> 2.8) logger-colors (1.0.0) - loofah (2.19.1) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.8.0.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -269,9 +288,9 @@ GEM marcel (1.0.2) memory_profiler (1.0.1) method_source (1.0.0) - mime-types (3.4.1) + mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) + mime-types-data (3.2023.0808) mimemagic (0.4.3) nokogiri (~> 1) rake @@ -279,22 +298,22 @@ GEM open4 (~> 1.3.4) rake mini_histogram (0.3.1) - mini_mime (1.1.2) - minitest (5.17.0) - minitest-reporters (1.5.0) + mini_mime (1.1.5) + minitest (5.19.0) + minitest-reporters (1.6.1) ansi builder minitest (>= 5.0) ruby-progressbar multi_json (1.15.0) multi_xml (0.6.0) - multipart-post (2.2.3) + multipart-post (2.3.0) mustache (1.1.1) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) - net-http-persistent (4.0.1) + net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-imap (0.3.4) + net-imap (0.3.7) date net-protocol net-pop (0.1.2) @@ -303,8 +322,8 @@ GEM timeout net-smtp (0.3.3) net-protocol - nio4r (2.5.8) - nokogiri (1.14.0-x86_64-linux) + nio4r (2.5.9) + nokogiri (1.15.4-x86_64-linux) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -339,19 +358,20 @@ GEM rack open4 (1.3.4) orm_adapter (0.5.0) - paper_trail (14.0.0) - activerecord (>= 6.0) + paper_trail (15.0.0) + activerecord (>= 6.1) request_store (~> 1.4) - parallel (1.22.1) - paranoia (2.6.1) + parallel (1.23.0) + paranoia (2.6.2) activerecord (>= 5.1, < 7.1) - parser (3.2.0.0) + parser (3.2.2.3) ast (~> 2.4.1) + racc path_expander (1.1.1) - pg (1.4.5) + pg (1.5.4) phantomjs (2.1.1.0) - pkg-config (1.5.1) - psych (5.0.2) + pkg-config (1.5.5) + psych (5.1.0) stringio ptools (1.5.0) public_activity (2.0.2) @@ -359,50 +379,52 @@ GEM activerecord (>= 5.0) i18n (>= 0.5.0) railties (>= 5.0.0) - public_suffix (5.0.1) - puma (6.0.2) + public_suffix (5.0.3) + puma (6.3.1) nio4r (~> 2.0) - pundit (2.3.0) + pundit (2.3.1) activesupport (>= 3.0.0) - racc (1.6.2) - rack (2.2.6.2) - rack-attack (6.6.1) - rack (>= 1.0, < 3) - rack-cors (1.1.1) + racc (1.7.1) + rack (2.2.8) + rack-attack (6.7.0) + rack (>= 1.0, < 4) + rack-cors (2.0.1) rack (>= 2.0.0) - rack-mini-profiler (3.0.0) + rack-mini-profiler (3.1.1) rack (>= 1.2.0) - rack-protection (3.0.5) - rack - rack-test (2.0.2) + rack-protection (3.1.0) + rack (~> 2.2, >= 2.2.4) + rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4.1) - actioncable (= 7.0.4.1) - actionmailbox (= 7.0.4.1) - actionmailer (= 7.0.4.1) - actionpack (= 7.0.4.1) - actiontext (= 7.0.4.1) - actionview (= 7.0.4.1) - activejob (= 7.0.4.1) - activemodel (= 7.0.4.1) - activerecord (= 7.0.4.1) - activestorage (= 7.0.4.1) - activesupport (= 7.0.4.1) + rails (7.0.7.2) + actioncable (= 7.0.7.2) + actionmailbox (= 7.0.7.2) + actionmailer (= 7.0.7.2) + actionpack (= 7.0.7.2) + actiontext (= 7.0.7.2) + actionview (= 7.0.7.2) + activejob (= 7.0.7.2) + activemodel (= 7.0.7.2) + activerecord (= 7.0.7.2) + activestorage (= 7.0.7.2) + activesupport (= 7.0.7.2) bundler (>= 1.15.0) - railties (= 7.0.4.1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + railties (= 7.0.7.2) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) rails-erd (1.7.2) activerecord (>= 4.2) activesupport (>= 4.2) choice (~> 0.2.0) ruby-graphviz (~> 1.2) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - railties (7.0.4.1) - actionpack (= 7.0.4.1) - activesupport (= 7.0.4.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.0.7.2) + actionpack (= 7.0.7.2) + activesupport (= 7.0.7.2) method_source rake (>= 12.2) thor (~> 1.0) @@ -411,145 +433,145 @@ GEM rake (13.0.6) rdoc (6.5.0) psych (>= 4.0.0) - redis-client (0.12.1) + redis-client (0.16.0) connection_pool reek (6.1.4) kwalify (~> 0.7.0) parser (~> 3.2.0) rainbow (>= 2.0, < 4.0) - regexp_parser (2.6.1) + regexp_parser (2.8.1) request_store (1.5.1) rack (>= 1.4) resource_kit (0.1.8) addressable (>= 2.3.6, < 3.0.0) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) - rexml (3.2.5) - rmagick (5.1.0) + responders (3.1.0) + actionpack (>= 5.2) + railties (>= 5.2) + rexml (3.2.6) + rmagick (5.3.0) pkg-config (~> 1.4) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.3) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.1) + rspec-rails (6.0.3) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) - rspec-support (3.12.0) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) + rspec-support (3.12.1) rspec_api_documentation (6.1.0) activesupport (>= 3.0.0) mustache (~> 1.0, >= 0.99.4) rspec (~> 3.0) - rubocop (1.43.0) + rubocop (1.56.2) + base64 (~> 0.1.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.2.2.3) 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.28.1, < 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-ast (1.29.0) + parser (>= 3.2.1.0) ruby-graphviz (1.2.5) rexml - ruby-progressbar (1.11.0) - ruby-statistics (3.0.1) + ruby-progressbar (1.13.0) + ruby-statistics (3.0.2) ruby2_keywords (0.0.5) - ruby_parser (3.19.2) + ruby_parser (3.20.3) sexp_processor (~> 4.16) - rubycritic (4.7.0) - flay (~> 2.8) - flog (~> 4.4) - launchy (>= 2.0.0) - parser (>= 2.6.0) - rainbow (~> 3.0) + rubycritic (4.8.1) + flay (~> 2.13) + flog (~> 4.6) + launchy (>= 2.5.2) + parser (>= 3.2.2.1) + rainbow (~> 3.1.1) reek (~> 6.0, < 7.0) - ruby_parser (~> 3.8) - simplecov (>= 0.17.0) - tty-which (~> 0.4.0) - virtus (~> 1.0) + ruby_parser (~> 3.20) + simplecov (>= 0.22.0) + tty-which (~> 0.5.0) + virtus (~> 2.0) rubyzip (2.3.2) screencap (0.1.4) phantomjs - sdoc (2.6.0) + sdoc (2.6.1) rdoc (>= 5.0) - searchkick (5.1.1) - activemodel (>= 5.2) + searchkick (5.3.0) + activemodel (>= 6.1) hashie - sexp_processor (4.16.1) + sexp_processor (4.17.0) shoulda (4.0.0) shoulda-context (~> 2.0) shoulda-matchers (~> 4.0) shoulda-context (2.0.0) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) - sidekiq (7.0.3) + sidekiq (7.1.2) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) - redis-client (>= 0.11.0) + redis-client (>= 0.14.0) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sinatra (3.0.5) + sinatra (3.1.0) mustermann (~> 3.0) rack (~> 2.2, >= 2.2.4) - rack-protection (= 3.0.5) + rack-protection (= 3.1.0) tilt (~> 2.0) - slim (4.1.0) - temple (>= 0.7.6, < 0.9) - tilt (>= 2.0.6, < 2.1) + slim (5.1.1) + temple (~> 0.10.0) + tilt (>= 2.1.0) snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) spring (4.1.1) - sqlite3 (1.6.0-x86_64-linux) - stackprof (0.2.23) + stackprof (0.2.25) streamio-ffmpeg (3.0.2) multi_json (~> 1.8) - stringio (3.0.4) - sys-uname (1.2.2) + stringio (3.0.8) + sys-uname (1.2.3) ffi (~> 1.1) - temple (0.8.2) + temple (0.10.2) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) - thor (1.2.1) + thor (1.2.2) thread_safe (0.3.6) - tilt (2.0.11) - timeout (0.3.1) - tty-which (0.4.2) - tzinfo (2.0.5) + tilt (2.2.0) + timeout (0.4.0) + tty-which (0.5.0) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) tzinfo-data (1.2023.3) tzinfo (>= 1.0.0) unicode-display_width (2.4.2) uniform_notifier (1.16.0) - version_gem (1.1.1) - virtus (1.0.5) + version_gem (1.1.3) + virtus (2.0.0) axiom-types (~> 0.1) coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) - equalizer (~> 0.0, >= 0.0.9) warden (1.2.9) rack (>= 2.0.9) web-console (4.0.4) @@ -557,12 +579,12 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) whenever (1.0.0) chronic (>= 0.6.3) - zeitwerk (2.6.6) + zeitwerk (2.6.11) PLATFORMS x86_64-linux @@ -572,6 +594,7 @@ DEPENDENCIES activerecord-import acts_as_list annotate + aws-sdk-s3 bcrypt (>= 3.1.7) better_errors (~> 2.8.0) brakeman diff --git a/app/services/s3/aws.rb b/app/services/s3/aws.rb new file mode 100644 index 0000000000000000000000000000000000000000..e3f2c5c1e9ec8329d10bf129c2248077df3e2095 --- /dev/null +++ b/app/services/s3/aws.rb @@ -0,0 +1,19 @@ + +require 'aws-sdk-s3' + +Aws.config.update( + endpoint: 'https://s3.c3sl.ufpr.br', + access_key_id:'GMHK60049J0FT1ZC5EPT', + secret_access_key: 'MyknbDcne4JRNCi6GJhDsSaH3No4TpdCzIjwcJ0K', + force_path_style: true, + region: 'default' +) + +s3_client = Aws::S3::Client.new + +buckets = s3_client.list_buckets + +puts 'List of S3 buckets:' +buckets.each do |bucket| + puts bucket.name +end \ No newline at end of file