From 6141fd88e58654266933339d8a28e9e74cb12177 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Thu, 31 Aug 2023 22:05:01 +1000 Subject: [PATCH 1/7] Update PR and issue templates. --- .github/ISSUE_TEMPLATE/bug-report.yml | 37 +++------------------- .github/ISSUE_TEMPLATE/feature-request.yml | 6 ++-- .github/PULL_REQUEST_TEMPLATE.yml | 27 ++++++++-------- 3 files changed, 21 insertions(+), 49 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index f0711ea7..0a2654e2 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -9,45 +9,18 @@ body: value: | Thanks for taking the time to fill out this bug report! - - type: textarea - id: project-version - attributes: - label: Project version - description: What version of this project are you using? - validations: - required: true - - type: textarea id: describe-bug attributes: label: Describe the bug - description: A clear and concise description of what the bug is. + description: A clear and concise description of what the bug is, including steps to reproduce it and the expected behaviour. validations: required: true - type: textarea - id: reproduction-steps + id: additional-information attributes: - label: Reproduction steps - description: Steps to reproduce the behavior - value: | - 1. - 2. - 3. - ... + label: Additional information + description: Add any other information such as version details for Educates, Kubernetes, Docker and the host operating system. validations: - required: true - - - type: textarea - id: expected-behavior - attributes: - label: Expected behavior - description: A clear and concise description of what you expected to happen. - validations: - required: true - - - type: textarea - id: additional-context - attributes: - label: Additional context - description: Add any other context about the problem here. + required: false diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index b2e4e293..b2cb06a7 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -29,9 +29,9 @@ body: required: false - type: textarea - id: additional-context + id: additional-information attributes: - label: Additional context - description: Add any other context or screenshots about the feature request here. + label: Additional information + description: Add any other information relevant to the feature request here. validations: required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.yml b/.github/PULL_REQUEST_TEMPLATE.yml index b033d7be..5bcb8dce 100644 --- a/.github/PULL_REQUEST_TEMPLATE.yml +++ b/.github/PULL_REQUEST_TEMPLATE.yml @@ -10,31 +10,30 @@ body: Please note that as per our contribution guidelines, unless the pull request is for a simple typo correction or obvious bug fix, it's recommended to initiate a discussion by first raising an issue. This - enables us to assess proposed modifications and ascertain whether they - necessitate adjustments to the core platform or if there's a more - effective approach to achieve the desired outcome without making - modifications. + enables us to assess proposed changes and evaluate whether a change to + the core platform is really needed, or if there's a more effective + approach to achieve the desired outcome without making the changes. - type: textarea - id: related-issues + id: change-summary attributes: - label: Related issue(s) for this pull request - description: Link(s) to the issues this pull request is addressing. + label: Summary of the changes being made by this pull request + description: An overview of the changes you've made and why they are necessary. validations: required: true - type: textarea - id: change-summary + id: related-issues attributes: - label: Summary of the changes being made by this pull request - description: An overview of the changes you've made and why they are necessary. + label: Related issue(s) for this pull request + description: Link(s) to the GitHub issues this pull request is addressing. validations: - required: true + required: false - type: textarea - id: additional-context + id: additional-information attributes: - label: Additional context - description: Add any other context or screenshots related to the changes here. + label: Additional information + description: Add any other information related to the changes. validations: required: false From 868027ee52f9b0158745628c95d3eaeeac5846b7 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Thu, 31 Aug 2023 22:08:10 +1000 Subject: [PATCH 2/7] Rely on single copyright in notice file to better align to CNCF recommendations. --- client-programs/cmd/educates/main.go | 2 - client-programs/pkg/cluster/cluster.go | 2 - client-programs/pkg/cluster/kindcluster.go | 2 - .../pkg/cmd/admin_cluster_cmd_group.go | 2 - .../pkg/cmd/admin_cluster_create_cmd.go | 2 - .../pkg/cmd/admin_cluster_delete_cmd.go | 2 - .../pkg/cmd/admin_cluster_start_cmd.go | 2 - .../pkg/cmd/admin_cluster_stop_cmd.go | 2 - client-programs/pkg/cmd/admin_cmd_group.go | 2 - .../pkg/cmd/admin_config_cmd_group.go | 2 - .../pkg/cmd/admin_config_edit_cmd.go | 2 - .../pkg/cmd/admin_config_reset_cmd.go | 2 - .../pkg/cmd/admin_config_view_cmd.go | 2 - .../pkg/cmd/admin_platform_cmd_group.go | 2 - .../pkg/cmd/admin_platform_config_cmd.go | 2 - .../pkg/cmd/admin_platform_delete_cmd.go | 2 - .../pkg/cmd/admin_platform_deploy_cmd.go | 2 - .../pkg/cmd/admin_registry_cmd_group.go | 2 - .../pkg/cmd/admin_registry_delete_cmd.go | 2 - .../pkg/cmd/admin_registry_deploy_cmd.go | 2 - .../pkg/cmd/admin_resolver_cmd_group.go | 2 - .../pkg/cmd/admin_resolver_delete_cmd.go | 2 - .../pkg/cmd/admin_resolver_deploy_cmd.go | 2 - .../pkg/cmd/admin_secrets_add_cmd.go | 2 - .../pkg/cmd/admin_secrets_cmd_group.go | 2 - .../pkg/cmd/admin_secrets_export_cmd.go | 2 - .../pkg/cmd/admin_secrets_import_cmd.go | 2 - .../pkg/cmd/admin_secrets_list_cmd.go | 2 - .../pkg/cmd/admin_secrets_remove_cmd.go | 2 - .../pkg/cmd/admin_secrets_sync_cmd.go | 2 - .../pkg/cmd/admin_services_cmd_group.go | 2 - .../pkg/cmd/admin_services_config_cmd.go | 2 - .../pkg/cmd/admin_services_delete_cmd.go | 2 - .../pkg/cmd/admin_services_deploy_cmd.go | 2 - client-programs/pkg/cmd/cluster_cmd_group.go | 2 - .../pkg/cmd/cluster_portal_cmd_group.go | 2 - .../pkg/cmd/cluster_portal_create_cmd.go | 2 - .../pkg/cmd/cluster_portal_delete_cmd.go | 2 - .../pkg/cmd/cluster_portal_list_cmd.go | 2 - .../pkg/cmd/cluster_portal_open_cmd.go | 2 - .../pkg/cmd/cluster_portal_password_cmd.go | 2 - .../pkg/cmd/cluster_session_cmd_group.go | 2 - .../pkg/cmd/cluster_session_extend_cmd.go | 2 - .../pkg/cmd/cluster_session_list_cmd.go | 2 - .../pkg/cmd/cluster_session_status_cmd.go | 2 - .../pkg/cmd/cluster_session_terminate_cmd.go | 2 - .../pkg/cmd/cluster_workshop_cmd_group.go | 2 - .../pkg/cmd/cluster_workshop_delete_cmd.go | 2 - .../pkg/cmd/cluster_workshop_deploy_cmd.go | 2 - .../pkg/cmd/cluster_workshop_list_cmd.go | 2 - .../pkg/cmd/cluster_workshop_request_cmd.go | 2 - .../pkg/cmd/cluster_workshop_serve_cmd.go | 2 - .../pkg/cmd/cluster_workshop_update_cmd.go | 2 - client-programs/pkg/cmd/docker_cmd_group.go | 2 - .../pkg/cmd/docker_extension_backend_cmd.go | 108 ++++++++++++++++++ .../pkg/cmd/docker_extension_cmd_group.go | 32 ++++++ .../pkg/cmd/docker_workshop_cmd_group.go | 2 - .../pkg/cmd/docker_workshop_delete_cmd.go | 2 - .../pkg/cmd/docker_workshop_deploy_cmd.go | 2 - .../pkg/cmd/docker_workshop_list_cmd.go | 2 - .../pkg/cmd/docker_workshop_logs.go | 2 - .../pkg/cmd/docker_workshop_open_cmd.go | 2 - client-programs/pkg/cmd/educates_cmd_group.go | 2 - client-programs/pkg/cmd/package_docs.go | 2 - client-programs/pkg/cmd/project_cmd_group.go | 2 - .../pkg/cmd/project_docs_cmd_group.go | 2 - .../pkg/cmd/project_docs_open_cmd.go | 2 - client-programs/pkg/cmd/project_info.go | 2 - .../pkg/cmd/project_version_cmd.go | 2 - client-programs/pkg/cmd/template_cmd_group.go | 2 - client-programs/pkg/cmd/template_list_cmd.go | 2 - client-programs/pkg/cmd/tunnel_cmd_group.go | 2 - client-programs/pkg/cmd/tunnel_connect_cmd.go | 2 - client-programs/pkg/cmd/workshop_cmd_group.go | 2 - .../pkg/cmd/workshop_export_cmd.go | 2 - client-programs/pkg/cmd/workshop_new_cmd.go | 2 - .../pkg/cmd/workshop_publish_cmd.go | 2 - client-programs/pkg/config/host.go | 2 - .../pkg/config/installationconfig.go | 2 - client-programs/pkg/operators/operators.go | 2 - client-programs/pkg/registry/registry.go | 2 - client-programs/pkg/renderer/hugo.go | 2 - client-programs/pkg/resolver/resolver.go | 2 - client-programs/pkg/services/services.go | 2 - client-programs/pkg/templates/internal.go | 2 - 85 files changed, 140 insertions(+), 166 deletions(-) create mode 100644 client-programs/pkg/cmd/docker_extension_backend_cmd.go create mode 100644 client-programs/pkg/cmd/docker_extension_cmd_group.go diff --git a/client-programs/cmd/educates/main.go b/client-programs/cmd/educates/main.go index b1d85d8d..ba28c779 100644 --- a/client-programs/cmd/educates/main.go +++ b/client-programs/cmd/educates/main.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - /* Command line client for Educates. */ diff --git a/client-programs/pkg/cluster/cluster.go b/client-programs/pkg/cluster/cluster.go index 12152416..2ec891b8 100644 --- a/client-programs/pkg/cluster/cluster.go +++ b/client-programs/pkg/cluster/cluster.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cluster import ( diff --git a/client-programs/pkg/cluster/kindcluster.go b/client-programs/pkg/cluster/kindcluster.go index 3cd9987a..64542742 100644 --- a/client-programs/pkg/cluster/kindcluster.go +++ b/client-programs/pkg/cluster/kindcluster.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cluster import ( diff --git a/client-programs/pkg/cmd/admin_cluster_cmd_group.go b/client-programs/pkg/cmd/admin_cluster_cmd_group.go index d8809364..d87db6e4 100644 --- a/client-programs/pkg/cmd/admin_cluster_cmd_group.go +++ b/client-programs/pkg/cmd/admin_cluster_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_cluster_create_cmd.go b/client-programs/pkg/cmd/admin_cluster_create_cmd.go index a97dcbee..a23b46f4 100644 --- a/client-programs/pkg/cmd/admin_cluster_create_cmd.go +++ b/client-programs/pkg/cmd/admin_cluster_create_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_cluster_delete_cmd.go b/client-programs/pkg/cmd/admin_cluster_delete_cmd.go index 275485d2..5fb4ae4c 100644 --- a/client-programs/pkg/cmd/admin_cluster_delete_cmd.go +++ b/client-programs/pkg/cmd/admin_cluster_delete_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_cluster_start_cmd.go b/client-programs/pkg/cmd/admin_cluster_start_cmd.go index 51aa8837..fb3051ad 100644 --- a/client-programs/pkg/cmd/admin_cluster_start_cmd.go +++ b/client-programs/pkg/cmd/admin_cluster_start_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_cluster_stop_cmd.go b/client-programs/pkg/cmd/admin_cluster_stop_cmd.go index e13bc943..103c7a06 100644 --- a/client-programs/pkg/cmd/admin_cluster_stop_cmd.go +++ b/client-programs/pkg/cmd/admin_cluster_stop_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_cmd_group.go b/client-programs/pkg/cmd/admin_cmd_group.go index ed7d0399..152a428a 100644 --- a/client-programs/pkg/cmd/admin_cmd_group.go +++ b/client-programs/pkg/cmd/admin_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_config_cmd_group.go b/client-programs/pkg/cmd/admin_config_cmd_group.go index 39f4cec0..2ffbb6ec 100644 --- a/client-programs/pkg/cmd/admin_config_cmd_group.go +++ b/client-programs/pkg/cmd/admin_config_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_config_edit_cmd.go b/client-programs/pkg/cmd/admin_config_edit_cmd.go index b44e1be7..839d83f0 100644 --- a/client-programs/pkg/cmd/admin_config_edit_cmd.go +++ b/client-programs/pkg/cmd/admin_config_edit_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_config_reset_cmd.go b/client-programs/pkg/cmd/admin_config_reset_cmd.go index 6cb5fc4c..39a571d2 100644 --- a/client-programs/pkg/cmd/admin_config_reset_cmd.go +++ b/client-programs/pkg/cmd/admin_config_reset_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_config_view_cmd.go b/client-programs/pkg/cmd/admin_config_view_cmd.go index d5499848..511956d6 100644 --- a/client-programs/pkg/cmd/admin_config_view_cmd.go +++ b/client-programs/pkg/cmd/admin_config_view_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_platform_cmd_group.go b/client-programs/pkg/cmd/admin_platform_cmd_group.go index 6cd54e69..9ee52205 100644 --- a/client-programs/pkg/cmd/admin_platform_cmd_group.go +++ b/client-programs/pkg/cmd/admin_platform_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_platform_config_cmd.go b/client-programs/pkg/cmd/admin_platform_config_cmd.go index bfd7239b..bd39bb31 100644 --- a/client-programs/pkg/cmd/admin_platform_config_cmd.go +++ b/client-programs/pkg/cmd/admin_platform_config_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_platform_delete_cmd.go b/client-programs/pkg/cmd/admin_platform_delete_cmd.go index a846699c..137bcad6 100644 --- a/client-programs/pkg/cmd/admin_platform_delete_cmd.go +++ b/client-programs/pkg/cmd/admin_platform_delete_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_platform_deploy_cmd.go b/client-programs/pkg/cmd/admin_platform_deploy_cmd.go index 26ede5fd..eca2a4f8 100644 --- a/client-programs/pkg/cmd/admin_platform_deploy_cmd.go +++ b/client-programs/pkg/cmd/admin_platform_deploy_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_registry_cmd_group.go b/client-programs/pkg/cmd/admin_registry_cmd_group.go index 993c1810..3ba7545a 100644 --- a/client-programs/pkg/cmd/admin_registry_cmd_group.go +++ b/client-programs/pkg/cmd/admin_registry_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_registry_delete_cmd.go b/client-programs/pkg/cmd/admin_registry_delete_cmd.go index 9ae63b24..da0b6544 100644 --- a/client-programs/pkg/cmd/admin_registry_delete_cmd.go +++ b/client-programs/pkg/cmd/admin_registry_delete_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_registry_deploy_cmd.go b/client-programs/pkg/cmd/admin_registry_deploy_cmd.go index bde0fd3f..7bfe3f70 100644 --- a/client-programs/pkg/cmd/admin_registry_deploy_cmd.go +++ b/client-programs/pkg/cmd/admin_registry_deploy_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_resolver_cmd_group.go b/client-programs/pkg/cmd/admin_resolver_cmd_group.go index 81d76309..56a98477 100644 --- a/client-programs/pkg/cmd/admin_resolver_cmd_group.go +++ b/client-programs/pkg/cmd/admin_resolver_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_resolver_delete_cmd.go b/client-programs/pkg/cmd/admin_resolver_delete_cmd.go index 7bfd2575..f5ab1376 100644 --- a/client-programs/pkg/cmd/admin_resolver_delete_cmd.go +++ b/client-programs/pkg/cmd/admin_resolver_delete_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_resolver_deploy_cmd.go b/client-programs/pkg/cmd/admin_resolver_deploy_cmd.go index 5018bb3b..97864f76 100644 --- a/client-programs/pkg/cmd/admin_resolver_deploy_cmd.go +++ b/client-programs/pkg/cmd/admin_resolver_deploy_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_secrets_add_cmd.go b/client-programs/pkg/cmd/admin_secrets_add_cmd.go index 175f47df..d5e9bc3b 100644 --- a/client-programs/pkg/cmd/admin_secrets_add_cmd.go +++ b/client-programs/pkg/cmd/admin_secrets_add_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_secrets_cmd_group.go b/client-programs/pkg/cmd/admin_secrets_cmd_group.go index 73f857e7..47bff1e9 100644 --- a/client-programs/pkg/cmd/admin_secrets_cmd_group.go +++ b/client-programs/pkg/cmd/admin_secrets_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_secrets_export_cmd.go b/client-programs/pkg/cmd/admin_secrets_export_cmd.go index 7aea7435..b10e3bbf 100644 --- a/client-programs/pkg/cmd/admin_secrets_export_cmd.go +++ b/client-programs/pkg/cmd/admin_secrets_export_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_secrets_import_cmd.go b/client-programs/pkg/cmd/admin_secrets_import_cmd.go index 7ea6bd51..85bad3e3 100644 --- a/client-programs/pkg/cmd/admin_secrets_import_cmd.go +++ b/client-programs/pkg/cmd/admin_secrets_import_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_secrets_list_cmd.go b/client-programs/pkg/cmd/admin_secrets_list_cmd.go index e21e84e7..b73ebd3e 100644 --- a/client-programs/pkg/cmd/admin_secrets_list_cmd.go +++ b/client-programs/pkg/cmd/admin_secrets_list_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_secrets_remove_cmd.go b/client-programs/pkg/cmd/admin_secrets_remove_cmd.go index bcdcaf8d..29c04c2f 100644 --- a/client-programs/pkg/cmd/admin_secrets_remove_cmd.go +++ b/client-programs/pkg/cmd/admin_secrets_remove_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_secrets_sync_cmd.go b/client-programs/pkg/cmd/admin_secrets_sync_cmd.go index 8f441d01..be7b4707 100644 --- a/client-programs/pkg/cmd/admin_secrets_sync_cmd.go +++ b/client-programs/pkg/cmd/admin_secrets_sync_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_services_cmd_group.go b/client-programs/pkg/cmd/admin_services_cmd_group.go index 60a03294..471add78 100644 --- a/client-programs/pkg/cmd/admin_services_cmd_group.go +++ b/client-programs/pkg/cmd/admin_services_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_services_config_cmd.go b/client-programs/pkg/cmd/admin_services_config_cmd.go index 19fbc06b..3c7480b3 100644 --- a/client-programs/pkg/cmd/admin_services_config_cmd.go +++ b/client-programs/pkg/cmd/admin_services_config_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_services_delete_cmd.go b/client-programs/pkg/cmd/admin_services_delete_cmd.go index d54cadb8..079e0056 100644 --- a/client-programs/pkg/cmd/admin_services_delete_cmd.go +++ b/client-programs/pkg/cmd/admin_services_delete_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/admin_services_deploy_cmd.go b/client-programs/pkg/cmd/admin_services_deploy_cmd.go index 87dcde2b..09c5e0c2 100644 --- a/client-programs/pkg/cmd/admin_services_deploy_cmd.go +++ b/client-programs/pkg/cmd/admin_services_deploy_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_cmd_group.go b/client-programs/pkg/cmd/cluster_cmd_group.go index 111209a8..a2b732cf 100644 --- a/client-programs/pkg/cmd/cluster_cmd_group.go +++ b/client-programs/pkg/cmd/cluster_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_portal_cmd_group.go b/client-programs/pkg/cmd/cluster_portal_cmd_group.go index 2d2bf070..b13c460f 100644 --- a/client-programs/pkg/cmd/cluster_portal_cmd_group.go +++ b/client-programs/pkg/cmd/cluster_portal_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_portal_create_cmd.go b/client-programs/pkg/cmd/cluster_portal_create_cmd.go index df4be678..826d617f 100644 --- a/client-programs/pkg/cmd/cluster_portal_create_cmd.go +++ b/client-programs/pkg/cmd/cluster_portal_create_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_portal_delete_cmd.go b/client-programs/pkg/cmd/cluster_portal_delete_cmd.go index 730a7bf4..db876e92 100644 --- a/client-programs/pkg/cmd/cluster_portal_delete_cmd.go +++ b/client-programs/pkg/cmd/cluster_portal_delete_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_portal_list_cmd.go b/client-programs/pkg/cmd/cluster_portal_list_cmd.go index cfac70eb..f551043e 100644 --- a/client-programs/pkg/cmd/cluster_portal_list_cmd.go +++ b/client-programs/pkg/cmd/cluster_portal_list_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_portal_open_cmd.go b/client-programs/pkg/cmd/cluster_portal_open_cmd.go index cee315d7..ea0f32d8 100644 --- a/client-programs/pkg/cmd/cluster_portal_open_cmd.go +++ b/client-programs/pkg/cmd/cluster_portal_open_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_portal_password_cmd.go b/client-programs/pkg/cmd/cluster_portal_password_cmd.go index aba18034..c7cdfa0c 100644 --- a/client-programs/pkg/cmd/cluster_portal_password_cmd.go +++ b/client-programs/pkg/cmd/cluster_portal_password_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_session_cmd_group.go b/client-programs/pkg/cmd/cluster_session_cmd_group.go index 84ab2819..8fb98977 100644 --- a/client-programs/pkg/cmd/cluster_session_cmd_group.go +++ b/client-programs/pkg/cmd/cluster_session_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_session_extend_cmd.go b/client-programs/pkg/cmd/cluster_session_extend_cmd.go index 571d6602..db4637ee 100644 --- a/client-programs/pkg/cmd/cluster_session_extend_cmd.go +++ b/client-programs/pkg/cmd/cluster_session_extend_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_session_list_cmd.go b/client-programs/pkg/cmd/cluster_session_list_cmd.go index f0f0f1aa..06b14501 100644 --- a/client-programs/pkg/cmd/cluster_session_list_cmd.go +++ b/client-programs/pkg/cmd/cluster_session_list_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_session_status_cmd.go b/client-programs/pkg/cmd/cluster_session_status_cmd.go index 24a1a1f6..ce181006 100644 --- a/client-programs/pkg/cmd/cluster_session_status_cmd.go +++ b/client-programs/pkg/cmd/cluster_session_status_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_session_terminate_cmd.go b/client-programs/pkg/cmd/cluster_session_terminate_cmd.go index 2e7b8e82..37b86629 100644 --- a/client-programs/pkg/cmd/cluster_session_terminate_cmd.go +++ b/client-programs/pkg/cmd/cluster_session_terminate_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_workshop_cmd_group.go b/client-programs/pkg/cmd/cluster_workshop_cmd_group.go index 2c18f0b3..a7c708a3 100644 --- a/client-programs/pkg/cmd/cluster_workshop_cmd_group.go +++ b/client-programs/pkg/cmd/cluster_workshop_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_workshop_delete_cmd.go b/client-programs/pkg/cmd/cluster_workshop_delete_cmd.go index 31afb7d4..b0eb4ce6 100644 --- a/client-programs/pkg/cmd/cluster_workshop_delete_cmd.go +++ b/client-programs/pkg/cmd/cluster_workshop_delete_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_workshop_deploy_cmd.go b/client-programs/pkg/cmd/cluster_workshop_deploy_cmd.go index a33f1143..61d0609b 100644 --- a/client-programs/pkg/cmd/cluster_workshop_deploy_cmd.go +++ b/client-programs/pkg/cmd/cluster_workshop_deploy_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_workshop_list_cmd.go b/client-programs/pkg/cmd/cluster_workshop_list_cmd.go index 2396db15..7fa20baa 100644 --- a/client-programs/pkg/cmd/cluster_workshop_list_cmd.go +++ b/client-programs/pkg/cmd/cluster_workshop_list_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_workshop_request_cmd.go b/client-programs/pkg/cmd/cluster_workshop_request_cmd.go index 57e3d3e7..8bd4c5ea 100644 --- a/client-programs/pkg/cmd/cluster_workshop_request_cmd.go +++ b/client-programs/pkg/cmd/cluster_workshop_request_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_workshop_serve_cmd.go b/client-programs/pkg/cmd/cluster_workshop_serve_cmd.go index b9182920..a2d2698c 100644 --- a/client-programs/pkg/cmd/cluster_workshop_serve_cmd.go +++ b/client-programs/pkg/cmd/cluster_workshop_serve_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/cluster_workshop_update_cmd.go b/client-programs/pkg/cmd/cluster_workshop_update_cmd.go index 0db67be0..85130723 100644 --- a/client-programs/pkg/cmd/cluster_workshop_update_cmd.go +++ b/client-programs/pkg/cmd/cluster_workshop_update_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/docker_cmd_group.go b/client-programs/pkg/cmd/docker_cmd_group.go index 3d996cb2..a04ce6a6 100644 --- a/client-programs/pkg/cmd/docker_cmd_group.go +++ b/client-programs/pkg/cmd/docker_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/docker_extension_backend_cmd.go b/client-programs/pkg/cmd/docker_extension_backend_cmd.go new file mode 100644 index 00000000..5c4a7f73 --- /dev/null +++ b/client-programs/pkg/cmd/docker_extension_backend_cmd.go @@ -0,0 +1,108 @@ +package cmd + +import ( + "context" + "fmt" + "net" + "net/http" + "os" + "os/signal" + "regexp" + "syscall" + + "github.com/pkg/errors" + "github.com/spf13/cobra" +) + +type DockerExtensionBackendOptions struct { + Socket string +} + +func (o *DockerExtensionBackendOptions) Run(p *ProjectInfo) error { + if o.Socket == "" { + return errors.New("invalid socket for HTTP server") + } + + router := http.NewServeMux() + + versionHandler := func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, p.Version) + } + + router.HandleFunc("/version", versionHandler) + + server := http.Server{ + Handler: router, + } + + // The socket string can either be of the form host:nnn, or it can be a file + // system path (absolute or relative). In the first case we start up a + // normal HTTP server accepting connections over an INET socket connection. + // In the second case connections will be accepted over a UNIX socket. + + inetRegexPattern := `^([a-zA-Z0-9.-]+):(\d+)$` + + match, err := regexp.MatchString(inetRegexPattern, o.Socket) + + if err != nil { + return errors.Wrap(err, "failed to perform regex match on socket") + } + + var listener net.Listener + + if match { + listener, err = net.Listen("tcp", o.Socket) + + if err != nil { + return errors.Wrap(err, "unable to create INET HTTP server socket") + } + } else { + listener, err = net.Listen("unix", o.Socket) + + if err != nil { + return errors.Wrap(err, "unable to create UNIX HTTP server socket") + } + + defer os.Remove(o.Socket) + } + + defer listener.Close() + + go func() { + server.Serve(listener) + }() + + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM) + <-sigChan + + err = server.Shutdown(context.TODO()) + + if err != nil { + return errors.Wrap(err, "failed to shutdown HTTP server") + } + + return nil +} + +func (p *ProjectInfo) NewDockerExtensionBackendCmd() *cobra.Command { + var o DockerExtensionBackendOptions + + var c = &cobra.Command{ + Args: cobra.NoArgs, + Use: "backend", + Short: "Docker desktop extension backend", + RunE: func(_ *cobra.Command, _ []string) error { return o.Run(p) }, + } + + c.Flags().StringVar( + &o.Socket, + "socket", + "", + "socket to listen on for HTTP server connections", + ) + + cobra.MarkFlagRequired(c.Flags(), "socket") + + return c +} diff --git a/client-programs/pkg/cmd/docker_extension_cmd_group.go b/client-programs/pkg/cmd/docker_extension_cmd_group.go new file mode 100644 index 00000000..e69d3454 --- /dev/null +++ b/client-programs/pkg/cmd/docker_extension_cmd_group.go @@ -0,0 +1,32 @@ +package cmd + +import ( + "github.com/spf13/cobra" + "k8s.io/kubectl/pkg/util/templates" +) + +func (p *ProjectInfo) NewDockerExtensionCmdGroup() *cobra.Command { + var c = &cobra.Command{ + Use: "extension", + Short: "Docker desktop extension", + } + + // Use a command group as it allows us to dictate the order in which they + // are displayed in the help message, as otherwise they are displayed in + // sort order. + + commandGroups := templates.CommandGroups{ + { + Message: "Available Commands:", + Commands: []*cobra.Command{ + p.NewDockerExtensionBackendCmd(), + }, + }, + } + + commandGroups.Add(c) + + templates.ActsAsRootCommand(c, []string{"options"}, commandGroups...) + + return c +} diff --git a/client-programs/pkg/cmd/docker_workshop_cmd_group.go b/client-programs/pkg/cmd/docker_workshop_cmd_group.go index 3abd8ecb..f31f8f81 100644 --- a/client-programs/pkg/cmd/docker_workshop_cmd_group.go +++ b/client-programs/pkg/cmd/docker_workshop_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/docker_workshop_delete_cmd.go b/client-programs/pkg/cmd/docker_workshop_delete_cmd.go index 75488f41..ba24d55a 100644 --- a/client-programs/pkg/cmd/docker_workshop_delete_cmd.go +++ b/client-programs/pkg/cmd/docker_workshop_delete_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/docker_workshop_deploy_cmd.go b/client-programs/pkg/cmd/docker_workshop_deploy_cmd.go index b2b6c2da..7fbb09f6 100644 --- a/client-programs/pkg/cmd/docker_workshop_deploy_cmd.go +++ b/client-programs/pkg/cmd/docker_workshop_deploy_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/docker_workshop_list_cmd.go b/client-programs/pkg/cmd/docker_workshop_list_cmd.go index 1cfe04f1..100fb802 100644 --- a/client-programs/pkg/cmd/docker_workshop_list_cmd.go +++ b/client-programs/pkg/cmd/docker_workshop_list_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/docker_workshop_logs.go b/client-programs/pkg/cmd/docker_workshop_logs.go index 682c883b..b73f0013 100644 --- a/client-programs/pkg/cmd/docker_workshop_logs.go +++ b/client-programs/pkg/cmd/docker_workshop_logs.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/docker_workshop_open_cmd.go b/client-programs/pkg/cmd/docker_workshop_open_cmd.go index ce2d3e05..b86d7780 100644 --- a/client-programs/pkg/cmd/docker_workshop_open_cmd.go +++ b/client-programs/pkg/cmd/docker_workshop_open_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/educates_cmd_group.go b/client-programs/pkg/cmd/educates_cmd_group.go index c31ee558..69fa2a72 100644 --- a/client-programs/pkg/cmd/educates_cmd_group.go +++ b/client-programs/pkg/cmd/educates_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/package_docs.go b/client-programs/pkg/cmd/package_docs.go index 28aa216e..6aaf7855 100644 --- a/client-programs/pkg/cmd/package_docs.go +++ b/client-programs/pkg/cmd/package_docs.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - /* Commands for Cobra based command line tools. */ diff --git a/client-programs/pkg/cmd/project_cmd_group.go b/client-programs/pkg/cmd/project_cmd_group.go index fda4b95c..31317b05 100644 --- a/client-programs/pkg/cmd/project_cmd_group.go +++ b/client-programs/pkg/cmd/project_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/project_docs_cmd_group.go b/client-programs/pkg/cmd/project_docs_cmd_group.go index 41acaa17..ec200109 100644 --- a/client-programs/pkg/cmd/project_docs_cmd_group.go +++ b/client-programs/pkg/cmd/project_docs_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/project_docs_open_cmd.go b/client-programs/pkg/cmd/project_docs_open_cmd.go index 15c9633b..7de7198a 100644 --- a/client-programs/pkg/cmd/project_docs_open_cmd.go +++ b/client-programs/pkg/cmd/project_docs_open_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/project_info.go b/client-programs/pkg/cmd/project_info.go index 72605d49..6e9d0f0e 100644 --- a/client-programs/pkg/cmd/project_info.go +++ b/client-programs/pkg/cmd/project_info.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd /* diff --git a/client-programs/pkg/cmd/project_version_cmd.go b/client-programs/pkg/cmd/project_version_cmd.go index 5b30206d..79a9e697 100644 --- a/client-programs/pkg/cmd/project_version_cmd.go +++ b/client-programs/pkg/cmd/project_version_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/template_cmd_group.go b/client-programs/pkg/cmd/template_cmd_group.go index 5d20ec34..19d47744 100644 --- a/client-programs/pkg/cmd/template_cmd_group.go +++ b/client-programs/pkg/cmd/template_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/template_list_cmd.go b/client-programs/pkg/cmd/template_list_cmd.go index 09b76ddd..e19ff2ce 100644 --- a/client-programs/pkg/cmd/template_list_cmd.go +++ b/client-programs/pkg/cmd/template_list_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/tunnel_cmd_group.go b/client-programs/pkg/cmd/tunnel_cmd_group.go index 6b72a09e..fd8c86b4 100644 --- a/client-programs/pkg/cmd/tunnel_cmd_group.go +++ b/client-programs/pkg/cmd/tunnel_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/tunnel_connect_cmd.go b/client-programs/pkg/cmd/tunnel_connect_cmd.go index 551b8581..f5330ad3 100644 --- a/client-programs/pkg/cmd/tunnel_connect_cmd.go +++ b/client-programs/pkg/cmd/tunnel_connect_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/workshop_cmd_group.go b/client-programs/pkg/cmd/workshop_cmd_group.go index f0f6bfa7..9bbd53c1 100644 --- a/client-programs/pkg/cmd/workshop_cmd_group.go +++ b/client-programs/pkg/cmd/workshop_cmd_group.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/workshop_export_cmd.go b/client-programs/pkg/cmd/workshop_export_cmd.go index 535b1647..f4c0beed 100644 --- a/client-programs/pkg/cmd/workshop_export_cmd.go +++ b/client-programs/pkg/cmd/workshop_export_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/workshop_new_cmd.go b/client-programs/pkg/cmd/workshop_new_cmd.go index 2a60791c..89ffe10f 100644 --- a/client-programs/pkg/cmd/workshop_new_cmd.go +++ b/client-programs/pkg/cmd/workshop_new_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/cmd/workshop_publish_cmd.go b/client-programs/pkg/cmd/workshop_publish_cmd.go index a1b738a3..7f4de0ed 100644 --- a/client-programs/pkg/cmd/workshop_publish_cmd.go +++ b/client-programs/pkg/cmd/workshop_publish_cmd.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package cmd import ( diff --git a/client-programs/pkg/config/host.go b/client-programs/pkg/config/host.go index 416acbff..fe278d90 100644 --- a/client-programs/pkg/config/host.go +++ b/client-programs/pkg/config/host.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package config import ( diff --git a/client-programs/pkg/config/installationconfig.go b/client-programs/pkg/config/installationconfig.go index 5a038788..661124ff 100644 --- a/client-programs/pkg/config/installationconfig.go +++ b/client-programs/pkg/config/installationconfig.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package config import ( diff --git a/client-programs/pkg/operators/operators.go b/client-programs/pkg/operators/operators.go index 5a99b080..a0ed58c8 100644 --- a/client-programs/pkg/operators/operators.go +++ b/client-programs/pkg/operators/operators.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package operators import ( diff --git a/client-programs/pkg/registry/registry.go b/client-programs/pkg/registry/registry.go index 0751f889..aa06ec80 100644 --- a/client-programs/pkg/registry/registry.go +++ b/client-programs/pkg/registry/registry.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package registry import ( diff --git a/client-programs/pkg/renderer/hugo.go b/client-programs/pkg/renderer/hugo.go index 3822a894..d111c522 100644 --- a/client-programs/pkg/renderer/hugo.go +++ b/client-programs/pkg/renderer/hugo.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package renderer import ( diff --git a/client-programs/pkg/resolver/resolver.go b/client-programs/pkg/resolver/resolver.go index 8db89e06..6a40849c 100644 --- a/client-programs/pkg/resolver/resolver.go +++ b/client-programs/pkg/resolver/resolver.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package resolver import ( diff --git a/client-programs/pkg/services/services.go b/client-programs/pkg/services/services.go index 51107698..12e5455f 100644 --- a/client-programs/pkg/services/services.go +++ b/client-programs/pkg/services/services.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package services import ( diff --git a/client-programs/pkg/templates/internal.go b/client-programs/pkg/templates/internal.go index f9dc8905..0ba355cc 100644 --- a/client-programs/pkg/templates/internal.go +++ b/client-programs/pkg/templates/internal.go @@ -1,5 +1,3 @@ -// Copyright 2022-2023 The Educates Authors. - package templates import ( From ba22d783af319c367d445ddab3b2af75a5a3f1ed Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Thu, 31 Aug 2023 22:19:23 +1000 Subject: [PATCH 3/7] Add note about not including personal or company copyright notices. --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0830f502..4e224742 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,8 +51,8 @@ Before submitting your pull request, we advise you to use the following: ### Pull Request Checklist -1. Check if your code changes will pass any code linting checks and unit tests which may be used by the project. -2. Ensure your commit messages are descriptive. We follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). Be sure to include any related GitHub issue references in the commit message. See [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) for referencing issues and commits. +1. Ensure that you have not included any personal or company copyright notices in any changes. This project relies on a single copyright assignment in the [NOTICE](NOTICE) file with attribution to "The Educates Authors". +2. Ensure your commit messages are descriptive. We aim to follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). Be sure to include any related GitHub issue references in the commit message. See [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) for referencing issues and commits. 3. Check the commits and commits messages and ensure they are free from typos. ## Reporting Bugs and Creating Issues From e66f34dfda18f3b90a620eb88bafa5bbf81e6cc0 Mon Sep 17 00:00:00 2001 From: VMware GitHub Bot Date: Fri, 1 Sep 2023 09:35:10 +0800 Subject: [PATCH 4/7] Add CONTRIBUTING_CLA.md template --- CONTRIBUTING_CLA.md | 75 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 CONTRIBUTING_CLA.md diff --git a/CONTRIBUTING_CLA.md b/CONTRIBUTING_CLA.md new file mode 100644 index 00000000..06f4f5c6 --- /dev/null +++ b/CONTRIBUTING_CLA.md @@ -0,0 +1,75 @@ +# Contributing to educates-training-platform + +_NOTE: This is a template document that requires editing before it is ready to use!_ + +We welcome contributions from the community and first want to thank you for taking the time to contribute! + +Please familiarize yourself with the [Code of Conduct](https://github.com/vmware/.github/blob/main/CODE_OF_CONDUCT.md) before contributing. + +Before you start working with educates-training-platform, please read and sign our Contributor License Agreement [CLA](https://cla.vmware.com/cla/1/preview). If you wish to contribute code and you have not signed our contributor license agreement (CLA), our bot will prompt you to do so when you open a Pull Request. For any questions about the CLA process, please refer to our [FAQ]([https://cla.vmware.com/faq](https://cla.vmware.com/faq)). + +## Ways to contribute + +We welcome many different types of contributions and not all of them need a Pull request. Contributions may include: + +* New features and proposals +* Documentation +* Bug fixes +* Issue Triage +* Answering questions and giving feedback +* Helping to onboard new contributors +* Other related activities + +## Getting started + +_TO BE EDITED: This section explains how to build the project from source, including Development Environment Setup, Build, Run and Test._ + +_Provide information about how someone can find your project, get set up, build the code, test it, and submit a pull request successfully without having to ask any questions. Also include common errors people run into, or useful scripts they should run._ + +_List any tests that the contributor should run / or testing processes to follow before submitting. Describe any automated and manual checks performed by reviewers._ + + +## Contribution Flow + +This is a rough outline of what a contributor's workflow looks like: + +* Make a fork of the repository within your GitHub account +* Create a topic branch in your fork from where you want to base your work +* Make commits of logical units +* Make sure your commit messages are with the proper format, quality and descriptiveness (see below) +* Push your changes to the topic branch in your fork +* Create a pull request containing that commit + +We follow the GitHub workflow and you can find more details on the [GitHub flow documentation](https://docs.github.com/en/get-started/quickstart/github-flow). + + +### Pull Request Checklist + +Before submitting your pull request, we advise you to use the following: + +1. Check if your code changes will pass both code linting checks and unit tests. +2. Ensure your commit messages are descriptive. We follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). Be sure to include any related GitHub issue references in the commit message. See [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) for referencing issues and commits. +3. Check the commits and commits messages and ensure they are free from typos. + +## Reporting Bugs and Creating Issues + +For specifics on what to include in your report, please follow the guidelines in the issue and pull request templates when available. + +_TO BE EDITED: Add additional information if needed._ + + +## Ask for Help + +_TO BE EDITED: Provide information about the channels you use to communicate (i.e. Slack, IRC, Discord, etc)_ + +The best way to reach us with a question when contributing is to ask on: + +* The original GitHub issue +* The developer mailing list +* Our Slack channel + + +## Additional Resources + +_Optional_ + From 02217f428390f2baf0914df3d3409c910e53b080 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Fri, 1 Sep 2023 11:47:17 +1000 Subject: [PATCH 5/7] Fix up broken hyperlink for CLA FAQ. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4e224742..5c5c8538 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ Please familiarize yourself with the [Code of Conduct](CODE_OF_CONDUCT.md) befor ## Contributor License Agreement -Before you start working with Educates, please read our Contributor License Agreement [CLA](https://cla.vmware.com/cla/1/preview). If you wish to contribute code and you have not signed our contributor license agreement (CLA), our bot will update the issue and walk you through the process when you open your first pull request. For any questions about the CLA process, please refer to our [FAQ]([https://cla.vmware.com/faq](https://cla.vmware.com/faq)). +Before you start working with Educates, please read our Contributor License Agreement [CLA](https://cla.vmware.com/cla/1/preview). If you wish to contribute code and you have not signed our contributor license agreement (CLA), our bot will update the issue and walk you through the process when you open your first pull request. For any questions about the CLA process, please refer to our [FAQ](https://cla.vmware.com/faq). ## Getting started From bbedf02bc73028684df7811e356a83b557582022 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Fri, 1 Sep 2023 14:39:19 +1000 Subject: [PATCH 6/7] Disable sending of data to backend while doing synchronization after browser refresh. --- .../gateway/src/backend/modules/terminals.ts | 3 +++ .../gateway/src/frontend/scripts/educates.ts | 27 +++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/workshop-images/base-environment/opt/gateway/src/backend/modules/terminals.ts b/workshop-images/base-environment/opt/gateway/src/backend/modules/terminals.ts index 0469fddc..ed02a002 100644 --- a/workshop-images/base-environment/opt/gateway/src/backend/modules/terminals.ts +++ b/workshop-images/base-environment/opt/gateway/src/backend/modules/terminals.ts @@ -35,6 +35,7 @@ interface HelloPacketArgs { interface OutboundDataPacketArgs { data: string + sync: boolean seq: number } @@ -87,6 +88,7 @@ class TerminalSession { let args: OutboundDataPacketArgs = { data: data, + sync: false, seq: ++this.sequence } @@ -219,6 +221,7 @@ class TerminalSession { let args: OutboundDataPacketArgs = { data: data, + sync: true, seq: seq } diff --git a/workshop-images/base-environment/opt/gateway/src/frontend/scripts/educates.ts b/workshop-images/base-environment/opt/gateway/src/frontend/scripts/educates.ts index 7bd02460..f8dfebfe 100644 --- a/workshop-images/base-environment/opt/gateway/src/frontend/scripts/educates.ts +++ b/workshop-images/base-environment/opt/gateway/src/frontend/scripts/educates.ts @@ -149,6 +149,7 @@ interface HelloPacketArgs { interface InboundDataPacketArgs { data: string + sync: boolean seq: number } @@ -179,6 +180,7 @@ class TerminalSession { private sensor: ResizeSensor private socket: WebSocket private started: Date + private synced: boolean private sequence: number private blocked: boolean private buffer: BufferedDataBlock[] @@ -199,6 +201,8 @@ class TerminalSession { this.element = element this.endpoint = endpoint + + this.synced = false this.sequence = -1 this.blocked = true @@ -331,8 +335,13 @@ class TerminalSession { console.log("Connecting terminal", this.id) this.terminal.onData((data) => { - let args: OutboundDataPacketArgs = { data: data } - this.send_message(PacketType.DATA, args) + // Only send data through to the backend if the initial + // data synchronization has been completed. + + if (this.synced) { + let args: OutboundDataPacketArgs = { data: data } + this.send_message(PacketType.DATA, args) + } }) this.initiate_pings() @@ -415,6 +424,20 @@ class TerminalSession { this.sequence = args.seq + // If this was the initial synchronization packet when + // reconnecting due to a browser refresh then we need to + // enable sending of data through to backend. We don't + // initially pass data through when handling the initial + // data as that could result in spurious escape + // sequences being sent to the backend from replaying + // past data which would then sit there as pending input + // to the terminal when not the original application. + + if (args.sync) { + console.log("Synchronized terminal", this.id) + this.synced = true + } + break } case (PacketType.EXIT): { From e0b497a062118937e0c5d5dff01da4ba7b2f20a6 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Fri, 1 Sep 2023 14:42:37 +1000 Subject: [PATCH 7/7] Remove contributions file template added by CLA bot. --- CONTRIBUTING_CLA.md | 75 --------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 CONTRIBUTING_CLA.md diff --git a/CONTRIBUTING_CLA.md b/CONTRIBUTING_CLA.md deleted file mode 100644 index 06f4f5c6..00000000 --- a/CONTRIBUTING_CLA.md +++ /dev/null @@ -1,75 +0,0 @@ -# Contributing to educates-training-platform - -_NOTE: This is a template document that requires editing before it is ready to use!_ - -We welcome contributions from the community and first want to thank you for taking the time to contribute! - -Please familiarize yourself with the [Code of Conduct](https://github.com/vmware/.github/blob/main/CODE_OF_CONDUCT.md) before contributing. - -Before you start working with educates-training-platform, please read and sign our Contributor License Agreement [CLA](https://cla.vmware.com/cla/1/preview). If you wish to contribute code and you have not signed our contributor license agreement (CLA), our bot will prompt you to do so when you open a Pull Request. For any questions about the CLA process, please refer to our [FAQ]([https://cla.vmware.com/faq](https://cla.vmware.com/faq)). - -## Ways to contribute - -We welcome many different types of contributions and not all of them need a Pull request. Contributions may include: - -* New features and proposals -* Documentation -* Bug fixes -* Issue Triage -* Answering questions and giving feedback -* Helping to onboard new contributors -* Other related activities - -## Getting started - -_TO BE EDITED: This section explains how to build the project from source, including Development Environment Setup, Build, Run and Test._ - -_Provide information about how someone can find your project, get set up, build the code, test it, and submit a pull request successfully without having to ask any questions. Also include common errors people run into, or useful scripts they should run._ - -_List any tests that the contributor should run / or testing processes to follow before submitting. Describe any automated and manual checks performed by reviewers._ - - -## Contribution Flow - -This is a rough outline of what a contributor's workflow looks like: - -* Make a fork of the repository within your GitHub account -* Create a topic branch in your fork from where you want to base your work -* Make commits of logical units -* Make sure your commit messages are with the proper format, quality and descriptiveness (see below) -* Push your changes to the topic branch in your fork -* Create a pull request containing that commit - -We follow the GitHub workflow and you can find more details on the [GitHub flow documentation](https://docs.github.com/en/get-started/quickstart/github-flow). - - -### Pull Request Checklist - -Before submitting your pull request, we advise you to use the following: - -1. Check if your code changes will pass both code linting checks and unit tests. -2. Ensure your commit messages are descriptive. We follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). Be sure to include any related GitHub issue references in the commit message. See [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) for referencing issues and commits. -3. Check the commits and commits messages and ensure they are free from typos. - -## Reporting Bugs and Creating Issues - -For specifics on what to include in your report, please follow the guidelines in the issue and pull request templates when available. - -_TO BE EDITED: Add additional information if needed._ - - -## Ask for Help - -_TO BE EDITED: Provide information about the channels you use to communicate (i.e. Slack, IRC, Discord, etc)_ - -The best way to reach us with a question when contributing is to ask on: - -* The original GitHub issue -* The developer mailing list -* Our Slack channel - - -## Additional Resources - -_Optional_ -