mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 21:35:23 +02:00
fix(agent): take agent_secret into account EE-2128 (#6379)
* EE-2128 take agent_sceret into account * EE-2128 align output code * EE-2128 fix copy command error * EE-2128 align code * EE-2128 fix typo * Update endpoint.html remove glint auto changes * EE-2128 Format html with Prettier * EE-2128 Adjust UI for dark mode and adopt AGENT_SECRET on k8s automatically * EE-2128 fix bug created by merge * EE-2128 Move the initailization of AGENT_SECRET to main.go * EE-2128 read AGENT_SECRET when settings is initializing
This commit is contained in:
parent
3eea3e88bc
commit
f707c90cd3
6 changed files with 93 additions and 24 deletions
|
@ -278,6 +278,12 @@ func updateSettingsFromFlags(dataStore dataservices.DataStore, flags *portainer.
|
|||
settings.BlackListedLabels = *flags.Labels
|
||||
}
|
||||
|
||||
if agentKey, ok := os.LookupEnv("AGENT_SECRET"); ok {
|
||||
settings.AgentSecret = agentKey
|
||||
} else {
|
||||
settings.AgentSecret = ""
|
||||
}
|
||||
|
||||
err = dataStore.Settings().UpdateSettings(settings)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -813,6 +813,8 @@ type (
|
|||
DisableTrustOnFirstConnect bool `json:"DisableTrustOnFirstConnect" example:"false"`
|
||||
// EnforceEdgeID makes Portainer store the Edge ID instead of accepting anyone
|
||||
EnforceEdgeID bool `json:"EnforceEdgeID" example:"false"`
|
||||
// Container environment parameter AGENT_SECRET
|
||||
AgentSecret string `json:"AgentSecret"`
|
||||
|
||||
// Deprecated fields
|
||||
DisplayDonationHeader bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue