chore(runner): remove client secret and add UUID in runner

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-10-15 20:03:33 +08:00
committed by Jason Song
parent bf5e3dc302
commit e08495af09
9 changed files with 122 additions and 167 deletions

View File

@ -27,13 +27,13 @@ type (
Address string `ignored:"true"`
Proto string `envconfig:"GITEA_RPC_PROTO" default:"http"`
Host string `envconfig:"GITEA_RPC_HOST"`
Secret string `envconfig:"GITEA_RPC_SECRET"`
SkipVerify bool `envconfig:"GITEA_RPC_SKIP_VERIFY"`
GRPC bool `envconfig:"GITEA_RPC_GRPC" default:"true"`
GRPCWeb bool `envconfig:"GITEA_RPC_GRPC_WEB"`
}
Runner struct {
UUID string `ignored:"true"`
Name string `envconfig:"GITEA_RUNNER_NAME"`
Token string `envconfig:"GITEA_RUNNER_TOKEN" required:"true"`
Capacity int `envconfig:"GITEA_RUNNER_CAPACITY" default:"1"`
@ -66,7 +66,7 @@ func FromEnviron() (Config, error) {
return cfg, err
}
if runner.UUID != "" {
cfg.Client.Secret = runner.UUID
cfg.Runner.UUID = runner.UUID
}
}