Commit Graph

68 Commits

Author SHA1 Message Date
neon443
af912f234f add suport for rewritten authwithpubkey in sshhandler
added removefromkeychain
added renamekey
added deletekey
updatekymanagerview to add deleting and ui uodates
remove publickey and passphrase from host
remove key related texboxes in connectionview
added a passwordstore instance
made keytypes and names published
added savekeypairs
updatedsavetokeychain to remove and readd if it exists in the keychain
update getkeys
remove authwithbiometrics from hostmanager
trying to add key renaming support
remove Key (unused)
cleanup
2025-07-02 21:22:21 +01:00
neon443
421444b2f8 AUTHWITHPUBKEY!!!!
i had to extract the middle base64 bit of the key
added computed properties for it
added more error logging
2025-07-02 09:23:23 +01:00
neon443
8b2cdf910b rewrote authwithpubkey, need to add error checking stuff 2025-07-02 08:50:46 +01:00
neon443
ce162f437a dependency injection in ShhShellApp via the init
added keymanager to sshhandler so it can access keys
2025-07-02 08:19:01 +01:00
neon443
80b83644b4 updated keypair data structure to have an name, passphrase and type
added generateKy to generate a key, currently only rsa
update generateRSA to return the Data for pub and priv, and take a custom size
bell animation better, slightly longer in total and easeinout
added new generate button hardcoded to a rsa 4096
added keytype to define key types (duh)
update getKeys to use the new keypair structure
2025-06-30 16:31:01 +01:00
neon443
c877b14ad5 fix servers with no auth
improve theme view column calculation
2025-06-30 12:11:33 +01:00
neon443
80ddde3a62 applying themes on the fly!! (to sessions already active)
added applySelectedTheme to sshhandler which will run applyselectedtheme on the terminalview if it exists
added applyselectedtheme to apply the chosen theme in hostsmanager
applying of the chosen theme on appear of any shell view
made the tap target for sessions actually the whole list item
fix undefined behaivour from modifying published values from background threads
2025-06-29 16:39:03 +01:00
neon443
8e69dfc165 terminalViewContainer is now an observable object
made the session list view more pretty
terminalviewcontaner has a static shared property which is an instance of itself
then it has sessions inside with a dict of uuid:terminalcontainer inside
hostsview is in the section "hosts"
2025-06-29 16:25:49 +01:00
neon443
331a921499 MULTI SESSIONS!!!
terminalviewcontainer has a dict of [handler, terminalView] with a uuid key
each session gets a new uuid, and on disconnect, the session is removed from terminalviewcontainer
sessions list view to reopen sessions
remove multiview
extracted terminalviewcontainer
2025-06-29 15:40:46 +01:00
neon443
747406df5d asdfasdfasdf 2025-06-26 15:50:25 +01:00
neon443
c6699a9818 implement scrollback saving
implement a scrollback cap of 10MiB
add prettyscrollback() to return kib, mib etc
tried a different resuming thingy
2025-06-26 15:46:58 +01:00
neon443
f082d8b77c tried to implement resuming 2025-06-26 15:03:59 +01:00
neon443
bb0ea0f9ee added animated screen flash for bell
screen will flash with a semi transparent white overlay and a bell emoji for 250ms
remove bell from nav bar, too distracting with the bell in the muiddle as well
2025-06-26 13:53:18 +01:00
neon443
a41edbb1aa added bell - the title will show a bell emoji if the bell has been rung for 0.2s
fix massive memory leak :cry
it liteally got to 10gigs :wilt
fixed cpu usage - 90+% lower
2025-06-26 13:38:06 +01:00
neon443
98e5b01970 center text
fix alignment
comment out ssh_free
fix Face ID appearing on touch id devices
2025-06-26 13:12:33 +01:00
neon443
51459f1839 fix crash when disconnecting, fix close terminal on exit 2025-06-26 12:49:27 +01:00
neon443
319373682c simlplify read from channel loop
main thread ui updates in disconnect()
2025-06-26 12:32:38 +01:00
neon443
d9154458fa made read blocking, adnd up to 1024 bytes
request env vars before opeing shell
cleanup
2025-06-26 11:32:45 +01:00
neon443
52629d7654 bump version 2025-06-25 17:19:33 +01:00
neon443
76601e0470 made more funcitons throw errors instead of just return, more informative
added name to host
removed hostkey from connectionview as its in keys now
fix crash on force unrap in keypair navigatoin labels
added hostinvalid() to check if the host is invalid
added case notconnected for keyerror
openshell is throwing
moved stuff round
2025-06-25 17:17:47 +01:00
neon443
2207c5d924 upon accepting the new hostkey, you connect 2025-06-25 14:12:41 +01:00
neon443
548beca410 updated gethostkey to work with strings, and the rest of the ui had been updated to reflect this 2025-06-25 14:07:27 +01:00
neon443
43b407b038 removed lots of testsucceeded = false by just setting it as false and then making it true if it suceeds
added connecition failed and authfailed sshstates
fix crash when unwrapping the hostkey data to a string
2025-06-25 13:47:07 +01:00
neon443
046dbbb06c fix more concurrency
free session if connection failed
read only once in testexec
unique names for key filenmaes
free pubkeys even if it fails to auth
fix bitmask reading of auth methods
remove handler.state from the terminal, put it inline with other status indicators
2025-06-25 13:17:38 +01:00
neon443
058915b115 removed lots of conurrency
its prob not needed tbh
2025-06-25 13:06:07 +01:00
neon443
46ba88aacb addedfunctions to check state
large code cleanup thanks to this
2025-06-25 12:40:16 +01:00
neon443
66547dc58e migrated from bunch of bools to an enum of ssh states 2025-06-25 12:26:29 +01:00
neon443
e8494b9296 improve disconnection on testexec - it disconnects right after testing exec!
- it saves the result of tesetexec even tho disconnect clears it
 - moved the logic into sshhandler
