1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-11-07 21:20:07 +01:00

Correctly detect secured proxies

This commit is contained in:
2022-04-12 20:43:57 +02:00
parent 1b8d6311ba
commit 2c0c0c5a11
7 changed files with 79 additions and 2 deletions

View File

@@ -45,6 +45,10 @@ class AddSiteVC: NSViewController, NSTextFieldDelegate {
// MARK: - Outlet Interactions
@IBAction func pressedCreateProxy(_ sender: Any) {
// valet proxy (domain) http://127.0.0.1:90 (--secure)
}
@IBAction func pressedCreateLink(_ sender: Any) {
let path = self.pathControl.url!.path
let name = self.linkName.stringValue

View File

@@ -22,7 +22,7 @@ class DomainListTLSCell: NSTableCellView, DomainListCellProtocol
}
func populateCell(with proxy: ValetProxy) {
imageViewLock.contentTintColor = proxy.target.contains("https")
imageViewLock.contentTintColor = proxy.secured
? NSColor(named: "IconColorGreen")
: NSColor(named: "IconColorRed")
}

View File

@@ -13,11 +13,13 @@ class ValetProxy: DomainListable
var domain: String
var tld: String
var target: String
var secured: Bool = false
init(_ configuration: NginxConfiguration) {
self.domain = configuration.domain
self.tld = configuration.tld
self.target = configuration.proxy!
self.secured = Filesystem.fileExists("~/.config/valet/Certificates/\(self.domain).\(self.tld).key")
}
// MARK: - DomainListable Protocol
@@ -27,7 +29,7 @@ class ValetProxy: DomainListable
}
func getListableSecured() -> Bool {
return false
return self.secured
}
func getListableAbsolutePath() -> String {