Revert "Merge pull request #239 from manaflow-ai/issue-151-ssh-remote-port-proxying"
This reverts commit78e4bd32ba, reversing changes made tocf75da8f8a.
This commit is contained in:
parent
78e4bd32ba
commit
f7cbbad434
60 changed files with 1250 additions and 17140 deletions
|
|
@ -406,18 +406,6 @@ struct SocketControlSettings {
|
|||
) -> String {
|
||||
let fallback = defaultSocketPath(bundleIdentifier: bundleIdentifier, isDebugBuild: isDebugBuild)
|
||||
|
||||
if let taggedDebugPath = taggedDebugSocketPath(
|
||||
bundleIdentifier: bundleIdentifier,
|
||||
environment: environment
|
||||
) {
|
||||
if isTruthy(environment[allowSocketPathOverrideKey]),
|
||||
let override = environment["CMUX_SOCKET_PATH"],
|
||||
!override.isEmpty {
|
||||
return override
|
||||
}
|
||||
return taggedDebugPath
|
||||
}
|
||||
|
||||
guard let override = environment["CMUX_SOCKET_PATH"], !override.isEmpty else {
|
||||
return fallback
|
||||
}
|
||||
|
|
@ -434,9 +422,6 @@ struct SocketControlSettings {
|
|||
}
|
||||
|
||||
static func defaultSocketPath(bundleIdentifier: String?, isDebugBuild: Bool) -> String {
|
||||
if let taggedDebugPath = taggedDebugSocketPath(bundleIdentifier: bundleIdentifier, environment: [:]) {
|
||||
return taggedDebugPath
|
||||
}
|
||||
if bundleIdentifier == "com.cmuxterm.app.nightly" {
|
||||
return "/tmp/cmux-nightly.sock"
|
||||
}
|
||||
|
|
@ -469,37 +454,6 @@ struct SocketControlSettings {
|
|||
|| bundleIdentifier.hasPrefix("com.cmuxterm.app.debug.")
|
||||
}
|
||||
|
||||
static func taggedDebugSocketPath(
|
||||
bundleIdentifier: String?,
|
||||
environment: [String: String]
|
||||
) -> String? {
|
||||
let bundleId = bundleIdentifier?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||
if bundleId.hasPrefix("\(baseDebugBundleIdentifier).") {
|
||||
let suffix = String(bundleId.dropFirst(baseDebugBundleIdentifier.count + 1))
|
||||
let slug = suffix
|
||||
.replacingOccurrences(of: ".", with: "-")
|
||||
.trimmingCharacters(in: CharacterSet(charactersIn: "-"))
|
||||
if !slug.isEmpty {
|
||||
return "/tmp/cmux-debug-\(slug).sock"
|
||||
}
|
||||
}
|
||||
|
||||
let tag = launchTag(environment: environment)?
|
||||
.lowercased()
|
||||
.replacingOccurrences(of: ".", with: "-")
|
||||
.replacingOccurrences(of: "_", with: "-")
|
||||
.components(separatedBy: CharacterSet.alphanumerics.inverted)
|
||||
.filter { !$0.isEmpty }
|
||||
.joined(separator: "-")
|
||||
|
||||
guard bundleId == baseDebugBundleIdentifier,
|
||||
let tag,
|
||||
!tag.isEmpty else {
|
||||
return nil
|
||||
}
|
||||
return "/tmp/cmux-debug-\(tag).sock"
|
||||
}
|
||||
|
||||
static func isStagingBundleIdentifier(_ bundleIdentifier: String?) -> Bool {
|
||||
guard let bundleIdentifier else { return false }
|
||||
return bundleIdentifier == "com.cmuxterm.app.staging"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue