<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>CHANGELOG.txt</filename>
    </added>
    <added>
      <filename>LICENSE.txt</filename>
    </added>
    <added>
      <filename>Manifest.txt</filename>
    </added>
    <added>
      <filename>README.txt</filename>
    </added>
    <added>
      <filename>Rakefile</filename>
    </added>
    <added>
      <filename>bin/rubycas-server</filename>
    </added>
    <added>
      <filename>lib/casserver/version.rb</filename>
    </added>
    <added>
      <filename>setup.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -62,7 +62,7 @@ ssl_cert: /path/to/your/ssl.pem
 
 database:
   adapter: sqlite3
-  dbfile: casserver.db
+  dbfile: /var/lib/casserver.db
   
 
 ##### AUTHENTICATION #################################################################
@@ -186,7 +186,7 @@ infoline: Powered by &lt;a href=&quot;http://code.google.com/p/rubycas-server/&quot;&gt;RubyCAS-
 # Set the level to DEBUG if you want more detailed logging.
 
 log:
-  file: casserver.log
+  file: /var/log/casserver.log
   level: INFO
 
 
@@ -194,4 +194,4 @@ log:
 # Every SQL query will be logged here. This is useful for debugging database problems.
 #
 #db_log:
-#  file: casserver_db.log
\ No newline at end of file
+#  file: /var/log/casserver_db.log
\ No newline at end of file</diff>
      <filename>config.example.yml</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@ srand
 # Camping.goes must be called after the authenticator class is loaded, otherwise weird things happen
 Camping.goes :CASServer
 
-module CASServer  
+module CASServer
 end
 
 require 'casserver/utils'
@@ -53,7 +53,7 @@ end
 
 
 # this gets run if we launch directly (i.e. `ruby casserver.rb` rather than `camping casserver`)
-if __FILE__ == $0
+if __FILE__ == $0 || $RUN
   CASServer::Models::Base.establish_connection(CASServer::Conf.database)
   if CASServer::Conf.db_log
     CASServer::Models::Base.logger = Logger.new(CASServer::Conf.db_log[:file] || 'casserver_db.log')
@@ -84,14 +84,19 @@ if __FILE__ == $0
     cert = OpenSSL::X509::Certificate.new(File.read(cert_path))
     key = OpenSSL::PKey::RSA.new(File.read(key_path))
     
-    s = WEBrick::HTTPServer.new(
-      :BindAddress =&gt; &quot;0.0.0.0&quot;,
-      :Port =&gt; CASServer::Conf.port,
-      :SSLEnable =&gt; true,
-      :SSLVerifyClient =&gt; ::OpenSSL::SSL::VERIFY_NONE,
-      :SSLCertificate =&gt; cert,
-      :SSLPrivateKey =&gt; key
-    )
+    begin
+      s = WEBrick::HTTPServer.new(
+        :BindAddress =&gt; &quot;0.0.0.0&quot;,
+        :Port =&gt; CASServer::Conf.port,
+        :SSLEnable =&gt; true,
+        :SSLVerifyClient =&gt; ::OpenSSL::SSL::VERIFY_NONE,
+        :SSLCertificate =&gt; cert,
+        :SSLPrivateKey =&gt; key
+      )
+    rescue Errno::EACCES
+      puts &quot;\nThe server could not launch. Are you running on a privileged port? (e.g. port 443) If so, you must run the server as root.&quot;
+      exit 2
+    end
     
     CASServer.create
     s.mount &quot;#{CASServer::Conf.uri_path}&quot;, WEBrick::CampingHandler, CASServer
@@ -116,7 +121,13 @@ if __FILE__ == $0
     
     CASServer.create
   
