-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
43 lines (32 loc) · 1.21 KB
/
main.py
File metadata and controls
43 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Breadbox is copyright of Akito Hoshi, 2025.
You are free to use any of the code within this project,
so long as you use it for an original purpose.
I offer no promise that any piece of this software is stable,
and I offer no warranty of any kind.
I built this software for my own personal purposes,
so there's a good chance that it may not work for your use case.
If you're aiming for a stable backend for your archive or webservice,
hire a developer. DO NOT USE AI.
"""
from uvicorn import run, __version__ as uvicorn_version
from breadbox import Breadbox, __version__ as breadbox_version
from breadbox.core.config import CONFIG_PATH
from users import UserDB
import logging
log = logging.getLogger('breadbox')
log.info(f"Using [bold yellow]{breadbox_version}[/bold yellow] as backend")
log.info(f"Using [bold yellow]uvicorn v{uvicorn_version}[/bold yellow] as server")
db = UserDB(CONFIG_PATH / 'users.db')
app = Breadbox(
user_db_handler=db
)
if __name__ == '__main__':
run(
app,
host=app.config.server.host,
port=app.config.server.port,
log_level="error",
ssl_keyfile=app.config_path / 'ssl' / 'key.pem',
ssl_certfile=app.config_path / 'ssl' / 'cert.pem',
)