update build
Some checks failed
/ mirror_to_github (push) Failing after 2m29s
/ test (push) Successful in 15s

This commit is contained in:
Leon van Kammen 2025-04-01 14:56:56 +02:00
parent 770c70f250
commit 5a3c4ecc13
4 changed files with 23 additions and 8 deletions

13
xrsh
View file

@ -18,6 +18,16 @@ showip(){
}
setupcerts(){
test -f ~/.websocat/cert.pem && return 0
mkdir ~/.websocat 2>/dev/null || true
echo "--- generating temporary SSL certs (press enter to all questions) ---"
#openssl req -x509 -newkey rsa:4096 -keyout ~/.websocat/key.pem -out ~/.websocat/cert.pem -days 365
openssl req -x509 -newkey rsa:2048 -new -nodes -keyout ~/.websocat/key.pem -out ~/.websocat/cert.pem -days 3650
openssl pkcs12 -export -out ~/.websocat/q.pkcs12 -inkey ~/.websocat/key.pem -in ~/.websocat/cert.pem
wget "https://curl.haxx.se/ca/cacert.pem" -O ~/.websocat/cacert.pem
}
keyboard(){
assert_cmds websocat pkill
trap "stty sane; trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT # cleanup processes when exit
@ -29,8 +39,9 @@ keyboard(){
echo "warn: CTRL-C is forwarded too"
echo "warn: to exit this app run: $0 --kill"
echo "warn: this terminal is now in raw sendmode, expect weird characters!"
setupcerts
stty raw
websocat -E -b -s 0.0.0.0:$PORT 2>&1
SSL_CERT_FILE=~/.websocat/cacert.pem websocat -E -b -s --pkcs12-der ~/.websocat/q.pkcs12 0.0.0.0:$PORT 2>&1
}
# launch!

BIN
xrsh.com

Binary file not shown.

View file

@ -1 +1 @@
06e233e76e452decb8849d547e7c42b3b602ea5db010d7241df2605f08035a6a xrsh.com
b01c85c6299d346860ff8bad8cd5e36d06bebce8ff78a9e4611b191029025331 xrsh.com

16
xrsh.js
View file

@ -258,8 +258,8 @@ e.removeClass=function(a){this.g.classList.remove(a);return this};e.toggleClass=
* | `depth` | `number` | 0.03 ||
* | `lineHeight` | `number` | 18 ||
* | `bootMenu` | `string` | "" | character to auto-enter in bootMenu |
* | `bootMenuURL` | `string` | "" | character to auto-enter in bootmeun when URL has fragment (#foo.zip e.g.) |
* | `padding` | `number`` | 18 | |
* | `bootMenuURL` | `string` | "" | character to auto-enter in bootMenu when URL has fragment (#foo.zip e.g.) |
* | `padding` | `number` | 18 | |
* | `maximized` | `boolean` | false | |
* | `minimized` | `boolean` | false | |
* | `muteUntilPrompt` | `boolean` | true | mute stdout until a prompt is detected in ISO |
@ -340,8 +340,12 @@ if( typeof AFRAME != 'undefined '){
this.setupPasteDrop()
this.setupEvents()
console.log(this.data.iso)
fetch(this.data.iso,{method: 'HEAD'})
.then( (res) => {
const size = res.headers.get('Content-Length');
console.dir({res,size})
debugger
if( res.status != 200 ) throw 'not found'
})
.catch( (e) => {
@ -4276,7 +4280,7 @@ ISOTerminal.prototype.enableRemoteKeyboard = function(opts){
this.send(clearScreen);
this.send(`\n\rfor instructions\n\rsee ${document.location.origin}/index.html#Remote%20keyboard\n\n\r`)
this.send("enter 'm' for mainmenu\n\n\r")
this.send("keyboard ip-adress> ")
this.send("keyboard ip-address> ")
// autofill ip
if( service.ip ){
for( let i = 0; i < service.ip.length; i++ ) this.send(service.ip.charAt(i))
@ -4285,11 +4289,11 @@ ISOTerminal.prototype.enableRemoteKeyboard = function(opts){
},
server: (term) => {
try{
service.addr = `ws://${service.ip}:9090/`;
service.addr = `wss://${service.ip}:9090/`;
service.ws = new WebSocket(service.addr)
service.ws.addEventListener("open", () => {
if( service.state == 'listening' ){
this.send(`\n\rconnected to ${service.addr}! \\o/\n\r`)
this.send(`\n\rconnected! \\o/\n\r`)
this.bootMenu()
}
service.state = 'receiving'
@ -4335,9 +4339,9 @@ ISOTerminal.prototype.enableRemoteKeyboard = function(opts){
this.send("\n\r")
this.bootMenu()
}else if( ch == '\n' || ch == '\r'){
this.send("\n\rwaiting for connection..")
service.server(this)
service.state = 'listening'
this.send("\n\rconnecting to "+service.addr)
}else{
service.ip = ch == '\b' ? service.ip.substr(0,this.service.ip.length-1)
: service.ip + ch