-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from aau-network-security/develop
Develop
- Loading branch information
Showing
32 changed files
with
1,876 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ casbin.md | |
.data | ||
.logs | ||
state/state.json | ||
log.log | ||
tmp | ||
pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E | |
EOSQL | ||
|
||
PGPASSWORD=$HAAUKINSDB_PASSWORD psql -v ON_ERROR_STOP=1 --username "$HAAUKINSDB_USER" --dbname "$HAAUKINSDB_NAME" <<-EOSQL | ||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | ||
CREATE TABLE IF NOT EXISTS events ( | ||
id serial primary key, | ||
tag varchar (255) NOT NULL, | ||
|
@@ -59,14 +60,17 @@ PGPASSWORD=$HAAUKINSDB_PASSWORD psql -v ON_ERROR_STOP=1 --username "$HAAUKINSDB_ | |
name varchar (255) NOT NULL, | ||
owner_user varchar(255) NOT NULL, | ||
owner_email varchar(255) NOT NULL, | ||
lab_quota integer, | ||
UNIQUE(name) | ||
); | ||
CREATE UNIQUE INDEX orgname_lower_index ON organizations (LOWER(name)); | ||
CREATE TABLE IF NOT EXISTS profiles ( | ||
id serial primary key, | ||
name varchar (255) NOT NULL, | ||
secret boolean NOT NULL, | ||
secret boolean NOT NULL, | ||
description text NOT NULL, | ||
public boolean NOT NULL, | ||
organization varchar(255) NOT NULL REFERENCES organizations (name) ON DELETE CASCADE | ||
); | ||
CREATE UNIQUE INDEX profilename_lower_index ON profiles (LOWER(name), LOWER(organization)); | ||
|
@@ -80,12 +84,14 @@ PGPASSWORD=$HAAUKINSDB_PASSWORD psql -v ON_ERROR_STOP=1 --username "$HAAUKINSDB_ | |
CREATE UNIQUE INDEX profile_challenges_duplicate_index ON profile_challenges (tag, profile_id); | ||
CREATE TABLE IF NOT EXISTS admin_users ( | ||
id serial primary key, | ||
id serial primary key, | ||
sid uuid NOT NULL DEFAULT uuid_generate_v4(), | ||
username varchar (255) NOT NULL, | ||
password varchar (255) NOT NULL, | ||
full_name varchar (255) NOT NULL, | ||
email varchar (255) NOT NULL, | ||
role varchar (255) NOT NULL, | ||
lab_quota integer, | ||
organization varchar (255) NOT NULL REFERENCES organizations (name) ON DELETE CASCADE | ||
); | ||
CREATE UNIQUE INDEX username_lower_index ON Admin_users (LOWER(username)); | ||
|
@@ -111,6 +117,8 @@ PGPASSWORD=$HAAUKINSDB_PASSWORD psql -v ON_ERROR_STOP=1 --username "$HAAUKINSDB_ | |
); | ||
CREATE UNIQUE INDEX frontendname_lower_index ON frontends (LOWER(name)); | ||
-- Setting up an administrative account with password admin | ||
INSERT INTO organizations (name, owner_user, owner_email) VALUES ('Admins', 'admin', '[email protected]'); | ||
INSERT INTO admin_users (username, password, full_name, email, role, organization) VALUES ('admin', '\$2a\$10\$uwUoW.w5OZKEa5/UJrYyM.fz9vjH3z1sGsZWXZ2Nmf0obL9OK80kC', 'Mikkel Høst Christiansen', '[email protected]', 'role::superadmin', 'Admins'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.