From b3e06bc48c7578bd0536a411adcc672ef6ddadae Mon Sep 17 00:00:00 2001 From: Dr Nic Williams Date: Tue, 6 Nov 2018 15:03:03 +1000 Subject: [PATCH] show env vars --- app.rb | 1 + views/index.erb | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app.rb b/app.rb index b6470a7..5679d24 100644 --- a/app.rb +++ b/app.rb @@ -1,4 +1,5 @@ require 'sinatra/base' +require 'json' class App < Sinatra::Base set :public_folder, File.dirname(__FILE__) + '/public' diff --git a/views/index.erb b/views/index.erb index cf105a7..7f489e1 100644 --- a/views/index.erb +++ b/views/index.erb @@ -9,6 +9,19 @@ -

Hello world

+

View environment vars and secret files

+

This little app will show environment variables and files mounted under /secret folder.

+

Secrets

+
+/secret/database/url - postgres://...
+  
+

Environment Variables

+
+<%=
+ENV.keys.sort.map do |key|
+  key + "=" + ENV[key]
+end.join("\n")
+%>
+  
\ No newline at end of file