Skip to content

Commit

Permalink
Enable auth by default. Decrease app resync period from 10m to 3m
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesuen committed Apr 23, 2018
1 parent 1a85a2d commit 8a28511
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/argocd-application-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
// CLIName is the name of the CLI
cliName = "argocd-application-controller"
// Default time in seconds for application resync period
defaultAppResyncPeriod = 600
defaultAppResyncPeriod = 180
)

func newCommand() *cobra.Command {
Expand Down
3 changes: 3 additions & 0 deletions cmd/argocd-server/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func NewCommand() *cobra.Command {
clientConfig clientcmd.ClientConfig
staticAssetsDir string
repoServerAddress string
disableAuth bool
)
var command = &cobra.Command{
Use: cliName,
Expand Down Expand Up @@ -47,6 +48,7 @@ func NewCommand() *cobra.Command {
KubeClientset: kubeclientset,
AppClientset: appclientset,
RepoClientset: repoclientset,
DisableAuth: disableAuth,
}
argocd := server.NewServer(argoCDOpts)
argocd.Run()
Expand All @@ -58,6 +60,7 @@ func NewCommand() *cobra.Command {
command.Flags().StringVar(&staticAssetsDir, "staticassets", "", "Static assets directory path")
command.Flags().StringVar(&logLevel, "loglevel", "info", "Set the logging level. One of: debug|info|warn|error")
command.Flags().StringVar(&repoServerAddress, "repo-server", "localhost:8081", "Repo server address.")
command.Flags().BoolVar(&disableAuth, "disable-auth", false, "Disable client authentication")
command.AddCommand(cli.NewVersionCmd(cliName))
return command
}
4 changes: 2 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"net"
"net/http"
"os"
"strings"

argocd "github.com/argoproj/argo-cd"
Expand Down Expand Up @@ -58,6 +57,7 @@ type ArgoCDServer struct {
}

type ArgoCDServerOpts struct {
DisableAuth bool
Insecure bool
Namespace string
StaticAssetsDir string
Expand Down Expand Up @@ -306,7 +306,7 @@ func (a *ArgoCDServer) parseTokens(tokens []string) bool {

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

Expand Down

0 comments on commit 8a28511

Please sign in to comment.