Compare commits

...

8 Commits

Author SHA1 Message Date
argo-bot
aab9542f8b Bump version to 2.1.1 2021-08-25 15:05:12 +00:00
argo-bot
a85ab6586d Bump version to 2.1.1 2021-08-25 15:04:57 +00:00
May Zhang
57abbf95ed fix: password reset requirements (#7071)
* fix: password reset meet requirement

Signed-off-by: May Zhang <may_zhang@intuit.com>
2021-08-24 23:22:23 -07:00
Alexander Matyushentsev
6a69d737da fix: Custom Styles feature is broken (#7067)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-08-24 15:11:52 -07:00
Remington Breeze
7c98813bb8 fix(ui): Add State to props passed to Extensions (#7045)
Signed-off-by: Remington Breeze <remington@breeze.software>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-08-24 15:11:43 -07:00
Alexander Matyushentsev
6868bd4213 fix: fix building remote container (#7062)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-08-24 15:11:32 -07:00
pasha-codefresh
c7c08426ac fix: make codegen (#7059)
fix: make codegen

Signed-off-by: pashavictorovich <pavel@codefresh.io>
2021-08-24 15:11:24 -07:00
Alexander Matyushentsev
86d21721a8 fix: keep uid_entrypoint.sh for backward compatibility (#7047)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2021-08-23 06:45:35 +00:00
31 changed files with 327 additions and 139 deletions

View File

@@ -62,6 +62,8 @@ COPY --from=builder /usr/local/bin/helm2 /usr/local/bin/helm2
COPY --from=builder /usr/local/bin/helm /usr/local/bin/helm
COPY --from=builder /usr/local/bin/kustomize /usr/local/bin/kustomize
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
# keep uid_entrypoint.sh for backward compatibility
RUN ln -s /usr/local/bin/entrypoint.sh /usr/local/bin/uid_entrypoint.sh
# support for mounting configuration from a configmap
RUN mkdir -p /app/config/ssh && \

View File

@@ -1 +1 @@
2.1.0
2.1.1

View File

@@ -3605,6 +3605,9 @@
"oidcConfig": {
"$ref": "#/definitions/clusterOIDCConfig"
},
"passwordPattern": {
"type": "string"
},
"plugins": {
"type": "array",
"items": {

View File

@@ -63,6 +63,7 @@ func NewCommand() *cobra.Command {
frameOptions string
repoServerPlaintext bool
repoServerStrictTLS bool
staticAssetsDir string
)
var command = &cobra.Command{
Use: cliName,
@@ -139,6 +140,7 @@ func NewCommand() *cobra.Command {
Cache: cache,
XFrameOptions: frameOptions,
RedisClient: redisClient,
StaticAssetsDir: staticAssetsDir,
}
stats.RegisterStackDumper()
@@ -157,9 +159,7 @@ func NewCommand() *cobra.Command {
clientConfig = cli.AddKubectlFlagsToCmd(command)
command.Flags().BoolVar(&insecure, "insecure", env.ParseBoolFromEnv("ARGOCD_SERVER_INSECURE", false), "Run server without TLS")
var staticAssetsDir string
command.Flags().StringVar(&staticAssetsDir, "staticassets", "", "Static assets directory path")
_ = command.Flags().MarkDeprecated("staticassets", "The --staticassets flag is not longer supported. Static assets are embedded into binary.")
command.Flags().StringVar(&staticAssetsDir, "staticassets", env.StringFromEnv("ARGOCD_SERVER_STATIC_ASSETS", "/shared/app"), "Directory path that contains additional static assets")
command.Flags().StringVar(&baseHRef, "basehref", env.StringFromEnv("ARGOCD_SERVER_BASEHREF", "/"), "Value for base href in index.html. Used if Argo CD is running behind reverse proxy under subpath different from /")
command.Flags().StringVar(&rootPath, "rootpath", env.StringFromEnv("ARGOCD_SERVER_ROOTPATH", ""), "Used if Argo CD is running behind reverse proxy under subpath different from /")
command.Flags().StringVar(&cmdutil.LogFormat, "logformat", env.StringFromEnv("ARGOCD_SERVER_LOGFORMAT", "text"), "Set the logging format. One of: text|json")

View File

@@ -70,6 +70,9 @@ const (
ChangePasswordSSOTokenMaxAge = time.Minute * 5
// GithubAppCredsExpirationDuration is the default time used to cache the GitHub app credentials
GithubAppCredsExpirationDuration = time.Minute * 60
// PasswordPatten is the default password patten
PasswordPatten = `^.{8,32}$`
)
// Dex related constants

View File

@@ -18,6 +18,9 @@ data:
# Specifies token expiration duration
users.session.duration: "24h"
# Specifies regex expression for password
passwordPattern: "^.{8,32}$"
# Enables google analytics tracking is specified
ga.trackingid: "UA-12345-1"
# Unless set to 'false' then user ids are hashed before sending to google analytics

View File

@@ -48,6 +48,8 @@ data:
server.basehref: "/"
# Used if Argo CD is running behind reverse proxy under subpath different from /
server.rootpath: "/"
# Directory path that contains additional static assets
server.staticassets: "/shared/app"
# Set the logging format. One of: text|json (default "text")
server.log.format: "text"

View File

@@ -88,9 +88,10 @@ spec:
name: styles
```
Note that the CSS file should be mounted within a subdirectory of the existing "/shared/app" directory
Note that the CSS file should be mounted within a subdirectory of the "/shared/app" directory
(e.g. "/shared/app/custom"). Otherwise, the file will likely fail to be imported by the browser with an
"incorrect MIME type" error.
"incorrect MIME type" error. The subdirectory can be changed using `server.staticassets` key of the
[argocd-cmd-params-cm.yaml](./argocd-cmd-params-cm.yaml) ConfigMap.
## Developing Style Overlays
The styles specified in the injected CSS file should be specific to components and classes defined in [argo-ui](https://github.com/argoproj/argo-ui).

View File

@@ -56,6 +56,7 @@ argocd-server [flags]
--sentinel stringArray Redis sentinel hostname and port (e.g. argocd-redis-ha-announce-0:6379).
--sentinelmaster string Redis sentinel master group name. (default "master")
--server string The address and port of the Kubernetes API server
--staticassets string Directory path that contains additional static assets (default "/shared/app")
--tls-server-name string If provided, this name will be used to validate server certificate. If this is not provided, hostname used to contact the server is used.
--tlsciphers string The list of acceptable ciphers to be used when establishing TLS connections. Use 'list' to list available ciphers. (default "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_RSA_WITH_AES_256_GCM_SHA384")
--tlsmaxversion string The maximum SSL/TLS version that is acceptable (one of: 1.0|1.1|1.2|1.3) (default "1.3")

View File

@@ -5,7 +5,7 @@ kind: Kustomization
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.1.0
newTag: v2.1.1
resources:
- ./application-controller
- ./dex

View File

@@ -136,6 +136,12 @@ spec:
name: argocd-cmd-params-cm
key: server.login.attempts.expiration
optional: true
- name: ARGOCD_SERVER_STATIC_ASSETS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: server.staticassets
optional: true
- name: ARGOCD_APP_STATE_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:

View File

@@ -11,7 +11,7 @@ patchesStrategicMerge:
images:
- name: quay.io/argoproj/argocd
newName: quay.io/argoproj/argocd
newTag: v2.1.0
newTag: v2.1.1
resources:
- ../../base/application-controller
- ../../base/dex

View File

@@ -3684,7 +3684,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
name: copyutil
volumeMounts:
@@ -3895,7 +3895,7 @@ spec:
key: reposerver.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -4114,6 +4114,12 @@ spec:
key: server.login.attempts.expiration
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_SERVER_STATIC_ASSETS
valueFrom:
configMapKeyRef:
key: server.staticassets
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_APP_STATE_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
@@ -4138,7 +4144,7 @@ spec:
key: server.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -4334,7 +4340,7 @@ spec:
key: controller.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:

View File

@@ -1071,7 +1071,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
name: copyutil
volumeMounts:
@@ -1282,7 +1282,7 @@ spec:
key: reposerver.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -1501,6 +1501,12 @@ spec:
key: server.login.attempts.expiration
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_SERVER_STATIC_ASSETS
valueFrom:
configMapKeyRef:
key: server.staticassets
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_APP_STATE_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
@@ -1525,7 +1531,7 @@ spec:
key: server.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -1721,7 +1727,7 @@ spec:
key: controller.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:

View File

@@ -3049,7 +3049,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
name: copyutil
volumeMounts:
@@ -3224,7 +3224,7 @@ spec:
key: reposerver.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -3439,6 +3439,12 @@ spec:
key: server.login.attempts.expiration
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_SERVER_STATIC_ASSETS
valueFrom:
configMapKeyRef:
key: server.staticassets
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_APP_STATE_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
@@ -3463,7 +3469,7 @@ spec:
key: server.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -3653,7 +3659,7 @@ spec:
key: controller.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:

View File

@@ -436,7 +436,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
name: copyutil
volumeMounts:
@@ -611,7 +611,7 @@ spec:
key: reposerver.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
@@ -826,6 +826,12 @@ spec:
key: server.login.attempts.expiration
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_SERVER_STATIC_ASSETS
valueFrom:
configMapKeyRef:
key: server.staticassets
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_APP_STATE_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
@@ -850,7 +856,7 @@ spec:
key: server.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:
@@ -1040,7 +1046,7 @@ spec:
key: controller.default.cache.expiration
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.1.0
image: quay.io/argoproj/argocd:v2.1.1
imagePullPolicy: Always
livenessProbe:
httpGet:

View File

@@ -92,6 +92,7 @@ type Settings struct {
UiCssURL string `protobuf:"bytes,14,opt,name=uiCssURL,proto3" json:"uiCssURL,omitempty"`
UiBannerContent string `protobuf:"bytes,15,opt,name=uiBannerContent,proto3" json:"uiBannerContent,omitempty"`
UiBannerURL string `protobuf:"bytes,16,opt,name=uiBannerURL,proto3" json:"uiBannerURL,omitempty"`
PasswordPattern string `protobuf:"bytes,17,opt,name=passwordPattern,proto3" json:"passwordPattern,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -242,6 +243,13 @@ func (m *Settings) GetUiBannerURL() string {
return ""
}
func (m *Settings) GetPasswordPattern() string {
if m != nil {
return m.PasswordPattern
}
return ""
}
type GoogleAnalyticsConfig struct {
TrackingID string `protobuf:"bytes,1,opt,name=trackingID,proto3" json:"trackingID,omitempty"`
AnonymizeUsers bool `protobuf:"varint,2,opt,name=anonymizeUsers,proto3" json:"anonymizeUsers,omitempty"`
@@ -609,68 +617,70 @@ func init() {
func init() { proto.RegisterFile("server/settings/settings.proto", fileDescriptor_a480d494da040caa) }
var fileDescriptor_a480d494da040caa = []byte{
// 976 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcf, 0x6f, 0x1b, 0xc5,
0x17, 0xd7, 0xc6, 0x69, 0x62, 0x3f, 0x37, 0x71, 0x32, 0xdf, 0x2f, 0x61, 0xb1, 0x2a, 0xc7, 0xf8,
0x50, 0x19, 0x09, 0x76, 0x89, 0x2b, 0x04, 0x42, 0x48, 0x80, 0xd7, 0x55, 0x6b, 0xea, 0x92, 0x32,
0x4d, 0x7a, 0x40, 0x42, 0xd1, 0x64, 0x77, 0xd8, 0x0c, 0xde, 0xcc, 0xac, 0x66, 0x66, 0xad, 0xba,
0x47, 0x6e, 0x5c, 0xb8, 0xc0, 0x1f, 0xd5, 0x23, 0x12, 0x77, 0x0b, 0x59, 0xfc, 0x21, 0x68, 0x67,
0x7f, 0x64, 0x63, 0x9b, 0x1f, 0x52,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1, 0x3d, 0xf3, 0xe7, 0x30, 0x3b, 0x2a, 0xb7, 0xf6, 0xd0, 0xfb, 0x75, 0xd1, 0xb1, 0x7e,
0x5b, 0x74, 0xac, 0x3f, 0x16, 0x1d, 0xeb, 0xeb, 0x0f, 0xfe, 0xdf, 0x1f, 0x44, 0xf6, 0x0e, 0x4b,
0x92, 0x8b, 0x2d, 0xb3, 0xef, 0x1f, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x31, 0x2c, 0x49,
0xde, 0x08, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -806,6 +816,15 @@ func (m *Settings) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.PasswordPattern) > 0 {
i -= len(m.PasswordPattern)
copy(dAtA[i:], m.PasswordPattern)
i = encodeVarintSettings(dAtA, i, uint64(len(m.PasswordPattern)))
i--
dAtA[i] = 0x1
i--
dAtA[i] = 0x8a
}
if len(m.UiBannerURL) > 0 {
i -= len(m.UiBannerURL)
copy(dAtA[i:], m.UiBannerURL)
@@ -1386,6 +1405,10 @@ func (m *Settings) Size() (n int) {
if l > 0 {
n += 2 + l + sovSettings(uint64(l))
}
l = len(m.PasswordPattern)
if l > 0 {
n += 2 + l + sovSettings(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
@@ -2227,6 +2250,38 @@ func (m *Settings) Unmarshal(dAtA []byte) error {
}
m.UiBannerURL = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 17:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field PasswordPattern", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSettings
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSettings
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthSettings
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.PasswordPattern = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSettings(dAtA[iNdEx:])

View File

@@ -3,6 +3,7 @@ package account
import (
"errors"
"fmt"
"regexp"
"sort"
"time"
@@ -76,6 +77,22 @@ func (s *Server) UpdatePassword(ctx context.Context, q *account.UpdatePasswordRe
}
}
//Need to validate password complexity with regular expression
passwordPattern, err := s.settingsMgr.GetPasswordPattern()
if err != nil {
return nil, err
}
validPasswordRegexp, err := regexp.Compile(passwordPattern)
if err != nil {
return nil, err
}
if !validPasswordRegexp.Match([]byte(q.NewPassword)) {
err := fmt.Errorf("New password does not match the following expression: %s.", passwordPattern)
return nil, err
}
hashedPassword, err := password.HashPassword(q.NewPassword)
if err != nil {
return nil, err

View File

@@ -4,7 +4,6 @@ import (
"context"
"crypto/tls"
"fmt"
goio "io"
"io/fs"
"math"
"net"
@@ -12,7 +11,6 @@ import (
"net/url"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
gosync "sync"
@@ -134,7 +132,6 @@ var (
maxConcurrentLoginRequestsCount = 50
replicasCount = 1
enableGRPCTimeHistogram = true
staticAssets = http.FS(&subDirFs{dir: "dist/app", fs: ui.Embedded})
)
func init() {
@@ -167,12 +164,14 @@ type ArgoCDServer struct {
indexDataInit gosync.Once
indexData []byte
indexDataErr error
staticAssets http.FileSystem
}
type ArgoCDServerOpts struct {
DisableAuth bool
EnableGZip bool
Insecure bool
StaticAssetsDir string
ListenPort int
MetricsPort int
Namespace string
@@ -236,6 +235,11 @@ func NewServer(ctx context.Context, opts ArgoCDServerOpts) *ArgoCDServer {
policyEnf := rbacpolicy.NewRBACPolicyEnforcer(enf, projLister)
enf.SetClaimsEnforcerFunc(policyEnf.EnforceClaims)
var staticFS fs.FS = io.NewSubDirFS("dist/app", ui.Embedded)
if opts.StaticAssetsDir != "" {
staticFS = io.NewComposableFS(staticFS, os.DirFS(opts.StaticAssetsDir))
}
return &ArgoCDServer{
ArgoCDServerOpts: opts,
log: log.NewEntry(log.StandardLogger()),
@@ -248,6 +252,7 @@ func NewServer(ctx context.Context, opts ArgoCDServerOpts) *ArgoCDServer {
appLister: appLister,
policyEnforcer: policyEnf,
userStateStorage: userStateStorage,
staticAssets: http.FS(staticFS),
}
}
@@ -842,8 +847,8 @@ func (s *ArgoCDServer) getIndexData() ([]byte, error) {
return s.indexData, s.indexDataErr
}
func uiAssetExists(filename string) bool {
f, err := staticAssets.Open(strings.Trim(filename, "/"))
func (server *ArgoCDServer) uiAssetExists(filename string) bool {
f, err := server.staticAssets.Open(strings.Trim(filename, "/"))
if err != nil {
return false
}
@@ -866,7 +871,7 @@ func (server *ArgoCDServer) newStaticAssetsHandler() func(http.ResponseWriter, *
}
}
fileRequest := r.URL.Path != "/index.html" && uiAssetExists(r.URL.Path)
fileRequest := r.URL.Path != "/index.html" && server.uiAssetExists(r.URL.Path)
// Set X-Frame-Options according to configuration
if server.XFrameOptions != "" {
@@ -889,50 +894,13 @@ func (server *ArgoCDServer) newStaticAssetsHandler() func(http.ResponseWriter, *
if err != nil {
modTime = time.Now()
}
http.ServeContent(w, r, "index.html", modTime, byteReadSeeker{data: data})
http.ServeContent(w, r, "index.html", modTime, io.NewByteReadSeeker(data))
} else {
http.FileServer(staticAssets).ServeHTTP(w, r)
http.FileServer(server.staticAssets).ServeHTTP(w, r)
}
}
}
type subDirFs struct {
dir string
fs fs.FS
}
func (s subDirFs) Open(name string) (fs.File, error) {
return s.fs.Open(filepath.Join(s.dir, name))
}
type byteReadSeeker struct {
data []byte
offset int64
}
func (f byteReadSeeker) Read(b []byte) (int, error) {
if f.offset >= int64(len(f.data)) {
return 0, goio.EOF
}
n := copy(b, f.data[f.offset:])
f.offset += int64(n)
return n, nil
}
func (f byteReadSeeker) Seek(offset int64, whence int) (int64, error) {
switch whence {
case 1:
offset += f.offset
case 2:
offset += int64(len(f.data))
}
if offset < 0 || offset > int64(len(f.data)) {
return 0, &fs.PathError{Op: "seek", Err: fs.ErrInvalid}
}
f.offset = offset
return offset, nil
}
type registerFunc func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error
// mustRegisterGWHandler is a convenience function to register a gateway handler

View File

@@ -99,6 +99,7 @@ func (s *Server) Get(ctx context.Context, q *settingspkg.SettingsQuery) (*settin
UserLoginsDisabled: userLoginsDisabled,
KustomizeVersions: kustomizeVersions,
UiCssURL: argoCDSettings.UiCssURL,
PasswordPattern: argoCDSettings.PasswordPattern,
}
if sessionmgr.LoggedIn(ctx) || s.disableAuth {

View File

@@ -33,6 +33,7 @@ message Settings {
string uiCssURL = 14;
string uiBannerContent = 15;
string uiBannerURL = 16;
string passwordPattern = 17;
}
message GoogleAnalyticsConfig {

View File

@@ -74,7 +74,7 @@ COPY --from=node /usr/local/bin/node /usr/local/bin
COPY --from=node /opt/yarn-v1.22.4 /opt/yarn-v1.22.4
# Entrypoint is required for container's user management
COPY ./test/container/uid_entrypoint.sh /usr/local/bin
COPY ./test/container/entrypoint.sh /usr/local/bin
ARG UID
@@ -104,4 +104,4 @@ RUN useradd -l -u ${UID} -d /home/user -s /bin/bash user && \
ln -s /opt/yarn-v1.22.4/bin/yarnpkg /usr/local/bin/yarnpkg && \
mkdir -p /var/lib/registry && chmod -R 777 /var/lib/registry
ENTRYPOINT ["/usr/local/bin/uid_entrypoint.sh"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@@ -36,7 +36,7 @@ COPY ./test/fixture/certs/argocd-e2e-server.key /etc/certs/argocd-test-server.ke
COPY ./test/fixture/certs/argocd-test-ca.crt /etc/certs/argocd-test-ca.crt
# Entrypoint is required for container's user management
COPY ./test/remote/uid_entrypoint.sh /usr/local/bin
COPY ./test/remote/entrypoint.sh /usr/local/bin
COPY ./test/remote/Procfile /Procfile
# We need goreman
@@ -83,4 +83,4 @@ RUN echo "[http]" >> /tmp/argo-e2e/submodule.git/config && \
RUN echo "[http]" >> /tmp/argo-e2e/submoduleParent.git/config && \
echo " receivepack = true" >> /tmp/argo-e2e/submoduleParent.git/config
ENTRYPOINT ["/usr/local/bin/uid_entrypoint.sh"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@@ -114,13 +114,13 @@ export const ResourceDetails = (props: ResourceDetailsProps) => {
}
]);
}
if (ExtensionComponent) {
if (ExtensionComponent && state) {
tabs.push({
title: 'More',
key: 'extension',
content: (
<div>
<ExtensionComponent node={node} tree={tree} />
<ExtensionComponent tree={tree} resource={state} />
</div>
)
});

View File

@@ -1,5 +1,5 @@
import * as React from 'react';
import {ApplicationTree, ResourceNode} from '../models';
import {ApplicationTree, State} from '../models';
const extensions: {[key: string]: Extension} = {};
const cache = new Map<string, Promise<Extension>>();
@@ -9,7 +9,7 @@ export interface Extension {
}
export interface ExtensionComponentProps {
node: ResourceNode;
resource: State;
tree: ApplicationTree;
}

38
util/io/bytereadseeker.go Normal file
View File

@@ -0,0 +1,38 @@
package io
import (
"io"
"io/fs"
)
func NewByteReadSeeker(data []byte) *byteReadSeeker {
return &byteReadSeeker{data: data}
}
type byteReadSeeker struct {
data []byte
offset int64
}
func (f byteReadSeeker) Read(b []byte) (int, error) {
if f.offset >= int64(len(f.data)) {
return 0, io.EOF
}
n := copy(b, f.data[f.offset:])
f.offset += int64(n)
return n, nil
}
func (f byteReadSeeker) Seek(offset int64, whence int) (int64, error) {
switch whence {
case 1:
offset += f.offset
case 2:
offset += int64(len(f.data))
}
if offset < 0 || offset > int64(len(f.data)) {
return 0, &fs.PathError{Op: "seek", Err: fs.ErrInvalid}
}
f.offset = offset
return offset, nil
}

23
util/io/componsablefs.go Normal file
View File

@@ -0,0 +1,23 @@
package io
import "io/fs"
type composableFS struct {
innerFS []fs.FS
}
// NewComposableFS creates files system that attempts reading file from multiple wrapped file systems
func NewComposableFS(innerFS ...fs.FS) *composableFS {
return &composableFS{innerFS: innerFS}
}
// Open attempts open file in wrapped file systems and returns first successful
func (c composableFS) Open(name string) (f fs.File, err error) {
for i := range c.innerFS {
f, err = c.innerFS[i].Open(name)
if err == nil {
break
}
}
return
}

20
util/io/subdirfs.go Normal file
View File

@@ -0,0 +1,20 @@
package io
import (
"io/fs"
"path/filepath"
)
type subDirFs struct {
dir string
fs fs.FS
}
func (s subDirFs) Open(name string) (fs.File, error) {
return s.fs.Open(filepath.Join(s.dir, name))
}
// NewSubDirFS returns file system that represents sub-directory in a wrapped file system
func NewSubDirFS(dir string, fs fs.FS) *subDirFs {
return &subDirFs{dir: dir, fs: fs}
}

View File

@@ -82,6 +82,8 @@ type ArgoCDSettings struct {
UiBannerContent string `json:"uiBannerContent,omitempty"`
// URL for UI Banner
UiBannerURL string `json:"uiBannerURL,omitempty"`
// PasswordPattern for password regular expression
PasswordPattern string `json:"passwordPattern,omitempty"`
}
type GoogleAnalytics struct {
@@ -309,6 +311,8 @@ const (
externalServerTLSSecretName = "argocd-server-tls"
// partOfArgoCDSelector holds label selector that should be applied to config maps and secrets used to manage Argo CD
partOfArgoCDSelector = "app.kubernetes.io/part-of=argocd"
// settingsPasswordPatternKey is the key to configure user password regular expression
settingsPasswordPatternKey = "passwordPattern"
)
// SettingsManager holds config info for a new manager with which to access Kubernetes ConfigMaps.
@@ -515,6 +519,18 @@ func (mgr *SettingsManager) GetAppInstanceLabelKey() (string, error) {
return label, nil
}
func (mgr *SettingsManager) GetPasswordPattern() (string, error) {
argoCDCM, err := mgr.getConfigMap()
if err != nil {
return "", err
}
label := argoCDCM.Data[settingsPasswordPatternKey]
if label == "" {
return common.PasswordPatten, nil
}
return label, nil
}
func (mgr *SettingsManager) GetConfigManagementPlugins() ([]v1alpha1.ConfigManagementPlugin, error) {
argoCDCM, err := mgr.getConfigMap()
if err != nil {
@@ -1039,6 +1055,10 @@ func updateSettingsFromConfigMap(settings *ArgoCDSettings, argoCDCM *apiv1.Confi
} else {
settings.UserSessionDuration = time.Hour * 24
}
settings.PasswordPattern = argoCDCM.Data[settingsPasswordPatternKey]
if settings.PasswordPattern == "" {
settings.PasswordPattern = common.PasswordPatten
}
}
// validateExternalURL ensures the external URL that is set on the configmap is valid