name: "Web terminal default"

input:
  devworkspace:
    components:
      - name: dev
        container:
          memoryLimit: "256Mi"
          image: quay.io/wto/web-terminal-tooling:latest
          args: ["tail", "-f", "/dev/null"]
          env:
            - name: PS1
              value: \[\e[34m\]>\[\e[m\]\[\e[33m\]>\[\e[m\]
      - name: web-terminal
        plugin:
          kubernetes:
            name: web-terminal
            namespace: devworkspace-plugins
  devworkspaceResources:
    web-terminal:
      kind: DevWorkspaceTemplate
      apiVersion: workspace.devfile.io/v1alpha2
      metadata:
        name: web-terminal
        annotations:
          "controller.devfile.io/allow-import-from": "*"
        labels:
          "devworkspace.devfile.io/editor-name": "web-terminal"
      spec:
        components:
          - name: web-terminal
            container:
              image: quay.io/eclipse/che-machine-exec:nightly
              command: ["/go/bin/che-machine-exec",
                        "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)",
                        "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)",
                        "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)",
                        "--use-bearer-token",
                        "--use-tls"]
              endpoints:
                - name: web-terminal
                  targetPort: 4444
                  attributes:
                    protocol: http
                    type: main
                    discoverable: "false"
                    secure: "true"
              env:
                - name: USE_BEARER_TOKEN
                  value: "true"

output:
  devworkspace:
    components:
      - name: dev
        container:
          image: quay.io/wto/web-terminal-tooling:latest
          memoryLimit: 256Mi
          args: ["tail", "-f", "/dev/null"]
          env:
            - value: '\[\e[34m\]>\[\e[m\]\[\e[33m\]>\[\e[m\]'
              name: PS1
      - name: web-terminal
        attributes:
          controller.devfile.io/imported-by: "web-terminal"
        container:
          image: quay.io/eclipse/che-machine-exec:nightly
          command: ["/go/bin/che-machine-exec",
                    "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)",
                    "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)",
                    "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)",
                    "--use-bearer-token",
                    "--use-tls"]
          endpoints:
            - name: web-terminal
              targetPort: 4444
              attributes:
                protocol: http
                type: main
                discoverable: "false"
                secure: "true"
          env:
            - name: USE_BEARER_TOKEN
              value: "true"
