Skip to content

Commit ce3c728

Browse files
chore: db path changed
1 parent c59279a commit ce3c728

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from flask import Flask, render_template
23
from flask_sqlalchemy import SQLAlchemy
34

@@ -18,8 +19,13 @@
1819
SYSTEM_NAME = get_system_node_name()
1920
SYSTEM_IP_ADDRESS = get_ip_address()
2021

22+
HOME_DIR = os.path.expanduser("~")
23+
DB_DIR = os.path.join(HOME_DIR, ".database")
24+
os.makedirs(DB_DIR, exist_ok=True)
25+
# systemguard path = /home/user/.database/systemguard.db
26+
2127
# Configure the SQLite database
22-
app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{APP_NAME.lower()}.db'
28+
app.config['SQLALCHEMY_DATABASE_URI'] = f"sqlite:///{DB_DIR}/systemguard.db"
2329
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
2430
app.config['SECRET_KEY'] = 'secret'
2531

0 commit comments

Comments
 (0)