Use the tzgyn relay as the default backend
The CLI and iOS app now point at share.tzgyn.dev:9009 instead of the upstream croc relay. Both were verified against the deployed relay; local relays remain available through --relay and the app's Relay setting.
This commit is contained in:
@@ -19,10 +19,10 @@ import (
|
|||||||
"github.com/tzgyn/share/src/utils"
|
"github.com/tzgyn/share/src/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultRelay is the public relay the CLI uses when the user does not
|
// DefaultRelay is the project's own relay, used by both the CLI and the
|
||||||
// pass --relay. The iOS app lets the user override it (for example with a
|
// iOS app when the user does not override it. Point this at a Mac's LAN
|
||||||
// relay running on their Mac's LAN address).
|
// address instead if you want to test with a local `share relay`.
|
||||||
const DefaultRelay = "croc.schollz.com:9009"
|
const DefaultRelay = "share.tzgyn.dev:9009"
|
||||||
|
|
||||||
// status is the JSON shape the Swift app decodes from StatusJSON. It
|
// status is the JSON shape the Swift app decodes from StatusJSON. It
|
||||||
// mirrors swarm.RoomStatus but adds the session fields that live only on
|
// mirrors swarm.RoomStatus but adds the session fields that live only on
|
||||||
|
|||||||
+3
-3
@@ -94,9 +94,9 @@ xcrun devicectl device copy from --device <device> \
|
|||||||
callback is on the stack, not for the lifetime of a transfer.
|
callback is on the stack, not for the lifetime of a transfer.
|
||||||
- Received files are written to `Documents/Received/`. `UIFileSharingEnabled`
|
- Received files are written to `Documents/Received/`. `UIFileSharingEnabled`
|
||||||
makes that folder visible in Files → On My iPhone → Share.
|
makes that folder visible in Files → On My iPhone → Share.
|
||||||
- The default relay is `croc.schollz.com:9009`. For local transfers, run
|
- The default relay is the project's own `share.tzgyn.dev:9009`; the CLI and
|
||||||
`share relay` on a Mac and enter its LAN address (`192.168.x.x:9009`) under
|
the iOS app both use it. For local transfers, run `share relay` on a Mac and
|
||||||
Relay in the app.
|
enter its LAN address (`192.168.x.x:9009`) under Relay in the app.
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ struct RoomView: View {
|
|||||||
HStack(spacing: 6) {
|
HStack(spacing: 6) {
|
||||||
Image(systemName: "network")
|
Image(systemName: "network")
|
||||||
.font(.system(size: 10, weight: .semibold))
|
.font(.system(size: 10, weight: .semibold))
|
||||||
Text(status.relay.isEmpty ? "public relay" : status.relay)
|
Text(status.relay.isEmpty ? "tzgyn relay" : status.relay)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.truncationMode(.middle)
|
.truncationMode(.middle)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
import Share
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
/// A headless-ish smoke test driven by launch arguments:
|
/// A headless-ish smoke test driven by launch arguments:
|
||||||
@@ -18,7 +19,7 @@ enum SelfTest {
|
|||||||
static func runIfRequested(model: AppModel) {
|
static func runIfRequested(model: AppModel) {
|
||||||
let args = ProcessInfo.processInfo.arguments
|
let args = ProcessInfo.processInfo.arguments
|
||||||
guard !started else { return }
|
guard !started else { return }
|
||||||
let relay = value(after: "-shareSelfTestRelay", in: args) ?? "127.0.0.1:9009"
|
let relay = value(after: "-shareSelfTestRelay", in: args) ?? ShareRelayDefault()
|
||||||
let code = value(after: "-shareSelfTestCode", in: args)
|
let code = value(after: "-shareSelfTestCode", in: args)
|
||||||
?? (args.contains("-shareSelfTestSend")
|
?? (args.contains("-shareSelfTestSend")
|
||||||
? "1234-selftest-send-apple"
|
? "1234-selftest-send-apple"
|
||||||
|
|||||||
@@ -286,14 +286,14 @@ struct SetupView: View {
|
|||||||
Image(systemName: "info.circle")
|
Image(systemName: "info.circle")
|
||||||
.font(.system(size: 11, weight: .semibold))
|
.font(.system(size: 11, weight: .semibold))
|
||||||
.padding(.top, 1)
|
.padding(.top, 1)
|
||||||
Text("Use your Mac's LAN address, like 192.168.1.20:9009, when you run `share relay` there. Leave it empty for the public relay.")
|
Text("Use your Mac's LAN address, like 192.168.1.20:9009, when you run `share relay` there. Leave it empty for the tzgyn relay.")
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.fixedSize(horizontal: false, vertical: true)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
}
|
}
|
||||||
.foregroundStyle(Theme.tertiaryText)
|
.foregroundStyle(Theme.tertiaryText)
|
||||||
|
|
||||||
if !model.relay.isEmpty {
|
if !model.relay.isEmpty {
|
||||||
Button("Use public relay") {
|
Button("Use tzgyn relay") {
|
||||||
model.relay = ShareRelayDefault()
|
model.relay = ShareRelayDefault()
|
||||||
}
|
}
|
||||||
.buttonStyle(QuietButtonStyle(tint: Theme.mint))
|
.buttonStyle(QuietButtonStyle(tint: Theme.mint))
|
||||||
|
|||||||
@@ -15,10 +15,12 @@ import (
|
|||||||
// TCP_BUFFER_SIZE is the maximum packet size
|
// TCP_BUFFER_SIZE is the maximum packet size
|
||||||
const TCP_BUFFER_SIZE = 1024 * 64
|
const TCP_BUFFER_SIZE = 1024 * 64
|
||||||
|
|
||||||
// DEFAULT_RELAY is the default relay used (can be set using --relay)
|
// DEFAULT_RELAY is the default relay used (can be set using --relay).
|
||||||
|
// The project runs its own relay at share.tzgyn.dev; both the CLI and the
|
||||||
|
// iOS app default to it instead of the upstream croc relay.
|
||||||
var (
|
var (
|
||||||
DEFAULT_RELAY = "croc.schollz.com"
|
DEFAULT_RELAY = "share.tzgyn.dev"
|
||||||
DEFAULT_RELAY6 = "croc6.schollz.com"
|
DEFAULT_RELAY6 = "share.tzgyn.dev"
|
||||||
DEFAULT_PORT = "9009"
|
DEFAULT_PORT = "9009"
|
||||||
INTERNAL_DNS = false
|
INTERNAL_DNS = false
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user