Skip to content

Commit 8a28511

Browse files
committed
Enable auth by default. Decrease app resync period from 10m to 3m
1 parent 1a85a2d commit 8a28511

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

cmd/argocd-application-controller/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const (
2929
// CLIName is the name of the CLI
3030
cliName = "argocd-application-controller"
3131
// Default time in seconds for application resync period
32-
defaultAppResyncPeriod = 600
32+
defaultAppResyncPeriod = 180
3333
)
3434

3535
func newCommand() *cobra.Command {

cmd/argocd-server/commands/root.go

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func NewCommand() *cobra.Command {
2020
clientConfig clientcmd.ClientConfig
2121
staticAssetsDir string
2222
repoServerAddress string
23+
disableAuth bool
2324
)
2425
var command = &cobra.Command{
2526
Use: cliName,
@@ -47,6 +48,7 @@ func NewCommand() *cobra.Command {
4748
KubeClientset: kubeclientset,
4849
AppClientset: appclientset,
4950
RepoClientset: repoclientset,
51+
DisableAuth: disableAuth,
5052
}
5153
argocd := server.NewServer(argoCDOpts)
5254
argocd.Run()
@@ -58,6 +60,7 @@ func NewCommand() *cobra.Command {
5860
command.Flags().StringVar(&staticAssetsDir, "staticassets", "", "Static assets directory path")
5961
command.Flags().StringVar(&logLevel, "loglevel", "info", "Set the logging level. One of: debug|info|warn|error")
6062
command.Flags().StringVar(&repoServerAddress, "repo-server", "localhost:8081", "Repo server address.")
63+
command.Flags().BoolVar(&disableAuth, "disable-auth", false, "Disable client authentication")
6164
command.AddCommand(cli.NewVersionCmd(cliName))
6265
return command
6366
}

server/server.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"net"
99
"net/http"
10-
"os"
1110
"strings"
1211

1312
argocd "github.com/argoproj/argo-cd"
@@ -58,6 +57,7 @@ type ArgoCDServer struct {
5857
}
5958

6059
type ArgoCDServerOpts struct {
60+
DisableAuth bool
6161
Insecure bool
6262
Namespace string
6363
StaticAssetsDir string
@@ -306,7 +306,7 @@ func (a *ArgoCDServer) parseTokens(tokens []string) bool {
306306

307307
// Authenticate checks for the presence of a token when accessing server-side resources.
308308
func (a *ArgoCDServer) authenticate(ctx context.Context) (context.Context, error) {
309-
if os.Getenv("REQUIREAUTH") != "1" {
309+
if a.DisableAuth {
310310
return ctx, nil
311311
}
312312

0 commit comments

Comments
 (0)