sync: Windmill-State übernehmen + neue Reporting-Flows
- Dateien nach Windmill-Naming-Konvention umbenannt (ssh-key_aus_db_testen, flow-fehler_per_nextcloud_talk_melden, bitwarden_(fallback)) - testpause-Schritt aus flow.yaml entfernt (Debugging abgeschlossen) - Neue Flows: f/Reporting/exchange_logins, f/Reporting/run_sql_events - mail_to_talk: Dateinamen nach Windmill-Konvention synchronisiert Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
type Mysql = {
|
||||
host: string;
|
||||
port: number;
|
||||
user: string;
|
||||
password: string;
|
||||
database: string;
|
||||
};
|
||||
|
||||
type LoginRecord = {
|
||||
username: string;
|
||||
lastaccess: string;
|
||||
ipaddress: string;
|
||||
memberof: string;
|
||||
};
|
||||
|
||||
export async function main(
|
||||
database: Mysql,
|
||||
record: LoginRecord
|
||||
): Promise<{ inserted: boolean }> {
|
||||
const mysql2 = await import("mysql2/promise");
|
||||
|
||||
const conn = await mysql2.createConnection({
|
||||
host: database.host,
|
||||
port: database.port,
|
||||
user: database.user,
|
||||
password: database.password,
|
||||
database: database.database,
|
||||
});
|
||||
|
||||
try {
|
||||
await conn.execute(
|
||||
"INSERT INTO `bronze.services.reporting` (username, lastaccess, ipaddress, add_date, memberof) VALUES (?, ?, ?, NOW(), ?)",
|
||||
[record.username, record.lastaccess, record.ipaddress, record.memberof]
|
||||
);
|
||||
return { inserted: true };
|
||||
} finally {
|
||||
await conn.end();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user