Skip to content

Commit

Permalink
use env vars in geoserver config
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan committed Sep 13, 2016
1 parent d4244ba commit d47cbbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/services/geo_concerns/delivery/geoserver.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'active_support/core_ext/hash/indifferent_access'
require 'rgeoserver'
require 'yaml'
require 'erb'

module GeoConcerns
module Delivery
Expand All @@ -15,7 +16,7 @@ class Geoserver

def initialize
begin
data = File.read(Rails.root.join('config', 'geoserver.yml'))
data = ERB.new(File.read(Rails.root.join('config', 'geoserver.yml'))).result
@config = YAML.load(data)['geoserver'].with_indifferent_access.freeze
rescue Errno::ENOENT
@config = DEFAULT_CONFIG
Expand Down
12 changes: 5 additions & 7 deletions lib/generators/geo_concerns/templates/config/geoserver.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
geoserver:
# Set to the REST API for the GeoServer
url: "http://localhost:8181/geoserver/rest"
url: <%= ENV['GEOSERVER_URL'] || "http://192.168.99.100:8181/geoserver/rest" %>
# Optional user/password, set to false to disable
user: "admin"
password: "geoserver"
# Set to your GWC server, or "builtin" for the one bundled with GeoServer
geowebcache_url: "builtin"
user: <%= ENV['GEOSERVER_USER'] || "admin" %>
password: <%= ENV['GEOSERVER_PASSWORD'] || "geoserver" %>
# Set to your GWC server, or "builtin" for the one bundled with GeoServer
geowebcache_url: <%= ENV['GEOSERVER_GWC_URL'] || "builtin" %>""

# RestClient:
restclient:
# Set to false to disable or stdout/stderr or 'filename.out'
logfile: stderr
# Timeout (in seconds)
timeout: 300
# Open Timeout (in seconds)
open_timeout: 60

0 comments on commit d47cbbb

Please sign in to comment.