Caps-Server/Sources/App/Config.swift

22 lines
458 B
Swift
Raw Normal View History

import Foundation
struct Config: Codable {
2022-05-27 09:25:41 +02:00
/// The path to the log file
let logPath: String
2022-05-27 09:25:41 +02:00
/// Serve files in the Public directory using Vapor
let serveFiles: Bool
2022-05-27 09:25:41 +02:00
/// Authentication tokens for remotes allowed to write
let writers: [String]
var logURL: URL {
.init(fileURLWithPath: logPath)
}
static var `default`: Config {
2022-05-27 09:25:41 +02:00
.init(logPath: "/var/log/caps.log", serveFiles: true, writers: [])
}
}