22 lines
458 B
Swift
22 lines
458 B
Swift
import Foundation
|
|
|
|
struct Config: Codable {
|
|
|
|
/// The path to the log file
|
|
let logPath: String
|
|
|
|
/// Serve files in the Public directory using Vapor
|
|
let serveFiles: Bool
|
|
|
|
/// Authentication tokens for remotes allowed to write
|
|
let writers: [String]
|
|
|
|
var logURL: URL {
|
|
.init(fileURLWithPath: logPath)
|
|
}
|
|
|
|
static var `default`: Config {
|
|
.init(logPath: "/var/log/caps.log", serveFiles: true, writers: [])
|
|
}
|
|
}
|