<commit_before>require 'stacks/namespace'
require 'stacks/machine_def_container'
require 'stacks/app_server'
require 'stacks/nat'
require 'stacks/proxy_vhost'
require 'uri'

module Stacks::VirtualProxyService
  attr_reader :cert
  attr_reader :proxy_vhosts
  attr_reader :proxy_vhosts_lookup

  def self.extended(object)
    object.configure
  end

  def configure
    @downstream_services = []
    @proxy_vhosts_lookup = {}
    @proxy_vhosts        = []
    @ports               = [80, 443]
    @cert                = 'wildcard_timgroup_com'
  end

  def vhost(service, vhost_properties = {}, &config_block)
    key = "#{name}.vhost.#{service}.server_name"
    _vhost(key, vip_fqdn(:front), vip_fqdn(:prod), service, 'default', vhost_properties, &config_block)
  end

  def vhost3(service, fqdn = nil, &config_block)
    vhost2(fqdn, service, &config_block)
  end

  def vhost2(fqdn, service, &config_block)
    fqdn = vip_fqdn(:front) if !fqdn
    proxy_vhost = Stacks::ProxyVHost.new(fqdn, service, &config_block)

    if proxy_vhost.add_default_aliases == true
      proxy_vhost.aliases << vip_fqdn(:front) if fqdn != vip_fqdn(:front)
      proxy_vhost.aliases << vip_fqdn(:prod)
    end
    key = "#{fqdn}-#{name}-#{service}"
    @proxy_vhosts << @proxy_vhosts_lookup[key] = proxy_vhost
  end

  def sso_vip_front_fqdn
    "#{environment.name}-#{name}-sso-vip.front.#{@domain}"
  end
<commit_msg>bye bye old vhost(), welcome new vhost()<commit_after>require 'stacks/namespace'
require 'stacks/machine_def_container'
require 'stacks/app_server'
require 'stacks/nat'
require 'stacks/proxy_vhost'
require 'uri'

module Stacks::VirtualProxyService
  attr_reader :cert
  attr_reader :proxy_vhosts
  attr_reader :proxy_vhosts_lookup

  def self.extended(object)
    object.configure
  end

  def configure
    @downstream_services = []
    @proxy_vhosts_lookup = {}
    @proxy_vhosts        = []
    @ports               = [80, 443]
    @cert                = 'wildcard_timgroup_com'
  end

  def vhost(service, fqdn = nil, &config_block)
    fqdn = vip_fqdn(:front) if !fqdn
    proxy_vhost = Stacks::ProxyVHost.new(fqdn, service, &config_block)

    if proxy_vhost.add_default_aliases == true
      proxy_vhost.aliases << vip_fqdn(:front) if fqdn != vip_fqdn(:front)
      proxy_vhost.aliases << vip_fqdn(:prod)
    end
    key = "#{fqdn}-#{name}-#{service}"
    @proxy_vhosts << @proxy_vhosts_lookup[key] = proxy_vhost
  end

  def vhost3(service, fqdn = nil, &config_block)
    vhost2(fqdn, service, &config_block)
  end

  def vhost2(fqdn, service, &config_block)
    fqdn = vip_fqdn(:front) if !fqdn
    proxy_vhost = Stacks::ProxyVHost.new(fqdn, service, &config_block)

    if proxy_vhost.add_default_aliases == true
      proxy_vhost.aliases << vip_fqdn(:front) if fqdn != vip_fqdn(:front)
      proxy_vhost.aliases << vip_fqdn(:prod)
    end
    key = "#{fqdn}-#{name}-#{service}"
    @proxy_vhosts << @proxy_vhosts_lookup[key] = proxy_vhost
  end

  def sso_vip_front_fqdn
    "#{environment.name}-#{name}-sso-vip.front.#{@domain}"
  end

{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.005249343832020997, 'mean_word_length': 3.83968253968254, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 3, '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': '3205275', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1159, 'n_words': 204}