package net.usebox.gemini.server import scala.concurrent.duration._ object TestData { val host = "localhost" val port = 1965 val portStr = port.toString() var resPath = sys.env("MILL_TEST_RESOURCE_FOLDER") val conf = ServiceConf( address = "127.0.0.1", port = port, defaultMimeType = "text/plain", idleTimeout = 10.seconds, virtualHosts = List( VirtualHost( host = host, root = resPath, keyStore = KeyStore( path = "/tmp/unused.jks", alias = "localhost", password = "secret" ) ) ), enabledProtocols = Nil, enabledCipherSuites = Nil ) val cgiConf = ServiceConf.initConf( conf.copy(virtualHosts = List( conf .virtualHosts(0) .copy( directoryListing = true, directories = List( Directory( "dir/", directoryListing = Some(false), allowCgi = Some(true) ) ) ) ) ) ) val cgiPrefConf = ServiceConf.initConf( conf.copy(virtualHosts = List( conf .virtualHosts(0) .copy( directoryListing = true, directories = List( Directory( "dir/", directoryListing = Some(false), allowCgi = Some(true) ), Directory( "dir/sub/", directoryListing = Some(false), allowCgi = Some(true) ) ) ) ) ) ) val cgiEnvConf = cgiConf.copy(virtualHosts = List( cgiConf .virtualHosts(0) .copy( environment = Some(Map("env1" -> "value")) ) ) ) val cgiIndexConf = cgiConf.copy(virtualHosts = List( cgiConf .virtualHosts(0) .copy( indexFile = "cgi" ) ) ) val confUserDir = conf.copy(virtualHosts = List( conf .virtualHosts(0) .copy( userDirectories = true, userDirectoryPath = Some( resPath + "/{user}/public_gemini/" ) ) ) ) val mimeTypes = Some( Map( "config" -> List(".gmi", ".gemini") ) ) }