<commit_before># - HTTP Server
# http://docs.tsuru.io/en/latest/reference/config.html#tsuru-configuration
listen: "<%= @tsuru_server_listen %>"
host: "<%= @tsuru_host %>"
<%- if @tsuru_use_tls %>
use-tls: <%= @tsuru_use_tls %>
  tls-cert-file: <%= @tsuru_tls_cert_file %>
  tls-key-file: <%= @tsuru_tls_key_file %>
<%- end %>

# - Database access
# http://docs.tsuru.io/en/latest/reference/config.html#database-access
database:
  url: <%= @mongodb_url %>
  name: <%= @mongodb_database_name %>

<%- if @smtp_server %>
# - Email configuration
# http://docs.tsuru.io/en/latest/reference/config.html#email-configuration
smtp:
  server: <%= @smtp_server %>
  user: <%= @smtp_user %>
  <%= @smtp_password ? "password: <PASSWORD>}" : '' %>
<%- end %>

# - Git configuration
# http://docs.tsuru.io/en/latest/reference/config.html#git-configuration
git:
  unit-repo: <%= @git_unit_repo %>
  api-server: <%= @git_api_server %>
  <%= @git_rw_host ? "rw-host: #{@git_rw_host}" : "" %>
  <%= @git_ro_host ? "ro-host: #{@git_ro_host}" : "" %>

# - Authentication configuration
# http://docs.tsuru.io/en/latest/reference/config.html#authentication-configuration
auth:
  token-expire-days: <%= @auth_token_expire_days %>
  hash-cost: <%= @auth_hash_cost %>
  user-registration: <%= @auth_user_registration %>
  scheme: <%= @auth_scheme %>
  <%- if @auth_scheme.eql?('oauth') %>
  oauth:
    client-id: <%= @oauth_client_id %>
    client-secret: <%= @oauth_client_secret %>
    scope: <%= @oauth_scope %>
    auth-url: <%= @oauth_auth_url %>
    token-url: <%= @oauth_token_url %>
    info-url: <%= @oauth_info_url %>
    collection: <%= @oauth_collection %>
    callback-port: <%= @oauth_callback_port %>
  <%- end %>

# Queue configuration
# http://docs.tsuru.io/en/latest/reference/config.html#queue
queue: <%= @tsuru_queue %>
redis-queue:
  host: <%= @redis_host %>
  port: <%= @redis_port %>
<%= @redis_password ? "  password: #{@<PASSWORD>}" : ''  %>
<%= @redis_db ? "  db: #{@redis_db}" : ''  %>

# - Admin users
# http://docs.tsuru.io/en/latest/reference/config.html#admin-users
admin-team: <%= @tsuru_admin_team %>

<%- if @tsuru_apps_per_user %>
# - Quota management
# http://docs.tsuru.io/en/latest/reference/config.html#quota-management
quota:
  apps-per-user: <%= @tsuru_apps_per_user %>
  units-per-app: <%= @tsuru_units_per_app %>
<%- end %>

# - Router configuration
# http://docs.tsuru.io/en/latest/reference/config.html#hipache
hipache:
  domain: <%= @hipache_domain %>
  redis-server: <%= @hipache_redis_server %>

<%- if @tsuru_provisioner.eql?('docker') %>
# - Provisioner configuration
# http://docs.tsuru.io/en/latest/reference/config.html#provisioner
provisioner: <%= @tsuru_provisioner %>
docker:
  memory: 512
  swap: 1024
  segregate: <%= @docker_segregate %>
  <%= @docker_registry ? "registry: #{@docker_registry}" : '' %>
  collection: <%= @docker_collection %>
  repository-namespace: <%= @docker_repository_namespace %>
  router: <%= @docker_router %>
  deploy-cmd: <%= @docker_deploy_cmd %>
  cluster:
    storage: <%= @docker_storage %>
    mongo-url: <%= @docker_cluster_mongo_url %>
    mongo-database: <%= @docker_cluster_mongodb_db %>
  run-cmd:
    bin: <%= @docker_run_cmd_bin %>
    port: <%= @docker_run_cmd_port %>
  ssh:
    add-key-cmd: <%= @docker_ssh_add_key_cmd %>
    public-key: <%= @docker_public_key %>
    user: <%= @docker_user %>
    sshd-path: <%= @docker_sshd_path %>
  <%- if @docker_healing_heal_nodes %>
  healing:
    heal-nodes: <%= @docker_healing_heal_nodes %>
    active-monitoring-interval: <%= @docker_healing_active_monitoring_interval %>
    disabled-time: <%= @docker_healing_disabled_time %>
    max-failures: <%= @docker_healing_max_failures %>
    wait-new-time: <%= @docker_healing_wait_new_time %>
    heal-containers-timeout: <%= @docker_healing_heal_containers_timeout %>
    events-collection : <%= @docker_healing_events_collection %>
    max-time: <%= @docker_healthcheck_max_time %>
  <%- end %>
  <%- end %>

