# | Gitea integration configuration default values
# | Migrated from: provisioning/kcl/gitea.k
# | Pattern: Pure defaults (no schema, no contracts)

{
  gitea_config = {
    mode = "local",
  },

  local_gitea = {
    enabled = false,
    deployment = "docker",
    port = 3000,
    data_dir = "~/.provisioning/gitea",
    auto_start = false,
  },

  docker_gitea = {
    image = "gitea/gitea:1.21",
    container_name = "provisioning-gitea",
    ssh_port = 222,
    environment = {
      "USER_UID" = "1000",
      "USER_GID" = "1000",
      "GITEA__database__DB_TYPE" = "sqlite3",
    },
    volumes = [
      "gitea-data:/data",
      "/etc/timezone:/etc/timezone:ro",
      "/etc/localtime:/etc/localtime:ro",
    ],
    restart_policy = "unless-stopped",
  },

  binary_gitea = {
    binary_path = "",
    config_path = "",
    version = "1.21.0",
    user = "git",
    group = "git",
  },

  remote_gitea = {
    enabled = false,
    url = "",
    api_url = "",
  },

  gitea_auth = {
    token_path = "",
  },

  gitea_repositories = {
    organization = "provisioning",
    core_repo = "provisioning-core",
    extensions_repo = "provisioning-extensions",
    platform_repo = "provisioning-platform",
    workspaces_org = "workspaces",
  },

  workspace_features = {
    git_integration = true,
    locking_enabled = true,
    webhooks_enabled = false,
    auto_sync = false,
    branch_protection = false,
  },

  gitea_repository = {
    name = "",
    owner = "",
    private = false,
    auto_init = true,
    default_branch = "main",
  },

  gitea_release = {
    tag_name = "",
    release_name = "",
    draft = false,
    prerelease = false,
    target_commitish = "main",
  },

  gitea_issue = {
    title = "",
    body = "",
    labels = [],
  },

  workspace_lock = {
    workspace_name = "",
    lock_type = "read",
    user = "",
    timestamp = "",
    force_unlock = false,
  },

  extension_publish_config = {
    extension_path = "",
    version = "",
    include_patterns = ["*.nu", "*.k", "*.toml", "*.md"],
    exclude_patterns = ["*.tmp", "*.log", ".git/*"],
    compression = "tar.gz",
  },

  gitea_webhook = {
    url = "",
    content_type = "json",
    events = ["push", "pull_request", "release"],
    active = true,
  },
}
