whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/2] Commit a0b045f: enable tailoring of HTTPS setting
Date Sun, 06 Mar 2016 19:24:10 GMT
Commit a0b045f44ff2b5d3ba78ea8332a420125cc01cc4:
    enable tailoring of HTTPS setting


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/test/vhost-generator.cgi                                 | +++++++ -
------------------------------------------------------------
16 changes: 14 additions, 2 deletions.
------------------------------------------------------------


diff --git a/www/test/vhost-generator.cgi b/www/test/vhost-generator.cgi
index 73f6669..d054124 100755
--- a/www/test/vhost-generator.cgi
+++ b/www/test/vhost-generator.cgi
@@ -3,12 +3,13 @@
 require 'wunderbar'
 
 # response to form requests
-if ENV['REQUEST_METHOD'].upcase == 'POST'
+if ENV['REQUEST_METHOD'].to_s.upcase == 'POST'
   cgi = CGI.new
   cgi.out 'type' => 'text/plain' do
     # extract parameters
     hostname = cgi.params['hostname'].first
     docroot = cgi.params['docroot'].first
+    https = cgi.params['https'].first
 
     # read live configuration
     conf = File.read(Dir['/etc/apache2/sites-available/*whimsy*.conf'].first)
@@ -30,6 +31,9 @@ if ENV['REQUEST_METHOD'].upcase == 'POST'
     # global replace docroot
     conf.gsub! '/srv/whimsy', docroot.chomp('/')
 
+    # global replace docroot
+    conf.gsub! /SetEnv HTTPS .*/, "SetEnv HTTPS #{https}"
+
     conf
   end
 
@@ -70,10 +74,18 @@ _html do
           value: '/srv/whimsy'
       end
 
+      _div_ do
+        _label 'HTTPS', for: 'https'
+        _select id: 'https', name: 'https' do
+          _option 'on'
+          _option 'off', selected: true
+        end
+      end
+
       _input type: 'submit', value: 'Submit'
     end
 
-    _h3 'Modules required'
+    _h3 'Modules enabled'
     _ul do
       Dir['/etc/apache2/mods-enabled/*.load'].sort.each do |conf|
         _li File.basename(conf, '.load')

Mime
View raw message