# - Iaas configuration
# http://docs.tsuru.io/en/latest/reference/config.html#iaas-configuration
<%- if @iaas_enable -%>
iaas:
  <%= @tsuru_iaas_default ? "default: #{tsuru_iaas_default}\n" : nil -%>
  <%- if @cloudstack_apikey -%>
  cloudstack:
    api-key: "<%= @cloudstack_apikey %>"
    secret-key: "<%= @cloudstack_secretkey %>"
    url: <%= @cloudstack_api_url %>
    user-data: <%= @cloudstack_user_data %>
  <%- end -%>
  <%- if @ec2_key_id -%>
  ec2:
    key-id: "<%= @ec2_key_id %>"
    secret-key: "<%= @ec2_secret_key %>"
    user-data: <%= @ec2_user_data %>
    wait-timeout: <%= @ec2_wait_timeout %>
  <%- end -%>
<%= @custom_iaas.empty? ? nil : 'custom:' %>
<%- @custom_iaas.each_key do |custom_key| -%>
    <%= custom_key %>:<commit_msg>api: sorting iaas identifiers with custom provider<commit_after># - HTTP Server
# http://docs.tsuru.io/en/latest/reference/config.html#tsuru-configuration
listen: "<%= @tsuru_server_listen %>"
host: "<%= @tsuru_host %>"
<%- if @tsuru_use_tls %>
use-tls: <%= @tsuru_use_tls %>
  tls-cert-file: <%= @tsuru_tls_cert_file %>
  tls-key-file: <%= @tsuru_tls_key_file %>
<%- end %>

# - Database access
# http://docs.tsuru.io/en/latest/reference/config.html#database-access
database:
  url: <%= @mongodb_url %>
  name: <%= @mongodb_database_name %>

<%- if @smtp_server %>
# - Email configuration
# http://docs.tsuru.io/en/latest/reference/config.html#email-configuration
smtp:
  server: <%= @smtp_server %>
  user: <%= @smtp_user %>
  <%= @smtp_password ? "password: #{@smtp_password}" : '' %>
<%- end %>

# - Git configuration
# http://docs.tsuru.io/en/latest/reference/config.html#git-configuration
git:
  unit-repo: <%= @git_unit_repo %>
  api-server: <%= @git_api_server %>
  <%= @git_rw_host ? "rw-host: #{@git_rw_host}" : "" %>
  <%= @git_ro_host ? "ro-host: #{@git_ro_host}" : "" %>

# - Authentication configuration
# http://docs.tsuru.io/en/latest/reference/config.html#authentication-configuration
auth:
  token-expire-days: <%= @auth_token_expire_days %>
  hash-cost: <%= @auth_hash_cost %>
  user-registration: <%= @auth_user_registration %>
  scheme: <%= @auth_scheme %>
  <%- if @auth_scheme.eql?('oauth') %>
  oauth:
    client-id: <%= @oauth_client_id %>
    client-secret: <%= @oauth_client_secret %>
    scope: <%= @oauth_scope %>
    auth-url: <%= @oauth_auth_url %>
    token-url: <%= @oauth_token_url %>
    info-url: <%= @oauth_info_url %>
    collection: <%= @oauth_collection %>
    callback-port: <%= @oauth_callback_port %>
  <%- end %>

