package net.usebox.gemini.server import scala.concurrent.duration._ object TestData { val host = "localhost" val port = 1965 val portStr = port.toString() val conf = ServiceConf( address = "127.0.0.1", port = port, defaultMimeType = "text/plain", idleTimeout = 10.seconds, virtualHosts = List( VirtualHost( host = host, root = getClass.getResource("/").getPath() ) ), genCertValidFor = 1.day, 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( getClass.getResource("/").getPath() + "{user}/public_gemini/" ) ) ) ) val mimeTypes = Some( Map( "config" -> List(".gmi", ".gemini") ) ) }