diff --git a/database/cs/01-init.sql b/database/cs/01-init.sql index 13c52a9..d6a9a6c 100644 --- a/database/cs/01-init.sql +++ b/database/cs/01-init.sql @@ -1,8 +1,8 @@ -- Setup databases and users CREATE DATABASE IF NOT EXISTS `pwnedhub`; CREATE DATABASE IF NOT EXISTS `pwnedhub-test`; -CREATE DATABASE IF NOT EXISTS `pwnedhub-config`; +CREATE DATABASE IF NOT EXISTS `pwnedhub-admin`; CREATE USER 'pwnedhub'@'%' IDENTIFIED BY 'dbconnectpass'; GRANT ALL PRIVILEGES ON `pwnedhub` . * TO 'pwnedhub'@'%'; GRANT ALL PRIVILEGES ON `pwnedhub-test` . * TO 'pwnedhub'@'%'; -GRANT ALL PRIVILEGES ON `pwnedhub-config` . * TO 'pwnedhub'@'%'; +GRANT ALL PRIVILEGES ON `pwnedhub-admin` . * TO 'pwnedhub'@'%'; diff --git a/database/cs/04-pwnedhub-config.sql b/database/cs/04-pwnedhub-admin.sql similarity index 97% rename from database/cs/04-pwnedhub-config.sql rename to database/cs/04-pwnedhub-admin.sql index 2e3d2ef..aab5905 100644 --- a/database/cs/04-pwnedhub-config.sql +++ b/database/cs/04-pwnedhub-admin.sql @@ -1,9 +1,9 @@ -- Attach to database -USE `pwnedhub-config`; +USE `pwnedhub-admin`; -- MySQL dump 10.13 Distrib 8.0.33, for Linux (x86_64) -- --- Host: localhost Database: pwnedhub-config +-- Host: localhost Database: pwnedhub-admin -- ------------------------------------------------------ -- Server version 8.0.33 diff --git a/database/ctf/01-init.sql b/database/ctf/01-init.sql index 13c52a9..d6a9a6c 100644 --- a/database/ctf/01-init.sql +++ b/database/ctf/01-init.sql @@ -1,8 +1,8 @@ -- Setup databases and users CREATE DATABASE IF NOT EXISTS `pwnedhub`; CREATE DATABASE IF NOT EXISTS `pwnedhub-test`; -CREATE DATABASE IF NOT EXISTS `pwnedhub-config`; +CREATE DATABASE IF NOT EXISTS `pwnedhub-admin`; CREATE USER 'pwnedhub'@'%' IDENTIFIED BY 'dbconnectpass'; GRANT ALL PRIVILEGES ON `pwnedhub` . * TO 'pwnedhub'@'%'; GRANT ALL PRIVILEGES ON `pwnedhub-test` . * TO 'pwnedhub'@'%'; -GRANT ALL PRIVILEGES ON `pwnedhub-config` . * TO 'pwnedhub'@'%'; +GRANT ALL PRIVILEGES ON `pwnedhub-admin` . * TO 'pwnedhub'@'%'; diff --git a/database/ctf/04-pwnedhub-config.sql b/database/ctf/04-pwnedhub-admin.sql similarity index 97% rename from database/ctf/04-pwnedhub-config.sql rename to database/ctf/04-pwnedhub-admin.sql index 508d910..ea5149e 100644 --- a/database/ctf/04-pwnedhub-config.sql +++ b/database/ctf/04-pwnedhub-admin.sql @@ -1,9 +1,9 @@ -- Attach to database -USE `pwnedhub-config`; +USE `pwnedhub-admin`; -- MySQL dump 10.13 Distrib 8.0.33, for Linux (x86_64) -- --- Host: localhost Database: pwnedhub-config +-- Host: localhost Database: pwnedhub-admin -- ------------------------------------------------------ -- Server version 8.0.33 diff --git a/database/init/01-init.sql b/database/init/01-init.sql index 13c52a9..d6a9a6c 100644 --- a/database/init/01-init.sql +++ b/database/init/01-init.sql @@ -1,8 +1,8 @@ -- Setup databases and users CREATE DATABASE IF NOT EXISTS `pwnedhub`; CREATE DATABASE IF NOT EXISTS `pwnedhub-test`; -CREATE DATABASE IF NOT EXISTS `pwnedhub-config`; +CREATE DATABASE IF NOT EXISTS `pwnedhub-admin`; CREATE USER 'pwnedhub'@'%' IDENTIFIED BY 'dbconnectpass'; GRANT ALL PRIVILEGES ON `pwnedhub` . * TO 'pwnedhub'@'%'; GRANT ALL PRIVILEGES ON `pwnedhub-test` . * TO 'pwnedhub'@'%'; -GRANT ALL PRIVILEGES ON `pwnedhub-config` . * TO 'pwnedhub'@'%'; +GRANT ALL PRIVILEGES ON `pwnedhub-admin` . * TO 'pwnedhub'@'%'; diff --git a/database/init/04-pwnedhub-config.sql b/database/init/04-pwnedhub-admin.sql similarity index 97% rename from database/init/04-pwnedhub-config.sql rename to database/init/04-pwnedhub-admin.sql index 2e3d2ef..aab5905 100644 --- a/database/init/04-pwnedhub-config.sql +++ b/database/init/04-pwnedhub-admin.sql @@ -1,9 +1,9 @@ -- Attach to database -USE `pwnedhub-config`; +USE `pwnedhub-admin`; -- MySQL dump 10.13 Distrib 8.0.33, for Linux (x86_64) -- --- Host: localhost Database: pwnedhub-config +-- Host: localhost Database: pwnedhub-admin -- ------------------------------------------------------ -- Server version 8.0.33 diff --git a/pwnedadmin/config.py b/pwnedadmin/config.py index c25ec6e..62ff904 100644 --- a/pwnedadmin/config.py +++ b/pwnedadmin/config.py @@ -11,7 +11,7 @@ class BaseConfig(object): # database DATABASE_HOST = os.environ.get('DATABASE_HOST', 'localhost') - SQLALCHEMY_DATABASE_URI = f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub-config" + SQLALCHEMY_DATABASE_URI = f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub-admin" SQLALCHEMY_TRACK_MODIFICATIONS = False diff --git a/pwnedadmin/templates/config.html b/pwnedadmin/templates/config.html index aa94e22..ad6ccb6 100644 --- a/pwnedadmin/templates/config.html +++ b/pwnedadmin/templates/config.html @@ -1,7 +1,7 @@ - Config + PwnedAdmin | Config diff --git a/pwnedadmin/templates/emails.html b/pwnedadmin/templates/emails.html index 93512b4..040529e 100644 --- a/pwnedadmin/templates/emails.html +++ b/pwnedadmin/templates/emails.html @@ -1,7 +1,7 @@ - Inbox + PwnedAdmin | Inbox diff --git a/pwnedapi/config.py b/pwnedapi/config.py index 8e8631a..16eddcf 100644 --- a/pwnedapi/config.py +++ b/pwnedapi/config.py @@ -13,7 +13,7 @@ class BaseConfig(object): DATABASE_HOST = os.environ.get('DATABASE_HOST', 'localhost') SQLALCHEMY_DATABASE_URI = f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub-test" SQLALCHEMY_BINDS = { - 'config': f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub-config" + 'admin': f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub-admin" } SQLALCHEMY_TRACK_MODIFICATIONS = False diff --git a/pwnedapi/models.py b/pwnedapi/models.py index a110082..79ef131 100644 --- a/pwnedapi/models.py +++ b/pwnedapi/models.py @@ -11,7 +11,7 @@ class Config(db.Model): __tablename__ = 'configs' - __bind_key__ = 'config' + __bind_key__ = 'admin' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(255), nullable=False) value = db.Column(db.Boolean, nullable=False) @@ -30,7 +30,7 @@ def __repr__(self): class Email(db.Model): __tablename__ = 'emails' - __bind_key__ = 'config' + __bind_key__ = 'admin' id = db.Column(db.Integer, primary_key=True) created = db.Column(db.DateTime, nullable=False, default=get_current_utc_time) sender = db.Column(db.String(255), nullable=False) diff --git a/pwnedhub/config.py b/pwnedhub/config.py index 78490e2..e37b908 100644 --- a/pwnedhub/config.py +++ b/pwnedhub/config.py @@ -15,7 +15,7 @@ class BaseConfig(object): DATABASE_HOST = os.environ.get('DATABASE_HOST', 'localhost') SQLALCHEMY_DATABASE_URI = f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub" SQLALCHEMY_BINDS = { - 'config': f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub-config" + 'admin': f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub-admin" } SQLALCHEMY_TRACK_MODIFICATIONS = False diff --git a/pwnedhub/models.py b/pwnedhub/models.py index c3eb79c..62b8d29 100644 --- a/pwnedhub/models.py +++ b/pwnedhub/models.py @@ -7,7 +7,7 @@ class Config(db.Model): __tablename__ = 'configs' - __bind_key__ = 'config' + __bind_key__ = 'admin' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(255), nullable=False) value = db.Column(db.Boolean, nullable=False) @@ -26,7 +26,7 @@ def __repr__(self): class Email(db.Model): __tablename__ = 'emails' - __bind_key__ = 'config' + __bind_key__ = 'admin' id = db.Column(db.Integer, primary_key=True) created = db.Column(db.DateTime, nullable=False, default=get_current_utc_time) sender = db.Column(db.String(255), nullable=False) diff --git a/pwnedsso/config.py b/pwnedsso/config.py index 509d3ae..d388766 100644 --- a/pwnedsso/config.py +++ b/pwnedsso/config.py @@ -12,9 +12,6 @@ class BaseConfig(object): # database DATABASE_HOST = os.environ.get('DATABASE_HOST', 'localhost') SQLALCHEMY_DATABASE_URI = f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub" - SQLALCHEMY_BINDS = { - 'config': f"mysql://pwnedhub:dbconnectpass@{DATABASE_HOST}/pwnedhub-config" - } SQLALCHEMY_TRACK_MODIFICATIONS = False