Skip to content

Commit

Permalink
Merge AEBM
Browse files Browse the repository at this point in the history
  • Loading branch information
klin-usgs committed Feb 2, 2017
2 parents 981a177 + d895900 commit 3183fbc
Show file tree
Hide file tree
Showing 124 changed files with 45,530 additions and 9,231 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Linux ignore files
sc/data/
sc/pids/
sc/logs/
sc/html/tiles/
sc/tmp/
sc/userdbs/

136 changes: 136 additions & 0 deletions sc/bin/manage_facility_xml.pl
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,138 @@
'sep_char' => $options{'separator'}
});

# HAZUS Facility Model defined in V2/V3
my %MBT_V2 =
('C1HH' => 'C1H High Code',
'C1HM' => 'C1H Moderate Code',
'C1HL' => 'C1H Low Code',
'C1HP' => 'C1H Pre Code',
'C1MH' => 'C1M High Code',
'C1MM' => 'C1M Moderate Code',
'C1ML' => 'C1M Low Code',
'C1MP' => 'C1M Pre Code',
'C1LH' => 'C1L High Code',
'C1LM' => 'C1L Moderate Code',
'C1LL' => 'C1L Low Code',
'C1LP' => 'C1L Pre Code',
'C2HH' => 'C2H High Code',
'C2HM' => 'C2H Moderate Code',
'C2HL' => 'C2H Low Code',
'C2HP' => 'C2H Pre Code',
'C2MH' => 'C2M High Code',
'C2MM' => 'C2M Moderate Code',
'C2ML' => 'C2M Low Code',
'C2MP' => 'C2M Pre Code',
'C2LH' => 'C2L High Code',
'C2LM' => 'C2L Moderate Code',
'C2LL' => 'C2L Low Code',
'C2LP' => 'C2L Pre Code',
'C3HL' => 'C3H Low Code',
'C3HP' => 'C3H Pre Code',
'C3LL' => 'C3L Low Code',
'C3LP' => 'C3L Pre Code',
'C3ML' => 'C3M Low Code',
'C3MP' => 'C3M Pre Code',
'MHH' => 'MH High Code',
'MHM' => 'MH Moderate Code',
'MHL' => 'MH Low Code',
'MHP' => 'MH Pre Code',
'PC1H' => 'PC1 High Code',
'PC1M' => 'PC1 Moderate Code',
'PC1L' => 'PC1 Low Code',
'PC1P' => 'PC1 Pre Code',
'PC2HH' => 'PC2H High Code',
'PC2HM' => 'PC2H Moderate Code',
'PC2HL' => 'PC2H Low Code',
'PC2HP' => 'PC2H Pre Code',
'PC2MH' => 'PC2M High Code',
'PC2MM' => 'PC2M Moderate Code',
'PC2ML' => 'PC2M Low Code',
'PC2MP' => 'PC2M Pre Code',
'PC2LH' => 'PC2L High Code',
'PC2LM' => 'PC2L Moderate Code',
'PC2LL' => 'PC2L Low Code',
'PC2LP' => 'PC2L Pre Code',
'RM1MH' => 'RM1M High Code',
'RM1MM' => 'RM1M Moderate Code',
'RM1ML' => 'RM1M Low Code',
'RM1MP' => 'RM1M Pre Code',
'RM1LH' => 'RM1L High Code',
'RM1LM' => 'RM1L Moderate Code',
'RM1LL' => 'RM1L Low Code',
'RM1LP' => 'RM1L Pre Code',
'RM2HH' => 'RM2H High Code',
'RM2HM' => 'RM2H Moderate Code',
'RM2HL' => 'RM2H Low Code',
'RM2HP' => 'RM2H Pre Code',
'RM2MH' => 'RM2M High Code',
'RM2MM' => 'RM2M Moderate Code',
'RM2ML' => 'RM2M Low Code',
'RM2MP' => 'RM2M Pre Code',
'RM2LH' => 'RM2L High Code',
'RM2LM' => 'RM2L Moderate Code',
'RM2LL' => 'RM2L Low Code',
'RM2LP' => 'RM2L Pre Code',
'S1HH' => 'S1H High Code',
'S1HM' => 'S1H Moderate Code',
'S1HL' => 'S1H Low Code',
'S1HP' => 'S1H Pre Code',
'S1MH' => 'S1M High Code',
'S1MM' => 'S1M Moderate Code',
'S1ML' => 'S1M Low Code',
'S1MP' => 'S1M Pre Code',
'S1LH' => 'S1L High Code',
'S1LM' => 'S1L Moderate Code',
'S1LL' => 'S1L Low Code',
'S1LP' => 'S1L Pre Code',
'S2HH' => 'S2H High Code',
'S2HM' => 'S2H Moderate Code',
'S2HL' => 'S2H Low Code',
'S2HP' => 'S2H Pre Code',
'S2MH' => 'S2M High Code',
'S2MM' => 'S2M Moderate Code',
'S2ML' => 'S2M Low Code',
'S2MP' => 'S2M Pre Code',
'S2LH' => 'S2L High Code',
'S2LM' => 'S2L Moderate Code',
'S2LL' => 'S2L Low Code',
'S2LP' => 'S2L Pre Code',
'S3H' => 'S3 High Code',
'S3M' => 'S3 Moderate Code',
'S3L' => 'S3 Low Code',
'S3P' => 'S3 Pre Code',
'S4HH' => 'S4H High Code',
'S4HM' => 'S4H Moderate Code',
'S4HL' => 'S4H Low Code',
'S4HP' => 'S4H Pre Code',
'S4MH' => 'S4M High Code',
'S4MM' => 'S4M Moderate Code',
'S4ML' => 'S4M Low Code',
'S4MP' => 'S4M Pre Code',
'S4LH' => 'S4L High Code',
'S4LM' => 'S4L Moderate Code',
'S4LL' => 'S4L Low Code',
'S4LP' => 'S4L Pre Code',
'S5HL' => 'S5H Low Code',
'S5HP' => 'S5H Pre Code',
'S5LL' => 'S5L Low Code',
'S5LP' => 'S5L Pre Code',
'S5ML' => 'S5M Low Code',
'S5MP' => 'S5M Pre Code',
'URMLL' => 'URML Low Code',
'URMLP' => 'URML Pre Code',
'URMML' => 'URMM Low Code',
'URMMP' => 'URMM Pre Code',
'W1H' => 'W1 High Code',
'W1M' => 'W1 Moderate Code',
'W1L' => 'W1 Low Code',
'W1P' => 'W1 Pre Code',
'W2H' => 'W2 High Code',
'W2M' => 'W2 Moderate Code',
'W2L' => 'W2 Low Code',
'W2P' => 'W2 Pre Code',
);

