From 0658c2603a7e11e645768d8788fa2fcc1c861bde Mon Sep 17 00:00:00 2001 From: metacryst Date: Thu, 30 Oct 2025 13:17:53 -0500 Subject: [PATCH] remove env file, make ws secure in prod --- .gitignore | 1 + server/.env | 3 --- server/main.go | 2 -- ui/site/ws/Connection.js | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 server/.env diff --git a/.gitignore b/.gitignore index a4b0931..8f0bba0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ _/build content db/* server/db/users.json +server/.env abetaccredited.html qrCodes/qr_codes \ No newline at end of file diff --git a/server/.env b/server/.env deleted file mode 100644 index 1b14025..0000000 --- a/server/.env +++ /dev/null @@ -1,3 +0,0 @@ -BASE_URL=http://localhost:3003 -JWT_SECRET=950b15c8c1c8a27dd716bba3ab51d96ce49afa85cae72884cf22e936e1bc0cb9 -ENV=development \ No newline at end of file diff --git a/server/main.go b/server/main.go index 3cacd6f..e24859f 100644 --- a/server/main.go +++ b/server/main.go @@ -35,7 +35,6 @@ func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { if(loggedIn(w, r)) { - log.Info().Msg("logged") if isWebSocketRequest(r) { handleWebSocket(w, r) return @@ -97,7 +96,6 @@ func handleSite(w http.ResponseWriter, r *http.Request) { return } if strings.Contains(r.URL.Path, "/_") { - log.Debug().Msg("this is what it is") handleAsset(w, r) return } diff --git a/ui/site/ws/Connection.js b/ui/site/ws/Connection.js index c02efa5..18be867 100644 --- a/ui/site/ws/Connection.js +++ b/ui/site/ws/Connection.js @@ -12,7 +12,7 @@ class Connection { if(window.location.hostname === "localhost") { this.ws = new WebSocket("ws://" + "localhost:3003") } else { - this.ws = new WebSocket("ws://" + window.location.hostname + window.location.pathname) + this.ws = new WebSocket("wss://" + window.location.hostname + window.location.pathname) } this.ws.addEventListener('open', () => { this.connectionTries = 0