diff options
author | Jochen Topf <jochen@topf.org> | 2014-05-19 11:07:55 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2014-05-19 11:07:55 +0200 |
commit | 94ddad1c9fec1e53d4b2a671901c3c3d4a0b8aef (patch) | |
tree | 7bb8ffc5ec6e8ca45cdbb9b38694194ad1b0f565 /web/lib | |
parent | eb071aad298c056f134f9e84ea8861afaebaf18f (diff) | |
download | taginfo-94ddad1c9fec1e53d4b2a671901c3c3d4a0b8aef.tar taginfo-94ddad1c9fec1e53d4b2a671901c3c3d4a0b8aef.tar.gz |
Add way to show taginfo configuration through web interface.
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/config.rb | 10 | ||||
-rw-r--r-- | web/lib/ui/taginfo.rb | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/web/lib/config.rb b/web/lib/config.rb index 6195c28..931b639 100644 --- a/web/lib/config.rb +++ b/web/lib/config.rb @@ -19,5 +19,15 @@ class TaginfoConfig return tree.nil? ? default : tree end + # Config without anything that a security concious admin wouldn't want to + # be public. Currently everything that contains local paths is removed. + def self.sanitized_config + c = @@config + c['sources'] && c['sources'].delete('db') + c['logging'] && c['logging'].delete('directory') + c['tagstats'] && c['tagstats'].delete('cxxflags') + return c + end + end diff --git a/web/lib/ui/taginfo.rb b/web/lib/ui/taginfo.rb index e688f82..2d3d6e6 100644 --- a/web/lib/ui/taginfo.rb +++ b/web/lib/ui/taginfo.rb @@ -53,6 +53,16 @@ class Taginfo < Sinatra::Base end end + get '/taginfo/config' do + @title = 'Configuration' + @section = 'taginfo' + @section_title = t.taginfo.meta + + @config = TaginfoConfig.sanitized_config + + erb :'taginfo/config' + end + get '/taginfo/translations' do @title = 'Translations Overview' @section = 'taginfo' |