show env vars

This commit is contained in:
Dr Nic Williams 2018-11-06 15:03:03 +10:00
parent a859de10b5
commit b3e06bc48c
2 changed files with 15 additions and 1 deletions

1
app.rb
View File

@ -1,4 +1,5 @@
require 'sinatra/base'
require 'json'
class App < Sinatra::Base
set :public_folder, File.dirname(__FILE__) + '/public'

View File

@ -9,6 +9,19 @@
<script src="/main.js"></script>
</head>
<body>
<p>Hello world</p>
<h1>View environment vars and secret files</h1>
<p>This little app will show environment variables and files mounted under <code>/secret</code> folder.</p>
<h2>Secrets</h2>
<pre>
/secret/database/url - postgres://...
</pre>
<h2>Environment Variables</h2>
<pre>
<%=
ENV.keys.sort.map do |key|
key + "=" + ENV[key]
end.join("\n")
%>
</pre>
</body>
</html>