Skip to content

Commit

Permalink
fix: add config partials for dynamic frontend plugins (#965)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Coufal <[email protected]>
  • Loading branch information
tumido authored Nov 23, 2023
1 parent 80499eb commit b01e55e
Show file tree
Hide file tree
Showing 28 changed files with 239 additions and 47 deletions.
2 changes: 0 additions & 2 deletions plugins/aap-backend/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
enabled:
aap: true
catalog:
providers:
aap:
Expand Down
17 changes: 9 additions & 8 deletions plugins/acr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ The Azure Container Registry (ACR) plugin displays information about your contai
```yaml
# app-config.yaml
proxy:
'/acr/api':
target: 'https://mycontainerregistry.azurecr.io/acr/v1/'
changeOrigin: true
headers:
# If you use Bearer Token for authorization, please replace the 'Basic' with 'Bearer' in the following line.
Authorization: 'Basic ${ACR_AUTH_TOKEN}'
# Change to "false" in case of using self hosted artifactory instance with a self-signed certificate
secure: true
endpoints:
'/acr/api':
target: 'https://mycontainerregistry.azurecr.io/acr/v1/'
changeOrigin: true
headers:
# If you use Bearer Token for authorization, please replace the 'Basic' with 'Bearer' in the following line.
Authorization: 'Basic ${ACR_AUTH_TOKEN}'
# Change to "false" in case of using self hosted artifactory instance with a self-signed certificate
secure: true
```
1. Set the authorization using one of the following options:
Expand Down
23 changes: 23 additions & 0 deletions plugins/acr/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
proxy:
endpoints:
'/acr/api':
target: ${ACR_URL}
changeOrigin: true
headers:
# If you use Bearer Token for authorization, please replace the 'Basic' with 'Bearer' in the following line.
Authorization: 'Bearer ${ACR_AUTH_TOKEN}'
# Change to "false" in case of using self hosted artifactory instance with a self-signed certificate
secure: true

dynamicPlugins:
frontend:
janus-idp.backstage-plugin-acr:
mountPoints:
- mountPoint: entity.page.image-registry/cards
importName: AcrPage
config:
layout:
gridColumn: 1 / -1
if:
anyOf:
- isAcrAvailable
3 changes: 2 additions & 1 deletion plugins/acr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
},
"files": [
"dist",
"dist-scalprum"
"dist-scalprum",
"app-config.janus-idp.yaml"
],
"repository": "github:janus-idp/backstage-plugins",
"keywords": [
Expand Down
6 changes: 6 additions & 0 deletions plugins/analytics-provider-segment/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
app:
analytics:
segment:
writeKey: ${SEGMENT_WRITE_KEY}
maskIP: true # prevents IP addresses from being sent if true
testMode: false # prevents data from being sent if true
3 changes: 2 additions & 1 deletion plugins/analytics-provider-segment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"files": [
"dist",
"dist-scalprum",
"config.d.ts"
"config.d.ts",
"app-config.janus-idp.yaml"
],
"configSchema": "config.d.ts"
}
13 changes: 7 additions & 6 deletions plugins/jfrog-artifactory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ The Jfrog Artifactory plugin displays information about your container images wi

```yaml title="app-config.yaml"
proxy:
'/jfrog-artifactory/api':
target: 'http://<hostname>:8082' # or https://<customer>.jfrog.io
headers:
# Authorization: 'Bearer <YOUR TOKEN>'
# Change to "false" in case of using self hosted artifactory instance with a self-signed certificate
secure: true
endpoints:
'/jfrog-artifactory/api':
target: 'http://<hostname>:8082' # or https://<customer>.jfrog.io
headers:
# Authorization: 'Bearer <YOUR TOKEN>'
# Change to "false" in case of using self hosted artifactory instance with a self-signed certificate
secure: true
```
1. Enable the **JFROG ARTIFACTORY** tab on the entity view page in `packages/app/src/components/catalog/EntityPage.tsx`:
Expand Down
21 changes: 21 additions & 0 deletions plugins/jfrog-artifactory/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
proxy:
endpoints:
'/jfrog-artifactory/api':
target: ${ARTIFACTORY_URL}
headers:
Authorization: Bearer ${ARTIFACTORY_TOKEN}
# Change to "false" in case of using self hosted artifactory instance with a self-signed certificate
secure: true

