require 'gitea-client'

config = Rails.application.config_for(:configuration).symbolize_keys!
gitea_config = config[:gitea].symbolize_keys!

$gitea_client = Gitea::Api::Client.new({
  domain: gitea_config[:domain], 
  base_url: gitea_config[:base_url],
  username: gitea_config[:access_key_id], 
  password: gitea_config[:access_key_secret],
  log_filepath: "log/gitea-client.log"
})

$gitea_hat_client = Gitea::Api::Hat::Client.new({
  domain: gitea_config[:domain], 
  hat_base_url:  gitea_config[:hat_base_url],
  username: gitea_config[:access_key_id], 
  password: gitea_config[:access_key_secret], 
  log_filepath: "log/gitea-hat-client.log"
})