From 002d677769b28a38d430a6864a63fcf91391d822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Tue, 8 Apr 2025 15:49:02 +0200 Subject: [PATCH] Make spiffy work with openssl even in statically-linked binary. --- backend/brminv.scm | 28 +++++++++++----------------- frontend/src/App.jsx | 10 ++-------- install-eggs.sh | 2 +- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/backend/brminv.scm b/backend/brminv.scm index 32ae6fd..93a501e 100644 --- a/backend/brminv.scm +++ b/backend/brminv.scm @@ -87,18 +87,16 @@ (print "Port: " port) (print "SSL: " ssl?) (when ssl? - (print " Certificate:" (-certificate-)) - (print " Key:" (-key-))) + (print " Certificate: " (-certificate-)) + (print " Key: " (-key-))) (define listener (if ssl? - (ssl-listen port) + (ssl-listen* port: port + certificate: (-certificate-) + private-key: (-key-)) (tcp-listen port))) -(when ssl? - (ssl-load-certificate-chain! listener (-certificate-)) - (ssl-load-private-key! listener (-key-))) - (when (and (-user-) (-group-)) (switch-user/group (-user-) (-group-))) @@ -110,15 +108,6 @@ (password . ,(-db-pass-))))) (print dbconn) -(define (handle-request-by-path path) - (print (->string path-lst) (length path)) - (define body - (cond ((equal? path-lst '(/ "")) - (print "index") - ) - (else - "error")))) - (define (handle-api-calls) #f) @@ -144,7 +133,12 @@ (when (not (handle-api-calls)) (send-response #:body (frontend-lookup "index.html")))))))))) +(debug-log (current-error-port)) (accept-loop listener (if ssl? ssl-accept - tcp-accept)) + tcp-accept) + (if ssl? + (lambda (p) + (tcp-addresses (ssl-port->tcp-port p))) + tcp-addresses)) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index f0356da..67b02eb 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -12,9 +12,6 @@ function App() { // State to store an array of scanned results for history tracking const [scanHistory, setScanHistory] = useState([]); - // Initialize audio for the beep sound effect - const beepSound = new Audio('/beep.mp3'); - /** * Handles the scanning result. * @param {Error} err - Error, if any, from the scanner. @@ -26,9 +23,6 @@ function App() { setCurrentData(result.text); setScanHistory(prevHistory => [...prevHistory, result.text]); - // Play the beep sound for successful scan feedback - beepSound.play(); - // Show a success notification using toast toast.success(`Product scanned: ${result.text}`); } else { @@ -42,10 +36,10 @@ function App() { {/* Scanner title */} -
Scanner
+
BrmInv
{/* Barcode scanner component */} -
+