Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn over webrtcv #482

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ you can now set `font_family` and `font_size`.

- Handling of unverified hosts
- Multi client layout sync
- The font in rename and search is set to Fira Sans like the rest of the app
- Fixing the font used in rename and search

## [1.10.1] - 2024/5/7

Expand Down
2 changes: 1 addition & 1 deletion aatp/infra/peerbook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ RUN go get ./...
ENV REDIS_HOST=redis:6379
ENV PB_STATIC_ROOT=/home/peerbook/src/peerbook/html
EXPOSE 17777
CMD go run .
CMD go run . -addr 0.0.0.0:17777
2 changes: 1 addition & 1 deletion css/terminal7.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ body {
}
* {
box-sizing: border-box;
touch-action: none;
}
*:focus { outline: none; }

Expand Down Expand Up @@ -325,6 +324,7 @@ nav::-webkit-scrollbar {
width: 100%;
position: absolute;
z-index: 3;
touch-action: none;
}
.oneline-box {
color: var(--text-color);
Expand Down
5 changes: 0 additions & 5 deletions ios/App/App/capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"preferences": {}
},
"packageClassList": [
"NativeAudio",
"NativeAudio",
"AppPlugin",
"CAPBrowserPlugin",
Expand All @@ -32,12 +31,8 @@
"PreferencesPlugin",
"StatusBarPlugin",
"PurchasesPlugin",
"PurchasesPlugin",
"NativeBiometric",
"NativeBiometric",
"CapacitorRateAppPlugin",
"CapacitorRateAppPlugin",
"SSHPlugin",
"SSHPlugin"
]
}
44 changes: 22 additions & 22 deletions ios/App/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
PODS:
- Capacitor (6.0.0):
- Capacitor (6.1.1):
- CapacitorCordova
- CapacitorApp (6.0.0):
- Capacitor
- CapacitorBrowser (6.0.0):
- CapacitorBrowser (6.0.1):
- Capacitor
- CapacitorCamera (6.0.0):
- CapacitorCamera (6.0.1):
- Capacitor
- CapacitorClipboard (6.0.0):
- Capacitor
- CapacitorCommunityNativeAudio (5.0.1):
- Capacitor
- CapacitorCordova (6.0.0)
- CapacitorCordova (6.1.1)
- CapacitorDevice (6.0.0):
- Capacitor
- CapacitorFilesystem (6.0.0):
- Capacitor
- CapacitorKeyboard (6.0.0):
- CapacitorKeyboard (6.0.1):
- Capacitor
- CapacitorNativeBiometric (0.0.1):
- Capacitor
- CapacitorNetwork (6.0.0):
- CapacitorNetwork (6.0.1):
- Capacitor
- CapacitorPreferences (6.0.0):
- CapacitorPreferences (6.0.1):
- Capacitor
- CapacitorRateApp (4.0.3):
- Capacitor
Expand All @@ -32,12 +32,12 @@ PODS:
- CapacitorStatusBar (6.0.0):
- Capacitor
- NMSSHT7 (2.9.1)
- PurchasesHybridCommon (10.6.1):
- RevenueCat (= 4.41.2)
- RevenueCat (4.41.2)
- RevenuecatPurchasesCapacitor (7.5.9):
- PurchasesHybridCommon (11.1.1):
- RevenueCat (= 4.43.2)
- RevenueCat (4.43.2)
- RevenuecatPurchasesCapacitor (7.7.1):
- Capacitor
- PurchasesHybridCommon (= 10.6.1)
- PurchasesHybridCommon (= 11.1.1)

DEPENDENCIES:
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
Expand Down Expand Up @@ -101,26 +101,26 @@ EXTERNAL SOURCES:
:path: "../../node_modules/@revenuecat/purchases-capacitor"

