Make spiffy work with openssl even in statically-linked binary.
This commit is contained in:
parent
fac8d8f4f1
commit
002d677769
3 changed files with 14 additions and 26 deletions
|
@ -87,18 +87,16 @@
|
||||||
(print "Port: " port)
|
(print "Port: " port)
|
||||||
(print "SSL: " ssl?)
|
(print "SSL: " ssl?)
|
||||||
(when ssl?
|
(when ssl?
|
||||||
(print " Certificate:" (-certificate-))
|
(print " Certificate: " (-certificate-))
|
||||||
(print " Key:" (-key-)))
|
(print " Key: " (-key-)))
|
||||||
|
|
||||||
(define listener
|
(define listener
|
||||||
(if ssl?
|
(if ssl?
|
||||||
(ssl-listen port)
|
(ssl-listen* port: port
|
||||||
|
certificate: (-certificate-)
|
||||||
|
private-key: (-key-))
|
||||||
(tcp-listen port)))
|
(tcp-listen port)))
|
||||||
|
|
||||||
(when ssl?
|
|
||||||
(ssl-load-certificate-chain! listener (-certificate-))
|
|
||||||
(ssl-load-private-key! listener (-key-)))
|
|
||||||
|
|
||||||
(when (and (-user-) (-group-))
|
(when (and (-user-) (-group-))
|
||||||
(switch-user/group (-user-) (-group-)))
|
(switch-user/group (-user-) (-group-)))
|
||||||
|
|
||||||
|
@ -110,15 +108,6 @@
|
||||||
(password . ,(-db-pass-)))))
|
(password . ,(-db-pass-)))))
|
||||||
(print dbconn)
|
(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)
|
(define (handle-api-calls)
|
||||||
#f)
|
#f)
|
||||||
|
|
||||||
|
@ -144,7 +133,12 @@
|
||||||
(when (not (handle-api-calls))
|
(when (not (handle-api-calls))
|
||||||
(send-response #:body (frontend-lookup "index.html"))))))))))
|
(send-response #:body (frontend-lookup "index.html"))))))))))
|
||||||
|
|
||||||
|
(debug-log (current-error-port))
|
||||||
(accept-loop listener
|
(accept-loop listener
|
||||||
(if ssl?
|
(if ssl?
|
||||||
ssl-accept
|
ssl-accept
|
||||||
tcp-accept))
|
tcp-accept)
|
||||||
|
(if ssl?
|
||||||
|
(lambda (p)
|
||||||
|
(tcp-addresses (ssl-port->tcp-port p)))
|
||||||
|
tcp-addresses))
|
||||||
|
|
|
@ -12,9 +12,6 @@ function App() {
|
||||||
// State to store an array of scanned results for history tracking
|
// State to store an array of scanned results for history tracking
|
||||||
const [scanHistory, setScanHistory] = useState([]);
|
const [scanHistory, setScanHistory] = useState([]);
|
||||||
|
|
||||||
// Initialize audio for the beep sound effect
|
|
||||||
const beepSound = new Audio('/beep.mp3');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the scanning result.
|
* Handles the scanning result.
|
||||||
* @param {Error} err - Error, if any, from the scanner.
|
* @param {Error} err - Error, if any, from the scanner.
|
||||||
|
@ -26,9 +23,6 @@ function App() {
|
||||||
setCurrentData(result.text);
|
setCurrentData(result.text);
|
||||||
setScanHistory(prevHistory => [...prevHistory, result.text]);
|
setScanHistory(prevHistory => [...prevHistory, result.text]);
|
||||||
|
|
||||||
// Play the beep sound for successful scan feedback
|
|
||||||
beepSound.play();
|
|
||||||
|
|
||||||
// Show a success notification using toast
|
// Show a success notification using toast
|
||||||
toast.success(`Product scanned: ${result.text}`);
|
toast.success(`Product scanned: ${result.text}`);
|
||||||
} else {
|
} else {
|
||||||
|
@ -42,10 +36,10 @@ function App() {
|
||||||
<Toaster position="top-right" reverseOrder={false} />
|
<Toaster position="top-right" reverseOrder={false} />
|
||||||
|
|
||||||
{/* Scanner title */}
|
{/* Scanner title */}
|
||||||
<div className="title">Scanner</div>
|
<div className="title">BrmInv</div>
|
||||||
|
|
||||||
{/* Barcode scanner component */}
|
{/* Barcode scanner component */}
|
||||||
<div className="scan">
|
<div className="scan" style={{border: '1px solid black'}}>
|
||||||
<BarcodeScannerComponent
|
<BarcodeScannerComponent
|
||||||
width={500}
|
width={500}
|
||||||
height={500}
|
height={500}
|
||||||
|
|
|
@ -53,8 +53,8 @@ chicken_cleanup() {
|
||||||
trap chicken_cleanup INT QUIT
|
trap chicken_cleanup INT QUIT
|
||||||
|
|
||||||
# Install required eggs
|
# Install required eggs
|
||||||
chicken_install spiffy
|
|
||||||
chicken_install openssl
|
chicken_install openssl
|
||||||
|
chicken_install spiffy
|
||||||
chicken_install postgresql
|
chicken_install postgresql
|
||||||
|
|
||||||
# Normal termination cleanup
|
# Normal termination cleanup
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue