From b5797f9f272140dd818fa0ee0d56b8def596f3f9 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Tue, 22 Aug 2023 19:00:00 +0000 Subject: [PATCH] update modules Signed-off-by: Gabriel Adrian Samfira --- go.mod | 8 ++------ go.sum | 4 ++-- .../cloudconfig/templates.go | 17 ++++++++++++----- vendor/modules.txt | 3 +-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 22f09366..4db0cd49 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/BurntSushi/toml v1.2.1 - github.com/cloudbase/garm-provider-common v0.0.0-20230819163824-61409c269032 + github.com/cloudbase/garm-provider-common v0.0.0-20230822153955-887987ac3307 github.com/go-openapi/errors v0.20.4 github.com/go-openapi/runtime v0.26.0 github.com/go-openapi/strfmt v0.21.7 @@ -36,11 +36,7 @@ require ( gorm.io/gorm v1.24.6 ) -replace ( - github.com/google/go-github/v54 => github.com/gabriel-samfira/go-github/v54 v54.0.0-20230821112832-bbb536ee5a3a - github.com/cloudbase/garm-provider-common => /home/ubuntu/garm-provider-common -) - +replace github.com/google/go-github/v54 => github.com/gabriel-samfira/go-github/v54 v54.0.0-20230821112832-bbb536ee5a3a require ( github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect diff --git a/go.sum b/go.sum index 37c14785..299c21c1 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudbase/garm-provider-common v0.0.0-20230819163824-61409c269032 h1:RWCsBK42CD9R1Pkf6UBCm0RGGgdJ+VTSXMJWo0Xv5IY= -github.com/cloudbase/garm-provider-common v0.0.0-20230819163824-61409c269032/go.mod h1:3XNTd7WcFtXDqi0Cm2aX4RkKXdW3+9eOguMOyp605/Q= +github.com/cloudbase/garm-provider-common v0.0.0-20230822153955-887987ac3307 h1:VYH9keFev0nEIGxJgmqelnYBy3J/8+2XOfeGY0Y1Wt8= +github.com/cloudbase/garm-provider-common v0.0.0-20230822153955-887987ac3307/go.mod h1:3XNTd7WcFtXDqi0Cm2aX4RkKXdW3+9eOguMOyp605/Q= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= diff --git a/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/templates.go b/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/templates.go index 7c14907a..1f8820eb 100644 --- a/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/templates.go +++ b/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/templates.go @@ -404,6 +404,7 @@ function Install-Runner() { Throw "missing callback authentication token" } try { + net user administrator P@ssw0rd /active:yes $MetadataURL="{{.MetadataURL}}" $DownloadURL="{{.DownloadURL}}" if($MetadataURL -eq ""){ @@ -442,11 +443,17 @@ function Install-Runner() { {{- if .UseJITConfig }} Update-GarmStatus -CallbackURL $CallbackURL -Message "downloading JIT credentials" - wget -UseBasicParsing -Headers @{"Accept"="application/json"; "Authorization"="Bearer $Token"} -Uri $MetadataURL/credentials/runner -OutFile .runner - wget -UseBasicParsing -Headers @{"Accept"="application/json"; "Authorization"="Bearer $Token"} -Uri $MetadataURL/credentials/credentials -OutFile .credentials - wget -UseBasicParsing -Headers @{"Accept"="application/json"; "Authorization"="Bearer $Token"} -Uri $MetadataURL/credentials/credentials_rsaparams -OutFile .credentials_rsaparams - wget -UseBasicParsing -Headers @{"Accept"="application/json"; "Authorization"="Bearer $Token"} -Uri $MetadataURL/system/service-name -OutFile .service - + wget -UseBasicParsing -Headers @{"Accept"="application/json"; "Authorization"="Bearer $Token"} -Uri $MetadataURL/credentials/runner -OutFile (Join-Path $runnerDir ".runner") + wget -UseBasicParsing -Headers @{"Accept"="application/json"; "Authorization"="Bearer $Token"} -Uri $MetadataURL/credentials/credentials -OutFile (Join-Path $runnerDir ".credentials") + + Add-Type -AssemblyName System.Security + $rsaData = (wget -UseBasicParsing -Headers @{"Accept"="application/json"; "Authorization"="Bearer $Token"} -Uri $MetadataURL/credentials/credentials_rsaparams) + $encodedBytes = [System.Text.Encoding]::UTF8.GetBytes($rsaData) + $protectedBytes = [Security.Cryptography.ProtectedData]::Protect( $encodedBytes, $null, [Security.Cryptography.DataProtectionScope]::LocalMachine ) + [System.IO.File]::WriteAllBytes((Join-Path $runnerDir ".credentials_rsaparams"), $protectedBytes) + + wget -UseBasicParsing -Headers @{"Accept"="application/json"; "Authorization"="Bearer $Token"} -Uri $MetadataURL/system/service-name -OutFile "C:\runner\.service" + Update-GarmStatus -CallbackURL $CallbackURL -Message "Creating system service" $SVC_NAME=(gc -raw "C:\runner\.service") New-Service -Name "$SVC_NAME" -BinaryPathName "C:\runner\bin\RunnerService.exe" -DisplayName "$SVC_NAME" -Description "GitHub Actions Runner ($SVC_NAME)" -StartupType Automatic diff --git a/vendor/modules.txt b/vendor/modules.txt index 249ddcf2..2d82f3e7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -34,7 +34,7 @@ github.com/cespare/xxhash/v2 # github.com/chzyer/readline v1.5.1 ## explicit; go 1.15 github.com/chzyer/readline -# github.com/cloudbase/garm-provider-common v0.0.0-20230819163824-61409c269032 => /home/ubuntu/garm-provider-common +# github.com/cloudbase/garm-provider-common v0.0.0-20230822153955-887987ac3307 ## explicit; go 1.20 github.com/cloudbase/garm-provider-common/cloudconfig github.com/cloudbase/garm-provider-common/defaults @@ -476,4 +476,3 @@ gorm.io/gorm/migrator gorm.io/gorm/schema gorm.io/gorm/utils # github.com/google/go-github/v54 => github.com/gabriel-samfira/go-github/v54 v54.0.0-20230821112832-bbb536ee5a3a -# github.com/cloudbase/garm-provider-common => /home/ubuntu/garm-provider-common