From e71ec9f0d4c674ee6646ac52c0177cf43271e68e Mon Sep 17 00:00:00 2001 From: Eliot Jordan Date: Tue, 22 Aug 2023 10:30:27 -0500 Subject: [PATCH] Set geonames usernames using environment variable --- .dassie/config/initializers/hyrax.rb | 2 +- .koppie/config/initializers/hyrax.rb | 2 +- docker-compose-koppie.yml | 1 + lib/generators/hyrax/templates/config/initializers/hyrax.rb | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.dassie/config/initializers/hyrax.rb b/.dassie/config/initializers/hyrax.rb index da007d2e36..260203d29a 100644 --- a/.dassie/config/initializers/hyrax.rb +++ b/.dassie/config/initializers/hyrax.rb @@ -40,7 +40,7 @@ config.browse_everything = nil end - # config.geonames_username = '' + config.geonames_username = ENV['GEONAMES_USERNAME'] || '' ## # Set the system-wide virus scanner diff --git a/.koppie/config/initializers/hyrax.rb b/.koppie/config/initializers/hyrax.rb index 0c88e25384..00a8ca1399 100644 --- a/.koppie/config/initializers/hyrax.rb +++ b/.koppie/config/initializers/hyrax.rb @@ -104,7 +104,7 @@ # Location autocomplete uses geonames to search for named regions # Username for connecting to geonames - # config.geonames_username = '' + config.geonames_username = ENV['GEONAMES_USERNAME'] || '' # Should the acceptance of the licence agreement be active (checkbox), or # implied when the save button is pressed? Set to true for active diff --git a/docker-compose-koppie.yml b/docker-compose-koppie.yml index c4e9d72e5b..7755748a3c 100644 --- a/docker-compose-koppie.yml +++ b/docker-compose-koppie.yml @@ -17,6 +17,7 @@ services: - .koppie/.env environment: - RAILS_ROOT=/app/samvera/hyrax-webapp + - GEONAMES_USERNAME=username depends_on: - chrome - db_migrate diff --git a/lib/generators/hyrax/templates/config/initializers/hyrax.rb b/lib/generators/hyrax/templates/config/initializers/hyrax.rb index 9d3f1b2391..ac79d02776 100644 --- a/lib/generators/hyrax/templates/config/initializers/hyrax.rb +++ b/lib/generators/hyrax/templates/config/initializers/hyrax.rb @@ -95,7 +95,7 @@ # Location autocomplete uses geonames to search for named regions # Username for connecting to geonames - # config.geonames_username = '' + config.geonames_username = ENV['GEONAMES_USERNAME'] || '' # Should the acceptance of the licence agreement be active (checkbox), or # implied when the save button is pressed? Set to true for active