--- smeserver-oats-2.0.3/root/etc/e-smith/db/configuration/migrate/80oats.db_httpd_templates-01 2006-12-17 15:58:52.000000000 -0700
+++ smeserver-oats-2.0.3/root/etc/e-smith/db/configuration/migrate/80oats 2008-02-01 15:18:54.000000000 -0700
@@ -1,37 +1,10 @@
{
- my $rec = $DB->get('oats')
- || $DB->new_record('oats', {type => 'service'});
-
- my $pw = $rec->prop('DbPassword');
-
- return "" if $pw;
- if (not $pw or length($pw) < 57)
- {
- use MIME::Base64 qw(encode_base64);
-
- $pw = "not set due to error";
-
- if ( open( RANDOM, "/dev/urandom" ) )
- {
- my $buf;
- # 57 bytes is a full line of Base64 coding, and contains
- # 456 bits of randomness - given a perfectly random /dev/random
- if ( read( RANDOM, $buf, 57 ) != 57 )
- {
- warn("Short read from /dev/random: $!");
- }
- else
- {
- $pw = encode_base64($buf);
- chomp $pw;
- }
- close RANDOM;
- }
- else
- {
- warn "Could not open /dev/urandom: $!";
- }
-
- $rec->set_prop('DbPassword', $pw);
- }
+ use MIME::Base64 qw(encode_base64);
+
+ my $rec = $DB->get('oats') || $DB->new_record('oats', {type => 'service'});
+
+ my $pw = $rec->prop('DbPassword');
+ return "" if $pw;
+
+ $rec->set_prop('DbPassword', sprintf("%15.0f", int( (1000000000000000) * rand() )));
}
--- smeserver-oats-2.0.3/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/88OptDomainOats.db_httpd_templates-01 2008-02-01 17:20:44.000000000 -0700
+++ smeserver-oats-2.0.3/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/88OptDomainOats 2008-02-01 17:33:06.000000000 -0700
@@ -0,0 +1,24 @@
+{
+ my $status = $oats{'status'} || "disabled";
+ return " # oats-status is disabled.\n"
+ unless $status eq 'enabled';
+
+ my $domain = $oats{'domain'} || "disabled";
+ return " # no hostname or domain for oats defined\n"
+ if $domain eq 'disabled';
+
+ my $DocRoot = "/opt/oats";
+
+ $OUT = "";
+ $OUT .= "\n";
+ $OUT .= "# Redirect an existing hostname or domain to $DocRoot.\n";
+ $OUT .=\n";
+ $OUT .= ServerName $domain\n";
+ $OUT .= DocumentRoot $DocRoot\n";
+ $OUT .=\n";
+ $OUT .=\n";
+ $OUT .= ServerName $domain\n";
+ $OUT .= DocumentRoot $DocRoot\n";
+ $OUT .= SSLEngine on\n";
+ $OUT .=\n";
+}
--- smeserver-oats-2.0.3/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/30oatsAlias.db_httpd_templates-01 2008-02-01 17:34:39.000000000 -0700
+++ smeserver-oats-2.0.3/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/30oatsAlias 2008-02-01 17:38:20.000000000 -0700
@@ -0,0 +1,10 @@
+{
+ my $status = $oats{'status'} || "disabled";
+ return " # oats is disabled in this VirtualHost"
+ unless $status eq 'enabled';
+
+ if ($port eq "443")
+ {
+ $OUT .= " ProxyPass /oats http://127.0.0.1/oats\n";
+ }
+}
--- smeserver-oats-2.0.3/root/etc/e-smith/templates/etc/e-smith/sql/init/80oats.sql.db_httpd_templates-01 2007-01-19 18:22:14.000000000 -0700
+++ smeserver-oats-2.0.3/root/etc/e-smith/templates/etc/e-smith/sql/init/80oats.sql 2008-02-01 16:51:13.000000000 -0700
@@ -1,18 +1,20 @@
-# Create the user account and password. (This is harmless if the
-# user account and password already exist.) Note the reference
-# to the 'moodle' database which will be created in the next
-# few statements.
-
-USE mysql;
-
-REPLACE INTO user (host, user, password)
- VALUES ('localhost', 'oats', PASSWORD ('{ $oats{DbPassword} }'));
-
-REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv, delete_priv, create_priv, create_tmp_table_priv, drop_priv, index_priv, alter_priv )
- VALUES ('localhost', 'oats', 'oats', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
-
-FLUSH PRIVILEGES;
-
-# Create 'oats' database. (Do nothing if the database already exists.)
-
-CREATE DATABASE IF NOT EXISTS oats;
+{
+ my $db = $oats{DbName} || 'oats';
+ my $user = $oats{DbUser} || 'oats';
+ my $pass = $oats{DbPassword} || 'pleasechangeme';
+ OUT .= <