Skip to content

Commit

Permalink
fix: add support for overwriting the UI extensions path
Browse files Browse the repository at this point in the history
via the environment variable ARGOCD_EXTENSIONS_SHARED_PATH

Signed-off-by: Vasile Groza <[email protected]>
  • Loading branch information
Vasile Groza committed Dec 3, 2024
1 parent aef4c5a commit c320c2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/developer-guide/extensions/ui-extensions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# UI Extensions

Argo CD web user interface can be extended with additional UI elements. Extensions should be delivered as a javascript file
in the `argocd-server` Pods that are placed in the `/tmp/extensions` directory and starts with `extension` prefix ( matches to `^extension(.*)\.js$` regex ).
in the `argocd-server` Pods that are placed in the `ARGOCD_EXTENSIONS_SHARED_PATH` directory with defaults to `/tmp/extensions` and starts with `extension` prefix ( matches to `^extension(.*)\.js$` regex ).

```
/tmp/extensions
Expand Down
3 changes: 2 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const (
maxConcurrentLoginRequestsCountEnv = "ARGOCD_MAX_CONCURRENT_LOGIN_REQUESTS_COUNT"
replicasCountEnv = "ARGOCD_API_SERVER_REPLICAS"
renewTokenKey = "renew-token"
extensionsSharedPathEnv = "ARGOCD_EXTENSIONS_SHARED_PATH"
)

// ErrNoSession indicates no auth token was supplied as part of a request
Expand Down Expand Up @@ -1100,7 +1101,7 @@ func (a *ArgoCDServer) newHTTPServer(ctx context.Context, port int, grpcWebHandl
registerDownloadHandlers(mux, "/download")

// Serve extensions
extensionsSharedPath := "/tmp/extensions/"
extensionsSharedPath := env.StringFromEnv(extensionsSharedPathEnv, "/tmp/extensions/")

var extensionsHandler http.Handler = http.HandlerFunc(func(writer http.ResponseWriter, _ *http.Request) {
a.serveExtensions(extensionsSharedPath, writer)
Expand Down

0 comments on commit c320c2e

Please sign in to comment.