Compare commits

..

2 Commits

Author SHA1 Message Date
metacryst
8a8fb7f4b1 Merge branch 'main' of https://git.sun.museum/sam/Hyperia 2025-10-30 13:19:43 -05:00
metacryst
0658c2603a remove env file, make ws secure in prod 2025-10-30 13:17:53 -05:00
4 changed files with 2 additions and 6 deletions

1
.gitignore vendored
View File

@@ -5,5 +5,6 @@ _/build
content content
db/* db/*
server/db/users.json server/db/users.json
server/.env
abetaccredited.html abetaccredited.html
qrCodes/qr_codes qrCodes/qr_codes

View File

@@ -1,3 +0,0 @@
BASE_URL=http://localhost:3003
JWT_SECRET=950b15c8c1c8a27dd716bba3ab51d96ce49afa85cae72884cf22e936e1bc0cb9
ENV=development

View File

@@ -47,7 +47,6 @@ func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if(loggedIn(w, r)) { if(loggedIn(w, r)) {
log.Info().Msg("logged")
if isWebSocketRequest(r) { if isWebSocketRequest(r) {
handleWebSocket(w, r) handleWebSocket(w, r)
return return
@@ -109,7 +108,6 @@ func handleSite(w http.ResponseWriter, r *http.Request) {
return return
} }
if strings.Contains(r.URL.Path, "/_") { if strings.Contains(r.URL.Path, "/_") {
log.Debug().Msg("this is what it is")
handleAsset(w, r) handleAsset(w, r)
return return
} }

View File

@@ -12,7 +12,7 @@ class Connection {
if(window.location.hostname === "localhost") { if(window.location.hostname === "localhost") {
this.ws = new WebSocket("ws://" + "localhost:3003") this.ws = new WebSocket("ws://" + "localhost:3003")
} else { } 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.ws.addEventListener('open', () => {
this.connectionTries = 0 this.connectionTries = 0