From c1f3ee10b99c5223c03c6eaae79d87b693358442 Mon Sep 17 00:00:00 2001 From: Christopher Woodall Date: Sun, 14 May 2023 17:05:58 -0500 Subject: [PATCH 1/5] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Sun, 14 May 2023 17:44:59 -0500 Subject: [PATCH 2/5] Check if space track and n2yo creds are present, else prompt the user to enter them --- main.go | 34 ++++++++++++++++++++++++++++++---- osint/satelliteposition.go | 6 +++--- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index d4de56e..b91a3c7 100644 --- a/main.go +++ b/main.go @@ -1,17 +1,43 @@ /* -Copyright © 2023 NAME HERE +Copyright © 2023 Angelina Tsuboi angelinatsuboi@proton.me */ package main import ( + "bufio" + "fmt" "os" + "strings" "github.com/ANG13T/SatIntel/cli" ) + +func set_environmental_variable(env_key string) { + reader := bufio.NewReader(os.Stdin) + fmt.Print(env_key + ": ") + input, err := reader.ReadString('\n') + + if err != nil { + fmt.Println("Error reading input:", err) + os.Exit(1) + } + + os.Setenv(env_key, strings.TrimSpace(input)) +} + + +func check_environmental_variable(env_key string) { + if os.Getenv(env_key) == "" { + set_environmental_variable(env_key) + } +} + + func main() { - os.Setenv("SPACE_TRACK_USERNAME", "username") - os.Setenv("SPACE_TRACK_PASSWORD", "password") - os.Setenv("N2YO_API_KEY", "api-key") + check_environmental_variable("SPACE_TRACK_USERNAME") + check_environmental_variable("SPACE_TRACK_PASSWORD") + check_environmental_variable("N2YO_API_KEY") + cli.SatIntel() } diff --git a/osint/satelliteposition.go b/osint/satelliteposition.go index 9044fe2..4fff648 100644 --- a/osint/satelliteposition.go +++ b/osint/satelliteposition.go @@ -3,10 +3,10 @@ package osint import ( "io/ioutil" "fmt" - "github.com/iskaa02/qalam/gradient" + "github.com/iskaa02/qalam/gradient" "encoding/json" "github.com/TwiN/go-color" - "net/http" + "net/http" "strconv" "os" ) @@ -31,7 +31,7 @@ func SatellitePositionVisualization() { var norad string fmt.Scanln(&norad) GetLocation(norad) - } + } return } From ec5028d3efa3be96bdd14b2077113b7a14d2db2e Mon Sep 17 00:00:00 2001 From: Christopher Woodall Date: Sun, 14 May 2023 17:55:32 -0500 Subject: [PATCH 3/5] Update main.go --- main.go | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/main.go b/main.go index b91a3c7..07d2817 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ /* Copyright © 2023 Angelina Tsuboi angelinatsuboi@proton.me - */ + package main import ( @@ -9,35 +9,42 @@ import ( "fmt" "os" "strings" + "github.com/ANG13T/SatIntel/cli" ) - -func set_environmental_variable(env_key string) { +func setEnvironmentalVariable(env_key string) string { reader := bufio.NewReader(os.Stdin) - fmt.Print(env_key + ": ") + fmt.Printf("%s: ", envKey) input, err := reader.ReadString('\n') if err != nil { fmt.Println("Error reading input:", err) os.Exit(1) } + input = strings.TrimSuffix(input, "\n") + + if err := os.Setenv(envKey, input); err != nil { + fmt.Printf("Error setting environment variable %s: %v\n", envKey, err) + os.Exit(1) + } - os.Setenv(env_key, strings.TrimSpace(input)) + return input } -func check_environmental_variable(env_key string) { - if os.Getenv(env_key) == "" { - set_environmental_variable(env_key) +func checkEnvironmentalVariable(env_key string) { + _environmental_variable, found := os.LookupEnv(env_key) + if !found { + _environmental_variable = setEnvironmentalVariable(env_key) } } func main() { - check_environmental_variable("SPACE_TRACK_USERNAME") - check_environmental_variable("SPACE_TRACK_PASSWORD") - check_environmental_variable("N2YO_API_KEY") + checkEnvironmentalVariable("SPACE_TRACK_USERNAME") + checkEnvironmentalVariable("SPACE_TRACK_PASSWORD") + checkEnvironmentalVariable("N2YO_API_KEY") cli.SatIntel() } From ce732fe86030f8f4e8750700322c77b12ee4008b Mon Sep 17 00:00:00 2001 From: Christopher Woodall Date: Sun, 14 May 2023 17:56:59 -0500 Subject: [PATCH 4/5] update env key param name --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 07d2817..f22ed36 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( "github.com/ANG13T/SatIntel/cli" ) -func setEnvironmentalVariable(env_key string) string { +func setEnvironmentalVariable(envKey string) string { reader := bufio.NewReader(os.Stdin) fmt.Printf("%s: ", envKey) input, err := reader.ReadString('\n') @@ -33,10 +33,10 @@ func setEnvironmentalVariable(env_key string) string { } -func checkEnvironmentalVariable(env_key string) { - _environmental_variable, found := os.LookupEnv(env_key) +func checkEnvironmentalVariable(envKey string) { + _, found := os.LookupEnv(envKey) if !found { - _environmental_variable = setEnvironmentalVariable(env_key) + setEnvironmentalVariable(envKey) } } From a984d9bcaa5159f3c2c49b6a42aee7f8744ca732 Mon Sep 17 00:00:00 2001 From: Christopher Woodall Date: Sun, 14 May 2023 18:07:09 -0500 Subject: [PATCH 5/5] Update README.md --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5a3b652..aa29c4a 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,18 @@ ``` . . . . . . . . . - . . . ________ + . . . ________ . ///////// . . . . . . . ________ . . ///////// . . |.____. /\ ///////// . . . . . // \/ |\ ///////// // \ | \ ///////// _______ _______ _______ _____ __ _ _______ _______ . - || | | ///////// . . |______ |_____| | | | \ | | |______ | - . || | |// ///// ______| | | | __|__ | \_| | |______ |_____ . - \\ / // \/ . + || | | ///////// . . |______ |_____| | | | \ | | |______ | + . || | |// ///// ______| | | | __|__ | \_| | |______ |_____ . + \\ / // \/ . \\.___./ //\ ,_\ . . . . . \ //////\ / \ . . Satellite OSINT CLI Tool . . - . ///////// \| | . + . ///////// \| | . . ///////// . \ __ / . Made by Angelina Tsuboi (G4LXY) . . ///////// . . . . . ///////// . . . . . . @@ -26,7 +26,7 @@ ### Features - Satellite Catalog Retrieval from NORAD ID or Selection Menu - Display Satellite Telemetry -- Visual and Radio Orbital Predictions +- Visual and Radio Orbital Predictions - Parse Two Line Elements (TLE) ### Preview @@ -37,17 +37,17 @@ Make an account at [**Space Track**](https://space-track.org) save username and Create an account at [**N2YO**](https://n2yo.com) and save API key. -Update `main.go` to have proper credentials -``` -os.Setenv("SPACE_TRACK_USERNAME", "username") -os.Setenv("SPACE_TRACK_PASSWORD", "password") -os.Setenv("N2YO_API_KEY", "api-key") +The CLI will prompt for both Space Track and N2YO credentials if none are present in your environmental variables. To export your credentials enter the following commands: +```bash +$ export SPACE_TRACK_USERNAME="YOUR_USER_NAME" +$ export SPACE_TRACK_PASSWORD="YOUR_PASSWORD" +$ export N2YO_API_KEY="YOUR_API_KEY" ``` To build from source, you will need Go installed. ```bash -$ export GO111MODULE=on +$ export GO111MODULE=on $ go get ./... $ go run main.go ``` @@ -61,5 +61,5 @@ To get a general overview of the underlying concepts of this tool, [read this ar ### Upcoming Features + [ ] Map Layout of Satellite Positioning -+ [ ] Including the [SGP4 Algorithm](joshuaferrara/go-satellite) for Position Prediction ++ [ ] Including the [SGP4 Algorithm](joshuaferrara/go-satellite) for Position Prediction