Skip to content

Commit

Permalink
Merge pull request #1199 from Teh-STIG/dev
Browse files Browse the repository at this point in the history
Connect to Self-Hosted Hudu instance through CloudFlare ZTNA Tunnel [2/2]
  • Loading branch information
KelvinTegelaar authored Jan 19, 2025
2 parents 0d0dbc6 + 70c9d60 commit 0ad13cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Modules/CippExtensions/Public/Hudu/Connect-HuduAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ function Connect-HuduAPI {
$null = Connect-AzAccount -Identity
$APIKey = (Get-AzKeyVaultSecret -VaultName $keyvaultname -Name 'Hudu' -AsPlainText)
}
# Add logic to check if we're using CloudFlare Tunnel (if Hudu.CFEnabled checkbox is checked from Extensions.json). If the checkbox is checked, pull CloudFlare ClientID and API Key and add as a header
if ($Configuration.CFEnabled) {
$CFClientID = (Get-AzKeyVaultSecret -VaultName $keyvaultname -Name 'CloudFlareClientID' -AsPlainText)
$CFAPIKey = (Get-AzKeyVaultSecret -VaultName $keyvaultname -Name 'CloudFlareAPIKey' -AsPlainText)
New-HuduCustomHeaders -Headers @{"CF-Access-Client-Id" = "$CFClientID"; "CF-Access-Client-Secret" = "$CFAPIKey"}
}
New-HuduBaseURL -BaseURL $Configuration.BaseURL
New-HuduAPIKey -ApiKey $APIKey
}

0 comments on commit 0ad13cd

Please sign in to comment.