my ($xml, %processed_fac);
foreach my $file (@ARGV) {
$xml = XMLin($file);
Expand Down Expand Up @@ -430,6 +562,10 @@ sub process {
}
my $fragility = $colp->{FRAGILITY};
my $attribute = $colp->{ATTRIBUTE};
if ($MBT_V2{$facility_model}) {
$attribute->{"MBT_V2"} = $facility_model;
}


my $fac_type = lookup_facility_type($type);
if ($fac_type <= 0) {
Expand Down
93 changes: 83 additions & 10 deletions sc/conf/httpd-sc.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<VirtualHost _default_:80>
<VirtualHost localhost:80>
ServerAdmin webmaster@localhost


########################################################
#
Expand All @@ -8,32 +10,90 @@
# $Id: httpd-sc.conf 278 2008-01-14 16:30:04Z klin $


DocumentRoot /usr/local/shakecast/sc/html
DocumentRoot /usr/local/shakecast/sc

ErrorLog /usr/local/shakecast/sc/logs/sc_error.log
CustomLog /usr/local/shakecast/sc/logs/sc_access.log combined


<Directory /usr/local/shakecast/sc>
Options None
AllowOverride None
Require all granted
#AuthType Basic
#AuthName ShakeCast
#AuthUserFile /usr/local/shakecast/sc/userdbs/sc-users
# By default forbid everything
#Deny from all
</Directory>

<Directory /usr/local/shakecast/sc/docs>
Allow from all
#require valid-user
Allow from all
require valid-user
AuthName "ShakeCast User"
AuthType Basic
AuthUserFile /usr/local/shakecast/sc/userdbs/sc-users
</Directory>

<Directory /usr/local/shakecast/sc/pma>
Allow from all
AuthName PMA
AuthType Basic
AuthUserFile /usr/local/shakecast/sc/userdbs/sc-servers
require valid-user
</Directory>

<Directory /usr/local/shakecast/sc/download>
Options +Indexes
IndexOptions FancyIndexing FoldersFirst
allow from all
#require valid-user
</Directory>

# Unrestricted access so we can serve error pages to unauthorized users
<Directory /usr/local/shakecast/sc/errordocs>
allow from all
</Directory>

<Directory /usr/local/shakecast/sc/html>
Options +ExecCGI
DirectoryIndex index.cgi
AddHandler cgi-script .cgi .pl
#Options +Indexes
#IndexOptions FancyIndexing FoldersFirst
Require all granted
#require valid-user
#AuthName "ShakeCast User"
#AuthType Basic
#AuthUserFile /usr/local/shakecast/sc/userdbs/sc-users
</Directory>

<Directory /usr/local/shakecast/sc/html/admin>
#Options +Indexes
#IndexOptions FancyIndexing FoldersFirst
Require all granted
</Directory>

<Directory /usr/local/shakecast/sc/images>
Options +Indexes
IndexOptions FancyIndexing FoldersFirst
Require all granted
#require valid-user
</Directory>

<Directory /usr/local/shakecast/sc/scripts/c>
Require all granted
AuthName "Admin Panel"
AuthType Basic
AuthUserFile /usr/local/shakecast/sc/userdbs/sc-users
require valid-user
</Directory>

<Directory /usr/local/shakecast/sc/scripts/r>
Require all granted
AuthName "Admin Panel"
AuthType Basic
AuthUserFile /usr/local/shakecast/sc/userdbs/sc-users
require valid-user
</Directory>

# Data file directory is wide open
Expand All @@ -43,14 +103,27 @@ CustomLog /usr/local/shakecast/sc/logs/sc_access.log combined
Require all granted
</Directory>

<Directory /usr/local/shakecast/sc/public_html>
Require all granted
</Directory>
RewriteEngine on

RewriteRule ^/admin$ /scripts/c/admin/admin.pl [PT]

ScriptAlias /scripts/ /usr/local/shakecast/sc/scripts/

Alias /data/ /usr/local/shakecast/sc/data/
Alias /errordocs/ /usr/local/shakecast/sc/errordocs/
Alias /html/ /usr/local/shakecast/sc/html/
Alias /images/ /usr/local/shakecast/sc/images/
Alias /public_html/ /usr/local/shakecast/sc/public_html/
Alias /pma/ /usr/local/shakecast/sc/pma/

ErrorDocument 401 /errordocs/401.html

Setenv PERL5LIB /usr/local/shakecast/sc/lib

#LoadModule rewrite_module modules/mod_rewrite.so
#RewriteEngine on
#RewriteCond %{REQUEST_METHOD} ^TRACE
#RewriteRule .* - [F]

</VirtualHost>
#LoadModule userdir_module modules/mod_userdir.so
#UserDir disabled
</VirtualHost>
5 changes: 3 additions & 2 deletions sc/conf/sc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ gnuplot /usr/bin/gnuplot
LogLevel 2
</Notify>
salt sc4neic
domain
RootDir /usr/local/shakecast/sc
wkhtmltopdf /usr/local/shakecast/wkhtmltopdf/wkhtmltoimage
DataRoot /usr/local/shakecast/sc/data
Expand Down Expand Up @@ -80,7 +79,9 @@ LogLevel 2
ServiceTitle ShakeCast Notification Generator
LogLevel 2
</NotifyQueue>
GUEST_ACCOUNT 0
perlbin /usr/local/shakecast/sc/sc.bin/perl
domain sc
Threshold 10
high_priority_list 10
<Admin>
Expand Down Expand Up @@ -152,4 +153,4 @@ LogDir /usr/local/shakecast/sc/logs
PORT 53458
</rss>
GUEST_ACCOUNT 0
GM_KEY AIzaSyAiXBtTt8LMdG0bHG0ftEcUJMPL1kvyuOo
GM_KEY AIzaSyAiXBtTt8LMdG0bHG0ftEcUJMPL1kvyuOo
Binary file added sc/db/product.hash
Binary file not shown.
Binary file added sc/html/css/images/ui-icons_444444_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sc/html/css/images/ui-icons_555555_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sc/html/css/images/ui-icons_777620_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sc/html/css/images/ui-icons_777777_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sc/html/css/images/ui-icons_cc0000_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sc/html/css/images/ui-icons_ffffff_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,880 changes: 0 additions & 1,880 deletions sc/html/images/GREEN.ai

This file was deleted.

Binary file removed sc/html/images/GREEN.png
Binary file not shown.
Loading

0 comments on commit 3183fbc

Please sign in to comment.