
if _kys != Undefined and _kys.gitea_adm_usr != Undefined and _kys.gitea_adm_usr.name: 
    _adm_user = {
        name = _kys.gitea_adm_usr.name 
        password = _kys.gitea_adm_usr.password
        email = _kys.gitea_adm_usr.email
    }
else:
    _adm_user = {
        name = ""
        password = ""
        email = ""
    }

if _kys != Undefined and _kys.gitea_db_usr != Undefined and _kys.gitea_db_usr.name: 
    _db_usr_name = _kys.gitea_db_usr.name
    _db_usr_password = _kys.gitea_db_usr.password
else:
    _db_usr_name = ""
    _db_usr_password = ""

_db_postgres =  {
    typ = "postgres"
    host = "127.0.0.1:5432"
    # host = "$network_private_ip:5432"
    name = "repo"
    user = _db_usr_name
    password = _db_usr_password
#   charset = "utf8"
#   ssl_mode = "disable"
}
#_db_sqlite =  {
#   typ = "sqlite"
#   name = "repo"
#   path = "/var/lib/gitea/gitea.db" # Only for sqlite"
#}

taskserv = Gitea_SSH_SSL {
    version = "1.22.1"
    app_name = "Local Repo CloudNative zone"
#   run_user = { name = "gitea" }
    adm_user = _adm_user
    db = _db_postgres
    #db = _db_sqlite
#    work_path = "/var/lib/gitea"
#    etc_path = "/etc/gitea"
#    config_path = "app.ini"
#    run_path = "/usr/local/bin/gitea"
    http_addr = "$network_private_ip"
#    http_port = 3000
    root_url = "https://localrepo.cloudnative.zone"
    domain = "localrepo.cloudnative.zone"
    ssh_domain = "localrepo.cloudnative.zone"
#    ssh_port = 2022
#    start_ssh_server = True
#    builtin_ssh_server_user = "git"
#    ssh_root_path = "/home/gitea/.ssh"
    certs_path = "/etc/gitea/ssl"
#    cert_file = "/etc/gitea/ssl/fullchain.pem"
#    key_file = "/etc/gitea/ssl/privkey.pem"

#    disable_registration = True
#    require_signin_view = False
    cdci_user = "devadm"
    cdci_group = "devadm"
    cdci_user_home = "/home/devadm"
    cdci_key = "~/.ssh/id_cdci"
    webhook_allowed_hosts_list = "$defaults.priv_cidr_block"
    copy_paths = ["repo-ssl|ssl"]
}

