chore: Make deployment admin page show better durations (#6856)

* chore: Make deployment admin page show better durations

Also fix group mappings
This commit is contained in:
Steven Masley
2023-03-29 16:26:20 -05:00
committed by GitHub
parent 872037bf85
commit 90da09bc2c
8 changed files with 115 additions and 37 deletions

View File

@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"flag"
"math"
"net/http"
"os"
"path/filepath"
@ -1113,10 +1112,13 @@ when required by your organization's security policy.`,
Description: "The maximum lifetime duration users can specify when creating an API token.",
Flag: "max-token-lifetime",
Env: "CODER_MAX_TOKEN_LIFETIME",
Default: time.Duration(math.MaxInt64).String(),
Value: &c.MaxTokenLifetime,
Group: &deploymentGroupNetworkingHTTP,
YAML: "maxTokenLifetime",
// The default value is essentially "forever", so just use 100 years.
// We have to add in the 25 leap days for the frontend to show the
// "100 years" correctly.
Default: ((100 * 365 * time.Hour * 24) + (25 * time.Hour * 24)).String(),
Value: &c.MaxTokenLifetime,
Group: &deploymentGroupNetworkingHTTP,
YAML: "maxTokenLifetime",
},
{
Name: "Enable swagger endpoint",