Skip to content

Commit

Permalink
Merge branch 'KelvinTegelaar:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
exservicesCapTech authored Mar 22, 2024
2 parents b7eee02 + 64cfeb3 commit 3edb762
Show file tree
Hide file tree
Showing 145 changed files with 1,507 additions and 1,237 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/dev_cippckdtz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cippckdtz

on:
push:
branches:
- dev
workflow_dispatch:

env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root

jobs:
deploy:
runs-on: windows-latest

steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cippckdtz'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_2101C7175BFB47E58240ABD1E72E81C2 }}
2 changes: 1 addition & 1 deletion BestPracticeAnalyser_Orchestration/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ param($Context)

$DurableRetryOptions = @{
FirstRetryInterval = (New-TimeSpan -Seconds 5)
MaxNumberOfAttempts = 3
MaxNumberOfAttempts = 1
BackoffCoefficient = 2
}
$RetryOptions = New-DurableRetryOptions @DurableRetryOptions
Expand Down
16 changes: 16 additions & 0 deletions CIPPActivityFunction/function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"scriptFile": "../Modules/CippEntryPoints/CippEntryPoints.psm1",
"entryPoint": "Receive-CippActivityTrigger",
"bindings": [
{
"name": "Item",
"type": "activityTrigger",
"direction": "in"
},
{
"name": "starter",
"type": "durableClient",
"direction": "in"
}
]
}
11 changes: 11 additions & 0 deletions CIPPOrchestrator/function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"scriptFile": "../Modules/CippEntryPoints/CippEntryPoints.psm1",
"entryPoint": "Receive-CippOrchestrationTrigger",
"bindings": [
{
"name": "Context",
"type": "orchestrationTrigger",
"direction": "in"
}
]
}
3 changes: 3 additions & 0 deletions DomainAnalyser_All/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ $Result = [PSCustomObject]@{
GUID = $($Domain.Replace('.', ''))
LastRefresh = $(Get-Date (Get-Date).ToUniversalTime() -UFormat '+%Y-%m-%dT%H:%M:%S.000Z')
Domain = $Domain
NSRecords = (Read-NSRecord -Domain $Domain).Records
ExpectedSPFRecord = ''
ActualSPFRecord = ''
SPFPassAll = ''
Expand All @@ -52,6 +53,7 @@ $Result = [PSCustomObject]@{
DNSSECPresent = ''
MailProvider = ''
DKIMEnabled = ''
DKIMRecords = ''
Score = ''
MaximumScore = 160
ScorePercentage = ''
Expand Down Expand Up @@ -218,6 +220,7 @@ try {
if ($DkimRecordCount -gt 0 -and $DkimFailCount -eq 0) {
$Result.DKIMEnabled = $true
$ScoreDomain += $Scores.DKIMActiveAndWorking
$Result.DKIMRecords = $DkimRecord.Records | Select-Object Selector, Record
} else {
$Result.DKIMEnabled = $false
$ScoreExplanation.Add('DKIM Not Configured') | Out-Null
Expand Down
70 changes: 33 additions & 37 deletions DomainAnalyser_Orchestration/run.ps1
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
param($Context)

try {
try {

$DurableRetryOptions = @{
FirstRetryInterval = (New-TimeSpan -Seconds 5)
MaxNumberOfAttempts = 3
BackoffCoefficient = 2
}
$RetryOptions = New-DurableRetryOptions @DurableRetryOptions
$DurableRetryOptions = @{
FirstRetryInterval = (New-TimeSpan -Seconds 5)
MaxNumberOfAttempts = 1
BackoffCoefficient = 2
}
$RetryOptions = New-DurableRetryOptions @DurableRetryOptions

# Sync tenants
try {
Invoke-ActivityFunction -FunctionName 'DomainAnalyser_GetTenantDomains' -Input 'Tenants'
}
catch { Write-Host "EXCEPTION: TenantDomains $($_.Exception.Message)" }
# Sync tenants
try {
Invoke-ActivityFunction -FunctionName 'DomainAnalyser_GetTenantDomains' -Input 'Tenants'
} catch { Write-Host "EXCEPTION: TenantDomains $($_.Exception.Message)" }

# Get list of all domains to process
$Batch = Invoke-ActivityFunction -FunctionName 'Activity_GetAllTableRows' -Input 'Domains'

$ParallelTasks = foreach ($Item in $Batch) {
Invoke-DurableActivity -FunctionName 'DomainAnalyser_All' -Input $item -NoWait -RetryOptions $RetryOptions
}

# Collect activity function results and send to database
$TableParams = Get-CippTable -tablename 'Domains'
$TableParams.Entity = Wait-ActivityFunction -Task $ParallelTasks
$TableParams.Force = $true
$TableParams = $TableParams | ConvertTo-Json -Compress
# Get list of all domains to process
$Batch = Invoke-ActivityFunction -FunctionName 'Activity_GetAllTableRows' -Input 'Domains'

try {
Invoke-ActivityFunction -FunctionName 'Activity_AddOrUpdateTableRows' -Input $TableParams
}
catch {
Write-Host "Orchestrator exception UpdateDomains $($_.Exception.Message)"
}
}
catch {
Write-LogMessage -API 'DomainAnalyser' -message "Domain Analyser Orchestrator Error $($_.Exception.Message)" -sev info
#Write-Host $_.Exception | ConvertTo-Json
}
finally {
Write-LogMessage -API 'DomainAnalyser' -message 'Domain Analyser has Finished' -sev Info
$ParallelTasks = foreach ($Item in $Batch) {
Invoke-DurableActivity -FunctionName 'DomainAnalyser_All' -Input $item -NoWait -RetryOptions $RetryOptions
}

# Collect activity function results and send to database
$TableParams = Get-CippTable -tablename 'Domains'
$TableParams.Entity = Wait-ActivityFunction -Task $ParallelTasks
$TableParams.Force = $true
$TableParams = $TableParams | ConvertTo-Json -Compress

try {
Invoke-ActivityFunction -FunctionName 'Activity_AddOrUpdateTableRows' -Input $TableParams
} catch {
Write-Host "Orchestrator exception UpdateDomains $($_.Exception.Message)"
}
} catch {
Write-LogMessage -API 'DomainAnalyser' -message "Domain Analyser Orchestrator Error $($_.Exception.Message)" -sev info
#Write-Host $_.Exception | ConvertTo-Json
} finally {
Write-LogMessage -API 'DomainAnalyser' -message 'Domain Analyser has Finished' -sev Info
}
16 changes: 0 additions & 16 deletions ExecExtensionNinjaOneQueue/function.json

This file was deleted.

13 changes: 0 additions & 13 deletions ExecExtensionNinjaOneQueue/run.ps1

This file was deleted.

7 changes: 3 additions & 4 deletions ExecGDAPInviteApproved_Timer/function.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"schedule": "0 0 */3 * * *"
},
{
"type": "queue",
"direction": "out",
"name": "gdapinvitequeue",
"queueName": "gdapinvitequeue"
"name": "starter",
"type": "durableClient",
"direction": "in"
}
]
}
10 changes: 0 additions & 10 deletions ExecGDAPInviteQueue/function.json

This file was deleted.

7 changes: 0 additions & 7 deletions ExecGDAPInviteQueue/run.ps1

This file was deleted.

10 changes: 0 additions & 10 deletions ExecScheduledCommand/function.json

This file was deleted.

83 changes: 0 additions & 83 deletions ExecScheduledCommand/run.ps1

This file was deleted.

10 changes: 0 additions & 10 deletions ListLicensesAllTenants/function.json

This file was deleted.

28 changes: 0 additions & 28 deletions ListLicensesAllTenants/run.ps1

This file was deleted.

10 changes: 0 additions & 10 deletions ListMFAUsersAllTenants/function.json

This file was deleted.

Loading

0 comments on commit 3edb762

Please sign in to comment.