Allow custom data folder
This commit is contained in:
@ -23,6 +23,13 @@ struct Configuration {
|
||||
/// The number of minutes until a password reset token is no longer valid
|
||||
let tokenExpiryDuration: Int
|
||||
}
|
||||
|
||||
/**
|
||||
The folder where the data should be stored.
|
||||
|
||||
If the folder is set to `nil`, then the `Resources` folder is used.
|
||||
*/
|
||||
let dataDirectory: String?
|
||||
|
||||
/// The authentication tokens to access the metrics
|
||||
let monitoringTokens: Set<String>
|
||||
@ -42,6 +49,13 @@ struct Configuration {
|
||||
}
|
||||
return resourcesDirectory.appendingPathComponent(logPath)
|
||||
}
|
||||
|
||||
func customDataDirectory(or publicDirectory: String) -> URL {
|
||||
guard let dataDirectory else {
|
||||
return URL(fileURLWithPath: publicDirectory)
|
||||
}
|
||||
return URL(fileURLWithPath: dataDirectory)
|
||||
}
|
||||
}
|
||||
|
||||
extension Configuration {
|
||||
|
Reference in New Issue
Block a user