Fixed dockerfile, added a docker-compose.yml, added db init function to run on every startup

This commit is contained in:
2025-10-20 23:12:38 +02:00
parent 966353de3e
commit fd0081d4d0
7 changed files with 28 additions and 11 deletions

View File

@@ -112,7 +112,7 @@ async function main( ) {
}
return false;
})( ev );
sendNotification(
await sendNotification(
`${today_prefix ? "TODAY " : ""}${notification_prefix ? notification_prefix + ": " : ""} ${ev.title} (${ TEventType[ ev.event_type ] })`,
`${body}`
// `${ev.link || "https://77th-jsoc.com/#/events"}`

View File

@@ -1,14 +1,16 @@
import * as Bun from "bun";
export function sendNotification(title: string, body: string, click?: string | null) {
export async function sendNotification(title: string, body: string, click?: string | null) {
const command = [
"python",
"./app/notification.py",
"./src/notification.py",
`--title=${title}`,
`--body=${body}`,
];
if (click) {
if ( click ) {
command.push(`--click=${click}`);
}
Bun.spawn(command);
const proc = Bun.spawn(command);
const text = await proc.stdout.text();
console.log("sendNotification: " + text);
}

View File

@@ -10,4 +10,6 @@ export const db = new Database(db_filepath);
export function init () {
Event.createTable(db);
}
}
init();