# Queue configuration
# http://docs.tsuru.io/en/latest/reference/config.html#queue
queue: <%= @tsuru_queue %>
redis-queue:
  host: <%= @redis_host %>
  port: <%= @redis_port %>
<%= @redis_password ? "  password: <PASSWORD>}" : ''  %>
<%= @redis_db ? "  db: #{@redis_db}" : ''  %>

# - Admin users
# http://docs.tsuru.io/en/latest/reference/config.html#admin-users
admin-team: <%= @tsuru_admin_team %>

<%- if @tsuru_apps_per_user %>
# - Quota management
# http://docs.tsuru.io/en/latest/reference/config.html#quota-management
quota:
  apps-per-user: <%= @tsuru_apps_per_user %>
  units-per-app: <%= @tsuru_units_per_app %>
<%- end %>

# - Router configuration
# http://docs.tsuru.io/en/latest/reference/config.html#hipache
hipache:
  domain: <%= @hipache_domain %>
  redis-server: <%= @hipache_redis_server %>

<%- if @tsuru_provisioner.eql?('docker') %>
# - Provisioner configuration
# http://docs.tsuru.io/en/latest/reference/config.html#provisioner
provisioner: <%= @tsuru_provisioner %>
docker:
  memory: 512
  swap: 1024
  segregate: <%= @docker_segregate %>
  <%= @docker_registry ? "registry: #{@docker_registry}" : '' %>
  collection: <%= @docker_collection %>
  repository-namespace: <%= @docker_repository_namespace %>
  router: <%= @docker_router %>
  deploy-cmd: <%= @docker_deploy_cmd %>
  cluster:
    storage: <%= @docker_storage %>
    mongo-url: <%= @docker_cluster_mongo_url %>
    mongo-database: <%= @docker_cluster_mongodb_db %>
  run-cmd:
    bin: <%= @docker_run_cmd_bin %>
    port: <%= @docker_run_cmd_port %>
  ssh:
    add-key-cmd: <%= @docker_ssh_add_key_cmd %>
    public-key: <%= @docker_public_key %>
    user: <%= @docker_user %>
    sshd-path: <%= @docker_sshd_path %>
  <%- if @docker_healing_heal_nodes %>
  healing:
    heal-nodes: <%= @docker_healing_heal_nodes %>
    active-monitoring-interval: <%= @docker_healing_active_monitoring_interval %>
    disabled-time: <%= @docker_healing_disabled_time %>
    max-failures: <%= @docker_healing_max_failures %>
    wait-new-time: <%= @docker_healing_wait_new_time %>
    heal-containers-timeout: <%= @docker_healing_heal_containers_timeout %>
    events-collection : <%= @docker_healing_events_collection %>
    max-time: <%= @docker_healthcheck_max_time %>
  <%- end %>
  <%- end %>

# - Iaas configuration
# http://docs.tsuru.io/en/latest/reference/config.html#iaas-configuration
<%- if @iaas_enable -%>
iaas:
  <%= @tsuru_iaas_default ? "default: #{tsuru_iaas_default}\n" : nil -%>
  <%- if @cloudstack_apikey -%>
  cloudstack:
    api-key: "<%= @cloudstack_apikey %>"
    secret-key: "<%= @cloudstack_secretkey %>"
    url: <%= @cloudstack_api_url %>
    user-data: <%= @cloudstack_user_data %>
  <%- end -%>
  <%- if @ec2_key_id -%>
  ec2:
    key-id: "<%= @ec2_key_id %>"
    secret-key: "<%= @ec2_secret_key %>"
    user-data: <%= @ec2_user_data %>
    wait-timeout: <%= @ec2_wait_timeout %>
  <%- end -%>
<%= @custom_iaas.empty? ? nil : 'custom:' %>
<%- @custom_iaas.keys.sort.each do |custom_key| -%>
    <%= custom_key %>:
{'fraction_non_alphanumeric': 0.198, 'fraction_numerical': 0.0027368421052631577, 'mean_word_length': 4.206027397260274, 'pattern_counts': {'":': 0, '<': 184, '<?xml version=': 0, '>': 184, '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': '1525915', 'n_tokens_mistral': 4053, 'n_tokens_neox': 3515, 'n_words': 472}