Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/automate_windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
run: |
cd imls-windows-installer
Get-Content setup.iss
cd 'Inno Setup 6'
ISCC.exe 'D:\a\estimating-wifi\estimating-wifi\imls-windows-installer\setup.iss'

- name: Upload the artifact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"gsa.gov/18f/internal/config"
"gsa.gov/18f/internal/session-counter-helper/session_counter"
"gsa.gov/18f/internal/session-counter-helper/state"
Expand All @@ -16,7 +15,7 @@ import (

var (
cfgFile string
mode string
mode string = "prod"
)

func launchTLP() {
Expand Down Expand Up @@ -44,7 +43,7 @@ func launchTLP() {
// Run the network
var wg sync.WaitGroup
wg.Add(1)
go session_counter.Run2()
go session_counter.Run2(mode)

// Wait forever.
wg.Wait()
Expand Down Expand Up @@ -77,8 +76,8 @@ func main() {
"session-counter.ini",
"config file (default is session-counter.ini in /etc/imls, %PROGRAMDATA%\\IMLS, or current directory")
//Sets default mode to "prod"
rootCmd.PersistentFlags().StringVar(&mode, "mode", "prod", "Mode to run the program in")
viper.BindPFlag("mode.run", rootCmd.PersistentFlags().Lookup("mode"))
//rootCmd.PersistentFlags().StringVar(&mode, "mode", "prod", "Mode to run the program in")
//viper.BindPFlag("mode.run", rootCmd.PersistentFlags().Lookup("mode"))
rootCmd.AddCommand(versionCmd)
rootCmd.Execute()
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"gsa.gov/18f/internal/config"
"gsa.gov/18f/internal/session-counter-helper/session_counter"
"gsa.gov/18f/internal/session-counter-helper/state"
Expand All @@ -14,7 +13,7 @@ import (

var (
cfgFile string
mode string
mode string = "prod"
)

func launchTLP() {
Expand Down Expand Up @@ -42,7 +41,7 @@ func launchTLP() {
// Run the network
var wg sync.WaitGroup
wg.Add(1)
go session_counter.Run2()
go session_counter.Run2(mode)
// Wait forever.
wg.Wait()
}
Expand All @@ -63,7 +62,7 @@ func main() {
"config",
"session-counter.ini",
"config file (default is session-counter.ini in /etc/imls, %PROGRAMDATA%\\IMLS, or current directory")
rootCmd.PersistentFlags().StringVar(&mode, "mode", "prod", "Mode to run the program in")
viper.BindPFlag("mode.run", rootCmd.PersistentFlags().Lookup("mode"))
//rootCmd.PersistentFlags().StringVar(&mode, "mode", "prod", "Mode to run the program in")
//viper.BindPFlag("mode.run", rootCmd.PersistentFlags().Lookup("mode"))
rootCmd.Execute()
}
10 changes: 7 additions & 3 deletions imls-wifi-sensor/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,15 @@ func GetLoggers() []string {
func createURI(what string) string {
scheme := viper.GetString("api.scheme")
host := viper.GetString("api.host")
port := viper.GetInt("api.port")
//port := viper.GetInt("api.port")
return (scheme + "://" +
// strings.TrimSuffix(strings.TrimPrefix(host, "/"), "/") +
// ":" + fmt.Sprint(port) + "/" +
// strings.TrimPrefix(what, "/"))
strings.TrimSuffix(strings.TrimPrefix(host, "/"), "/") +
":" + fmt.Sprint(port) + "/" +
"/" +
strings.TrimPrefix(what, "/"))

}

func GetDurationsURI() string {
Expand Down Expand Up @@ -212,7 +216,7 @@ func SetConfigDefaults() {
viper.SetDefault("api.port", 3000)
viper.SetDefault("api.login_uri", "/rpc/login")
viper.SetDefault("api.heartbeat_uri", "/rpc/beat_the_heart")
viper.SetDefault("api.presences_uri", "/rpc/update_presences")
viper.SetDefault("api.presences_uri", "/rpc/update_presence")
// At midnight every night
viper.SetDefault("cron.reset", "0 0 * * *")
// Every hour
Expand Down
6 changes: 6 additions & 0 deletions imls-wifi-sensor/internal/session-counter-helper/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ func PostAuthentication(jwt *JWTToken) error {

login := config.GetLoginURI()

log.Debug().
Str("login_uri", login).
Str("fscs", fscs).
Str("api_key", key).
Msg("login information")

resp, err := client.R().
SetBody(login_data).
SetHeader("Content-Type", "application/json").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ func runEvery(process string, crontab string, c *cron.Cron, fun func()) {
}
}

func Run2() {
func Run2(mode string) {
sq := state.NewQueue[int64]("sent")
durationsdb := state.NewDurationsDB()
c := cron.New()
var sem = make(chan int, 1)

if config.IsDeveloperMode() {
if mode == "dev" {
log.Debug().Msg("DEV MODE, RUNNING FAKESHARK (IT'S A DOLPHIN)")
mock_hw.FakeWiresharkSetup()
}
Expand All @@ -52,7 +52,7 @@ func Run2() {
// We have a race on the ephemeral DB.
// If we're in the data collection loop, we shouldn't let the data send and clear the DB.
sem <- 1
if config.IsDeveloperMode() {
if mode == "dev" {
tlp.SimpleShark(
// search.SetMonitorMode,
func(d *models.Device) {},
Expand Down
Binary file removed imls-windows-installer/Inno Setup 6/Compil32.exe
Binary file not shown.
Loading