mirror of
https://github.com/Casvt/MIND.git
synced 2026-04-03 03:00:22 -04:00
V1.0.1 (#30)
* Update README.md * Update README.md * Fixed problem with docker volume mount location * Updated docker compose with new volume mount location * Fixed folder creation for db file * Added support for cross-timezone clients * Fixed database test Co-authored-by: Noted <57927413+ItsNoted@users.noreply.github.com>
This commit is contained in:
12
Noted.py
12
Noted.py
@@ -1,21 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
#-*- coding: utf-8 -*-
|
||||
|
||||
from os import urandom
|
||||
from os.path import dirname, join, abspath
|
||||
from os import makedirs, urandom
|
||||
from os.path import abspath, dirname, join
|
||||
from sys import version_info
|
||||
|
||||
from flask import Flask, render_template, request
|
||||
from waitress.server import create_server
|
||||
|
||||
from backend.db import close_db, setup_db, DBConnection
|
||||
from backend.db import DBConnection, close_db, setup_db
|
||||
from frontend.api import api, reminder_handler
|
||||
from frontend.ui import ui
|
||||
|
||||
HOST = '0.0.0.0'
|
||||
PORT = '8080'
|
||||
THREADS = 10
|
||||
DB_FILENAME = 'Noted.db'
|
||||
DB_FILENAME = 'db', 'Noted.db'
|
||||
|
||||
def _folder_path(*folders) -> str:
|
||||
"""Turn filepaths relative to the project folder into absolute paths
|
||||
@@ -79,7 +79,9 @@ def Noted() -> None:
|
||||
# Register web server
|
||||
app = _create_app()
|
||||
with app.app_context():
|
||||
DBConnection.file = _folder_path(DB_FILENAME)
|
||||
db_location = _folder_path(*DB_FILENAME)
|
||||
makedirs(dirname(db_location), exist_ok=True)
|
||||
DBConnection.file = db_location
|
||||
setup_db()
|
||||
reminder_handler._find_next_reminder()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user