Compare commits

..

15 Commits

Author SHA1 Message Date
Ian VanSchooten 525bb67529
Merge 1c32d11503 into 2d74360bc2 2024-10-15 19:56:43 +00:00
Ian VanSchooten 1c32d11503 Remove checkBuild lane 2024-10-15 12:35:10 -04:00
Ian VanSchooten 4374c9d5b6 Just manually xcodebuild 2024-10-15 12:21:43 -04:00
Ian VanSchooten 571093410e Remove setup_ci 2024-10-15 11:16:10 -04:00
Ian VanSchooten daa634fdb3 Skip signing 2024-10-15 10:41:06 -04:00
Ian VanSchooten 4c6d9d0745 Build ios debug app, do not sign 2024-10-11 11:40:01 -04:00
Ian VanSchooten dfa0e7bd40 Fix rebase error 2024-10-11 11:39:38 -04:00
Ian VanSchooten 5ba3891eda Rename workflow 2024-10-11 11:39:38 -04:00
Ian VanSchooten 093d734094 Avoid incrementing version number 2024-10-11 11:39:38 -04:00
Ian VanSchooten cb8b44bd27 Use fastlane to build 2024-10-11 11:39:38 -04:00
Ian VanSchooten d26b25704d Add fastlane match token 2024-10-11 11:39:38 -04:00
Ian VanSchooten ed9aeff3e0 Add ios build step to ci 2024-10-11 11:39:38 -04:00
Ian VanSchooten 9f262ba5a7 Specify androidapi for gomobile 2024-10-11 11:39:38 -04:00
Ian VanSchooten 22a13b1a1c Add build workflow 2024-10-11 11:39:38 -04:00
Ian VanSchooten b2d7fe99a2 Simplify/fix dart formatting in CI 2024-10-11 11:39:38 -04:00
3 changed files with 8 additions and 13 deletions

View File

@ -7,7 +7,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
private var networkMonitor: NWPathMonitor? private var networkMonitor: NWPathMonitor?
private var site: Site? private var site: Site?
private let log = Logger(subsystem: "net.defined.mobileNebula", category: "PacketTunnelProvider") private var log = Logger(subsystem: "net.defined.mobileNebula", category: "PacketTunnelProvider")
private var nebula: MobileNebulaNebula? private var nebula: MobileNebulaNebula?
private var dnUpdater = DNUpdater() private var dnUpdater = DNUpdater()
private var didSleep = false private var didSleep = false
@ -106,7 +106,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
try self.nebula?.reload(String(data: newSite.getConfig(), encoding: .utf8), key: newSite.getKey()) try self.nebula?.reload(String(data: newSite.getConfig(), encoding: .utf8), key: newSite.getKey())
} catch { } catch {
log.error("Got an error while updating nebula \(error.localizedDescription, privacy: .public)") self.log.error("Got an error while updating nebula \(error.localizedDescription, privacy: .public)")
} }
} }

View File

@ -1,9 +1,6 @@
import NetworkExtension import NetworkExtension
import MobileNebula import MobileNebula
import SwiftyJSON import SwiftyJSON
import os.log
let log = Logger(subsystem: "net.defined.mobileNebula", category: "Site")
extension String: Error {} extension String: Error {}
@ -433,7 +430,7 @@ struct IncomingSite: Codable {
return return
} }
log.notice("Saving to \(configPath, privacy: .public)") print("Saving to \(configPath)")
do { do {
if (self.key != nil) { if (self.key != nil) {
let data = self.key!.data(using: .utf8) let data = self.key!.data(using: .utf8)

View File

@ -1,10 +1,8 @@
import Foundation import Foundation
import os.log
class DNUpdater { class DNUpdater {
private let apiClient = APIClient() private let apiClient = APIClient()
private let timer = RepeatingTimer(timeInterval: 30) // 15 * 60 is 15 minutes private let timer = RepeatingTimer(timeInterval: 15 * 60) // 15 * 60 is 15 minutes
private let log = Logger(subsystem: "net.defined.mobileNebula", category: "DNUpdater")
func updateAll(onUpdate: @escaping (Site) -> ()) { func updateAll(onUpdate: @escaping (Site) -> ()) {
_ = SiteList{ (sites, _) -> () in _ = SiteList{ (sites, _) -> () in
@ -57,7 +55,7 @@ class DNUpdater {
} catch (APIClientError.invalidCredentials) { } catch (APIClientError.invalidCredentials) {
if (!credentials.invalid) { if (!credentials.invalid) {
try site.invalidateDNCredentials() try site.invalidateDNCredentials()
log.notice("Invalidated credentials in site: \(site.name, privacy: .public)") print("Invalidated credentials in site \(site.name)")
} }
return return
@ -65,7 +63,7 @@ class DNUpdater {
newSite?.save(manager: nil) { error in newSite?.save(manager: nil) { error in
if (error != nil) { if (error != nil) {
self.log.error("failed to save update: \(error!.localizedDescription, privacy: .public)") print("failed to save update: \(error!.localizedDescription)")
} else { } else {
onUpdate(Site(incoming: newSite!)) onUpdate(Site(incoming: newSite!))
} }
@ -73,11 +71,11 @@ class DNUpdater {
if (credentials.invalid) { if (credentials.invalid) {
try site.validateDNCredentials() try site.validateDNCredentials()
log.notice("Revalidated credentials in site \(site.name, privacy: .public)") print("Revalidated credentials in site \(site.name)")
} }
} catch { } catch {
log.error("Error while updating \(site.name, privacy: .public): \(error.localizedDescription, privacy: .public)") print("Error while updating \(site.name): \(error.localizedDescription)")
} }
} }
} }