SPEC CHECKSUMS:
Capacitor: 559d073c4ca6c27f8e7002c807eea94c3ba435a9
Capacitor: 8941aba4364ba9d1b22188569001f2ce45cc2b00
CapacitorApp: 9d53aec7101f7b030a950c5bdc4df8612576b279
CapacitorBrowser: 7e1e2cdbb3e372f09f0bad0c4c21a6d187b679ad
CapacitorCamera: b61f125d92a0ef75d7becb7956fed7dd13187ee0
CapacitorBrowser: 473c7fd70ddbe541608ff09ec1be14da0078279e
CapacitorCamera: 3b77b3e8311b98220de65e63445c0e4d0b30ce3a
CapacitorClipboard: 80282f684154124b9019ebf401235b70b0cf4994
CapacitorCommunityNativeAudio: 1a4d5490acb59f155602c0b6bcf1b42ee4efe91b
CapacitorCordova: 8c4bfdf69368512e85b1d8b724dd7546abeb30af
CapacitorCordova: 8f2cc8d8d3619c566e9418fe8772064a94266106
CapacitorDevice: f8fd88f9edd1261c55a109f32015b09bbbfdc4a0
CapacitorFilesystem: 60e59ba274c234a979e7a3be2552feaadcee4263
CapacitorKeyboard: deacbd09d8d1029c3681197fb05d206b721d5f73
CapacitorKeyboard: 5f32a712adf41e07a61caafb82cf29fb6d8ba123
CapacitorNativeBiometric: b47637a8cd349bdac014424bb4ddcae9ee5d4919
CapacitorNetwork: f15a94c16a33cba7c47a17814cb6bcfe3ea34ded
CapacitorPreferences: c9b839a80baa72e4ed4bdb117618e1950d3046b5
CapacitorNetwork: 5c94acfdddc22043f2ffaff224ce9b4aa5a179f0
CapacitorPreferences: 72909b165bc7807103778ddbb86d5d8ce06abf71
CapacitorRateApp: 896df7ec6a237fea72d1955e0cb26394654b00db
CapacitorSshPlugin: 79f67cb26d40bd0c07cec6dda93d93d5faf7b614
CapacitorStatusBar: 2e4369f99166125435641b1908d05f561eaba6f6
NMSSHT7: 67f9d8f43b40b997728761b4cf2aa7ea660ba7c2
PurchasesHybridCommon: 465af21945a10dda051b725933a1fd7b7c2d2a07
RevenueCat: 0250867579677899de94f96ad9be342be865560f
RevenuecatPurchasesCapacitor: 3356d0d375cf40dcde55555cbcff43eb9a99e7c0
PurchasesHybridCommon: 73f4f2c6e4ec3487b4219bf60e1661100fb85da3
RevenueCat: 3d934653b7e8b09af88fd47e9e84cfaf5d0a89ba
RevenuecatPurchasesCapacitor: 180baf04b08c3bd1aac2abe60f536aa35196cbc3

