---
# Default values for Forgejo deployment

# Database configuration
forgejo_use_postgres_ha: false  # Set to true to use PostgreSQL HA, false for standard PostgreSQL

# Storage configuration
forgejo_storage_class_name: "forgejo-local-storage"
forgejo_data_pv_size: "10Gi"
forgejo_postgresql_pv_size: "8Gi"
forgejo_postgresql_ha_pv_size: "8Gi"
forgejo_redis_pv_size: "8Gi"
forgejo_pv_reclaim_policy: "Retain"

# Namespace settings
forgejo_namespace: "container-mom-git"

# NOTE: Credentials are managed entirely by vault under global.forgejo.*
# - global.forgejo.admin_username: Forgejo admin username
# - global.forgejo.admin_password: Forgejo admin password
# - global.forgejo.admin_email: Forgejo admin email
# - global.forgejo.db_password: Database password

# Database configuration (non-sensitive)
forgejo_db_username: "gitea"  # Used by both Forgejo and PostgreSQL
forgejo_db_name: "gitea"      # Used by both Forgejo and PostgreSQL

# Helm chart values
forgejo_helm_chart_ref: "oci://code.forgejo.org/forgejo-helm/forgejo"
forgejo_helm_chart_version: "10.0.0"
forgejo_image_tag: "10.0.3"
forgejo_helm_release_name: "forgejo"
forgejo_helm_wait_timeout: "600s"

# OpenShift specific
forgejo_openshift_uid: 1000860000

# Service and route settings
forgejo_root_url: "https://git.container.mom"
forgejo_domain: "git.container.mom"
forgejo_ssh_domain: "git.container.mom"

# Node for local storage
forgejo_node_hostname: "master-0"

# Local storage paths - using /var/tmp which should exist on most systems
forgejo_data_path: "/var/tmp/forgejo-data"
forgejo_postgresql_path: "/var/tmp/forgejo-postgresql"
postgresql_ha_data_path: "/var/tmp/forgejo-postgresql-ha"
redis_data_path: "/var/tmp/forgejo-redis"
forgejo_postgresql_ha_path_prefix: "/var/forgejo-postgresql-ha-"
forgejo_redis_path_prefix: "/var/forgejo-redis-"

# Service accounts
forgejo_storage_init_sa: "forgejo-storage-init"
forgejo_app_sa: "forgejo"

# Persistent volumes names
forgejo_data_pv_name: "forgejo-local-pv-data"
forgejo_postgresql_pv_name: "forgejo-local-pv-postgresql"
forgejo_postgresql_ha_pv_name_prefix: "forgejo-local-pv-postgresql-ha-"
forgejo_redis_pv_name_prefix: "forgejo-local-pv-redis-"

# Node selector for PVs
forgejo_node_selector_key: "node-role.kubernetes.io/worker"
forgejo_node_selector_operator: "Exists"

# HA configuration
forgejo_postgresql_ha_replicas: 3
forgejo_redis_replicas: 3

# Timeout values
forgejo_resource_deletion_wait: 30
forgejo_job_timeout_retries: 15
forgejo_job_timeout_delay: 10
forgejo_storage_init_retries: 15
forgejo_storage_init_delay: 10

# List of PVCs to clean up
forgejo_pvcs_to_cleanup:
  - gitea-shared-storage
  - forgejo-postgresql-ha-postgresql-0
  - forgejo-postgresql-ha-postgresql-1
  - forgejo-postgresql-ha-postgresql-2
  - data-forgejo-postgresql-ha-postgresql-0
  - data-forgejo-postgresql-ha-postgresql-1
  - data-forgejo-postgresql-ha-postgresql-2
  - redis-data-forgejo-redis-cluster-0
  - redis-data-forgejo-redis-cluster-1
  - redis-data-forgejo-redis-cluster-2
  - redis-data-forgejo-redis-master

# List of deployments/statefulsets to clean up
forgejo_deployments_to_cleanup:
  - { kind: "Deployment", name: "forgejo" }
  - { kind: "StatefulSet", name: "forgejo-postgresql-ha-postgresql" }
  - { kind: "StatefulSet", name: "forgejo-postgresql-ha-pgpool" }
  - { kind: "StatefulSet", name: "forgejo-redis-cluster" }

# List of ConfigMaps and Secrets to clean up
forgejo_configs_to_cleanup:
  - { kind: "ConfigMap", name: "forgejo" }
  - { kind: "ConfigMap", name: "forgejo-inline-config" }
  - { kind: "Secret", name: "forgejo" }
  - { kind: "Secret", name: "forgejo-init" }
  - { kind: "Secret", name: "forgejo-inline-config" }
  - { kind: "Secret", name: "forgejo-postgresql-ha" }
  - { kind: "ConfigMap", name: "forgejo-postgresql-ha-configuration" }
