1. György Kohut
  2. honeeebox

Commits

György Kohut  committed d8f3b4c

update for hbbackend rev 4c85cedac808

  • Participants
  • Parent commits bc0d55c
  • Branches master

Comments (0)

Files changed (5)

Submodule hbbackend

  • Ignore whitespace
-Subproject commit dfe7e2b8a3039d7ce5658e5fcfa3a0a88e6a0095
+Subproject commit 4c85cedac808883e8527e60be114573abc0e5530

File vagrant/puppet/modules/backend/files/opt/honeynet/bin/create-hbbackend-db.sh

View file
  • Ignore whitespace
 
 if [ ! -f ~/_hbbackend_db_created ]
 then
-    echo "create user hbbackend with password 'hbbackend';" | sudo -u postgres psql
-    echo "create database hbbackend owner hbbackend;" | sudo -u postgres psql template1
+    sudo -u postgres psql -c "create user hbbackend with password 'hbbackend';"
+    sudo -u postgres psql -c "create user hbstats with password 'hbstats';"
+    sudo -u postgres psql -c "create database hbbackend owner hbbackend;"
+
+    PGPASSWORD=hbbackend psql -h localhost -U hbbackend -c "create schema hbbackend;"
     PGPASSWORD=hbbackend psql -h localhost -U hbbackend < /repo/hbbackend/schema/hbbackend.sql
     PGPASSWORD=hbbackend psql -h localhost -U hbbackend < /repo/hbbackend/schema/hbbackend_functions.sql
+    PGPASSWORD=hbbackend psql -h localhost -U hbbackend -c "grant usage on schema hbbackend to hbstats;"
+    PGPASSWORD=hbbackend psql -h localhost -U hbbackend -c "grant select on all tables in schema hbbackend to hbstats;"
+    PGPASSWORD=hbbackend psql -h localhost -U hbbackend -c "grant create on database hbbackend to hbstats;"
+
+    PGPASSWORD=hbstats psql -h localhost -U hbstats -d hbbackend -c "create schema hbstats;"
+    PGPASSWORD=hbstats psql -h localhost -U hbstats -d hbbackend < /repo/hbbackend/schema/hbstats.sql
+    PGPASSWORD=hbstats psql -h localhost -U hbstats -d hbbackend < /repo/hbbackend/schema/hbstats_functions.sql
 
     touch ~/_hbbackend_db_created
 fi

File vagrant/puppet/modules/backend/files/opt/honeynet/bin/deploy-backend.sh

View file
  • Ignore whitespace
 cd /repo/hbbackend
 asadmin --port 9948 deploy target/modules/org.honeynet.hbbackend.hpfeedsra.rar
 asadmin --port 9948 deploy target/modules/org.honeynet.hbbackend.hpfeeds.jar
+asadmin --port 9948 deploy target/modules/org.honeynet.hbbackend.stats.jar
 

File vagrant/puppet/modules/backend/files/opt/honeynet/bin/setup-hbbackend-domain.sh

View file
  • Ignore whitespace
 # start
 asadmin --port 9948 start-domain hbbackend
 
-# postgres connection pool and jdbc
+# postgres connection pools and jdbc
 asadmin --port 9948 <<EOL
-create-jdbc-connection-pool --datasourceclassname org.postgresql.xa.PGXADataSource --restype javax.sql.XADataSource --property user=hbbackend:password=hbbackend:databaseName=hbbackend:serverName=localhost:port=5432 PgPool
-ping-connection-pool PgPool
-create-jdbc-resource --connectionpoolid PgPool jdbc/hbbackend
+create-jdbc-connection-pool --datasourceclassname org.postgresql.xa.PGXADataSource --restype javax.sql.XADataSource --property user=hbbackend:password=hbbackend:databaseName=hbbackend:serverName=localhost:port=5432 PgPool_hbbackend
+ping-connection-pool PgPool_hbbackend
+create-jdbc-resource --connectionpoolid PgPool_hbbackend jdbc/hbbackend
+
+create-jdbc-connection-pool --datasourceclassname org.postgresql.xa.PGXADataSource --restype javax.sql.XADataSource --property user=hbstats:password=hbstats:databaseName=hbbackend:serverName=localhost:port=5432 --steadypoolsize 1 --maxpoolsize 4 PgPool_hbstats
+ping-connection-pool PgPool_hbstats
+create-jdbc-resource --connectionpoolid PgPool_hbstats jdbc/hbstats
 EOL
 
 # thread pools

File vagrant/puppet/modules/backend/files/opt/honeynet/bin/undeploy-backend.sh

View file
  • Ignore whitespace
 #!/bin/sh -e
 
-asadmin --port 9948 undeploy org.honeynet.hbbackend.hpfeedsra.rar
-asadmin --port 9948 undeploy org.honeynet.hbbackend.hpfeeds.jar
+asadmin --port 9948 undeploy org.honeynet.hbbackend.stats
+asadmin --port 9948 undeploy org.honeynet.hbbackend.hpfeedsra
+asadmin --port 9948 undeploy org.honeynet.hbbackend.hpfeeds