dynamicPlugins:
frontend:
janus-idp.backstage-plugin-jfrog-artifactory:
mountPoints:
- mountPoint: entity.page.image-registry/cards
importName: JfrogArtifactoryPage
config:
layout:
gridColumn: 1 / -1
if:
anyOf:
- isJfrogArtifactoryAvailable
3 changes: 2 additions & 1 deletion plugins/jfrog-artifactory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"files": [
"dist",
"dist-scalprum",
"config.d.ts"
"config.d.ts",
"app-config.janus-idp.yaml"
],
"configSchema": "config.d.ts",
"repository": "github:janus-idp/backstage-plugins",
Expand Down
2 changes: 1 addition & 1 deletion plugins/matomo-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function main() {
4. Now you need to add in app-config.yaml file
```
```yaml
matomo:
apiToken: ${MATOMO_API_TOKEN}
apiUrl: ${MATOMO_API_URL}
Expand Down
3 changes: 3 additions & 0 deletions plugins/matomo-backend/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
matomo:
apiToken: ${MATOMO_API_TOKEN}
apiUrl: ${MATOMO_API_URL}
3 changes: 3 additions & 0 deletions plugins/matomo/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
matomo:
frontendBaseUrl: ${MATOMO_INSTANCE_URL}
contactUsLink: mailto:${MATOMO_CONTACT_EMAIL}
3 changes: 2 additions & 1 deletion plugins/matomo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"files": [
"dist",
"dist-scalprum",
"config.d.ts"
"config.d.ts",
"app-config.janus-idp.yaml"
],
"repository": "github:janus-idp/backstage-plugins",
"keywords": [
Expand Down
19 changes: 10 additions & 9 deletions plugins/nexus-repository-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ The Nexus Repository Manager plugin displays the information about your build ar

```yaml title="app-config.yaml"
proxy:
'/nexus-repository-manager':
target: 'https://<NEXUS_REPOSITORY_MANAGER_URL>'
headers:
X-Requested-With: 'XMLHttpRequest'
# Uncomment the following line to access a private Nexus Repository Manager using a token
# Authorization: 'Bearer <YOUR TOKEN>'
changeOrigin: true
# Change to "false" in case of using self hosted Nexus Repository Manager instance with a self-signed certificate
secure: true
endpoints:
'/nexus-repository-manager':
target: 'https://<NEXUS_REPOSITORY_MANAGER_URL>'
headers:
X-Requested-With: 'XMLHttpRequest'
# Uncomment the following line to access a private Nexus Repository Manager using a token
# Authorization: 'Bearer <YOUR TOKEN>'
changeOrigin: true
# Change to "false" in case of using self hosted Nexus Repository Manager instance with a self-signed certificate
secure: true
```
1. Optional: Change the base URL of Nexus Repository Manager proxy as follows:
Expand Down
27 changes: 27 additions & 0 deletions plugins/nexus-repository-manager/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
proxy:
endpoints:
'/nexus-repository-manager':
target: ${NEXUS_REPOSITORY_MANAGER_URL}
headers:
X-Requested-With: 'XMLHttpRequest'
# Uncomment the following line to access a private Nexus Repository Manager using a token
# Authorization: 'Bearer <NEXUS_REPOSITORY_MANAGER_TOKEN>'
changeOrigin: true
# Change to "false" in case of using self hosted Nexus Repository Manager instance with a self-signed certificate
secure: true

nexusRepositoryManager:
experimentalAnnotations: true

dynamicPlugins:
frontend:
janus-idp.backstage-plugin-nexus-repository-manager:
mountPoints:
- mountPoint: entity.page.image-registry/cards
importName: NexusRepositoryManagerPage
config:
layout:
gridColumn: 1 / -1
if:
anyOf:
- isNexusRepositoryManagerAvailable
3 changes: 2 additions & 1 deletion plugins/nexus-repository-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"files": [
"dist",
"dist-scalprum",
"config.d.ts"
"config.d.ts",
"app-config.janus-idp.yaml"
],
"configSchema": "config.d.ts",
"repository": "github:janus-idp/backstage-plugins",
Expand Down
2 changes: 0 additions & 2 deletions plugins/ocm-backend/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
enabled:
ocm: true
catalog:
providers:
ocm:
Expand Down
39 changes: 39 additions & 0 deletions plugins/ocm/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
dynamicPlugins:
frontend:
janus-idp.backstage-plugin-ocm:
appIcons:
- name: ocmIcon
importName: OcmIcon
dynamicRoutes:
- path: /ocm
importName: OcmPage
menuItem:
icon: ocmIcon
text: Clusters
mountPoints:
- mountPoint: entity.page.overview/context
importName: ClusterContextProvider
- mountPoint: entity.page.overview/cards
importName: ClusterAvailableResourceCard
config:
layout:
gridColumnEnd:
lg: 'span 4'
md: 'span 6'
xs: 'span 12'
if:
allOf:
- isKind: resource
- isType: kubernetes-cluster
- mountPoint: entity.page.overview/cards
importName: ClusterInfoCard
config:
layout:
gridColumnEnd:
lg: 'span 4'
md: 'span 6'
xs: 'span 12'
if:
allOf:
- isKind: resource
- isType: kubernetes-cluster
3 changes: 2 additions & 1 deletion plugins/ocm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
},
"files": [
"dist",
"dist-scalprum"
"dist-scalprum",
"app-config.janus-idp.yaml"
],
"repository": "github:janus-idp/backstage-plugins",
"keywords": [
Expand Down
17 changes: 9 additions & 8 deletions plugins/openshift-image-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ yarn workspace app add @janus-idp/backstage-plugin-openshift-image-registry

```yaml title="app-config.yaml"
proxy:
'/openshift-image-registry/api':
target: <URL where k8s control plane for OpenShift cluster is running>
headers:
X-Requested-With: 'XMLHttpRequest'
Authorization: Bearer <TOKEN>
changeOrigin: true
# Change to "false" in case of using self hosted OpenShift cluster with a self-signed certificate
secure: true
endpoints:
'/openshift-image-registry/api':
target: <URL where k8s control plane for OpenShift cluster is running>
headers:
X-Requested-With: 'XMLHttpRequest'
Authorization: Bearer <TOKEN>
changeOrigin: true
# Change to "false" in case of using self hosted OpenShift cluster with a self-signed certificate
secure: true
```
2. Enable an additional sidebar-item on the app sidebar in the `packages/app/src/components/Root/Root.tsx` file:
Expand Down
20 changes: 20 additions & 0 deletions plugins/openshift-image-registry/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
proxy:
endpoints:
'/openshift-image-registry/api':
target: ${OCP_API_ENDPOINT}
headers:
X-Requested-With: 'XMLHttpRequest'
Authorization: Bearer ${OCP_API_TOKEN}
changeOrigin: true
# Change to "false" in case of using self hosted OpenShift cluster with a self-signed certificate
secure: true

dynamicPlugins:
frontend:
janus-idp.backstage-plugin-acr:
dynamicRoutes:
- path: /openshift-image-registry
importName: OpenshiftImageRegistryPage
menuItem:
icon: dashboard
text: Image Registry
3 changes: 2 additions & 1 deletion plugins/openshift-image-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"files": [
"dist",
"dist-scalprum",
"config.d.ts"
"config.d.ts",
"app-config.janus-idp.yaml"
],
"configSchema": "config.d.ts"
}
12 changes: 12 additions & 0 deletions plugins/quay/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dynamicPlugins:
frontend:
janus-idp.backstage-plugin-quay:
mountPoints:
- mountPoint: entity.page.image-registry/cards
importName: QuayPage
config:
layout:
gridColumn: 1 / -1
if:
anyOf:
- isQuayAvailable
7 changes: 5 additions & 2 deletions plugins/tekton/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,13 @@ The Tekton plugin enables you to visualize the `PipelineRun` resources available
```tsx title="packages/app/src/components/catalog/EntityPage.tsx"
/* highlight-add-next-line */
import { TektonCI, isTektonCIAvailable } from '@janus-idp/backstage-plugin-tekton';
import {
isTektonCIAvailable,
TektonCI,
} from '@janus-idp/backstage-plugin-tekton';

const cicdContent = (
<EntitySwitch>>
<EntitySwitch>
{/* ... */}
{/* highlight-add-start */}
<EntitySwitch.Case if={isTektonCIAvailable}>
Expand Down
12 changes: 12 additions & 0 deletions plugins/tekton/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dynamicPlugins:
frontend:
janus-idp.backstage-plugin-tekton:
mountPoints:
- mountPoint: entity.page.ci/cards
importName: TektonCI
config:
layout:
gridColumn: '1 / -1'
if:
allOf:
- isTektonCIAvailable
3 changes: 2 additions & 1 deletion plugins/tekton/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
},
"files": [
"dist",
"dist-scalprum"
"dist-scalprum",
"app-config.janus-idp.yaml"
],
"repository": "github:janus-idp/backstage-plugins",
"keywords": [
Expand Down
Loading

0 comments on commit b01e55e

Please sign in to comment.