<commit_before>package ems

import java.io.File
import javax.servlet.http.{HttpServletResponse, HttpServletRequest}

import ems.security.{JAASAuthenticator, PropertyFileAuthenticator}

import scala.util.Properties

object Jetty extends App {
  val port = Properties.envOrElse("PORT", "8081").toInt
  val contextPath = Properties.propOrElse("contextPath", Properties.envOrElse("contextPath", "/server"))
  val authStrategy = Properties.propOrElse("auth-strategy", Properties.envOrElse("auth-strategy", "jaas"))
  val auth = authStrategy match {
    case "file" => PropertyFileAuthenticator[HttpServletRequest, HttpServletResponse](new File("passwords.properties"))
    case _ => JAASAuthenticator
  }

  private val server = unfiltered.jetty.Server.http(port).context(contextPath) {
    _.plan(Resources(auth))
  }

  server.underlying.setSendDateHeader(true)<commit_msg>user app.home<commit_after>package ems

import java.io.File
import javax.servlet.http.{HttpServletResponse, HttpServletRequest}

import ems.security.{JAASAuthenticator, PropertyFileAuthenticator}

import scala.util.Properties

object Jetty extends App {
  val port = Properties.envOrElse("PORT", "8081").toInt
  val contextPath = Properties.propOrElse("contextPath", Properties.envOrElse("contextPath", "/server"))
  val authStrategy = Properties.propOrElse("auth-strategy", Properties.envOrElse("auth-strategy", "jaas"))
  val home = new File(Properties.propOrElse("app.home", Properties.envOrElse("app.home", ".")))
  val auth = authStrategy match {
    case "file" => PropertyFileAuthenticator[HttpServletRequest, HttpServletResponse](new File(home, "passwords.properties"))
    case _ => JAASAuthenticator
  }

  private val server = unfiltered.jetty.Server.http(port).context(contextPath) {
    _.plan(Resources(auth))
  }

  server.underlying.setSendDateHeader(true)
{'fraction_non_alphanumeric': 0.12160694896851248, 'fraction_numerical': 0.004343105320304018, 'mean_word_length': 6.19921875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7635242', 'n_tokens_mistral': 566, 'n_tokens_neox': 541, 'n_words': 100}