-
Notifications
You must be signed in to change notification settings - Fork 13
NOISSUE - Update cocos to match certs changes #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
7be1a60
21b9710
0c1b1a2
43525b6
1f05b8a
e760b38
ff71a18
66f6f14
e867cae
6b788fa
92778a6
656b367
703a1e3
0bc444d
bbebb40
aa1989b
f369263
068b9dc
4204d33
39cbec5
da68ce0
b0ece26
032628d
4303f26
df3ff58
ce21e17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,8 +14,8 @@ import ( | |
| "os" | ||
| "os/signal" | ||
| "syscall" | ||
| "time" | ||
|
|
||
| "github.com/absmach/certs/sdk" | ||
| mglog "github.com/absmach/supermq/logger" | ||
| "github.com/absmach/supermq/pkg/prometheus" | ||
| "github.com/caarlos0/env/v11" | ||
|
|
@@ -39,22 +39,22 @@ import ( | |
|
|
||
| const ( | ||
| svcName = "agent" | ||
| defSvcGRPCPort = "7002" | ||
| retryInterval = 5 * time.Second | ||
| envPrefixCVMGRPC = "AGENT_CVM_GRPC_" | ||
| storageDir = "/var/lib/cocos/agent" | ||
| ) | ||
|
|
||
| type config struct { | ||
| LogLevel string `env:"AGENT_LOG_LEVEL" envDefault:"debug"` | ||
| Vmpl int `env:"AGENT_VMPL" envDefault:"2"` | ||
| AgentGrpcHost string `env:"AGENT_GRPC_HOST" envDefault:"0.0.0.0"` | ||
| CAUrl string `env:"AGENT_CVM_CA_URL" envDefault:""` | ||
| CVMId string `env:"AGENT_CVM_ID" envDefault:""` | ||
| AgentMaaURL string `env:"AGENT_MAA_URL" envDefault:"https://sharedeus2.eus2.attest.azure.net"` | ||
| AgentOSBuild string `env:"AGENT_OS_BUILD" envDefault:"UVC"` | ||
| AgentOSDistro string `env:"AGENT_OS_DISTRO" envDefault:"UVC"` | ||
| AgentOSType string `env:"AGENT_OS_TYPE" envDefault:"UVC"` | ||
| LogLevel string `env:"AGENT_LOG_LEVEL" envDefault:"debug"` | ||
| Vmpl int `env:"AGENT_VMPL" envDefault:"2"` | ||
| AgentGrpcHost string `env:"AGENT_GRPC_HOST" envDefault:"0.0.0.0"` | ||
| CAUrl string `env:"AGENT_CVM_CA_URL" envDefault:""` | ||
| CVMId string `env:"AGENT_CVM_ID" envDefault:""` | ||
| DomainId string `env:"AGENT_DOMAIN_ID" envDefault:""` | ||
|
||
| CertsToken string `env:"AGENT_CERTS_TOKEN" envDefault:""` | ||
| AgentMaaURL string `env:"AGENT_MAA_URL" envDefault:"https://sharedeus2.eus2.attest.azure.net"` | ||
| AgentOSBuild string `env:"AGENT_OS_BUILD" envDefault:"UVC"` | ||
| AgentOSDistro string `env:"AGENT_OS_DISTRO" envDefault:"UVC"` | ||
| AgentOSType string `env:"AGENT_OS_TYPE" envDefault:"UVC"` | ||
|
Comment on lines
47
to
56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update agent service readme, also open a pr in cocos docs |
||
| } | ||
|
|
||
| func main() { | ||
|
|
@@ -167,7 +167,13 @@ func main() { | |
| var certProvider atls.CertificateProvider | ||
|
|
||
| if ccPlatform != attestation.NoCC { | ||
| certProvider, err = atls.NewProvider(provider, ccPlatform, cfg.CVMId, cfg.CAUrl) | ||
| var certsSDK sdk.SDK | ||
| if cfg.CAUrl != "" { | ||
| certsSDK = sdk.NewSDK(sdk.Config{ | ||
| HostURL: cfg.CAUrl, | ||
| }) | ||
| } | ||
| certProvider, err = atls.NewProvider(provider, ccPlatform, cfg.CertsToken, cfg.CVMId, certsSDK) | ||
| if err != nil { | ||
| logger.Error(fmt.Sprintf("failed to create certificate provider: %s", err)) | ||
| exitCode = 1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
domain id is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DomainId is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it from agent