This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
async fetch(request:any, env:any) { | |
const url = new URL(request.url); | |
const key = url.pathname.slice(1); | |
const corsHeaders = { | |
"Access-Control-Allow-Origin": "*", | |
"Access-Control-Allow-Methods": "PUT, GET, DELETE, OPTIONS", | |
"Access-Control-Allow-Headers": "*" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use salvo::oapi::{ToParameters, ToSchema}; | |
use serde::Deserialize; | |
use crate::CONN; | |
use rusqlite::{Result}; | |
use tokio::task; | |
#[derive(Deserialize, ToParameters, Debug)] | |
pub struct Event { | |
pub(crate) uid: String, | |
pub(crate) title: String, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.5" | |
services: | |
postgres: | |
container_name: postgres_container | |
image: postgres | |
environment: | |
POSTGRES_USER: ${POSTGRES_USER:-postgres} | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} | |
PGDATA: /data/postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cronJob | |
import ( | |
"fmt" | |
"log" | |
"network-chesswork/mac" | |
"time" | |
) | |
func FindConnectedMacAddresses(iface string) error { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mac | |
import ( | |
"fmt" | |
"network-chesswork/utilities" | |
"time" | |
"github.com/google/gopacket" | |
"github.com/google/gopacket/layers" | |
"github.com/google/gopacket/pcap" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utilities | |
import ( | |
"fmt" | |
"os" | |
) | |
func FilePathValidity(path string) error { | |
// Check if the script path is valid | |
info, err := os.Stat(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utilities | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
) | |
// / RunScript executes a bash script located at the given path and returns whether it was successful and any error encountered. | |
func RunScript(scriptPath string, props map[string]string) (bool, error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mac | |
import ( | |
"fmt" | |
"network-chesswork/utilities" | |
) | |
// Sniff performs a sniffing operation based on the provided range. | |
func Sniff(interfaceRange string) error { | |
if interfaceRange == "" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cronJob | |
import ( | |
"fmt" | |
"network-chesswork/mac" | |
) | |
func FindConnectedMacAddresses(interfaceRange string) error { | |
err := mac.Sniff(interfaceRange) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"network-chesswork/cronJob" | |
"network-chesswork/info" // Assuming this is the correct package path | |
"github.com/robfig/cron/v3" // Updated import path for the robfig/cron package |
NewerOlder