2025-06-25 12:00:49 +01:00
neon443
5d80c69152 fixed getAuthMethods - had to auth with none first
rename to testChannel in testexec to prevent confusion
stop write(1 in testexec to prevent printing the output
running testexec will disconnect after 3s, but keep result
read non blocking in testexec
added sshstate unused atm
2025-06-25 11:55:21 +01:00
neon443
db36c56f29 improved disconnection - will dismiss terminal on exit
-- before you had to type more to exit
improved connection logic with a try catch
improved disconnection doesnt crash
fix [int] to [cchar] reduced mem usage
code cleanup
try? -> catch print(error.localizedDesc)
guard let var = var  else ---> guard let var else
removed file importers as it didnt eork
compbined guards in writetochannel
2025-06-25 11:40:25 +01:00
neon443
f71bd0ddf2 bell ringing backend done now need to actually trigger it
added ring() to ring the bell
terminal is now a fullscreencover
can be dismissed and reopened or disconnected
 - need to make it keep the scrollback
increased sleep between reads
added support for title
added setTitle function, defaults to username@server
increased the buffer to 16384 bytes
2025-06-25 11:12:10 +01:00
neon443
bf4a273a46 moved hostsmanger back out because nested observedobjects are wierd
added multiView - it connects to all your hosts at once, this proves that i can do many at once
 --- for a future update
2025-06-24 15:33:56 +01:00
neon443
0f5d45cc85 integrated hostsmanager into sshhandler lets see where this goes
made disconnct async
rewrote async reading from ssh
usleep -> Task.sleep() to prevent blocking
2025-06-24 14:57:25 +01:00
neon443
1e3a57d788 added dialogview for custom dialogs
added nice green color
updated debug host
reduced sleep greatly
removed channel checker in sshqueasync loop
set dark mode on the app
gonna start work on async in sshhandler
2025-06-24 12:33:52 +01:00
neon443
3f2c92cd91 massively optimised reading from ssh, reduced cpu usage and energy usage 2025-06-24 09:48:33 +01:00
neon443
1bb761d80e swift 6 underway 2025-06-23 20:33:31 +01:00
neon443
88b39363b2 version bump
remove @mainactors
set env vars
use sshoptionsset to set a username
disconnect sends an eof and handles the channel clsoing, for some reason it crashes on disconnect tho
do catch for pubkeyauth
added asyncReadFromChannel
remove weak self
condense guards
disconnect on a eof reccieve
reduce time sleeping
2025-06-23 18:14:08 +01:00
neon443
31beda2124 fix test connection button
increase buffer to 512 bytes
made it a blocking read because its happening on a bg thread anyways
using a cchar bitpattern for each string.utf8 when writing
its made no diff yet
increased sleep if nothing is returned
2025-06-23 13:41:20 +01:00
neon443
8df8c77c7a implemented actually using Host.publicKey and Host.privateKey to store pubkeys and privkeys
- this gives u icloud synced pub/privkeys
 - per host!!
made it load the key's string representation (if present) into the textboxes to tell the user that the key is there
made the privkey box a securefield to show .... instead of the key

added a handler.go() to handler disconnecting if connected and choosing password/pubkey auth
- really cleaned up the view code
added getPubkey(_: SecKey) to keychainmanager
added SSHErrors - commfail, connectionFail, backenderror
added AuthError - rejectedCreds, notconnected
added KeyError - importpub/privError, pub/priv rejected
made most functions throw in sshhandler
fix memoryLayoutsize(ofvalue to buffer.count in testexec
[weak self] in the async loop to prevent memory leaks i guess
added loccritical for easy red logging
2025-06-23 12:51:41 +01:00
neon443
c9eab9dde8 every fucking time i try rewriting that function 2025-06-23 11:33:32 +01:00
neon443
db76329f80 rewrote autwithpubkey to use emmeory strings
added strip pubkey and privkey functions to remove stuff like ssh-ed25519 and neon443@mac anc  -----begin key ----- end key etcc
2025-06-23 11:23:25 +01:00
neon443
01d569a859 mainacotr for sshhandler
added a cleanup to run after 10s clearing memory for keys and files
remove timer code
remove write(1 to stop console echo
open links
image -> systemImage
2025-06-23 10:19:49 +01:00
neon443
aab1756b5a bump version
remove send Ax256
change powerplug.portrait to power
reduce time from 10_000 to 1_000
remove sending print
add shellview
2025-06-22 19:53:12 +01:00
neon443
71c8e3f891 YESSSSS
typing works
so basically it just stopped tryna read from the server once the server was silent for a sec
so then i removed the return and made it an optional if let and wait 10_000 us if nothing comes back
this is so goood

changed it to get 256 bytes from server
2025-06-22 19:32:42 +01:00
neon443
9338b46760 improved how the terminal is updated, now just async reads aytomatically and will js not do anything if nothing recieved
terminal also starts at the top and doesnt have th wierd scroll artifacting
2025-06-22 18:43:10 +01:00
neon443
b60e8f4eed can kinda type - it gets sent to teh server, but doesnt refres :skulk: 2025-06-22 16:24:21 +01:00
neon443
e156d63cf6 WORKS!!!!! PUBKEY ON IOS!!!!!!
no file import rn
2025-06-22 12:35:08 +01:00
neon443
1cf9518e0f remove terminal string
rewrote authWithPubkey() to not write files and take data direcytly
remove read loop (comment adding it)
readfromchannel returns string
using swifterm to do terminal emulation
2025-06-22 10:51:21 +01:00
neon443
ed1e7ab25d commiting atp
pressing write sends ls\n
terminal view gets sshhandler instead of js text
sumplify writetochannel, takes a string
implemented a terminalviewdelegate that some rason never gets to do anythoing
2025-06-21 17:07:28 +01:00
neon443
c33e22cd3d write to channel works!!!!!!!!!!!!!!!!!
removing the read funciton call fixed it
2025-06-21 12:58:43 +01:00