PODFILE CHECKSUM: 0b234f47d92ce42f718c406e1f2c37447bc3c605

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
},
"dependencies": {
"@capacitor-community/native-audio": "^5.0.1",
"@capacitor/android": "^6.0.0",
"@capacitor/android": "^6.1.1",
"@capacitor/app": "^6.0.0",
"@capacitor/browser": "^6.0.0",
"@capacitor/camera": "^6.0.0",
"@capacitor/cli": "^6.0.0",
"@capacitor/browser": "^6.0.1",
"@capacitor/camera": "^6.0.1",
"@capacitor/cli": "^6.1.1",
"@capacitor/clipboard": "^6.0.0",
"@capacitor/core": "^6.0.0",
"@capacitor/core": "^6.1.1",
"@capacitor/device": "^6.0.0",
"@capacitor/filesystem": "^6.0.0",
"@capacitor/ios": "^6.0.0",
"@capacitor/keyboard": "^6.0.0",
"@capacitor/network": "^6.0.0",
"@capacitor/preferences": "^6.0.0",
"@capacitor/ios": "^6.1.1",
"@capacitor/keyboard": "^6.0.1",
"@capacitor/network": "^6.0.1",
"@capacitor/preferences": "^6.0.1",
"@capacitor/status-bar": "^6.0.0",
"@revenuecat/purchases-capacitor": "^7.0.0",
"@revenuecat/purchases-capacitor": "^7.7.1",
"@tuzig/codemirror": "5.65.5-mods",
"@tuzig/toml": "^3.0.0-browser",
"@types/marked": "^4.0.7",
Expand Down
26 changes: 17 additions & 9 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,24 @@ async function connectCMD(shell:Shell, args: string[]) {
shell.t.writeln(`Host not found: ${hostname}`)
return
}
const pbOpen = terminal7.pb && terminal7.pb.isOpen()
const overPB = pbOpen && gate.fp && (gate.fp.length > 0) && gate.online
const native = Capacitor.isNativePlatform()
const pbOpen = terminal7.pb?.isOpen()
let overPB = pbOpen && gate.fp?.length > 0 && gate.online
if (overPB && !gate.verified) {
const answer = await shell.askValue("Gate unverified, would you like to verify it?", "y")
if (answer == "y" || answer == "Y" || answer == "") {
await terminal7.pb.verifyFP(gate.fp)
} else {
if (Capacitor.isNativePlatform())
try {
await terminal7.pb.verifyFP(gate.fp, "Unverified peer. Please enter OTP to verify or ^-C")
} catch(e) {
if (native) {
shell.t.writeln("Falling back to SSH")
overPB = false
}
daonb marked this conversation as resolved.
Show resolved Hide resolved
else {
shell.t.writeln("Please verify the gate before connecting")
return
}
}
}
if (Capacitor.isNativePlatform()) {
if (native && !overPB) {
let dirty = false
if (!gate.addr) {
try {
Expand Down Expand Up @@ -711,6 +713,12 @@ async function subscribeCMD(shell: Shell) {
}
if (!terminal7.pb.isOpen()) {
if (!Capacitor.isNativePlatform()) {
// we can't add a new subscriber on the web.
// the user has to buy a subscription from the app store
// on the weeb all he can do is login
shell.t.writeln("Subscribing is still WIP for web client")
shell.t.writeln("If you subscribed on the app, please login")
shell.t.writeln("")
await loginCMD(shell);
return
}
Expand Down Expand Up @@ -1071,7 +1079,7 @@ async function supportCMD(shell: Shell) {
}
}
async function loginCMD(shell: Shell) {
if (terminal7.pb.isOpen()) {
if (terminal7.pb?.isOpen()) {
shell.t.writeln("You are already logged in")
return
}
Expand Down
5 changes: 2 additions & 3 deletions src/gate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ export class Gate {
return
case Failure.BadRemoteDescription:
terminal7.pbClose()
this.notify("Sync Error. Please try again")
this.notify("Connection Sync Error. Retrying")
break
case Failure.NotImplemented:
this.session.close()
this.session = null
this.notify("Not Implemented. Please try again")
break
return
case Failure.Unauthorized:
// TODO: handle HTTP based authorization failure
this.session.close()
Expand All @@ -215,7 +215,6 @@ export class Gate {
return

case Failure.BadMarker:
this.notify("Sync Error. Starting fresh")
this.marker = null
this.session.close()
this.session = null
Expand Down
19 changes: 10 additions & 9 deletions src/pane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class Pane extends Cell {
e.style.borderColor = FOCUSED_BORDER_COLOR
e.appendChild(te)
c.appendChild(e)
this.w.e.classList.add("hidden")
this.gate.e.classList.add("hidden")
navbar.classList.add("hidden")
this.styleZoomed(e)
c.classList.remove("hidden")
Expand All @@ -262,7 +262,7 @@ export class Pane extends Cell {
const terminalE = zoomedPane.removeChild(zoomedPane.firstElementChild)
if (terminalE) {
this.e.appendChild(terminalE.firstElementChild)
this.w.e.classList.remove("hidden")
this.gate.e.classList.remove("hidden")
}
zoomedPane.classList.add("hidden")
navbar.classList.remove("hidden")
Expand Down Expand Up @@ -590,13 +590,14 @@ export class Pane extends Cell {
f = () => this.t7.dumpLog()
break
default:
if (ev.key >= "1" && ev.key <= "9") {
const win = this.gate.windows[ev.key - 1]
if (this.zoomed)
this.toggleZoom()
if (win)
win.focus()
}
if (ev.key >= "1" && ev.key <= "9")
f = () => {
const win = this.gate.windows[ev.key - 1]
if (this.zoomed)
this.toggleZoom()
if (win)
win.focus()
}
break
}

Expand Down
11 changes: 5 additions & 6 deletions src/peerbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,7 @@ export class PeerbookConnection {
// TODO:gAdd biometrics verification
while (!validated) {
console.log("Verifying FP", fp)
let otp: string
try {
otp = await this.shell.askValue(prompt || "Enter OTP to verify gate")
} catch(e) {
return
}
const otp = await this.shell.askValue(prompt || "Enter OTP to verify gate")
try {
await this.adminCommand(new ControlMessage("verify", { target: fp, otp: otp }))
validated = true
Expand Down Expand Up @@ -441,6 +436,10 @@ export class PeerbookConnection {
this.notify(`Unverified client. Please check you email.`)
return
}
if (m["ice_servers"] !== undefined) {
terminal7.setIceServers(m["ice_servers"])
return
}
const fp = m.source_fp
// look for a gate where g.fp == fp
const myFP = await terminal7.getFingerprint()
Expand Down
Loading
Loading