feat: added basic command issuing
This commit is contained in:
@@ -86,6 +86,25 @@ pub async fn handle_checkin(
|
||||
.cwd
|
||||
.to_str()
|
||||
.unwrap_or("(unknown)");
|
||||
|
||||
let template_category = sqlx::query!(
|
||||
"SELECT default_category FROM beacon_template WHERE template_id = ?",
|
||||
reg.template_id
|
||||
)
|
||||
.fetch_optional(&state.db)
|
||||
.await?;
|
||||
|
||||
if let Some(category_id) = template_category.map(|r| r.default_category) {
|
||||
sqlx::query!(
|
||||
"INSERT INTO beacon_category_assignment (category_id, beacon_id)
|
||||
VALUES (?, ?)",
|
||||
category_id,
|
||||
reg.beacon_id
|
||||
)
|
||||
.execute(&state.db)
|
||||
.await?;
|
||||
}
|
||||
|
||||
sqlx::query!(
|
||||
r#"INSERT INTO beacon_instance
|
||||
(beacon_id, template_id, peer_ip, nickname, cwd, operating_system, beacon_userent, hostname)
|
||||
|
||||
Reference in New Issue
Block a user