-    server = Mongrel::Camping::start(&quot;0.0.0.0&quot;,CASServer::Conf.port,&quot;#{CASServer::Conf.uri_path}&quot;,CASServer)
+    begin
+      server = Mongrel::Camping::start(&quot;0.0.0.0&quot;,CASServer::Conf.port,&quot;#{CASServer::Conf.uri_path}&quot;,CASServer)
+    rescue Errno::EACCES
+      puts &quot;\nThe server could not launch. Are you running on a privileged port? (e.g. port 443) If so, you must run the server as root.&quot;
+      exit 2
+    end
+    
     puts &quot;\n** CASServer is running at http://localhost:#{CASServer::Conf.port}#{CASServer::Conf.uri_path} and logging to '#{CASServer::Conf.log[:file]}'&quot;
     server.run.join
   </diff>
      <filename>lib/casserver.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,37 @@
 # load configuration
-begin
-  conf_file = File.dirname(File.expand_path(__FILE__))+&quot;/../../config.yml&quot;
+#begin
+  
+  conf_file = etc_conf = &quot;/etc/rubycas-server/config.yml&quot;
+  unless File.exists? conf_file 
+    # can use local config.yml file in case we're running non-gem installation
+    conf_file = File.dirname(File.expand_path(__FILE__))+&quot;/../../config.yml&quot;
+  end
+
+  unless File.exists? conf_file  
+    require 'fileutils'
+    
+    example_conf_file = File.expand_path(File.dirname(File.expand_path(__FILE__))+&quot;/../../config.example.yml&quot;)
+    puts &quot;\nCAS SERVER NOT YET CONFIGURED!!!\n&quot;
+    puts &quot;\nAttempting to copy sample configuration from '#{example_conf_file}' to '#{etc_conf}'...\n&quot;
+    
+    begin
+      FileUtils.mkdir(&quot;/etc/rubycas-server&quot;) unless File.exists? &quot;/etc/rubycas-server&quot;
+      FileUtils.cp(example_conf_file, etc_conf)
+    rescue Errno::EACCES
+      puts &quot;\nIt appears that you do not have permissions to create the '#{etc_conf}' file. Try running this command using sudo (as root).\n&quot;
+      exit 2
+    rescue
+      puts &quot;\nFor some reason the '#{etc_conf}' file could not be created. You'll have to copy the file manually.&quot; +
+        &quot; Use '#{example_conf_file}' as a template.\n&quot;  
+      exit 2
+    end
+    
+    puts &quot;\nA sample configuration has been created for you in '#{etc_conf}'. Please edit this file to&quot; +
+      &quot; suit your needs and then run rubycas-server again.\n&quot;
+    exit 1
+  end
+  
+  
   loaded_conf = HashWithIndifferentAccess.new(YAML.load_file(conf_file))
   
   if $CONF
@@ -18,20 +49,12 @@ begin
     require 'casserver/'+auth_rb
     $AUTH = $CONF[:authenticator][:class].constantize.new
   end
-rescue
-  if File.exists? conf_file
-    raise &quot;Your RubyCAS-Server configuration may be invalid.&quot;+
-      &quot; Please double-check check your config.yml file.&quot;+
-      &quot; Make sure that you are using spaces instead of tabs for your indentation!!&quot; +
-      &quot;\n\nUNDERLYING EXCEPTION:\n#{$!}&quot;
-  else
-    puts &quot;\nCAS SERVER NOT YET CONFIGURED!!!\n&quot;
-    puts &quot;\nIt appears that you have not yet created a configuration for the CAS server.&quot; +
-      &quot; \nYou should make a copy of the 'config.example.yml' file, name it 'config.yml'&quot; + 
-      &quot; and edit it to match your desired configuration.\n\n&quot;
-    exit 1
-  end
-end
+#rescue
+#    raise &quot;Your RubyCAS-Server configuration may be invalid.&quot;+
+#      &quot; Please double-check check your config.yml file.&quot;+
+#      &quot; Make sure that you are using spaces instead of tabs for your indentation!!&quot; +
+#      &quot;\n\nUNDERLYING EXCEPTION:\n#{$!}&quot;
+#end
 
 module CASServer
   module Conf</diff>
      <filename>lib/casserver/conf.rb</filename>
    </modified>
    <modified>
      <diff>@@ -97,7 +97,7 @@ div.messagebox {
 
 div.mistake {
 	color: #d00;
-	background-image: url(/themes/warning.png);
+	background-image: url(warning.png);
 	background-repeat: no-repeat;
 	background-position: 10px 5px;
 	font-weight: bold;
@@ -105,7 +105,7 @@ div.mistake {
 
 div.confirmation {
 	color: #280;
-	background-image: url(/themes/ok.png);
+	background-image: url(ok.png);
 	background-repeat: no-repeat;
 	background-position: 10px 5px;
 	font-weight: bold;</diff>
      <filename>lib/themes/cas.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e638525d36bc92791b87bf6e20141a9e05696f1d</id>
    </parent>
  </parents>
  <author>
    <name>matt.zukowski</name>
    <email>matt.zukowski@fffcb96a-a727-0410-ad3e-7b35c796b8d7</email>
  </author>
  <url>http://github.com/gunark/rubycas-server/commit/60f88753c66a0b09adf07fd39235c887b55e3d96</url>
  <id>60f88753c66a0b09adf07fd39235c887b55e3d96</id>
  <committed-date>2007-03-08T15:22:43-08:00</committed-date>
  <authored-date>2007-03-08T15:22:43-08:00</authored-date>
  <message>packaged as gem, ready for first public release

git-svn-id: https://rubycas-server.googlecode.com/svn/trunk@50 fffcb96a-a727-0410-ad3e-7b35c796b8d7</message>
  <tree>81ed5655d95280046a8b5a8f23eb9931b1d7402f</tree>
  <committer>
    <name>matt.zukowski</name>
    <email>matt.zukowski@fffcb96a-a727-0410-ad3e-7b35c796b8d7</email>
  </committer>
</commit>
