malp/cgi-bin/malp.rb

17 lines
329 B
Ruby
Executable File

#!/usr/bin/env ruby
require "cgi"
require "erb"
ASSETS_DIR = File.join(__dir__, "../assets")
cgi = CGI.new
hostname = File.read("/etc/hostname").strip rescue "localhost"
template = ERB.new(File.read(File.join(ASSETS_DIR, "login.erb")))
cgi.out("type" => "text/html", "charset" => "UTF-8") do
template.result(binding)
end