## Configuration file of Harbor

#The IP address or hostname to access admin UI and registry service.
#DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: {{hostname}}

# http related comfig
http:
  # port for http, default is 80. If https enabled, this port will redirect to https port
  port: 80

{% if ui_url_protocol == 'https'%}
https:
  port: 443
  #The path of cert and key files for nginx
  certificate: {{ ssl_cert }}
  private_key: {{ ssl_cert_key }}
{% else %}
# https:
#   port: 443
#   #The path of cert and key files for nginx
#   certificate: /your/certificate/path
#   private_key: /your/private/key/path
{% endif %}

# Uncomment extearnal_url if you want to enable external proxy
# And when it enabled the hostname will no longger used
# external_url: https://reg.mydomain.com:8433

# The initial password of Harbor admin
# It only works in first time to install harbor
# Remember Change the admin password from UI after launching Harbor.
harbor_admin_password: Harbor12345

## Harbor DB configuration
database:
  #The password for the root user of Harbor DB. Change this before any production use.
  password: {{ db_password }}

# The default data volume
data_volume: /data

# Harbor Storage settings by default is using data_volume dir on local filesystem
# Uncomment storage_service setting If you want to using external storage
storage_service:
  # ca_bundle is the path to the custom root ca certificate, which will be injected into the truststore
  # of registry's and chart repository's containers.  This is usually needed when the user hosts a internal storage with self signed certificate.
  ca_bundle: {{ registry_custom_ca_bundle }}

  {{storage_provider_info}}

# Clair configuration
clair:
  # The interval of clair updaters, the unit is hour, set to 0 to disable the updaters.
  updaters_interval: {{ clair_updaters_interval }}

  # Config http proxy for Clair, e.g. http://my.proxy.com:3128
  # Clair doesn't need to connect to harbor internal components via http proxy.
  http_proxy: {{ http_proxy }}
  https_proxy: {{ https_proxy }}
  no_proxy: {{ no_proxy }}

jobservice:
  # Maximum number of job workers in job service  
  max_job_workers: {{ max_job_workers }}

# Log configurations
log:
  # options are debug, info, warn, error
  level: info
  # Log files are rotated log_rotate_count times before being removed. If count is 0, old versions are removed rather than rotated.
  rotate_count: {{ log_rotate_count }}
  # Log files are rotated only if they grow bigger than log_rotate_size bytes. If size is followed by k, the size is assumed to be in kilobytes. 
  # If the M is used, the size is in megabytes, and if G is used, the size is in gigabytes. So size 100, size 100k, size 100M and size 100G 
  # are all valid.
  rotate_size: {{ log_rotate_size }}
  # The directory on your host that store log
  location: /var/log/harbor

#This attribute is for migrator to detect the version of the .cfg file, DO NOT MODIFY!
_version: 1.8.0

{% if external_db %}
# Uncomment external_database if using external database. And the password will replace the the password setting in database.
# And currently ontly support postgres.
external_database:
  harbor:
    host: {{ db_host }}
    port: {{ db_port }}
    db_name: registry
    username: {{ db_user }}
    password: {{ db_password }}
    ssl_mode: disable
  clair:
    host: {{ clair_db_host }}
    port: {{ clair_db_port }}
    db_name: {{ clair_db }}
    username: {{ clair_db_username }}
    password: {{ clair_db_password }}
    ssl_mode: disable
  notary_signer:
    host: {{ db_host }}
    port: {{ db_port }}
    db_name: notarysigner
    username: {{ db_user }}
    password: {{ db_password }}
    ssl_mode: disable
  notary_server:
    host: {{ db_host }}
    port: {{ db_port }}
    db_name: notaryserver
    username: {{ db_user }}
    password: {{ db_password }}
    ssl_mode: disable
{% endif %}

{% if external_redis %}
external_redis:
  host: {{ redis_host }}
  port: {{ redis_port }}
  password: {{ redis_password }}
  # db_index 0 is for core, it's unchangeable
  registry_db_index: {{ registry_db_index }}
  jobservice_db_index: {{ jobservice_db_index }}
  chartmuseum_db_index: {{ chartmuseum_db_index }}
{% else %}
# Umcomments external_redis if using external Redis server
# external_redis:
#   host: redis
#   port: 6379
#   password:
#   # db_index 0 is for core, it's unchangeable
#   registry_db_index: 1
#   jobservice_db_index: 2
#   chartmuseum_db_index: 3
{% endif %}