diff --git a/Dockerfile b/Dockerfile index 361b8f1..809ad51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ # The base stage scaffolds elements which are common to building and running # the application, such as installing ca-certificates, creating the app user, # and installing runtime system dependencies. -FROM ruby:3.2-slim AS base +FROM ruby:3.4-slim AS base # ------------------------------------------------------------ # Declarative metadata @@ -78,7 +78,7 @@ RUN apt-get install -y --no-install-recommends \ USER $APP_USER # Base image ships with an older version of bundler -RUN gem install bundler --version 2.3.25 +RUN gem install bundler --version 4.0.15 # Install gems. We don't enforce the validity of the Gemfile.lock until the # final (production) stage. diff --git a/Gemfile b/Gemfile index c3443e7..ec4aac0 100644 --- a/Gemfile +++ b/Gemfile @@ -8,11 +8,18 @@ gem 'digest', '~> 3.1' # For API calls gem 'faraday', '~> 2.7', '>= 2.7.1' +# For parsing command line options +gem 'getoptlong' + # Simplfy finding data values from the JSON we get back from APIs gem 'jsonpath', '~> 0.5.8' # UCPath also collects data from LDAP gem 'net-ldap', '~> 0.17.0' +# net-ldap requires base64.. +gem 'base64' +# ..and ostruct +gem 'ostruct' # Alma requires XML for their sync gem 'nokogiri', '~> 1.12', '>= 1.12.5' diff --git a/Gemfile.lock b/Gemfile.lock index c8e714d..12d52fc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,6 +4,7 @@ GEM addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) ast (2.4.2) + base64 (0.3.0) bcrypt_pbkdf (1.1.0) bigdecimal (3.1.6) crack (1.0.0) @@ -20,6 +21,7 @@ GEM logger faraday-net_http (3.4.4) net-http (~> 0.5) + getoptlong (0.2.1) hashdiff (1.1.0) json (2.20.0) jsonpath (0.5.8) @@ -38,6 +40,7 @@ GEM racc (~> 1.4) nokogiri (1.19.4-x86_64-linux-gnu) racc (~> 1.4) + ostruct (0.6.3) parallel (1.24.0) parser (3.3.0.5) ast (~> 2.4.1) @@ -97,15 +100,18 @@ PLATFORMS x86_64-linux DEPENDENCIES + base64 bcrypt_pbkdf (~> 1.1) digest (~> 3.1) dotenv (~> 2.7, >= 2.7.6) ed25519 (~> 1.3) faraday (~> 2.7, >= 2.7.1) + getoptlong jsonpath (~> 0.5.8) net-ldap (~> 0.17.0) net-sftp (~> 3.0) nokogiri (~> 1.12, >= 1.12.5) + ostruct rspec (~> 3.10) rspec_junit_formatter rubocop (~> 1.26.0) @@ -115,4 +121,4 @@ DEPENDENCIES webmock (~> 3.14) BUNDLED WITH - 2.3.25 + 4.0.15 diff --git a/lib/docker.rb b/lib/docker.rb index 02c4444..70c8373 100644 --- a/lib/docker.rb +++ b/lib/docker.rb @@ -3,6 +3,8 @@ class Secret class << self def setup_environment!(fileglob = '/run/secrets/*') Dir[fileglob].each do |filepath| + next unless File.file?(filepath) + puts "FP: #{filepath}" secret = File.read(filepath) secret_name = File.basename(filepath)