1.4.1-alpha - hotfix

This commit is contained in:
mst 2024-09-19 18:34:51 +03:00
parent d70b2ce859
commit e537c3083e
4 changed files with 9 additions and 3 deletions

View file

@ -2,6 +2,6 @@ DB_HOST = 127.0.0.1
DB_NAME = catask DB_NAME = catask
DB_USER = DB_USER =
DB_PASS = DB_PASS =
DB_PORT = DB_PORT = 3306
ADMIN_PASSWORD = ADMIN_PASSWORD =
APP_SECRET = APP_SECRET =

6
app.py
View file

@ -44,11 +44,15 @@ def initDatabase():
if error.errno == errorcode.ER_ACCESS_DENIED_ERROR: if error.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Bad credentials") print("Bad credentials")
elif error.errno == errorcode.ER_BAD_DB_ERROR: elif error.errno == errorcode.ER_BAD_DB_ERROR:
dbPort = os.environ.get("DB_PORT")
if not dbPort:
dbPort = 3306
conn = mysql.connector.connect( conn = mysql.connector.connect(
user=os.environ.get("DB_USER"), user=os.environ.get("DB_USER"),
password=os.environ.get("DB_PASS"), password=os.environ.get("DB_PASS"),
host=os.environ.get("DB_HOST"), host=os.environ.get("DB_HOST"),
port=os.environ.get("DB_PORT"), port=dbPort,
database='mysql' database='mysql'
) )
cursor = conn.cursor() cursor = conn.cursor()

View file

@ -2,6 +2,6 @@ antiSpamFile = 'wordlist.txt'
blacklistFile = 'word_blacklist.txt' blacklistFile = 'word_blacklist.txt'
configFile = 'config.json' configFile = 'config.json'
appName = 'CatAsk' appName = 'CatAsk'
version = '1.4.0' version = '1.4.1'
# id (identifier) is to be interpreted as described in https://semver.org/#spec-item-9 # id (identifier) is to be interpreted as described in https://semver.org/#spec-item-9
version_id = '-alpha' version_id = '-alpha'

View file

@ -44,6 +44,8 @@ dbUser = os.environ.get("DB_USER")
dbPass = os.environ.get("DB_PASS") dbPass = os.environ.get("DB_PASS")
dbName = os.environ.get("DB_NAME") dbName = os.environ.get("DB_NAME")
dbPort = os.environ.get("DB_PORT") dbPort = os.environ.get("DB_PORT")
if not dbPort:
dbPort = 3306
def createDatabase(cursor, dbName): def createDatabase(cursor, dbName):
try: try: