diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 000000000..3ff41f764 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,92 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/platform-dependent/bug-report.yml +# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms + +name: Bug report +description: Report a problem with the code or documentation in this repository. +labels: + - "type: imperfection" +body: + - type: textarea + id: description + attributes: + label: Describe the problem + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: To reproduce + description: Provide the specific set of steps we can follow to reproduce the problem. + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected behavior + description: What would you expect to happen after following those instructions? + validations: + required: true + - type: input + id: project-version + attributes: + label: Arduino Create Agent version + description: | + Which version of Arduino Create Agent are you using? + _This should be the most recent version available._ + validations: + required: true + - type: dropdown + id: os + attributes: + label: Operating system + description: Which operating system(s) are you using on your computer? + multiple: true + options: + - Windows + - Linux + - macOS + - N/A + validations: + required: true + - type: input + id: os-version + attributes: + label: Operating system version + description: Which version of the operating system are you using on your computer? + validations: + required: true + - type: input + id: browser + attributes: + label: Browser + description: | + Which web browser(s) are you using on your computer? + (e.g., Chrome, Safari) + validations: + required: true + - type: input + id: browser-version + attributes: + label: Browser version + description: Which version of the web browser are you using on your computer? + validations: + required: true + - type: textarea + id: additional + attributes: + label: Additional context + description: Add any additional information here. + validations: + required: false + - type: checkboxes + id: checklist + attributes: + label: Issue checklist + description: Please double-check that you have done each of the following things before submitting the issue. + options: + - label: I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-create-agent/issues?q=) + required: true + - label: I verified the problem still occurs when using the latest version + required: true + - label: My report contains all necessary details + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..8301c8bbc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,17 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/template-choosers/general/config.yml +# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser + +blank_issues_enabled: true +contact_links: + - name: Install Arduino Create Agent + url: https://create.arduino.cc/getting-started/plugin/welcome + about: This guided installer provides easy installation. + - name: Learn about using this project + url: https://github.com/arduino/arduino-create-agent#readme + about: Detailed usage documentation is available here. + - name: Support request + url: https://forum.arduino.cc/c/software/editor/134 + about: We can help you out on the Arduino Forum! + - name: Discuss development work on the project + url: https://groups.google.com/a/arduino.cc/g/developers + about: Arduino Developers Mailing List diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 000000000..b9a47d376 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,87 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/platform-dependent/bug-report.yml +# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms + +name: Feature request +description: Suggest an enhancement to this project. +labels: + - "type: enhancement" +body: + - type: textarea + id: description + attributes: + label: Describe the request + validations: + required: true + - type: textarea + id: current + attributes: + label: Describe the current behavior + description: | + What is the current behavior of Arduino Create Agent in relation to your request? + How can we reproduce that behavior? + validations: + required: true + - type: input + id: project-version + attributes: + label: Arduino Create Agent version + description: | + Which version of Arduino Create Agent are you using? + _This should be the most recent version available._ + validations: + required: true + - type: dropdown + id: os + attributes: + label: Operating system + description: Which operating system(s) are you using on your computer? + multiple: true + options: + - Windows + - Linux + - macOS + - N/A + validations: + required: true + - type: input + id: os-version + attributes: + label: Operating system version + description: Which version of the operating system are you using on your computer? + validations: + required: true + - type: input + id: browser + attributes: + label: Browser + description: | + Which web browser(s) are you using on your computer? + (e.g., Chrome, Safari) + validations: + required: true + - type: input + id: browser-version + attributes: + label: Browser version + description: Which version of the web browser are you using on your computer? + validations: + required: true + - type: textarea + id: additional + attributes: + label: Additional context + description: Add any additional information here. + validations: + required: false + - type: checkboxes + id: checklist + attributes: + label: Issue checklist + description: Please double-check that you have done each of the following things before submitting the issue. + options: + - label: I searched for previous requests in [the issue tracker](https://github.com/arduino/arduino-create-agent/issues?q=) + required: true + - label: I verified the feature was still missing when using the latest version + required: true + - label: My request contains all necessary details + required: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..a596de422 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 +updates: +- package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + ignore: + - dependency-name: go.bug.st/serial + versions: + - 1.1.2 + - 1.1.3 + - dependency-name: github.com/sirupsen/logrus + versions: + - 1.7.1 + labels: + - "topic: infrastructure" +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + labels: + - "topic: infrastructure" diff --git a/.github/label-configuration-files/labels.yml b/.github/label-configuration-files/labels.yml new file mode 100644 index 000000000..2942afd63 --- /dev/null +++ b/.github/label-configuration-files/labels.yml @@ -0,0 +1,11 @@ +# Used by the "Sync Labels" workflow +# See: https://github.com/Financial-Times/github-label-sync#label-config-file + +# Added by the "Close stale issues" workflow. +- name: "conclusion: stale" + color: "940404" + description: Closed due to lack of activity +# Added by the "Close stale issues" workflow. +- name: "status: stale" + color: "940404" + description: Pending closure due to lack of activity diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..9075f7dfb --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,20 @@ +**Please check if the PR fulfills these requirements** + +- [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-create-agent/pulls) + before creating one) +- [ ] Tests for the changes have been added (for bug fixes / features) + +* **What kind of change does this PR introduce?** + + +- **What is the current behavior?** + + +* **What is the new behavior?** + + +- **Does this PR introduce a breaking change?** + + +* **Other information**: + diff --git a/.github/workflows/check-certificates.yml b/.github/workflows/check-certificates.yml new file mode 100644 index 000000000..694792dcd --- /dev/null +++ b/.github/workflows/check-certificates.yml @@ -0,0 +1,154 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-certificates.md +name: Check Certificates + +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/check-certificates.ya?ml" + pull_request: + paths: + - ".github/workflows/check-certificates.ya?ml" + schedule: + # Run every 10 hours. + - cron: "0 */10 * * *" + workflow_dispatch: + repository_dispatch: + +env: + # Begin notifications when there are less than this many days remaining before expiration. + EXPIRATION_WARNING_PERIOD: 30 + +jobs: + check-certificates: + name: ${{ matrix.certificate.identifier }} + # Only run when the workflow will have access to the certificate secrets. + if: > + (github.event_name != 'pull_request' && github.repository == 'arduino/arduino-create-agent') || + (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'arduino/arduino-create-agent') + runs-on: ubuntu-22.04 + + strategy: + fail-fast: false + + matrix: + certificate: + # Additional certificate definitions can be added to this list. + - identifier: macOS signing certificate # Text used to identify certificate in notifications. + certificate-secret: INSTALLER_CERT_MAC_P12 # Name of the secret that contains the certificate. + password-secret: INSTALLER_CERT_MAC_PASSWORD # Name of the secret that contains the certificate password. + type: pkcs12 + - identifier: Windows signing certificate + certificate-secret: INSTALLER_CERT_WINDOWS_CER + # The password for the Windows certificate is not needed, because its not a container, but a single certificate. + type: x509 + + steps: + - name: Set certificate path environment variable + run: | + # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable + echo "CERTIFICATE_PATH=${{ runner.temp }}/certificate.p12" >> "$GITHUB_ENV" + + - name: Decode certificate + env: + CERTIFICATE: ${{ secrets[matrix.certificate.certificate-secret] }} + run: | + echo "${{ env.CERTIFICATE }}" | base64 --decode > "${{ env.CERTIFICATE_PATH }}" + + - name: Verify certificate + env: + CERTIFICATE_PASSWORD: ${{ secrets[matrix.certificate.password-secret] }} + run: | + ( + openssl ${{ matrix.certificate.type }} \ + -in "${{ env.CERTIFICATE_PATH }}" \ + -noout -passin env:CERTIFICATE_PASSWORD \ + -legacy + ) || ( + echo "::error::Verification of ${{ matrix.certificate.identifier }} failed!!!" + exit 1 + ) + + - name: Slack notification of certificate verification failure + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.TEAM_CREATE_CHANNEL_SLACK_WEBHOOK }} + SLACK_MESSAGE: | + :warning::warning::warning::warning: + WARNING: ${{ github.repository }} ${{ matrix.certificate.identifier }} verification failed!!! + :warning::warning::warning::warning: + SLACK_COLOR: danger + MSG_MINIMAL: true + uses: rtCamp/action-slack-notify@v2 + + - name: Get days remaining before certificate expiration date + env: + CERTIFICATE_PASSWORD: ${{ secrets[matrix.certificate.password-secret] }} + id: get-days-before-expiration + run: | + if [[ ${{ matrix.certificate.type }} == "pkcs12" ]]; then + EXPIRATION_DATE="$( + ( + openssl pkcs12 \ + -in ${{ env.CERTIFICATE_PATH }} \ + -clcerts \ + -nodes \ + -passin env:CERTIFICATE_PASSWORD \ + -legacy + ) | ( + openssl x509 \ + -noout \ + -enddate + ) | ( + grep \ + --max-count=1 \ + --only-matching \ + --perl-regexp \ + 'notAfter=(\K.*)' + ) + )" + elif [[ ${{ matrix.certificate.type }} == "x509" ]]; then + EXPIRATION_DATE="$( + ( + openssl x509 \ + -in ${{ env.CERTIFICATE_PATH }} \ + -noout \ + -enddate + ) | ( + grep \ + --max-count=1 \ + --only-matching \ + --perl-regexp \ + 'notAfter=(\K.*)' + ) + )" + fi + + DAYS_BEFORE_EXPIRATION="$((($(date --utc --date="$EXPIRATION_DATE" +%s) - $(date --utc +%s)) / 60 / 60 / 24))" + + # Display the expiration information in the log. + echo "Certificate expiration date: $EXPIRATION_DATE" + echo "Days remaining before expiration: $DAYS_BEFORE_EXPIRATION" + + echo "days=$DAYS_BEFORE_EXPIRATION" >> $GITHUB_OUTPUT + + - name: Check if expiration notification period has been reached + id: check-expiration + run: | + if [[ ${{ steps.get-days-before-expiration.outputs.days }} -lt ${{ env.EXPIRATION_WARNING_PERIOD }} ]]; then + echo "::error::${{ matrix.certificate.identifier }} will expire in ${{ steps.get-days-before-expiration.outputs.days }} days!!!" + exit 1 + fi + + - name: Slack notification of pending certificate expiration + # Don't send spurious expiration notification if verification fails. + if: failure() && steps.check-expiration.outcome == 'failure' + env: + SLACK_WEBHOOK: ${{ secrets.TEAM_CREATE_CHANNEL_SLACK_WEBHOOK }} + SLACK_MESSAGE: | + :warning::warning::warning::warning: + WARNING: ${{ github.repository }} ${{ matrix.certificate.identifier }} will expire in ${{ steps.get-days-before-expiration.outputs.days }} days!!! + :warning::warning::warning::warning: + SLACK_COLOR: danger + MSG_MINIMAL: true + uses: rtCamp/action-slack-notify@v2 diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml new file mode 100644 index 000000000..417c525e5 --- /dev/null +++ b/.github/workflows/check-go-dependencies-task.yml @@ -0,0 +1,156 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md +name: Check Go Dependencies + +env: + # See: https://github.com/actions/setup-go/tree/v3#readme + GO_VERSION: "1.23" + +# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows +on: + create: + push: + paths: + - ".github/workflows/check-go-dependencies-task.ya?ml" + - ".licenses/**" + - ".licensed.json" + - ".licensed.ya?ml" + - "Taskfile.ya?ml" + - "**/.gitmodules" + - "**/go.mod" + - "**/go.sum" + pull_request: + paths: + - ".github/workflows/check-go-dependencies-task.ya?ml" + - ".licenses/**" + - ".licensed.json" + - ".licensed.ya?ml" + - "Taskfile.ya?ml" + - "**/.gitmodules" + - "**/go.mod" + - "**/go.sum" + schedule: + # Run periodically to catch breakage caused by external changes. + - cron: "0 8 * * WED" + workflow_dispatch: + repository_dispatch: + +jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. + if [[ + "${{ github.event_name }}" != "create" || + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "result=$RESULT" >> $GITHUB_OUTPUT + + check-cache: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + env: + CACHE_PATH: .licenses/ + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + # This is required to allow licensee/setup-licensed to install Licensed via Ruby gem. + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ruby # Install latest version + + - name: Install licensed + uses: licensee/setup-licensed@v1.3.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + version: 5.x + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Update dependencies license metadata cache + run: task --silent general:cache-dep-licenses + + - name: Check for outdated cache + id: diff + run: | + git add . + if ! git diff --cached --color --exit-code "${{ env.CACHE_PATH }}"; then + echo + echo "::error::Dependency license metadata out of sync. See: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md#metadata-cache" + exit 1 + fi + + # Some might find it convenient to have CI generate the cache rather than setting up for it locally + - name: Upload cache to workflow artifact + if: failure() && steps.diff.outcome == 'failure' + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + include-hidden-files: true + name: dep-licenses-cache + path: ${{ env.CACHE_PATH }} + + check-deps: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + # This is required to allow licensee/setup-licensed to install Licensed via Ruby gem. + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ruby # Install latest version + + - name: Install licensed + uses: licensee/setup-licensed@v1.3.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + version: 5.x + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Check for dependencies with unapproved licenses + run: task --silent general:check-dep-licenses diff --git a/.github/workflows/check-go-task.yml b/.github/workflows/check-go-task.yml new file mode 100644 index 000000000..21478d23e --- /dev/null +++ b/.github/workflows/check-go-task.yml @@ -0,0 +1,231 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-task.md +name: Check Go + +env: + # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax + GO_VERSION: "1.23" + +# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows +on: + create: + push: + paths: + - ".github/workflows/check-go-task.ya?ml" + - "Taskfile.ya?ml" + - "**/go.mod" + - "**/go.sum" + - "**.go" + pull_request: + paths: + - ".github/workflows/check-go-task.ya?ml" + - "Taskfile.ya?ml" + - "**/go.mod" + - "**/go.sum" + - "**.go" + schedule: + # Run periodically to catch breakage caused by external changes. + - cron: "0 7 * * WED" + workflow_dispatch: + repository_dispatch: + +jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. + if [[ + "${{ github.event_name }}" != "create" || + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "result=$RESULT" >> $GITHUB_OUTPUT + + check-errors: + name: check-errors (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + module: + # TODO: add paths of all Go modules here + - path: ./ + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Install Dependencies + run: sudo apt update && sudo apt install -y --no-install-recommends build-essential libgtk-3-dev libwebkit2gtk-4.1-0 libappindicator3-dev + + - name: Check for errors + env: + GO_MODULE_PATH: ${{ matrix.module.path }} + run: task go:vet + + check-outdated: + name: check-outdated (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + module: + # TODO: add paths of all Go modules here + - path: ./ + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Modernize usages of outdated APIs + env: + GO_MODULE_PATH: ${{ matrix.module.path }} + run: task go:fix + + - name: Check if any fixes were needed + run: git diff --color --exit-code + + check-style: + name: check-style (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + module: + # TODO: add paths of all Go modules here + - path: ./ + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Install golint + run: go install golang.org/x/lint/golint@latest + + - name: Check style + env: + GO_MODULE_PATH: ${{ matrix.module.path }} + run: task --silent go:lint + + check-formatting: + name: check-formatting (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + module: + # TODO: add paths of all Go modules here + - path: ./ + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Format code + env: + GO_MODULE_PATH: ${{ matrix.module.path }} + run: task go:format + + - name: Check formatting + run: git diff --color --exit-code + + check-config: + name: check-config (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + module: + # TODO: add paths of all Go modules here + - path: ./ + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Run go mod tidy + working-directory: ${{ matrix.module.path }} + run: go mod tidy + + - name: Check whether any tidying was needed + run: git diff --color --exit-code diff --git a/.github/workflows/check-license.yml b/.github/workflows/check-license.yml new file mode 100644 index 000000000..5a7ce5daf --- /dev/null +++ b/.github/workflows/check-license.yml @@ -0,0 +1,96 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-license.md +name: Check License + +env: + EXPECTED_LICENSE_FILENAME: LICENSE.txt + # SPDX identifier: https://spdx.org/licenses/ + EXPECTED_LICENSE_TYPE: AGPL-3.0 + +# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows +on: + create: + push: + paths: + - ".github/workflows/check-license.ya?ml" + # See: https://github.com/licensee/licensee/blob/master/docs/what-we-look-at.md#detecting-the-license-file + - "[cC][oO][pP][yY][iI][nN][gG]*" + - "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*" + - "[lL][iI][cC][eE][nN][cCsS][eE]*" + - "[oO][fF][lL]*" + - "[pP][aA][tT][eE][nN][tT][sS]*" + pull_request: + paths: + - ".github/workflows/check-license.ya?ml" + - "[cC][oO][pP][yY][iI][nN][gG]*" + - "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*" + - "[lL][iI][cC][eE][nN][cCsS][eE]*" + - "[oO][fF][lL]*" + - "[pP][aA][tT][eE][nN][tT][sS]*" + schedule: + # Run periodically to catch breakage caused by external changes. + - cron: "0 6 * * WED" + workflow_dispatch: + repository_dispatch: + +jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. + if [[ + "${{ github.event_name }}" != "create" || + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "result=$RESULT" >> $GITHUB_OUTPUT + + check-license: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ruby # Install latest version + + - name: Install licensee + run: gem install licensee + + - name: Check license file + run: | + EXIT_STATUS=0 + # See: https://github.com/licensee/licensee + LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)" + + DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')" + echo "Detected license file: $DETECTED_LICENSE_FILE" + if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then + echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $DETECTED_LICENSE_FILE doesn't match expected: $EXPECTED_LICENSE_FILENAME" + EXIT_STATUS=1 + fi + + DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')" + echo "Detected license type: $DETECTED_LICENSE_TYPE" + if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then + echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${EXPECTED_LICENSE_TYPE}\"" + EXIT_STATUS=1 + fi + + exit $EXIT_STATUS diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml new file mode 100644 index 000000000..06850e563 --- /dev/null +++ b/.github/workflows/close-stale-issues.yml @@ -0,0 +1,24 @@ +name: Close stale issues +on: + workflow_dispatch: + schedule: + - cron: '30 8 * * mon' + +permissions: + issues: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + stale-issue-message: 'This issue has been marked as stale because it has been open for more than 14 days with no activity. Remove stale label or comment, otherwise it will be closed in 7 days ' + stale-issue-label: 'status: stale' + close-issue-message: 'This issue has been closed becasue has been stale for more than 7 days. If you think this issue deserves some attention feel free to reopen it' + close-issue-label: 'conclusion: stale' + days-before-stale: 14 + days-before-close: 7 + days-before-pr-close: -1 + only-labels: 'status: waiting for information' + debug-only: false diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml new file mode 100644 index 000000000..89d5c2b45 --- /dev/null +++ b/.github/workflows/publish-go-tester-task.yml @@ -0,0 +1,157 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/publish-go-tester-task.md +name: Publish Tester Build + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + create: + push: + paths: + - ".github/workflows/publish-go-tester-task.ya?ml" + - "go.mod" + - "go.sum" + - "Taskfile.ya?ml" + - "DistTasks.ya?ml" + - "**.go" + - "icon/**" + - "config.ini" + - "manifest.xml" + pull_request: + paths: + - ".github/workflows/publish-go-tester-task.ya?ml" + - "go.mod" + - "go.sum" + - "Taskfile.ya?ml" + - "DistTasks.ya?ml" + - "**.go" + - "icon/**" + - "config.ini" + - "manifest.xml" + workflow_dispatch: + repository_dispatch: + +env: + PROJECT_NAME: arduino-cloud-agent + GO_VERSION: "1.23" + +jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. + if [[ \ + "${{ github.event_name }}" != "create" || \ + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "result=$RESULT" >> $GITHUB_OUTPUT + + #this job is heavily customized because the build is quite a bit different from other tooling team projects + build: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + + #use the strategy instead because we still use the native build + strategy: + matrix: + os: [ubuntu-22.04, windows-2019, macos-13] + arch: [-amd64] + include: + - os: windows-2019 + arch: -386 + + defaults: + run: + shell: bash + + runs-on: ${{ matrix.os }} + + steps: + - name: Set env vars + run: | + echo $(go env GOPATH)/bin >> $GITHUB_PATH + + - name: Disable EOL conversions + run: git config --global core.autocrlf false + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Build the Agent for linux + run: task go:build + if: runner.os == 'Linux' + + # the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28) + # rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable. + - name: Download tool to embed manifest in win binary + run: go install github.com/akavel/rsrc@latest + if: runner.os == 'Windows' + + # building the agent for win requires a different task because of an extra flag + - name: Build the Agent for win32 + env: + GOARCH: 386 # 32bit architecture (for support) + run: task go:build-win + if: runner.os == 'Windows' && matrix.arch == '-386' + + - name: Build the Agent for win64 + run: task go:build-win # GOARCH=amd64 by default on the runners + if: runner.os == 'Windows' && matrix.arch == '-amd64' + + - name: Build the Agent for macos amd 64 + env: + MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac + CGO_CFLAGS: -mmacosx-version-min=10.15 + CGO_LDFLAGS: -mmacosx-version-min=10.15 + run: | + task go:build + mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_amd64 + if: runner.os == 'macOS' + + - name: Build the Agent for macos arm 64 + env: + MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac + CGO_CFLAGS: -mmacosx-version-min=10.15 + CGO_LDFLAGS: -mmacosx-version-min=10.15 + GOARCH: arm64 + CGO_ENABLED: 1 + run: | + task go:build + mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_arm64 + if: runner.os == 'macOS' + + - name: Create universal macos executable + run: | + lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_amd64 ${{ env.PROJECT_NAME}}_arm64 + rm ${{ env.PROJECT_NAME}}_amd64 ${{ env.PROJECT_NAME}}_arm64 + if: runner.os == 'macOS' + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PROJECT_NAME}}-${{ matrix.os }}${{ matrix.arch }} + path: | + ${{ env.PROJECT_NAME}}* + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..12b3781ba --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,692 @@ +name: Release + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+*" + +permissions: + contents: write + id-token: write # This is required for requesting the JWT + +env: + # As defined by the Taskfile's PROJECT_NAME variable + PROJECT_NAME: arduino-cloud-agent + TARGET: "/CreateAgent/Stable/" + VERSION_TARGET: "arduino-create-static/agent-metadata/" + AWS_REGION: "us-east-1" # or https://github.com/aws/aws-cli/issues/5623 + KEYCHAIN: "sign.keychain" + KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret + GON_CONFIG_PATH: gon.config.hcl + INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12" + AC_USERNAME: ${{ secrets.AC_USERNAME }} # used by gon + AC_PASSWORD: ${{ secrets.AC_PASSWORD }} # used by gon + AC_PROVIDER: ${{ secrets.AC_PROVIDER }} # used by gon + # See: https://github.com/actions/setup-go/tree/v3#readme + GO_VERSION: "1.23" + +jobs: + # The build job is responsible for: configuring the environment, testing and compiling process + build: + outputs: + prerelease: ${{ steps.prerelease.outputs.IS_PRE }} + strategy: + matrix: + os: [ubuntu-22.04, windows-2019, macos-13] + arch: [amd64] + include: + - os: windows-2019 + arch: 386 + ext: ".exe" + - os: windows-2019 + ext: ".exe" + + defaults: + run: + shell: bash + + # by default disable CGO, it's not needed (except on macos) + env: + CGO_ENABLED: 0 + + runs-on: ${{ matrix.os }} + environment: production + + steps: + - name: Set env vars + run: | + echo "TAG_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV + echo $(go env GOPATH)/bin >> $GITHUB_PATH + + - name: Identify Prerelease + # This is a workaround while waiting for create-release action to implement auto pre-release based on tag + id: prerelease + run: | + curl -L -s https://github.com/fsaintjacques/semver-tool/archive/3.1.0.zip -o /tmp/3.1.0.zip + unzip -p /tmp/3.1.0.zip semver-tool-3.1.0/src/semver >/tmp/semver && chmod +x /tmp/semver + if [[ $(/tmp/semver get prerel ${GITHUB_REF/refs\/tags\//}) ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT; fi + + - name: Disable EOL conversions + run: git config --global core.autocrlf false + + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Go deps + run: go install github.com/sanbornm/go-selfupdate/...@latest + + - name: Install Taskfile + uses: arduino/setup-task@v2 + with: + version: "3.x" + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build the Agent for linux + run: task go:build + if: matrix.os == 'ubuntu-22.04' + + # the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28) + # rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable. + - name: Download tool to embed manifest in win binary + run: go install github.com/akavel/rsrc@latest + if: matrix.os == 'windows-2019' + + # building the agent for win requires a different task because of an extra flag + - name: Build the Agent for win32 + env: + GOARCH: 386 # 32bit architecture (for support) + run: task go:build-win + if: matrix.os == 'windows-2019' && matrix.arch == '386' + + - name: Build the Agent for win64 + run: task go:build-win # GOARCH=amd64 by default on the runners + if: matrix.os == 'windows-2019' && matrix.arch == 'amd64' + + - name: Build the Agent for macos amd64 + env: + CGO_ENABLED: 1 + MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac + CGO_CFLAGS: -mmacosx-version-min=10.15 + CGO_LDFLAGS: -mmacosx-version-min=10.15 + run: | + task go:build + mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64 + if: matrix.os == 'macos-13' + + - name: Build the Agent for macos arm64 + env: + CGO_ENABLED: 1 + MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac + CGO_CFLAGS: -mmacosx-version-min=10.15 + CGO_LDFLAGS: -mmacosx-version-min=10.15 + GOARCH: arm64 + run: | + task go:build + mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_arm64 + if: matrix.os == 'macos-13' + + - name: Create universal macos executable + run: | + lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64 ${{ env.PROJECT_NAME }}_arm64 + rm ${{ env.PROJECT_NAME }}_amd64 ${{ env.PROJECT_NAME }}_arm64 + if: matrix.os == 'macos-13' + + # this will create `public/` dir with compressed full bin (/-.gz) and a json file + - name: Create autoupdate files + run: go-selfupdate ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION} + if: matrix.arch != '386' && steps.prerelease.outputs.IS_PRE != 'true' + + - name: Copy autoupdate file for darwin-arm64 (m1 arch) + working-directory: public/ + run: | + cp darwin-amd64.json darwin-arm64.json + cp ${TAG_VERSION}/darwin-amd64.gz ${TAG_VERSION}/darwin-arm64.gz + if: matrix.os == 'macos-13' && steps.prerelease.outputs.IS_PRE != 'true' + + - name: Create autoupdate files for win32 + run: go-selfupdate -platform windows-${{ matrix.arch }} ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION} + if: matrix.arch == '386' && matrix.os == 'windows-2019' && steps.prerelease.outputs.IS_PRE != 'true' + + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + role-session-name: "github_${{ env.PROJECT_NAME }}" + aws-region: ${{ env.AWS_REGION }} + if: steps.prerelease.outputs.IS_PRE != 'true' + + - name: Upload autoupdate files to Arduino downloads servers + run: | + aws s3 sync public/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }} + if: steps.prerelease.outputs.IS_PRE != 'true' + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PROJECT_NAME }}-${{ matrix.os }}-${{ matrix.arch }} + path: | + ${{ env.PROJECT_NAME }}* + if-no-files-found: error + + create-macos-bundle: + needs: build + + # for now they are exaclty the same + strategy: + matrix: + arch: [amd64, arm64] + + runs-on: macos-13 + env: + EXE_PATH: "skel/ArduinoCloudAgent.app/Contents/MacOS/" + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: "bcmi-labs/arduino-create-agent-installer" # the repo which contains the bundle structure and icons + token: ${{ secrets.ARDUINO_CREATE_AGENT_CI_PAT }} + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ env.PROJECT_NAME }}-macos-13-amd64 # if we want to support darwin-arm64 in the future for real this has to change. + path: ${{ env.EXE_PATH }} + + - name: Remove placeholder file + run: rm -rf ${{ env.EXE_PATH }}.empty + + # zip artifacts do not mantain executable permission + - name: Make executable + run: chmod -v +x ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }} + + - name: Rename executable to Arduino_Cloud_Agent + run: mv -v ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }} ${{ env.EXE_PATH }}Arduino_Cloud_Agent + + - name: get year + run: echo "YEAR=$(date "+%Y")" >> $GITHUB_ENV + + - name: Generate Info.plist for MacOS + run: | + cat > skel/ArduinoCloudAgent.app/Contents/Info.plist <CFBundlePackageTypeAPPLCFBundleInfoDictionaryVersion6.0 + + CFBundleIconFile AppIcon.icns + + CFBundleName Arduino Cloud Agent + CFBundleExecutable Arduino_Cloud_Agent + CFBundleIdentifier create.arduino.cc + + CFBundleVersion ${GITHUB_REF##*/} + NSHumanReadableCopyright © Copyright ${{ env.YEAR }} Arduino LLC + CFBundleShortVersionString ${GITHUB_REF##*/} + LSUIElement + + NSPrincipalClassNSApplication + NSMainNibFileMainMenu + + + EOF + + - name: Tar bundle to keep permissions + run: tar -cvf ArduinoCloudAgent.app_${{ matrix.arch }}.tar -C skel/ . + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: ArduinoCloudAgent.app_${{ matrix.arch }} + path: ArduinoCloudAgent.app_${{ matrix.arch }}.tar + + # The notarize-macos job will download the macos bundle from the previous job, sign, notarize and re-upload it, uploading it also on s3 download servers for the autoupdate. + notarize-macos: + name: Notarize bundle + + # for now they are exaclty the same + strategy: + matrix: + arch: [amd64, arm64] + + runs-on: macos-13 + env: + GON_PATH: ${{ github.workspace }}/gon + needs: [build, create-macos-bundle] + environment: production + + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ArduinoCloudAgent.app_${{ matrix.arch }} + + - name: un-Tar bundle + run: tar -xvf ArduinoCloudAgent.app_${{ matrix.arch }}.tar + + - name: Import Code-Signing Certificates + run: | + echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}" + security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" + security default-keychain -s "${{ env.KEYCHAIN }}" + security unlock-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" + security import \ + "${{ env.INSTALLER_CERT_MAC_PATH }}" \ + -k "${{ env.KEYCHAIN }}" \ + -f pkcs12 \ + -A \ + -T "/usr/bin/codesign" \ + -P "${{ secrets.INSTALLER_CERT_MAC_PASSWORD }}" + security set-key-partition-list \ + -S apple-tool:,apple: \ + -s \ + -k "${{ env.KEYCHAIN_PASSWORD }}" \ + "${{ env.KEYCHAIN }}" + + - name: Install gon for code signing + uses: actions/checkout@v4 + with: + repository: darkvertex/gon #this fork has support for --deep notarization + path: ${{ env.GON_PATH }} + ref: deep_sign_support + + - name: Build gon + working-directory: ${{ env.GON_PATH }}/cmd/gon/ + run: | + ls -lah + go build + mv gon /usr/local/bin + + - name: Write gon config to file + # gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) + run: | + cat > "${{ env.GON_CONFIG_PATH }}" < "${{ env.GON_CONFIG_PATH }}" < darwin-${{ matrix.arch }}-bundle.json < /tmp/license.xml + + - name: Launch Bitrock installbuilder + run: ${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.installbuilder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} architecture=${{ matrix.arch }} + + - name: Generate archive + run: tar -czvf ArduinoCloudAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer.tar.gz ArduinoCloudAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer${{matrix.installer-extension}} + if: matrix.os == 'ubuntu-22.04' + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ArduinoCloudAgent-${{ matrix.platform-name }}-${{ matrix.arch }} + path: ArduinoCloudAgent* + if-no-files-found: error + + # This job will sign the Windows installer + sign-windows: + runs-on: [self-hosted, windows-sign-pc] + needs: package + + defaults: + run: + shell: bash + + env: + INSTALLER_CERT_WINDOWS_CER: "/tmp/cert.cer" + # We are hardcoding the path for signtool because is not present on the windows PATH env var by default. + # Keep in mind that this path could change when upgrading to a new runner version + SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe" + + strategy: + matrix: + arch: [amd64, 386] + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ArduinoCloudAgent-windows-${{ matrix.arch }} + + - name: Save Win signing certificate to file + run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_CER }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_CER}} + + - name: Sign EXE + env: + CERT_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }} + CONTAINER_NAME: ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }} + # https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken + run: | + "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino Cloud Agent" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "ArduinoCloudAgent-${GITHUB_REF##*/}-windows-${{ matrix.arch }}-installer.exe" + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: ArduinoCloudAgent-windows-${{ matrix.arch }}-signed + path: ArduinoCloudAgent-*-windows-${{ matrix.arch }}-installer.exe + + # This step is needed because the self hosted runner does not delete files automatically + - name: Clean up EXE + run: rm ArduinoCloudAgent-*-windows-${{ matrix.arch }}-installer.exe + + # This job will generate a dmg mac installer, sign/notarize it. + generate-sign-dmg: + needs: notarize-macos + strategy: + matrix: + arch: [amd64] + + runs-on: macos-13 + steps: + - name: Checkout repo with icons/background + uses: actions/checkout@v4 + with: + repository: "bcmi-labs/arduino-create-agent-installer" # the repo which contains the icons/background + token: ${{ secrets.ARDUINO_CREATE_AGENT_CI_PAT }} + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ArduinoCloudAgent.app_${{ matrix.arch }}_notarized + path: ArduinoCloudAgent.app + + - name: unzip artifact + working-directory: ArduinoCloudAgent.app + run: | + unzip ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip + rm ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip + + - name: Install create-dmg + run: brew install create-dmg + + - name: Generate DMG + run: | + create-dmg \ + --volname "ArduinoCloudAgent" \ + --background "installer_icons/background.tiff" \ + --window-pos 200 120 \ + --window-size 500 320 \ + --icon-size 80 \ + --icon "ArduinoCloudAgent.app" 125 150 \ + --app-drop-link 375 150 \ + "ArduinoCloudAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg" \ + "ArduinoCloudAgent.app" + + - name: Import Code-Signing Certificates + run: | + echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}" + security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" + security default-keychain -s "${{ env.KEYCHAIN }}" + security unlock-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}" + security import \ + "${{ env.INSTALLER_CERT_MAC_PATH }}" \ + -k "${{ env.KEYCHAIN }}" \ + -f pkcs12 \ + -A \ + -T "/usr/bin/codesign" \ + -P "${{ secrets.INSTALLER_CERT_MAC_PASSWORD }}" + security set-key-partition-list \ + -S apple-tool:,apple: \ + -s \ + -k "${{ env.KEYCHAIN_PASSWORD }}" \ + "${{ env.KEYCHAIN }}" + + - name: Install gon for code signing and app notarization + run: | + wget -q https://github.com/Bearer/gon/releases/download/v0.0.36/gon_macos.zip + unzip gon_macos.zip -d /usr/local/bin + + - name: Write gon config to file + # gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) + run: | + cat > gon.config_installer.hcl <> $GITHUB_OUTPUT + echo "$(cat CHANGELOG.md)" >> $GITHUB_OUTPUT + echo "
" >> $GITHUB_OUTPUT + echo "VirusTotal analysis 🛡" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "$(echo ${{ steps.virustotal_step.outputs.analysis}} | sed 's/release\///g' | sed 's/,/\n/g' | sed 's/^/- [/' | sed 's/=/](/' | sed 's/$/)/')" >> $GITHUB_OUTPUT + echo "
" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Create Github Release and upload artifacts + uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + body: ${{ steps.release_body.outputs.RBODY}} + draft: false + prerelease: ${{ needs.build.outputs.prerelease }} + # NOTE: "Artifact is a directory" warnings are expected and don't indicate a problem + # (all the files we need are in the DIST_DIR root) + artifacts: release/* + + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + role-session-name: "github_${{ env.PROJECT_NAME }}" + aws-region: ${{ env.AWS_REGION }} + if: ${{ needs.build.outputs.prerelease != 'true' }} + + - name: Upload release files on Arduino downloads servers + run: aws s3 sync release/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }} + if: ${{ needs.build.outputs.prerelease != 'true' }} + + - name: Update version file (used by frontend to trigger autoupdate and create filename) + run: | + echo {\"Version\": \"${GITHUB_REF##*/}\"} > /tmp/agent-version.json + # TODO remove this when we will have a new frontend + aws s3 cp /tmp/agent-version.json s3://${{ env.VERSION_TARGET }} + aws s3 cp /tmp/agent-version.json s3://${{ secrets.DOWNLOADS_BUCKET }}/agent-metadata/ + if: ${{ needs.build.outputs.prerelease != 'true' }} diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 000000000..184a42077 --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,140 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md +name: Sync Labels + +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + pull_request: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + schedule: + # Run daily at 8 AM UTC to sync with changes to shared label configurations. + - cron: "0 8 * * *" + workflow_dispatch: + repository_dispatch: + +env: + CONFIGURATIONS_FOLDER: .github/label-configuration-files + CONFIGURATIONS_ARTIFACT: label-configuration-files + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download JSON schema for labels configuration file + id: download-schema + uses: carlosperate/download-file-action@v2 + with: + file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json + location: ${{ runner.temp }}/label-configuration-schema + + - name: Install JSON schema validator + run: | + sudo npm install \ + --global \ + ajv-cli \ + ajv-formats + + - name: Validate local labels configuration + run: | + # See: https://github.com/ajv-validator/ajv-cli#readme + ajv validate \ + --all-errors \ + -c ajv-formats \ + -s "${{ steps.download-schema.outputs.file-path }}" \ + -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" + + download: + needs: check + runs-on: ubuntu-latest + + strategy: + matrix: + filename: + # Filenames of the shared configurations to apply to the repository in addition to the local configuration. + # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels + - universal.yml + - tooling.yml + + steps: + - name: Download + uses: carlosperate/download-file-action@v2 + with: + file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} + + - name: Pass configuration files to next job via workflow artifact + uses: actions/upload-artifact@v4 + with: + path: | + *.yaml + *.yml + if-no-files-found: error + name: ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }} + + sync: + needs: download + runs-on: ubuntu-latest + + steps: + - name: Set environment variables + run: | + # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable + echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" + + - name: Determine whether to dry run + id: dry-run + if: > + github.event_name == 'pull_request' || + ( + ( + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' + ) && + github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + ) + run: | + # Use of this flag in the github-label-sync command will cause it to only check the validity of the + # configuration. + echo "flag=--dry-run" >> $GITHUB_OUTPUT + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download configuration files artifact + uses: actions/download-artifact@v4 + with: + pattern: ${{ env.CONFIGURATIONS_ARTIFACT }}-* # Download all configuration files + path: ${{ env.CONFIGURATIONS_FOLDER }} + merge-multiple: true + + - name: Remove unneeded artifact + uses: geekyeggo/delete-artifact@v5 + with: + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + + - name: Merge label configuration files + run: | + # Merge all configuration files + shopt -s extglob + cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" + + - name: Install github-label-sync + run: sudo npm install --global github-label-sync + + - name: Sync labels + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # See: https://github.com/Financial-Times/github-label-sync + github-label-sync \ + --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ + ${{ steps.dry-run.outputs.flag }} \ + ${{ github.repository }} diff --git a/.github/workflows/test-go-integration-task.yml b/.github/workflows/test-go-integration-task.yml new file mode 100644 index 000000000..7eeb8e55f --- /dev/null +++ b/.github/workflows/test-go-integration-task.yml @@ -0,0 +1,106 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/test-go-integration-task.md +name: Test Integration + +env: + # See: https://github.com/actions/setup-go/tree/v2#readme + GO_VERSION: "1.23" + # See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python + PYTHON_VERSION: "3.9" + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + create: + push: + paths: + - ".github/workflows/test-go-integration-task.ya?ml" + - "Taskfile.ya?ml" + - "**.go" + - "go.mod" + - "go.sum" + - "poetry.lock" + - "pyproject.toml" + - "tests/**" + pull_request: + paths: + - ".github/workflows/test-go-integration-task.ya?ml" + - "Taskfile.ya?ml" + - "**.go" + - "go.mod" + - "go.sum" + - "poetry.lock" + - "pyproject.toml" + - "tests/**" + workflow_dispatch: + repository_dispatch: + +jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. + if [[ \ + "${{ github.event_name }}" != "create" || \ + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "result=$RESULT" >> $GITHUB_OUTPUT + + test: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + + strategy: + matrix: + operating-system: + - ubuntu-latest + - windows-latest + - macos-latest + + runs-on: ${{ matrix.operating-system }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Poetry + run: pip install poetry + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + # build the agent for integration testing + - name: Build the Agent-cli + run: task go:build + if: matrix.operating-system != 'windows-latest' + + - name: Build the Agent-cli for win + run: task go:build-win-cli + if: matrix.operating-system == 'windows-latest' + + - name: Run integration tests + run: task go:test-integration diff --git a/.github/workflows/test-go-task.yml b/.github/workflows/test-go-task.yml new file mode 100644 index 000000000..cbb95655f --- /dev/null +++ b/.github/workflows/test-go-task.yml @@ -0,0 +1,121 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/test-go-task.md +name: Test Go + +env: + # See: https://github.com/actions/setup-go/tree/v2#readme + GO_VERSION: "1.23" + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + create: + push: + paths: + - ".github/workflows/test-go-task.ya?ml" + - "codecov.ya?ml" + - "**/go.mod" + - "**/go.sum" + - "Taskfile.ya?ml" + - "**.go" + - "**/testdata/**" + pull_request: + paths: + - ".github/workflows/test-go-task.ya?ml" + - "codecov.ya?ml" + - "**/go.mod" + - "**/go.sum" + - "Taskfile.ya?ml" + - "**.go" + - "**/testdata/**" + workflow_dispatch: + repository_dispatch: + +jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. + if [[ \ + "${{ github.event_name }}" != "create" || \ + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "result=$RESULT" >> $GITHUB_OUTPUT + + test: + name: test (${{ matrix.module.path }} - ${{ matrix.operating-system }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + + strategy: + fail-fast: false + + matrix: + operating-system: + - ubuntu-latest + - windows-latest + - macos-latest + module: + - path: ./ + codecov-flags: unit + + runs-on: ${{ matrix.operating-system }} + + steps: + # By default, actions/checkout converts the repo's LF line endings to CRLF on the Windows runner. + - name: Disable EOL conversions + run: git config --global core.autocrlf false + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Run tests + env: + GO_MODULE_PATH: ${{ matrix.module.path }} + run: task go:test + + # A token is used to avoid intermittent spurious job failures caused by rate limiting. + - name: Set up Codecov upload token + if: runner.os == 'Linux' + run: | + if [[ "${{ github.repository }}" == "arduino/arduino-create-agent" ]]; then + # In order to avoid uploads of data from forks, only use the token for runs in the arduino/arduino-create-agent repo. + # Token is intentionally exposed. + # See: https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 + CODECOV_TOKEN=fe64847a-368e-4f95-9212-1f7a6835043f + else + # codecov/codecov-action does unauthenticated upload if empty string is passed via the `token` input. + CODECOV_TOKEN="" + fi + echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> "$GITHUB_ENV" + + - name: Send unit tests coverage to Codecov + if: runner.os == 'Linux' + uses: codecov/codecov-action@v4 + with: + token: ${{ env.CODECOV_TOKEN }} + files: ${{ matrix.module.path }}coverage_unit.txt + flags: ${{ matrix.module.codecov-flags }} + fail_ci_if_error: ${{ github.repository == 'arduino/arduino-create-agent' }} diff --git a/.gitignore b/.gitignore index 954188769..c1926ca22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,21 @@ bufferflow_tinyg_old.md -serial-port-json-server +/arduino-cloud-agent* +!/arduino-cloud-agent*/ +rsrc.syso snapshot/* public/ +artifacts* +logs/ + +# IDEs config +.idea +.vscode + +# macOS +.DS_Store + +# Python +__pycache__ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29bb..000000000 diff --git a/.licensed.yml b/.licensed.yml new file mode 100644 index 000000000..12e7395a3 --- /dev/null +++ b/.licensed.yml @@ -0,0 +1,136 @@ +# See: https://github.com/github/licensed/blob/master/docs/configuration.md +sources: + go: true + +apps: + - source_path: ./ + +reviewed: + go: + - golang.org/x/net/html + - golang.org/x/net/html/atom + - golang.org/x/crypto/curve25519 + - golang.org/x/sys/unix + - github.com/ProtonMail/go-crypto/bitcurves + - github.com/ProtonMail/go-crypto/brainpool + - github.com/ProtonMail/go-crypto/eax + - github.com/ProtonMail/go-crypto/internal/byteutil + - github.com/ProtonMail/go-crypto/ocb + - github.com/ProtonMail/go-crypto/openpgp + - github.com/ProtonMail/go-crypto/openpgp/aes/keywrap + - github.com/ProtonMail/go-crypto/openpgp/armor + - github.com/ProtonMail/go-crypto/openpgp/ecdh + - github.com/ProtonMail/go-crypto/openpgp/ecdsa + - github.com/ProtonMail/go-crypto/openpgp/ed25519 + - github.com/ProtonMail/go-crypto/openpgp/ed448 + - github.com/ProtonMail/go-crypto/openpgp/eddsa + - github.com/ProtonMail/go-crypto/openpgp/elgamal + - github.com/ProtonMail/go-crypto/openpgp/errors + - github.com/ProtonMail/go-crypto/openpgp/internal/algorithm + - github.com/ProtonMail/go-crypto/openpgp/internal/ecc + - github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519 + - github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field + - github.com/ProtonMail/go-crypto/openpgp/internal/encoding + - github.com/ProtonMail/go-crypto/openpgp/packet + - github.com/ProtonMail/go-crypto/openpgp/s2k + - github.com/ProtonMail/go-crypto/openpgp/symmetric + - github.com/ProtonMail/go-crypto/openpgp/x25519 + - github.com/ProtonMail/go-crypto/openpgp/x448 + - github.com/cloudflare/circl/dh/x25519 + - github.com/cloudflare/circl/dh/x448 + - github.com/cloudflare/circl/ecc/goldilocks + - github.com/cloudflare/circl/internal/conv + - github.com/cloudflare/circl/internal/sha3 + - github.com/cloudflare/circl/math + - github.com/cloudflare/circl/math/fp25519 + - github.com/cloudflare/circl/math/fp448 + - github.com/cloudflare/circl/math/mlsbset + - github.com/cloudflare/circl/sign + - github.com/cloudflare/circl/sign/ed25519 + - github.com/cloudflare/circl/sign/ed448 + - golang.org/x/crypto/argon2 + - golang.org/x/crypto/blake2b + - golang.org/x/crypto/sha3 + - golang.org/x/net/internal/socks + - golang.org/x/net/proxy + +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies/AGPL-3.0/.licensed.yml +allowed: + # The following are based on: https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses + - gpl-1.0-or-later + - gpl-1.0+ # Deprecated ID for `gpl-1.0-or-later` + - gpl-2.0 + - gpl-2.0-or-later + - gpl-2.0+ # Deprecated ID for `gpl-2.0-or-later` + - gpl-3.0-only + - gpl-3.0 # Deprecated ID for `gpl-3.0-only` + - gpl-3.0-or-later + - gpl-3.0+ # Deprecated ID for `gpl-3.0-or-later` + - lgpl-2.0-or-later + - lgpl-2.0+ # Deprecated ID for `lgpl-2.0-or-later` + - lgpl-2.1-only + - lgpl-2.1 # Deprecated ID for `lgpl-2.1-only` + - lgpl-2.1-or-later + - lgpl-2.1+ # Deprecated ID for `lgpl-2.1-or-later` + - lgpl-3.0-only + - lgpl-3.0 # Deprecated ID for `lgpl-3.0-only` + - lgpl-3.0-or-later + - lgpl-3.0+ # Deprecated ID for `lgpl-3.0-or-later` + - agpl-1.0-or-later + - agpl-3.0-only + - agpl-3.0 # Deprecated ID for `agpl-3.0-only` + - agpl-3.0-or-later + - fsfap + - apache-2.0 + - artistic-2.0 + - clartistic + - sleepycat + - bsl-1.0 + - bsd-3-clause + - cecill-2.0 + - bsd-3-clause-clear + # "Cryptix General License" - no SPDX ID (https://github.com/spdx/license-list-XML/issues/456) + - ecos-2.0 + - ecl-2.0 + - efl-2.0 + - eudatagrid + - mit + - bsd-2-clause # Subsumed by `bsd-2-clause-views` + - bsd-2-clause-netbsd # Deprecated ID for `bsd-2-clause` + - bsd-2-clause-views # This is the version linked from https://www.gnu.org/licenses/license-list.html#FreeBSD + - bsd-2-clause-freebsd # Deprecated ID for `bsd-2-clause-views` + - ftl + - hpnd + - imatix + - imlib2 + - ijg + # "Informal license" - this is a general class of license + - intel + - isc + - mpl-2.0 + - ncsa + # "License of Netscape JavaScript" - no SPDX ID + - oldap-2.7 + # "License of Perl 5 and below" - possibly `Artistic-1.0-Perl` ? + - cc0-1.0 + - cc-pddc + - psf-2.0 + - ruby + - sgi-b-2.0 + - smlnj + - standardml-nj # Deprecated ID for `smlnj` + - unicode-dfs-2015 + - upl-1.0 + - unlicense + - vim + - w3c + - wtfpl + - lgpl-2.0-or-later with wxwindows-exception-3.1 + - wxwindows # Deprecated ID for `lgpl-2.0-or-later with wxwindows-exception-3.1` + - x11 + - xfree86-1.1 + - zlib + - zpl-2.0 + - zpl-2.1 + # The following are based on individual license text + - eupl-1.2 diff --git a/.licenses/arduino-create-agent/go/fyne.io/systray.dep.yml b/.licenses/arduino-create-agent/go/fyne.io/systray.dep.yml new file mode 100644 index 000000000..b36391cdd --- /dev/null +++ b/.licenses/arduino-create-agent/go/fyne.io/systray.dep.yml @@ -0,0 +1,214 @@ +--- +name: fyne.io/systray +version: v1.10.0 +type: go +summary: Package systray is a cross-platform Go library to place an icon and menu + in the notification area. +homepage: https://pkg.go.dev/fyne.io/systray +license: apache-2.0 +licenses: +- sources: LICENSE + text: |2 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 Brave New Software Project, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +notices: [] diff --git a/.licenses/arduino-create-agent/go/fyne.io/systray/internal/generated/menu.dep.yml b/.licenses/arduino-create-agent/go/fyne.io/systray/internal/generated/menu.dep.yml new file mode 100644 index 000000000..314410260 --- /dev/null +++ b/.licenses/arduino-create-agent/go/fyne.io/systray/internal/generated/menu.dep.yml @@ -0,0 +1,213 @@ +--- +name: fyne.io/systray/internal/generated/menu +version: v1.10.0 +type: go +summary: Code generated by dbus-codegen-go DO NOT EDIT. +homepage: https://pkg.go.dev/fyne.io/systray/internal/generated/menu +license: apache-2.0 +licenses: +- sources: systray@v1.10.0/LICENSE + text: |2 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 Brave New Software Project, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +notices: [] diff --git a/.licenses/arduino-create-agent/go/fyne.io/systray/internal/generated/notifier.dep.yml b/.licenses/arduino-create-agent/go/fyne.io/systray/internal/generated/notifier.dep.yml new file mode 100644 index 000000000..e03d14275 --- /dev/null +++ b/.licenses/arduino-create-agent/go/fyne.io/systray/internal/generated/notifier.dep.yml @@ -0,0 +1,213 @@ +--- +name: fyne.io/systray/internal/generated/notifier +version: v1.10.0 +type: go +summary: Code generated by dbus-codegen-go DO NOT EDIT. +homepage: https://pkg.go.dev/fyne.io/systray/internal/generated/notifier +license: apache-2.0 +licenses: +- sources: systray@v1.10.0/LICENSE + text: |2 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 Brave New Software Project, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/bitcurves.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/bitcurves.dep.yml new file mode 100644 index 000000000..ff1d983d0 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/bitcurves.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/bitcurves +version: v1.1.0-alpha.5-proton +type: go +summary: +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/bitcurves +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/brainpool.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/brainpool.dep.yml new file mode 100644 index 000000000..9ec1b1cef --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/brainpool.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/brainpool +version: v1.1.0-alpha.5-proton +type: go +summary: Package brainpool implements Brainpool elliptic curves. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/brainpool +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/eax.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/eax.dep.yml new file mode 100644 index 000000000..e086227d1 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/eax.dep.yml @@ -0,0 +1,65 @@ +--- +name: github.com/ProtonMail/go-crypto/eax +version: v1.1.0-alpha.5-proton +type: go +summary: 'Package eax provides an implementation of the EAX (encrypt-authenticate-translate) + mode of operation, as described in Bellare, Rogaway, and Wagner "THE EAX MODE OF + OPERATION: A TWO-PASS AUTHENTICATED-ENCRYPTION SCHEME OPTIMIZED FOR SIMPLICITY AND + EFFICIENCY." In FSE''04, volume 3017 of LNCS, 2004' +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/eax +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/internal/byteutil.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/internal/byteutil.dep.yml new file mode 100644 index 000000000..1d0b837c3 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/internal/byteutil.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/internal/byteutil +version: v1.1.0-alpha.5-proton +type: go +summary: +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/internal/byteutil +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/ocb.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/ocb.dep.yml new file mode 100644 index 000000000..f24f78fe7 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/ocb.dep.yml @@ -0,0 +1,65 @@ +--- +name: github.com/ProtonMail/go-crypto/ocb +version: v1.1.0-alpha.5-proton +type: go +summary: 'Package ocb provides an implementation of the OCB (offset codebook) mode + of operation, as described in RFC-7253 of the IRTF and in Rogaway, Bellare, Black + and Krovetz - OCB: A BLOCK-CIPHER MODE OF OPERATION FOR EFFICIENT AUTHENTICATED + ENCRYPTION (2003).' +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/ocb +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp.dep.yml new file mode 100644 index 000000000..af72530c0 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp +version: v1.1.0-alpha.5-proton +type: go +summary: Package openpgp implements high level operations on OpenPGP messages. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap.dep.yml new file mode 100644 index 000000000..7cc6fb0d4 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/aes/keywrap +version: v1.1.0-alpha.5-proton +type: go +summary: Package keywrap is an implementation of the RFC 3394 AES key wrapping algorithm. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/armor.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/armor.dep.yml new file mode 100644 index 000000000..982a14505 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/armor.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/armor +version: v1.1.0-alpha.5-proton +type: go +summary: Package armor implements OpenPGP ASCII Armor, see RFC 4880. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/armor +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdh.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdh.dep.yml new file mode 100644 index 000000000..9107dd71b --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdh.dep.yml @@ -0,0 +1,63 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/ecdh +version: v1.1.0-alpha.5-proton +type: go +summary: Package ecdh implements ECDH encryption, suitable for OpenPGP, as specified + in RFC 6637, section 8. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/ecdh +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdsa.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdsa.dep.yml new file mode 100644 index 000000000..26ae39b99 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdsa.dep.yml @@ -0,0 +1,63 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/ecdsa +version: v1.1.0-alpha.5-proton +type: go +summary: Package ecdsa implements ECDSA signature, suitable for OpenPGP, as specified + in RFC 6637, section 5. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/ecdsa +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed25519.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed25519.dep.yml new file mode 100644 index 000000000..b98f3d6ff --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed25519.dep.yml @@ -0,0 +1,63 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/ed25519 +version: v1.1.0-alpha.5-proton +type: go +summary: Package ed25519 implements the ed25519 signature algorithm for OpenPGP as + defined in the Open PGP crypto refresh. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/ed25519 +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed448.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed448.dep.yml new file mode 100644 index 000000000..a3ec2359a --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed448.dep.yml @@ -0,0 +1,63 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/ed448 +version: v1.1.0-alpha.5-proton +type: go +summary: Package ed448 implements the ed448 signature algorithm for OpenPGP as defined + in the Open PGP crypto refresh. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/ed448 +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/eddsa.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/eddsa.dep.yml new file mode 100644 index 000000000..77cb4464e --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/eddsa.dep.yml @@ -0,0 +1,63 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/eddsa +version: v1.1.0-alpha.5-proton +type: go +summary: Package eddsa implements EdDSA signature, suitable for OpenPGP, as specified + in https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-13.7 +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/eddsa +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/elgamal.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/elgamal.dep.yml new file mode 100644 index 000000000..30c4e4652 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/elgamal.dep.yml @@ -0,0 +1,64 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/elgamal +version: v1.1.0-alpha.5-proton +type: go +summary: Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified + in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," + IEEE Transactions on Information Theory, v. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/elgamal +license: bsd-3-clause +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/errors.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/errors.dep.yml new file mode 100644 index 000000000..81688cd2f --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/errors.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/errors +version: v1.1.0-alpha.5-proton +type: go +summary: Package errors contains common error types for the OpenPGP packages. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/errors +license: bsd-3-clause +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm.dep.yml new file mode 100644 index 000000000..6d96f4443 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/internal/algorithm +version: v1.1.0-alpha.5-proton +type: go +summary: +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc.dep.yml new file mode 100644 index 000000000..81e8f7cb5 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/internal/ecc +version: v1.1.0-alpha.5-proton +type: go +summary: Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/ecc +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.dep.yml new file mode 100644 index 000000000..ce6e3efe5 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.dep.yml @@ -0,0 +1,63 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519 +version: v1.1.0-alpha.5-proton +type: go +summary: Package curve25519 implements custom field operations without clamping for + forwarding. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519 +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field.dep.yml new file mode 100644 index 000000000..8df0ed080 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field +version: v1.1.0-alpha.5-proton +type: go +summary: Package field implements fast arithmetic modulo 2^255-19. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/encoding.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/encoding.dep.yml new file mode 100644 index 000000000..990da1aa3 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/encoding.dep.yml @@ -0,0 +1,63 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/internal/encoding +version: v1.1.0-alpha.5-proton +type: go +summary: Package encoding implements openpgp packet field encodings as specified in + RFC 4880 and 6637. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/encoding +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/packet.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/packet.dep.yml new file mode 100644 index 000000000..c470a9e2b --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/packet.dep.yml @@ -0,0 +1,63 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/packet +version: v1.1.0-alpha.5-proton +type: go +summary: Package packet implements parsing and serialization of OpenPGP packets, as + specified in RFC 4880. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/packet +license: bsd-3-clause +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/s2k.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/s2k.dep.yml new file mode 100644 index 000000000..a1a554e68 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/s2k.dep.yml @@ -0,0 +1,64 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/s2k +version: v1.1.0-alpha.5-proton +type: go +summary: Package s2k implements the various OpenPGP string-to-key transforms as specified + in RFC 4800 section 3.7.1, and Argon2 specified in draft-ietf-openpgp-crypto-refresh-08 + section 3.7.1.4. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/s2k +license: bsd-3-clause +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/symmetric.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/symmetric.dep.yml new file mode 100644 index 000000000..581db5cbd --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/symmetric.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/symmetric +version: v1.1.0-alpha.5-proton +type: go +summary: +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/symmetric +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x25519.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x25519.dep.yml new file mode 100644 index 000000000..16798ee8e --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x25519.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/x25519 +version: v1.1.0-alpha.5-proton +type: go +summary: +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/x25519 +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x448.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x448.dep.yml new file mode 100644 index 000000000..27acdb02c --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x448.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/x448 +version: v1.1.0-alpha.5-proton +type: go +summary: +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/x448 +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/arduino/go-paths-helper.dep.yml b/.licenses/arduino-create-agent/go/github.com/arduino/go-paths-helper.dep.yml new file mode 100644 index 000000000..21d102e90 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/arduino/go-paths-helper.dep.yml @@ -0,0 +1,350 @@ +--- +name: github.com/arduino/go-paths-helper +version: v1.12.1 +type: go +summary: +homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper +license: gpl-2.0-or-later +licenses: +- sources: LICENSE + text: |2 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Lesser General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, and + (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the + Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any + later version", you have the option of following the terms and conditions + either of that version or of any later version published by the Free + Software Foundation. If the Program does not specify a version number of + this License, you may choose any version ever published by the Free Software + Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, the commands you use may + be called something other than `show w' and `show c'; they could even be + mouse-clicks or menu items--whatever suits your program. + + You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the + library. If this is what you want to do, use the GNU Lesser General + Public License instead of this License. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/arduino/go-properties-orderedmap.dep.yml b/.licenses/arduino-create-agent/go/github.com/arduino/go-properties-orderedmap.dep.yml new file mode 100644 index 000000000..d7e78f9e6 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/arduino/go-properties-orderedmap.dep.yml @@ -0,0 +1,350 @@ +--- +name: github.com/arduino/go-properties-orderedmap +version: v1.8.0 +type: go +summary: Package properties is a library for handling maps of hierarchical properties. +homepage: https://pkg.go.dev/github.com/arduino/go-properties-orderedmap +license: gpl-2.0 +licenses: +- sources: LICENSE + text: |2 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Lesser General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, and + (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the + Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any + later version", you have the option of following the terms and conditions + either of that version or of any later version published by the Free + Software Foundation. If the Program does not specify a version number of + this License, you may choose any version ever published by the Free Software + Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, the commands you use may + be called something other than `show w' and `show c'; they could even be + mouse-clicks or menu items--whatever suits your program. + + You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the + library. If this is what you want to do, use the GNU Lesser General + Public License instead of this License. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/arduino/go-serial-utils.dep.yml b/.licenses/arduino-create-agent/go/github.com/arduino/go-serial-utils.dep.yml new file mode 100644 index 000000000..fb7fa6ea5 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/arduino/go-serial-utils.dep.yml @@ -0,0 +1,458 @@ +--- +name: github.com/arduino/go-serial-utils +version: v0.1.2 +type: go +summary: +homepage: https://pkg.go.dev/github.com/arduino/go-serial-utils +license: gpl-3.0 +licenses: +- sources: LICENSE.txt + text: "This file includes licensing information for \n\nCopyright (c) 2024 ARDUINO + SA (www.arduino.cc)\n\nThe software is released under the GNU General Public License, + which covers the main body\nof the arduino-cli code. The terms of this license + can be found at:\nhttps://www.gnu.org/licenses/gpl-3.0.en.html\n\nYou can be released + from the requirements of the above licenses by purchasing\na commercial license. + Buying such a license is mandatory if you want to modify or\notherwise use the + software for commercial activities involving the Arduino\nsoftware without disclosing + the source code of your own applications. To purchase\na commercial license, send + an email to license@arduino.cc\n\n GNU GENERAL PUBLIC LICENSE\n + \ Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software + Foundation, Inc. \n Everyone is permitted to copy and distribute + verbatim copies\n of this license document, but changing it is not allowed.\n\n + \ Preamble\n\n The GNU General Public License is a + free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses + for most software and other practical works are designed\nto take away your freedom + to share and change the works. By contrast,\nthe GNU General Public License is + intended to guarantee your freedom to\nshare and change all versions of a program--to + make sure it remains free\nsoftware for all its users. We, the Free Software + Foundation, use the\nGNU General Public License for most of our software; it applies + also to\nany other work released this way by its authors. You can apply it to\nyour + programs, too.\n\n When we speak of free software, we are referring to freedom, + not\nprice. Our General Public Licenses are designed to make sure that you\nhave + the freedom to distribute copies of free software (and charge for\nthem if you + wish), that you receive source code or can get it if you\nwant it, that you can + change the software or use pieces of it in new\nfree programs, and that you know + you can do these things.\n\n To protect your rights, we need to prevent others + from denying you\nthese rights or asking you to surrender the rights. Therefore, + you have\ncertain responsibilities if you distribute copies of the software, or + if\nyou modify it: responsibilities to respect the freedom of others.\n\n For + example, if you distribute copies of such a program, whether\ngratis or for a + fee, you must pass on to the recipients the same\nfreedoms that you received. + \ You must make sure that they, too, receive\nor can get the source code. And + you must show them these terms so they\nknow their rights.\n\n Developers that + use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the + software, and (2) offer you this License\ngiving you legal permission to copy, + distribute and/or modify it.\n\n For the developers' and authors' protection, + the GPL clearly explains\nthat there is no warranty for this free software. For + both users' and\nauthors' sake, the GPL requires that modified versions be marked + as\nchanged, so that their problems will not be attributed erroneously to\nauthors + of previous versions.\n\n Some devices are designed to deny users access to install + or run\nmodified versions of the software inside them, although the manufacturer\ncan + do so. This is fundamentally incompatible with the aim of\nprotecting users' + freedom to change the software. The systematic\npattern of such abuse occurs + in the area of products for individuals to\nuse, which is precisely where it is + most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit + the practice for those\nproducts. If such problems arise substantially in other + domains, we\nstand ready to extend this provision to those domains in future versions\nof + the GPL, as needed to protect the freedom of users.\n\n Finally, every program + is threatened constantly by software patents.\nStates should not allow patents + to restrict development and use of\nsoftware on general-purpose computers, but + in those that do, we wish to\navoid the special danger that patents applied to + a free program could\nmake it effectively proprietary. To prevent this, the GPL + assures that\npatents cannot be used to render the program non-free.\n\n The + precise terms and conditions for copying, distribution and\nmodification follow.\n\n + \ TERMS AND CONDITIONS\n\n 0. Definitions.\n\n \"This License\" + refers to version 3 of the GNU General Public License.\n\n \"Copyright\" also + means copyright-like laws that apply to other kinds of\nworks, such as semiconductor + masks.\n\n \"The Program\" refers to any copyrightable work licensed under this\nLicense. + \ Each licensee is addressed as \"you\". \"Licensees\" and\n\"recipients\" may + be individuals or organizations.\n\n To \"modify\" a work means to copy from + or adapt all or part of the work\nin a fashion requiring copyright permission, + other than the making of an\nexact copy. The resulting work is called a \"modified + version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n A + \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n + \ To \"propagate\" a work means to do anything with it that, without\npermission, + would make you directly or secondarily liable for\ninfringement under applicable + copyright law, except executing it on a\ncomputer or modifying a private copy. + \ Propagation includes copying,\ndistribution (with or without modification), + making available to the\npublic, and in some countries other activities as well.\n\n + \ To \"convey\" a work means any kind of propagation that enables other\nparties + to make or receive copies. Mere interaction with a user through\na computer network, + with no transfer of a copy, is not conveying.\n\n An interactive user interface + displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient + and prominently visible\nfeature that (1) displays an appropriate copyright notice, + and (2)\ntells the user that there is no warranty for the work (except to the\nextent + that warranties are provided), that licensees may convey the\nwork under this + License, and how to view a copy of this License. If\nthe interface presents a + list of user commands or options, such as a\nmenu, a prominent item in the list + meets this criterion.\n\n 1. Source Code.\n\n The \"source code\" for a work + means the preferred form of the work\nfor making modifications to it. \"Object + code\" means any non-source\nform of a work.\n\n A \"Standard Interface\" means + an interface that either is an official\nstandard defined by a recognized standards + body, or, in the case of\ninterfaces specified for a particular programming language, + one that\nis widely used among developers working in that language.\n\n The \"System + Libraries\" of an executable work include anything, other\nthan the work as a + whole, that (a) is included in the normal form of\npackaging a Major Component, + but which is not part of that Major\nComponent, and (b) serves only to enable + use of the work with that\nMajor Component, or to implement a Standard Interface + for which an\nimplementation is available to the public in source code form. A\n\"Major + Component\", in this context, means a major essential component\n(kernel, window + system, and so on) of the specific operating system\n(if any) on which the executable + work runs, or a compiler used to\nproduce the work, or an object code interpreter + used to run it.\n\n The \"Corresponding Source\" for a work in object code form + means all\nthe source code needed to generate, install, and (for an executable\nwork) + run the object code and to modify the work, including scripts to\ncontrol those + activities. However, it does not include the work's\nSystem Libraries, or general-purpose + tools or generally available free\nprograms which are used unmodified in performing + those activities but\nwhich are not part of the work. For example, Corresponding + Source\nincludes interface definition files associated with source files for\nthe + work, and the source code for shared libraries and dynamically\nlinked subprograms + that the work is specifically designed to require,\nsuch as by intimate data communication + or control flow between those\nsubprograms and other parts of the work.\n\n The + Corresponding Source need not include anything that users\ncan regenerate automatically + from other parts of the Corresponding\nSource.\n\n The Corresponding Source for + a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n + \ All rights granted under this License are granted for the term of\ncopyright + on the Program, and are irrevocable provided the stated\nconditions are met. This + License explicitly affirms your unlimited\npermission to run the unmodified Program. + \ The output from running a\ncovered work is covered by this License only if the + output, given its\ncontent, constitutes a covered work. This License acknowledges + your\nrights of fair use or other equivalent, as provided by copyright law.\n\n + \ You may make, run and propagate covered works that you do not\nconvey, without + conditions so long as your license otherwise remains\nin force. You may convey + covered works to others for the sole purpose\nof having them make modifications + exclusively for you, or provide you\nwith facilities for running those works, + provided that you comply with\nthe terms of this License in conveying all material + for which you do\nnot control copyright. Those thus making or running the covered + works\nfor you must do so exclusively on your behalf, under your direction\nand + control, on terms that prohibit them from making any copies of\nyour copyrighted + material outside their relationship with you.\n\n Conveying under any other circumstances + is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; + section 10\nmakes it unnecessary.\n\n 3. Protecting Users' Legal Rights From + Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective + technological\nmeasure under any applicable law fulfilling obligations under article\n11 + of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting + or restricting circumvention of such\nmeasures.\n\n When you convey a covered + work, you waive any legal power to forbid\ncircumvention of technological measures + to the extent such circumvention\nis effected by exercising rights under this + License with respect to\nthe covered work, and you disclaim any intention to limit + operation or\nmodification of the work as a means of enforcing, against the work's\nusers, + your or third parties' legal rights to forbid circumvention of\ntechnological + measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies + of the Program's source code as you\nreceive it, in any medium, provided that + you conspicuously and\nappropriately publish on each copy an appropriate copyright + notice;\nkeep intact all notices stating that this License and any\nnon-permissive + terms added in accord with section 7 apply to the code;\nkeep intact all notices + of the absence of any warranty; and give all\nrecipients a copy of this License + along with the Program.\n\n You may charge any price or no price for each copy + that you convey,\nand you may offer support or warranty protection for a fee.\n\n + \ 5. Conveying Modified Source Versions.\n\n You may convey a work based on the + Program, or the modifications to\nproduce it from the Program, in the form of + source code under the\nterms of section 4, provided that you also meet all of + these conditions:\n\n a) The work must carry prominent notices stating that + you modified\n it, and giving a relevant date.\n\n b) The work must carry + prominent notices stating that it is\n released under this License and any + conditions added under section\n 7. This requirement modifies the requirement + in section 4 to\n \"keep intact all notices\".\n\n c) You must license the + entire work, as a whole, under this\n License to anyone who comes into possession + of a copy. This\n License will therefore apply, along with any applicable + section 7\n additional terms, to the whole of the work, and all its parts,\n + \ regardless of how they are packaged. This License gives no\n permission + to license the work in any other way, but it does not\n invalidate such permission + if you have separately received it.\n\n d) If the work has interactive user + interfaces, each must display\n Appropriate Legal Notices; however, if the + Program has interactive\n interfaces that do not display Appropriate Legal + Notices, your\n work need not make them do so.\n\n A compilation of a covered + work with other separate and independent\nworks, which are not by their nature + extensions of the covered work,\nand which are not combined with it such as to + form a larger program,\nin or on a volume of a storage or distribution medium, + is called an\n\"aggregate\" if the compilation and its resulting copyright are + not\nused to limit the access or legal rights of the compilation's users\nbeyond + what the individual works permit. Inclusion of a covered work\nin an aggregate + does not cause this License to apply to the other\nparts of the aggregate.\n\n + \ 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object + code form under the terms\nof sections 4 and 5, provided that you also convey + the\nmachine-readable Corresponding Source under the terms of this License,\nin + one of these ways:\n\n a) Convey the object code in, or embodied in, a physical + product\n (including a physical distribution medium), accompanied by the\n + \ Corresponding Source fixed on a durable physical medium\n customarily used + for software interchange.\n\n b) Convey the object code in, or embodied in, + a physical product\n (including a physical distribution medium), accompanied + by a\n written offer, valid for at least three years and valid for as\n long + as you offer spare parts or customer support for that product\n model, to give + anyone who possesses the object code either (1) a\n copy of the Corresponding + Source for all the software in the\n product that is covered by this License, + on a durable physical\n medium customarily used for software interchange, for + a price no\n more than your reasonable cost of physically performing this\n + \ conveying of source, or (2) access to copy the\n Corresponding Source from + a network server at no charge.\n\n c) Convey individual copies of the object + code with a copy of the\n written offer to provide the Corresponding Source. + \ This\n alternative is allowed only occasionally and noncommercially, and\n + \ only if you received the object code with such an offer, in accord\n with + subsection 6b.\n\n d) Convey the object code by offering access from a designated\n + \ place (gratis or for a charge), and offer equivalent access to the\n Corresponding + Source in the same way through the same place at no\n further charge. You + need not require recipients to copy the\n Corresponding Source along with the + object code. If the place to\n copy the object code is a network server, the + Corresponding Source\n may be on a different server (operated by you or a third + party)\n that supports equivalent copying facilities, provided you maintain\n + \ clear directions next to the object code saying where to find the\n Corresponding + Source. Regardless of what server hosts the\n Corresponding Source, you remain + obligated to ensure that it is\n available for as long as needed to satisfy + these requirements.\n\n e) Convey the object code using peer-to-peer transmission, + provided\n you inform other peers where the object code and Corresponding\n + \ Source of the work are being offered to the general public at no\n charge + under subsection 6d.\n\n A separable portion of the object code, whose source + code is excluded\nfrom the Corresponding Source as a System Library, need not + be\nincluded in conveying the object code work.\n\n A \"User Product\" is either + (1) a \"consumer product\", which means any\ntangible personal property which + is normally used for personal, family,\nor household purposes, or (2) anything + designed or sold for incorporation\ninto a dwelling. In determining whether a + product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. + \ For a particular\nproduct received by a particular user, \"normally used\" refers + to a\ntypical or common use of that class of product, regardless of the status\nof + the particular user or of the way in which the particular user\nactually uses, + or expects or is expected to use, the product. A product\nis a consumer product + regardless of whether the product has substantial\ncommercial, industrial or non-consumer + uses, unless such uses represent\nthe only significant mode of use of the product.\n\n + \ \"Installation Information\" for a User Product means any methods,\nprocedures, + authorization keys, or other information required to install\nand execute modified + versions of a covered work in that User Product from\na modified version of its + Corresponding Source. The information must\nsuffice to ensure that the continued + functioning of the modified object\ncode is in no case prevented or interfered + with solely because\nmodification has been made.\n\n If you convey an object + code work under this section in, or with, or\nspecifically for use in, a User + Product, and the conveying occurs as\npart of a transaction in which the right + of possession and use of the\nUser Product is transferred to the recipient in + perpetuity or for a\nfixed term (regardless of how the transaction is characterized), + the\nCorresponding Source conveyed under this section must be accompanied\nby + the Installation Information. But this requirement does not apply\nif neither + you nor any third party retains the ability to install\nmodified object code on + the User Product (for example, the work has\nbeen installed in ROM).\n\n The + requirement to provide Installation Information does not include a\nrequirement + to continue to provide support service, warranty, or updates\nfor a work that + has been modified or installed by the recipient, or for\nthe User Product in which + it has been modified or installed. Access to a\nnetwork may be denied when the + modification itself materially and\nadversely affects the operation of the network + or violates the rules and\nprotocols for communication across the network.\n\n + \ Corresponding Source conveyed, and Installation Information provided,\nin accord + with this section must be in a format that is publicly\ndocumented (and with an + implementation available to the public in\nsource code form), and must require + no special password or key for\nunpacking, reading or copying.\n\n 7. Additional + Terms.\n\n \"Additional permissions\" are terms that supplement the terms of + this\nLicense by making exceptions from one or more of its conditions.\nAdditional + permissions that are applicable to the entire Program shall\nbe treated as though + they were included in this License, to the extent\nthat they are valid under applicable + law. If additional permissions\napply only to part of the Program, that part + may be used separately\nunder those permissions, but the entire Program remains + governed by\nthis License without regard to the additional permissions.\n\n When + you convey a copy of a covered work, you may at your option\nremove any additional + permissions from that copy, or from any part of\nit. (Additional permissions + may be written to require their own\nremoval in certain cases when you modify + the work.) You may place\nadditional permissions on material, added by you to + a covered work,\nfor which you have or can give appropriate copyright permission.\n\n + \ Notwithstanding any other provision of this License, for material you\nadd to + a covered work, you may (if authorized by the copyright holders of\nthat material) + supplement the terms of this License with terms:\n\n a) Disclaiming warranty + or limiting liability differently from the\n terms of sections 15 and 16 of + this License; or\n\n b) Requiring preservation of specified reasonable legal + notices or\n author attributions in that material or in the Appropriate Legal\n + \ Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation + of the origin of that material, or\n requiring that modified versions of such + material be marked in\n reasonable ways as different from the original version; + or\n\n d) Limiting the use for publicity purposes of names of licensors or\n + \ authors of the material; or\n\n e) Declining to grant rights under trademark + law for use of some\n trade names, trademarks, or service marks; or\n\n f) + Requiring indemnification of licensors and authors of that\n material by anyone + who conveys the material (or modified versions of\n it) with contractual assumptions + of liability to the recipient, for\n any liability that these contractual assumptions + directly impose on\n those licensors and authors.\n\n All other non-permissive + additional terms are considered \"further\nrestrictions\" within the meaning of + section 10. If the Program as you\nreceived it, or any part of it, contains a + notice stating that it is\ngoverned by this License along with a term that is + a further\nrestriction, you may remove that term. If a license document contains\na + further restriction but permits relicensing or conveying under this\nLicense, + you may add to a covered work material governed by the terms\nof that license + document, provided that the further restriction does\nnot survive such relicensing + or conveying.\n\n If you add terms to a covered work in accord with this section, + you\nmust place, in the relevant source files, a statement of the\nadditional + terms that apply to those files, or a notice indicating\nwhere to find the applicable + terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform + of a separately written license, or stated as exceptions;\nthe above requirements + apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a + covered work except as expressly\nprovided under this License. Any attempt otherwise + to propagate or\nmodify it is void, and will automatically terminate your rights + under\nthis License (including any patent licenses granted under the third\nparagraph + of section 11).\n\n However, if you cease all violation of this License, then + your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, + unless and until the copyright holder explicitly and\nfinally terminates your + license, and (b) permanently, if the copyright\nholder fails to notify you of + the violation by some reasonable means\nprior to 60 days after the cessation.\n\n + \ Moreover, your license from a particular copyright holder is\nreinstated permanently + if the copyright holder notifies you of the\nviolation by some reasonable means, + this is the first time you have\nreceived notice of violation of this License + (for any work) from that\ncopyright holder, and you cure the violation prior to + 30 days after\nyour receipt of the notice.\n\n Termination of your rights under + this section does not terminate the\nlicenses of parties who have received copies + or rights from you under\nthis License. If your rights have been terminated and + not permanently\nreinstated, you do not qualify to receive new licenses for the + same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n + \ You are not required to accept this License in order to receive or\nrun a copy + of the Program. Ancillary propagation of a covered work\noccurring solely as + a consequence of using peer-to-peer transmission\nto receive a copy likewise does + not require acceptance. However,\nnothing other than this License grants you + permission to propagate or\nmodify any covered work. These actions infringe copyright + if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered + work, you indicate your acceptance of this License to do so.\n\n 10. Automatic + Licensing of Downstream Recipients.\n\n Each time you convey a covered work, + the recipient automatically\nreceives a license from the original licensors, to + run, modify and\npropagate that work, subject to this License. You are not responsible\nfor + enforcing compliance by third parties with this License.\n\n An \"entity transaction\" + is a transaction transferring control of an\norganization, or substantially all + assets of one, or subdividing an\norganization, or merging organizations. If + propagation of a covered\nwork results from an entity transaction, each party + to that\ntransaction who receives a copy of the work also receives whatever\nlicenses + to the work the party's predecessor in interest had or could\ngive under the previous + paragraph, plus a right to possession of the\nCorresponding Source of the work + from the predecessor in interest, if\nthe predecessor has it or can get it with + reasonable efforts.\n\n You may not impose any further restrictions on the exercise + of the\nrights granted or affirmed under this License. For example, you may\nnot + impose a license fee, royalty, or other charge for exercise of\nrights granted + under this License, and you may not initiate litigation\n(including a cross-claim + or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by + making, using, selling, offering for\nsale, or importing the Program or any portion + of it.\n\n 11. Patents.\n\n A \"contributor\" is a copyright holder who authorizes + use under this\nLicense of the Program or a work on which the Program is based. + \ The\nwork thus licensed is called the contributor's \"contributor version\".\n\n + \ A contributor's \"essential patent claims\" are all patent claims\nowned or + controlled by the contributor, whether already acquired or\nhereafter acquired, + that would be infringed by some manner, permitted\nby this License, of making, + using, or selling its contributor version,\nbut do not include claims that would + be infringed only as a\nconsequence of further modification of the contributor + version. For\npurposes of this definition, \"control\" includes the right to + grant\npatent sublicenses in a manner consistent with the requirements of\nthis + License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent + license under the contributor's essential patent claims, to\nmake, use, sell, + offer for sale, import and otherwise run, modify and\npropagate the contents of + its contributor version.\n\n In the following three paragraphs, a \"patent license\" + is any express\nagreement or commitment, however denominated, not to enforce a + patent\n(such as an express permission to practice a patent or covenant not to\nsue + for patent infringement). To \"grant\" such a patent license to a\nparty means + to make such an agreement or commitment not to enforce a\npatent against the party.\n\n + \ If you convey a covered work, knowingly relying on a patent license,\nand the + Corresponding Source of the work is not available for anyone\nto copy, free of + charge and under the terms of this License, through a\npublicly available network + server or other readily accessible means,\nthen you must either (1) cause the + Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of + the benefit of the\npatent license for this particular work, or (3) arrange, in + a manner\nconsistent with the requirements of this License, to extend the patent\nlicense + to downstream recipients. \"Knowingly relying\" means you have\nactual knowledge + that, but for the patent license, your conveying the\ncovered work in a country, + or your recipient's use of the covered work\nin a country, would infringe one + or more identifiable patents in that\ncountry that you have reason to believe + are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, + you convey, or propagate by procuring conveyance of, a\ncovered work, and grant + a patent license to some of the parties\nreceiving the covered work authorizing + them to use, propagate, modify\nor convey a specific copy of the covered work, + then the patent license\nyou grant is automatically extended to all recipients + of the covered\nwork and works based on it.\n\n A patent license is \"discriminatory\" + if it does not include within\nthe scope of its coverage, prohibits the exercise + of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically + granted under this License. You may not convey a covered\nwork if you are a party + to an arrangement with a third party that is\nin the business of distributing + software, under which you make payment\nto the third party based on the extent + of your activity of conveying\nthe work, and under which the third party grants, + to any of the\nparties who would receive the covered work from you, a discriminatory\npatent + license (a) in connection with copies of the covered work\nconveyed by you (or + copies made from those copies), or (b) primarily\nfor and in connection with specific + products or compilations that\ncontain the covered work, unless you entered into + that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n + \ Nothing in this License shall be construed as excluding or limiting\nany implied + license or other defenses to infringement that may\notherwise be available to + you under applicable patent law.\n\n 12. No Surrender of Others' Freedom.\n\n + \ If conditions are imposed on you (whether by court order, agreement or\notherwise) + that contradict the conditions of this License, they do not\nexcuse you from the + conditions of this License. If you cannot convey a\ncovered work so as to satisfy + simultaneously your obligations under this\nLicense and any other pertinent obligations, + then as a consequence you may\nnot convey it at all. For example, if you agree + to terms that obligate you\nto collect a royalty for further conveying from those + to whom you convey\nthe Program, the only way you could satisfy both those terms + and this\nLicense would be to refrain entirely from conveying the Program.\n\n + \ 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any + other provision of this License, you have\npermission to link or combine any covered + work with a work licensed\nunder version 3 of the GNU Affero General Public License + into a single\ncombined work, and to convey the resulting work. The terms of + this\nLicense will continue to apply to the part which is the covered work,\nbut + the special requirements of the GNU Affero General Public License,\nsection 13, + concerning interaction through a network will apply to the\ncombination as such.\n\n + \ 14. Revised Versions of this License.\n\n The Free Software Foundation may + publish revised and/or new versions of\nthe GNU General Public License from time + to time. Such new versions will\nbe similar in spirit to the present version, + but may differ in detail to\naddress new problems or concerns.\n\n Each version + is given a distinguishing version number. If the\nProgram specifies that a certain + numbered version of the GNU General\nPublic License \"or any later version\" applies + to it, you have the\noption of following the terms and conditions either of that + numbered\nversion or of any later version published by the Free Software\nFoundation. + \ If the Program does not specify a version number of the\nGNU General Public + License, you may choose any version ever published\nby the Free Software Foundation.\n\n + \ If the Program specifies that a proxy can decide which future\nversions of the + GNU General Public License can be used, that proxy's\npublic statement of acceptance + of a version permanently authorizes you\nto choose that version for the Program.\n\n + \ Later license versions may give you additional or different\npermissions. However, + no additional obligations are imposed on any\nauthor or copyright holder as a + result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n + \ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER + PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, + YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. + Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR + AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES + AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT + OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS + OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES + OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH + HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n + \ 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty + and limitation of liability provided\nabove cannot be given local legal effect + according to their terms,\nreviewing courts shall apply local law that most closely + approximates\nan absolute waiver of all civil liability in connection with the\nProgram, + unless a warranty or assumption of liability accompanies a\ncopy of the Program + in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How + to Apply These Terms to Your New Programs\n\n If you develop a new program, and + you want it to be of the greatest\npossible use to the public, the best way to + achieve this is to make it\nfree software which everyone can redistribute and + change under these terms.\n\n To do so, attach the following notices to the program. + \ It is safest\nto attach them to the start of each source file to most effectively\nstate + the exclusion of warranty; and each file should have at least\nthe \"copyright\" + line and a pointer to where the full notice is found.\n\n \n Copyright (C) + \ \n\n This program is free software: you can redistribute + it and/or modify\n it under the terms of the GNU General Public License as + published by\n the Free Software Foundation, either version 3 of the License, + or\n (at your option) any later version.\n\n This program is distributed + in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even + the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + \ See the\n GNU General Public License for more details.\n\n You should + have received a copy of the GNU General Public License\n along with this program. + \ If not, see .\n\nAlso add information on how + to contact you by electronic and paper mail.\n\n If the program does terminal + interaction, make it output a short\nnotice like this when it starts in an interactive + mode:\n\n Copyright (C) \n This program + comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n This is free + software, and you are welcome to redistribute it\n under certain conditions; + type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' + should show the appropriate\nparts of the General Public License. Of course, + your program's commands\nmight be different; for a GUI interface, you would use + an \"about box\".\n\n You should also get your employer (if you work as a programmer) + or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor + more information on this, and how to apply and follow the GNU GPL, see\n.\n\n + \ The GNU General Public License does not permit incorporating your program\ninto + proprietary programs. If your program is a subroutine library, you\nmay consider + it more useful to permit linking proprietary applications with\nthe library. If + this is what you want to do, use the GNU Lesser General\nPublic License instead + of this License. But first, please read\n.\n" +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/arduino/pluggable-discovery-protocol-handler/v2.dep.yml b/.licenses/arduino-create-agent/go/github.com/arduino/pluggable-discovery-protocol-handler/v2.dep.yml new file mode 100644 index 000000000..0825582ba --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/arduino/pluggable-discovery-protocol-handler/v2.dep.yml @@ -0,0 +1,709 @@ +--- +name: github.com/arduino/pluggable-discovery-protocol-handler/v2 +version: v2.2.1 +type: go +summary: Package discovery is a library for handling the Arduino Pluggable-Discovery + protocol (https://github.com/arduino/tooling-rfcs/blob/main/RFCs/0002-pluggable-discovery.md#pluggable-discovery-api-via-stdinstdout) +homepage: https://pkg.go.dev/github.com/arduino/pluggable-discovery-protocol-handler/v2 +license: other +licenses: +- sources: LICENSE.txt + text: | + This file includes licensing information for serial-discovery + + Copyright (c) 2018 ARDUINO SA (www.arduino.cc) + + The software is released under the GNU General Public License, which covers the main body + of the serial-discovery code. The terms of this license can be found at: + https://www.gnu.org/licenses/gpl-3.0.en.html + + You can be released from the requirements of the above licenses by purchasing + a commercial license. Buying such a license is mandatory if you want to modify or + otherwise use the software for commercial activities involving the Arduino + software without disclosing the source code of your own applications. To purchase + a commercial license, send an email to license@arduino.cc + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for + software and other kinds of works. + + The licenses for most software and other practical works are designed + to take away your freedom to share and change the works. By contrast, + the GNU General Public License is intended to guarantee your freedom to + share and change all versions of a program--to make sure it remains free + software for all its users. We, the Free Software Foundation, use the + GNU General Public License for most of our software; it applies also to + any other work released this way by its authors. You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + them if you wish), that you receive source code or can get it if you + want it, that you can change the software or use pieces of it in new + free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you + these rights or asking you to surrender the rights. Therefore, you have + certain responsibilities if you distribute copies of the software, or if + you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must pass on to the recipients the same + freedoms that you received. You must make sure that they, too, receive + or can get the source code. And you must show them these terms so they + know their rights. + + Developers that use the GNU GPL protect your rights with two steps: + (1) assert copyright on the software, and (2) offer you this License + giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains + that there is no warranty for this free software. For both users' and + authors' sake, the GPL requires that modified versions be marked as + changed, so that their problems will not be attributed erroneously to + authors of previous versions. + + Some devices are designed to deny users access to install or run + modified versions of the software inside them, although the manufacturer + can do so. This is fundamentally incompatible with the aim of + protecting users' freedom to change the software. The systematic + pattern of such abuse occurs in the area of products for individuals to + use, which is precisely where it is most unacceptable. Therefore, we + have designed this version of the GPL to prohibit the practice for those + products. If such problems arise substantially in other domains, we + stand ready to extend this provision to those domains in future versions + of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. + States should not allow patents to restrict development and use of + software on general-purpose computers, but in those that do, we wish to + avoid the special danger that patents applied to a free program could + make it effectively proprietary. To prevent this, the GPL assures that + patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and + modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of + works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work + in a fashion requiring copyright permission, other than the making of an + exact copy. The resulting work is called a "modified version" of the + earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based + on the Program. + + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it on a + computer or modifying a private copy. Propagation includes copying, + distribution (with or without modification), making available to the + public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user through + a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" + to the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to the + extent that warranties are provided), that licensees may convey the + work under this License, and how to view a copy of this License. If + the interface presents a list of user commands or options, such as a + menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source + form of a work. + + A "Standard Interface" means an interface that either is an official + standard defined by a recognized standards body, or, in the case of + interfaces specified for a particular programming language, one that + is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other + than the work as a whole, that (a) is included in the normal form of + packaging a Major Component, but which is not part of that Major + Component, and (b) serves only to enable use of the work with that + Major Component, or to implement a Standard Interface for which an + implementation is available to the public in source code form. A + "Major Component", in this context, means a major essential component + (kernel, window system, and so on) of the specific operating system + (if any) on which the executable work runs, or a compiler used to + produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all + the source code needed to generate, install, and (for an executable + work) run the object code and to modify the work, including scripts to + control those activities. However, it does not include the work's + System Libraries, or general-purpose tools or generally available free + programs which are used unmodified in performing those activities but + which are not part of the work. For example, Corresponding Source + includes interface definition files associated with source files for + the work, and the source code for shared libraries and dynamically + linked subprograms that the work is specifically designed to require, + such as by intimate data communication or control flow between those + subprograms and other parts of the work. + + The Corresponding Source need not include anything that users + can regenerate automatically from other parts of the Corresponding + Source. + + The Corresponding Source for a work in source code form is that + same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running a + covered work is covered by this License only if the output, given its + content, constitutes a covered work. This License acknowledges your + rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not + convey, without conditions so long as your license otherwise remains + in force. You may convey covered works to others for the sole purpose + of having them make modifications exclusively for you, or provide you + with facilities for running those works, provided that you comply with + the terms of this License in conveying all material for which you do + not control copyright. Those thus making or running the covered works + for you must do so exclusively on your behalf, under your direction + and control, on terms that prohibit them from making any copies of + your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under + the conditions stated below. Sublicensing is not allowed; section 10 + makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under article + 11 of the WIPO copyright treaty adopted on 20 December 1996, or + similar laws prohibiting or restricting circumvention of such + measures. + + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such circumvention + is effected by exercising rights under this License with respect to + the covered work, and you disclaim any intention to limit operation or + modification of the work as a means of enforcing, against the work's + users, your or third parties' legal rights to forbid circumvention of + technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the code; + keep intact all notices of the absence of any warranty; and give all + recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, + and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the + terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered work, + and which are not combined with it such as to form a larger program, + in or on a volume of a storage or distribution medium, is called an + "aggregate" if the compilation and its resulting copyright are not + used to limit the access or legal rights of the compilation's users + beyond what the individual works permit. Inclusion of a covered work + in an aggregate does not cause this License to apply to the other + parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms + of sections 4 and 5, provided that you also convey the + machine-readable Corresponding Source under the terms of this License, + in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded + from the Corresponding Source as a System Library, need not be + included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any + tangible personal property which is normally used for personal, family, + or household purposes, or (2) anything designed or sold for incorporation + into a dwelling. In determining whether a product is a consumer product, + doubtful cases shall be resolved in favor of coverage. For a particular + product received by a particular user, "normally used" refers to a + typical or common use of that class of product, regardless of the status + of the particular user or of the way in which the particular user + actually uses, or expects or is expected to use, the product. A product + is a consumer product regardless of whether the product has substantial + commercial, industrial or non-consumer uses, unless such uses represent + the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to install + and execute modified versions of a covered work in that User Product from + a modified version of its Corresponding Source. The information must + suffice to ensure that the continued functioning of the modified object + code is in no case prevented or interfered with solely because + modification has been made. + + If you convey an object code work under this section in, or with, or + specifically for use in, a User Product, and the conveying occurs as + part of a transaction in which the right of possession and use of the + User Product is transferred to the recipient in perpetuity or for a + fixed term (regardless of how the transaction is characterized), the + Corresponding Source conveyed under this section must be accompanied + by the Installation Information. But this requirement does not apply + if neither you nor any third party retains the ability to install + modified object code on the User Product (for example, the work has + been installed in ROM). + + The requirement to provide Installation Information does not include a + requirement to continue to provide support service, warranty, or updates + for a work that has been modified or installed by the recipient, or for + the User Product in which it has been modified or installed. Access to a + network may be denied when the modification itself materially and + adversely affects the operation of the network or violates the rules and + protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, + in accord with this section must be in a format that is publicly + documented (and with an implementation available to the public in + source code form), and must require no special password or key for + unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this + License by making exceptions from one or more of its conditions. + Additional permissions that are applicable to the entire Program shall + be treated as though they were included in this License, to the extent + that they are valid under applicable law. If additional permissions + apply only to part of the Program, that part may be used separately + under those permissions, but the entire Program remains governed by + this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option + remove any additional permissions from that copy, or from any part of + it. (Additional permissions may be written to require their own + removal in certain cases when you modify the work.) You may place + additional permissions on material, added by you to a covered work, + for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you + add to a covered work, you may (if authorized by the copyright holders of + that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as you + received it, or any part of it, contains a notice stating that it is + governed by this License along with a term that is a further + restriction, you may remove that term. If a license document contains + a further restriction but permits relicensing or conveying under this + License, you may add to a covered work material governed by the terms + of that license document, provided that the further restriction does + not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the + additional terms that apply to those files, or a notice indicating + where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the + form of a separately written license, or stated as exceptions; + the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights under + this License (including any patent licenses granted under the third + paragraph of section 11). + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the copyright + holder fails to notify you of the violation by some reasonable means + prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from that + copyright holder, and you cure the violation prior to 30 days after + your receipt of the notice. + + Termination of your rights under this section does not terminate the + licenses of parties who have received copies or rights from you under + this License. If your rights have been terminated and not permanently + reinstated, you do not qualify to receive new licenses for the same + material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or + run a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer transmission + to receive a copy likewise does not require acceptance. However, + nothing other than this License grants you permission to propagate or + modify any covered work. These actions infringe copyright if you do + not accept this License. Therefore, by modifying or propagating a + covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not responsible + for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a covered + work results from an entity transaction, each party to that + transaction who receives a copy of the work also receives whatever + licenses to the work the party's predecessor in interest had or could + give under the previous paragraph, plus a right to possession of the + Corresponding Source of the work from the predecessor in interest, if + the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you may + not impose a license fee, royalty, or other charge for exercise of + rights granted under this License, and you may not initiate litigation + (including a cross-claim or counterclaim in a lawsuit) alleging that + any patent claim is infringed by making, using, selling, offering for + sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. The + work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims + owned or controlled by the contributor, whether already acquired or + hereafter acquired, that would be infringed by some manner, permitted + by this License, of making, using, or selling its contributor version, + but do not include claims that would be infringed only as a + consequence of further modification of the contributor version. For + purposes of this definition, "control" includes the right to grant + patent sublicenses in a manner consistent with the requirements of + this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free + patent license under the contributor's essential patent claims, to + make, use, sell, offer for sale, import and otherwise run, modify and + propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express + agreement or commitment, however denominated, not to enforce a patent + (such as an express permission to practice a patent or covenant not to + sue for patent infringement). To "grant" such a patent license to a + party means to make such an agreement or commitment not to enforce a + patent against the party. + + If you convey a covered work, knowingly relying on a patent license, + and the Corresponding Source of the work is not available for anyone + to copy, free of charge and under the terms of this License, through a + publicly available network server or other readily accessible means, + then you must either (1) cause the Corresponding Source to be so + available, or (2) arrange to deprive yourself of the benefit of the + patent license for this particular work, or (3) arrange, in a manner + consistent with the requirements of this License, to extend the patent + license to downstream recipients. "Knowingly relying" means you have + actual knowledge that, but for the patent license, your conveying the + covered work in a country, or your recipient's use of the covered work + in a country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, modify + or convey a specific copy of the covered work, then the patent license + you grant is automatically extended to all recipients of the covered + work and works based on it. + + A patent license is "discriminatory" if it does not include within + the scope of its coverage, prohibits the exercise of, or is + conditioned on the non-exercise of one or more of the rights that are + specifically granted under this License. You may not convey a covered + work if you are a party to an arrangement with a third party that is + in the business of distributing software, under which you make payment + to the third party based on the extent of your activity of conveying + the work, and under which the third party grants, to any of the + parties who would receive the covered work from you, a discriminatory + patent license (a) in connection with copies of the covered work + conveyed by you (or copies made from those copies), or (b) primarily + for and in connection with specific products or compilations that + contain the covered work, unless you entered into that arrangement, + or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting + any implied license or other defenses to infringement that may + otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot convey a + covered work so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you may + not convey it at all. For example, if you agree to terms that obligate you + to collect a royalty for further conveying from those to whom you convey + the Program, the only way you could satisfy both those terms and this + License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU Affero General Public License into a single + combined work, and to convey the resulting work. The terms of this + License will continue to apply to the part which is the covered work, + but the special requirements of the GNU Affero General Public License, + section 13, concerning interaction through a network will apply to the + combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of + the GNU General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies that a certain numbered version of the GNU General + Public License "or any later version" applies to it, you have the + option of following the terms and conditions either of that numbered + version or of any later version published by the Free Software + Foundation. If the Program does not specify a version number of the + GNU General Public License, you may choose any version ever published + by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future + versions of the GNU General Public License can be used, that proxy's + public statement of acceptance of a version permanently authorizes you + to choose that version for the Program. + + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT + HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY + OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM + IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF + ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS + THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY + GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE + USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), + EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely approximates + an absolute waiver of all civil liability in connection with the + Program, unless a warranty or assumption of liability accompanies a + copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + state the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short + notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, your program's commands + might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, + if any, to sign a "copyright disclaimer" for the program, if necessary. + For more information on this, and how to apply and follow the GNU GPL, see + . + + The GNU General Public License does not permit incorporating your program + into proprietary programs. If your program is a subroutine library, you + may consider it more useful to permit linking proprietary applications with + the library. If this is what you want to do, use the GNU Lesser General + Public License instead of this License. But first, please read + . +- sources: README.md + text: |- + Copyright (c) 2021 ARDUINO SA (www.arduino.cc) + + The software is released under the GNU General Public License, which covers the main body + of the serial-discovery code. The terms of this license can be found at: + https://www.gnu.org/licenses/gpl-3.0.en.html + + See [LICENSE.txt](https://github.com/arduino/pluggable-discovery-protocol-handler/blob/master/LICENSE.txt) for details. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml b/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml new file mode 100644 index 000000000..39cce428f --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/blang/semver +version: v3.5.1+incompatible +type: go +summary: +homepage: https://pkg.go.dev/github.com/blang/semver +license: mit +licenses: +- sources: LICENSE + text: |+ + The MIT License + + Copyright (c) 2014 Benedikt Lang + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +- sources: README.md + text: See [LICENSE](LICENSE) file. +notices: [] +... diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/dh/x25519.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/dh/x25519.dep.yml new file mode 100644 index 000000000..9a3efa5ab --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/dh/x25519.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/dh/x25519 +version: v1.3.7 +type: go +summary: Package x25519 provides Diffie-Hellman functions as specified in RFC-7748. +homepage: https://pkg.go.dev/github.com/cloudflare/circl/dh/x25519 +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/dh/x448.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/dh/x448.dep.yml new file mode 100644 index 000000000..89ebbe189 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/dh/x448.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/dh/x448 +version: v1.3.7 +type: go +summary: Package x448 provides Diffie-Hellman functions as specified in RFC-7748. +homepage: https://pkg.go.dev/github.com/cloudflare/circl/dh/x448 +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/ecc/goldilocks.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/ecc/goldilocks.dep.yml new file mode 100644 index 000000000..e9daa0487 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/ecc/goldilocks.dep.yml @@ -0,0 +1,71 @@ +--- +name: github.com/cloudflare/circl/ecc/goldilocks +version: v1.3.7 +type: go +summary: Package goldilocks provides elliptic curve operations over the goldilocks + curve. +homepage: https://pkg.go.dev/github.com/cloudflare/circl/ecc/goldilocks +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/internal/conv.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/internal/conv.dep.yml new file mode 100644 index 000000000..02404fe46 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/internal/conv.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/internal/conv +version: v1.3.7 +type: go +summary: +homepage: https://pkg.go.dev/github.com/cloudflare/circl/internal/conv +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/internal/sha3.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/internal/sha3.dep.yml new file mode 100644 index 000000000..49fa79d68 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/internal/sha3.dep.yml @@ -0,0 +1,71 @@ +--- +name: github.com/cloudflare/circl/internal/sha3 +version: v1.3.7 +type: go +summary: Package sha3 implements the SHA-3 fixed-output-length hash functions and + the SHAKE variable-output-length hash functions defined by FIPS-202. +homepage: https://pkg.go.dev/github.com/cloudflare/circl/internal/sha3 +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math.dep.yml new file mode 100644 index 000000000..efdc59bc4 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/math +version: v1.3.7 +type: go +summary: Package math provides some utility functions for big integers. +homepage: https://pkg.go.dev/github.com/cloudflare/circl/math +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math/fp25519.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math/fp25519.dep.yml new file mode 100644 index 000000000..20c3b2393 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math/fp25519.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/math/fp25519 +version: v1.3.7 +type: go +summary: Package fp25519 provides prime field arithmetic over GF(2^255-19). +homepage: https://pkg.go.dev/github.com/cloudflare/circl/math/fp25519 +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math/fp448.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math/fp448.dep.yml new file mode 100644 index 000000000..b65891c91 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math/fp448.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/math/fp448 +version: v1.3.7 +type: go +summary: Package fp448 provides prime field arithmetic over GF(2^448-2^224-1). +homepage: https://pkg.go.dev/github.com/cloudflare/circl/math/fp448 +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math/mlsbset.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math/mlsbset.dep.yml new file mode 100644 index 000000000..c837e724c --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/math/mlsbset.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/math/mlsbset +version: v1.3.7 +type: go +summary: Package mlsbset provides a constant-time exponentiation method with precomputation. +homepage: https://pkg.go.dev/github.com/cloudflare/circl/math/mlsbset +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/sign.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/sign.dep.yml new file mode 100644 index 000000000..5d3285605 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/sign.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/sign +version: v1.3.7 +type: go +summary: Package sign provides unified interfaces for signature schemes. +homepage: https://pkg.go.dev/github.com/cloudflare/circl/sign +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/sign/ed25519.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/sign/ed25519.dep.yml new file mode 100644 index 000000000..8586196a4 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/sign/ed25519.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/sign/ed25519 +version: v1.3.7 +type: go +summary: Package ed25519 implements Ed25519 signature scheme as described in RFC-8032. +homepage: https://pkg.go.dev/github.com/cloudflare/circl/sign/ed25519 +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/sign/ed448.dep.yml b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/sign/ed448.dep.yml new file mode 100644 index 000000000..96cace11d --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/cloudflare/circl/sign/ed448.dep.yml @@ -0,0 +1,70 @@ +--- +name: github.com/cloudflare/circl/sign/ed448 +version: v1.3.7 +type: go +summary: Package ed448 implements Ed448 signature scheme as described in RFC-8032. +homepage: https://pkg.go.dev/github.com/cloudflare/circl/sign/ed448 +license: other +licenses: +- sources: circl@v1.3.7/LICENSE + text: | + Copyright (c) 2019 Cloudflare. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Cloudflare nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ======================================================================== + + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: circl@v1.3.7/README.md + text: The project is licensed under the [BSD-3-Clause License](./LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/codeclysm/extract/v4.dep.yml b/.licenses/arduino-create-agent/go/github.com/codeclysm/extract/v4.dep.yml new file mode 100644 index 000000000..9defe5f88 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/codeclysm/extract/v4.dep.yml @@ -0,0 +1,33 @@ +--- +name: github.com/codeclysm/extract/v4 +version: v4.0.0 +type: go +summary: Package extract allows to extract archives in zip, tar.gz or tar.bz2 formats + easily. +homepage: https://pkg.go.dev/github.com/codeclysm/extract/v4 +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2016 codeclysm + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml b/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml new file mode 100644 index 000000000..0785cd02c --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/creack/goselect +version: v0.1.2 +type: go +summary: +homepage: https://pkg.go.dev/github.com/creack/goselect +license: mit +licenses: +- sources: LICENSE + text: |+ + The MIT License (MIT) + + Copyright (c) 2014 Guillaume J. Charmes + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +- sources: README.md + text: Released under the [MIT license](LICENSE). +notices: [] +... diff --git a/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype.dep.yml b/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype.dep.yml new file mode 100644 index 000000000..898030905 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype.dep.yml @@ -0,0 +1,33 @@ +--- +name: github.com/gabriel-vasile/mimetype +version: v1.4.3 +type: go +summary: Package mimetype uses magic number signatures to detect the MIME type of + a file. +homepage: https://pkg.go.dev/github.com/gabriel-vasile/mimetype +license: mit +licenses: +- sources: LICENSE + text: | + MIT License + + Copyright (c) 2018-2020 Gabriel Vasile + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype/internal/charset.dep.yml b/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype/internal/charset.dep.yml new file mode 100644 index 000000000..ae2d894c1 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype/internal/charset.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/gabriel-vasile/mimetype/internal/charset +version: v1.4.3 +type: go +summary: +homepage: https://pkg.go.dev/github.com/gabriel-vasile/mimetype/internal/charset +license: mit +licenses: +- sources: mimetype@v1.4.3/LICENSE + text: | + MIT License + + Copyright (c) 2018-2020 Gabriel Vasile + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype/internal/json.dep.yml b/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype/internal/json.dep.yml new file mode 100644 index 000000000..f6a55e8ba --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype/internal/json.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/gabriel-vasile/mimetype/internal/json +version: v1.4.3 +type: go +summary: Package json provides a JSON value parser state machine. +homepage: https://pkg.go.dev/github.com/gabriel-vasile/mimetype/internal/json +license: mit +licenses: +- sources: mimetype@v1.4.3/LICENSE + text: | + MIT License + + Copyright (c) 2018-2020 Gabriel Vasile + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype/internal/magic.dep.yml b/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype/internal/magic.dep.yml new file mode 100644 index 000000000..cacd38ad9 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gabriel-vasile/mimetype/internal/magic.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/gabriel-vasile/mimetype/internal/magic +version: v1.4.3 +type: go +summary: Package magic holds the matching functions used to find MIME types. +homepage: https://pkg.go.dev/github.com/gabriel-vasile/mimetype/internal/magic +license: mit +licenses: +- sources: mimetype@v1.4.3/LICENSE + text: | + MIT License + + Copyright (c) 2018-2020 Gabriel Vasile + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gin-contrib/cors.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-contrib/cors.dep.yml new file mode 100644 index 000000000..a24f26880 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gin-contrib/cors.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/gin-contrib/cors +version: v1.7.2 +type: go +summary: +homepage: https://pkg.go.dev/github.com/gin-contrib/cors +license: mit +licenses: +- sources: LICENSE + text: | + MIT License + + Copyright (c) 2016 Gin-Gonic + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gin-contrib/sse.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-contrib/sse.dep.yml new file mode 100644 index 000000000..c888d59ab --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gin-contrib/sse.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/gin-contrib/sse +version: v0.1.0 +type: go +summary: +homepage: https://pkg.go.dev/github.com/gin-contrib/sse +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2014 Manuel Martínez-Almeida + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin.dep.yml new file mode 100644 index 000000000..7d4960e69 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin.dep.yml @@ -0,0 +1,440 @@ +--- +name: github.com/gin-gonic/gin +version: v1.10.0 +type: go +summary: Package gin implements a HTTP web framework called gin. +homepage: https://pkg.go.dev/github.com/gin-gonic/gin +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2014 Manuel Martínez-Almeida + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: +- sources: AUTHORS.md + text: |- + List of all the awesome people working to make Gin the best Web Framework in Go. + + ## gin 1.x series authors + + **Gin Core Team:** Bo-Yi Wu (@appleboy), thinkerou (@thinkerou), Javier Provecho (@javierprovecho) + + ## gin 0.x series authors + + **Maintainers:** Manu Martinez-Almeida (@manucorporat), Javier Provecho (@javierprovecho) + + ------ + + People and companies, who have contributed, in alphabetical order. + + - 178inaba <178inaba@users.noreply.github.com> + - A. F + - ABHISHEK SONI + - Abhishek Chanda + - Abner Chen + - AcoNCodes + - Adam Dratwinski + - Adam Mckaig + - Adam Zielinski + - Adonis + - Alan Wang + - Albin Gilles + - Aleksandr Didenko + - Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com> + - Alex + - Alexander + - Alexander Lokhman + - Alexander Melentyev <55826637+alexander-melentyev@users.noreply.github.com> + - Alexander Nyquist + - Allen Ren + - AllinGo + - Ammar Bandukwala + - An Xiao (Luffy) + - Andre Dublin <81dublin@gmail.com> + - Andrew Szeto + - Andrey Abramov + - Andrey Nering + - Andrey Smirnov + - Andrii Bubis + - André Bazaglia + - Andy Pan + - Antoine GIRARD + - Anup Kumar Panwar <1anuppanwar@gmail.com> + - Aravinth Sundaram + - Artem + - Ashwani + - Aurelien Regat-Barrel + - Austin Heap + - Barnabus + - Bo-Yi Wu + - Boris Borshevsky + - Boyi Wu + - BradyBromley <51128276+BradyBromley@users.noreply.github.com> + - Brendan Fosberry + - Brian Wigginton + - Carlos Eduardo + - Chad Russell + - Charles + - Christian Muehlhaeuser + - Christian Persson + - Christopher Harrington + - Damon Zhao + - Dan Markham + - Dang Nguyen + - Daniel Krom + - Daniel M. Lambea + - Danieliu + - David Irvine + - David Zhang + - Davor Kapsa + - DeathKing + - Dennis Cho <47404603+forest747@users.noreply.github.com> + - Dmitry Dorogin + - Dmitry Kutakov + - Dmitry Sedykh + - Don2Quixote <35610661+Don2Quixote@users.noreply.github.com> + - Donn Pebe + - Dustin Decker + - Eason Lin + - Edward Betts + - Egor Seredin <4819888+agmt@users.noreply.github.com> + - Emmanuel Goh + - Equim + - Eren A. Akyol + - Eric_Lee + - Erik Bender + - Ethan Kan + - Evgeny Persienko + - Faisal Alam + - Fareed Dudhia + - Filip Figiel + - Florian Polster + - Frank Bille + - Franz Bettag + - Ganlv + - Gaozhen Ying + - George Gabolaev + - George Kirilenko + - Georges Varouchas + - Gordon Tyler + - Harindu Perera + - Helios <674876158@qq.com> + - Henry Kwan + - Henry Yee + - Himanshu Mishra + - Hiroyuki Tanaka + - Ibraheem Ahmed + - Ignacio Galindo + - Igor H. Vieira + - Ildar1111 <54001462+Ildar1111@users.noreply.github.com> + - Iskander (Alex) Sharipov + - Ismail Gjevori + - Ivan Chen + - JINNOUCHI Yasushi + - James Pettyjohn + - Jamie Stackhouse + - Jason Lee + - Javier Provecho + - Javier Provecho + - Javier Provecho + - Javier Provecho Fernandez + - Javier Provecho Fernandez + - Jean-Christophe Lebreton + - Jeff + - Jeremy Loy + - Jim Filippou + - Jimmy Pettersson + - John Bampton + - Johnny Dallas + - Johnny Dallas + - Jonathan (JC) Chen + - Josep Jesus Bigorra Algaba <42377845+averageflow@users.noreply.github.com> + - Josh Horowitz + - Joshua Loper + - Julien Schmidt + - Jun Kimura + - Justin Beckwith + - Justin Israel + - Justin Mayhew + - Jérôme Laforge + - Kacper Bąk <56700396+53jk1@users.noreply.github.com> + - Kamron Batman + - Kane Rogers + - Kaushik Neelichetty + - Keiji Yoshida + - Kel Cecil + - Kevin Mulvey + - Kevin Zhu + - Kirill Motkov + - Klemen Sever + - Kristoffer A. Iversen + - Krzysztof Szafrański + - Kumar McMillan + - Kyle Mcgill + - Lanco <35420416+lancoLiu@users.noreply.github.com> + - Levi Olson + - Lin Kao-Yuan + - Linus Unnebäck + - Lucas Clemente + - Ludwig Valda Vasquez + - Luis GG + - MW Lim + - Maksimov Sergey + - Manjusaka + - Manu MA + - Manu MA + - Manu Mtz-Almeida + - Manu Mtz.-Almeida + - Manuel Alonso + - Mara Kim + - Mario Kostelac + - Martin Karlsch + - Matt Newberry + - Matt Williams + - Matthieu MOREL + - Max Hilbrunner + - Maxime Soulé + - MetalBreaker + - Michael Puncel + - MichaelDeSteven <51652084+MichaelDeSteven@users.noreply.github.com> + - Mike <38686456+icy4ever@users.noreply.github.com> + - Mike Stipicevic + - Miki Tebeka + - Miles + - Mirza Ceric + - Mykyta Semenistyi + - Naoki Takano + - Ngalim Siregar + - Ni Hao + - Nick Gerakines + - Nikifor Seryakov + - Notealot <714804968@qq.com> + - Olivier Mengué + - Olivier Robardet + - Pablo Moncada + - Pablo Moncada + - Panmax <967168@qq.com> + - Peperoncino <2wua4nlyi@gmail.com> + - Philipp Meinen + - Pierre Massat + - Qt + - Quentin ROYER + - README Bot <35302948+codetriage-readme-bot@users.noreply.github.com> + - Rafal Zajac + - Rahul Datta Roy + - Rajiv Kilaparti + - Raphael Gavache + - Ray Rodriguez + - Regner Blok-Andersen + - Remco + - Rex Lee(李俊) + - Richard Lee + - Riverside + - Robert Wilkinson + - Rogier Lommers + - Rohan Pai + - Romain Beuque + - Roman Belyakovsky + - Roman Zaynetdinov <627197+zaynetro@users.noreply.github.com> + - Roman Zaynetdinov + - Ronald Petty + - Ross Wolf <31489089+rw-access@users.noreply.github.com> + - Roy Lou + - Rubi <14269809+codenoid@users.noreply.github.com> + - Ryan <46182144+ryanker@users.noreply.github.com> + - Ryan J. Yoder + - SRK.Lyu + - Sai + - Samuel Abreu + - Santhosh Kumar + - Sasha Melentyev + - Sasha Myasoedov + - Segev Finer + - Sergey Egorov + - Sergey Fedchenko + - Sergey Gonimar + - Sergey Ponomarev + - Serica <943914044@qq.com> + - Shamus Taylor + - Shilin Wang + - Shuo + - Skuli Oskarsson + - Snawoot + - Sridhar Ratnakumar + - Steeve Chailloux + - Sudhir Mishra + - Suhas Karanth + - TaeJun Park + - Tatsuya Hoshino + - Tevic + - Tevin Jeffrey + - The Gitter Badger + - Thibault Jamet + - Thomas Boerger + - Thomas Schaffer + - Tommy Chu + - Tudor Roman + - Uwe Dauernheim + - Valentine Oragbakosi + - Vas N + - Vasilyuk Vasiliy + - Victor Castell + - Vince Yuan + - Vyacheslav Dubinin + - Waynerv + - Weilin Shi <934587911@qq.com> + - Xudong Cai + - Yasuhiro Matsumoto + - Yehezkiel Syamsuhadi + - Yoshiki Nakagawa + - Yoshiyuki Kinjo + - Yue Yang + - ZYunH + - Zach Newburgh + - Zasda Yusuf Mikail + - ZhangYunHao + - ZhiFeng Hu + - Zhu Xi + - a2tt + - ahuigo <1781999+ahuigo@users.noreply.github.com> + - ali + - aljun + - andrea + - andriikushch + - anoty + - awkj + - axiaoxin <254606826@qq.com> + - bbiao + - bestgopher <84328409@qq.com> + - betahu + - bigwheel + - bn4t <17193640+bn4t@users.noreply.github.com> + - bullgare + - chainhelen + - chenyang929 + - chriswhelix + - collinmsn <4130944@qq.com> + - cssivision + - danielalves + - delphinus + - dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> + - dickeyxxx + - edebernis + - error10 + - esplo + - eudore <30709860+eudore@users.noreply.github.com> + - ffhelicopter <32922889+ffhelicopter@users.noreply.github.com> + - filikos <11477309+filikos@users.noreply.github.com> + - forging2012 + - goqihoo + - grapeVine + - guonaihong + - heige + - heige + - hellojukay + - henrylee2cn + - htobenothing + - iamhesir <78344375+iamhesir@users.noreply.github.com> + - ijaa + - ishanray + - ishanray + - itcloudy <272685110@qq.com> + - jarodsong6 + - jasonrhansen + - jincheng9 + - joeADSP <75027008+joeADSP@users.noreply.github.com> + - junfengye + - kaiiak + - kebo + - keke <19yamashita15@gmail.com> + - kishor kunal raj <68464660+kishorkunal-raj@users.noreply.github.com> + - kyledinh + - lantw44 + - likakuli <1154584512@qq.com> + - linfangrong + - linzi <873804682@qq.com> + - llgoer + - long-road <13412081338@163.com> + - mbesancon + - mehdy + - metal A-wing + - micanzhang + - minarc + - mllu + - mopemoepe + - msoedov + - mstmdev + - novaeye + - olebedev + - phithon + - pjgg + - qm012 <67568757+qm012@users.noreply.github.com> + - raymonder jin + - rns + - root@andrea:~# + - sekky0905 <20237968+sekky0905@users.noreply.github.com> + - senhtry + - shadrus + - silasb + - solos + - songjiayang + - sope + - srt180 <30768686+srt180@users.noreply.github.com> + - stackerzzq + - sunshineplan + - syssam + - techjanitor + - techjanitor + - thinkerou + - thinkgo <49174849+thinkgos@users.noreply.github.com> + - tsirolnik + - tyltr <31768692+tylitianrui@users.noreply.github.com> + - vinhha96 + - voidman + - vz + - wei + - weibaohui + - whirosan + - willnewrelic + - wssccc + - wuhuizuo + - xyb + - y-yagi + - yiranzai + - youzeliang + - yugu + - yuyabe + - zebozhuang + - zero11-0203 <93071220+zero11-0203@users.noreply.github.com> + - zesani <7sin@outlook.co.th> + - zhanweidu + - zhing + - ziheng + - zzjin + - 森 優太 <59682979+uta-mori@users.noreply.github.com> + - 杰哥 <858806258@qq.com> + - 涛叔 + - 市民233 + - 尹宝强 + - 梦溪笔谈 + - 飞雪无情 + - 寻寻觅觅的Gopher diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml new file mode 100644 index 000000000..a99238ac3 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/gin-gonic/gin/binding +version: v1.10.0 +type: go +summary: +homepage: https://pkg.go.dev/github.com/gin-gonic/gin/binding +license: mit +licenses: +- sources: gin@v1.10.0/LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2014 Manuel Martínez-Almeida + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml new file mode 100644 index 000000000..97e8d6cb9 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/gin-gonic/gin/internal/bytesconv +version: v1.10.0 +type: go +summary: +homepage: https://pkg.go.dev/github.com/gin-gonic/gin/internal/bytesconv +license: mit +licenses: +- sources: gin@v1.10.0/LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2014 Manuel Martínez-Almeida + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml new file mode 100644 index 000000000..2551fb8d9 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/gin-gonic/gin/internal/json +version: v1.10.0 +type: go +summary: +homepage: https://pkg.go.dev/github.com/gin-gonic/gin/internal/json +license: mit +licenses: +- sources: gin@v1.10.0/LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2014 Manuel Martínez-Almeida + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml new file mode 100644 index 000000000..deb06fb36 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/gin-gonic/gin/render +version: v1.10.0 +type: go +summary: +homepage: https://pkg.go.dev/github.com/gin-gonic/gin/render +license: mit +licenses: +- sources: gin@v1.10.0/LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2014 Manuel Martínez-Almeida + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/go-chi/chi/v5.dep.yml b/.licenses/arduino-create-agent/go/github.com/go-chi/chi/v5.dep.yml new file mode 100644 index 000000000..ed956774e --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/go-chi/chi/v5.dep.yml @@ -0,0 +1,42 @@ +--- +name: github.com/go-chi/chi/v5 +version: v5.0.12 +type: go +summary: Package chi is a small, idiomatic and composable router for building HTTP + services. +homepage: https://pkg.go.dev/github.com/go-chi/chi/v5 +license: mit +licenses: +- sources: LICENSE + text: | + Copyright (c) 2015-present Peter Kieltyka (https://github.com/pkieltyka), Google Inc. + + MIT License + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- sources: README.md + text: |- + Copyright (c) 2015-present [Peter Kieltyka](https://github.com/pkieltyka) + + Licensed under [MIT License](./LICENSE) + + [GoDoc]: https://pkg.go.dev/github.com/go-chi/chi/v5 + [GoDoc Widget]: https://godoc.org/github.com/go-chi/chi?status.svg + [Travis]: https://travis-ci.org/go-chi/chi + [Travis Widget]: https://travis-ci.org/go-chi/chi.svg?branch=master +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/go-ini/ini.dep.yml b/.licenses/arduino-create-agent/go/github.com/go-ini/ini.dep.yml new file mode 100644 index 000000000..446908dd7 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/go-ini/ini.dep.yml @@ -0,0 +1,205 @@ +--- +name: github.com/go-ini/ini +version: v1.62.0 +type: go +summary: Package ini provides INI file read and write functionality in Go. +homepage: https://pkg.go.dev/github.com/go-ini/ini +license: apache-2.0 +licenses: +- sources: LICENSE + text: | + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, and + distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by the copyright + owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all other entities + that control, are controlled by, or are under common control with that entity. + For the purposes of this definition, "control" means (i) the power, direct or + indirect, to cause the direction or management of such entity, whether by + contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity exercising + permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, including + but not limited to software source code, documentation source, and configuration + files. + + "Object" form shall mean any form resulting from mechanical transformation or + translation of a Source form, including but not limited to compiled object code, + generated documentation, and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or Object form, made + available under the License, as indicated by a copyright notice that is included + in or attached to the work (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object form, that + is based on (or derived from) the Work and for which the editorial revisions, + annotations, elaborations, or other modifications represent, as a whole, an + original work of authorship. For the purposes of this License, Derivative Works + shall not include works that remain separable from, or merely link (or bind by + name) to the interfaces of, the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including the original version + of the Work and any modifications or additions to that Work or Derivative Works + thereof, that is intentionally submitted to Licensor for inclusion in the Work + by the copyright owner or by an individual or Legal Entity authorized to submit + on behalf of the copyright owner. For the purposes of this definition, + "submitted" means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, and + issue tracking systems that are managed by, or on behalf of, the Licensor for + the purpose of discussing and improving the Work, but excluding communication + that is conspicuously marked or otherwise designated in writing by the copyright + owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf + of whom a Contribution has been received by Licensor and subsequently + incorporated within the Work. + + 2. Grant of Copyright License. + + Subject to the terms and conditions of this License, each Contributor hereby + grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, + irrevocable copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the Work and such + Derivative Works in Source or Object form. + + 3. Grant of Patent License. + + Subject to the terms and conditions of this License, each Contributor hereby + grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, + irrevocable (except as stated in this section) patent license to make, have + made, use, offer to sell, sell, import, and otherwise transfer the Work, where + such license applies only to those patent claims licensable by such Contributor + that are necessarily infringed by their Contribution(s) alone or by combination + of their Contribution(s) with the Work to which such Contribution(s) was + submitted. If You institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work or a + Contribution incorporated within the Work constitutes direct or contributory + patent infringement, then any patent licenses granted to You under this License + for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. + + You may reproduce and distribute copies of the Work or Derivative Works thereof + in any medium, with or without modifications, and in Source or Object form, + provided that You meet the following conditions: + + You must give any other recipients of the Work or Derivative Works a copy of + this License; and + You must cause any modified files to carry prominent notices stating that You + changed the files; and + You must retain, in the Source form of any Derivative Works that You distribute, + all copyright, patent, trademark, and attribution notices from the Source form + of the Work, excluding those notices that do not pertain to any part of the + Derivative Works; and + If the Work includes a "NOTICE" text file as part of its distribution, then any + Derivative Works that You distribute must include a readable copy of the + attribution notices contained within such NOTICE file, excluding those notices + that do not pertain to any part of the Derivative Works, in at least one of the + following places: within a NOTICE text file distributed as part of the + Derivative Works; within the Source form or documentation, if provided along + with the Derivative Works; or, within a display generated by the Derivative + Works, if and wherever such third-party notices normally appear. The contents of + the NOTICE file are for informational purposes only and do not modify the + License. You may add Your own attribution notices within Derivative Works that + You distribute, alongside or as an addendum to the NOTICE text from the Work, + provided that such additional attribution notices cannot be construed as + modifying the License. + You may add Your own copyright statement to Your modifications and may provide + additional or different license terms and conditions for use, reproduction, or + distribution of Your modifications, or for any such Derivative Works as a whole, + provided Your use, reproduction, and distribution of the Work otherwise complies + with the conditions stated in this License. + + 5. Submission of Contributions. + + Unless You explicitly state otherwise, any Contribution intentionally submitted + for inclusion in the Work by You to the Licensor shall be under the terms and + conditions of this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify the terms of + any separate license agreement you may have executed with Licensor regarding + such Contributions. + + 6. Trademarks. + + This License does not grant permission to use the trade names, trademarks, + service marks, or product names of the Licensor, except as required for + reasonable and customary use in describing the origin of the Work and + reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. + + Unless required by applicable law or agreed to in writing, Licensor provides the + Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + including, without limitation, any warranties or conditions of TITLE, + NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are + solely responsible for determining the appropriateness of using or + redistributing the Work and assume any risks associated with Your exercise of + permissions under this License. + + 8. Limitation of Liability. + + In no event and under no legal theory, whether in tort (including negligence), + contract, or otherwise, unless required by applicable law (such as deliberate + and grossly negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, incidental, + or consequential damages of any character arising as a result of this License or + out of the use or inability to use the Work (including but not limited to + damages for loss of goodwill, work stoppage, computer failure or malfunction, or + any and all other commercial damages or losses), even if such Contributor has + been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. + + While redistributing the Work or Derivative Works thereof, You may choose to + offer, and charge a fee for, acceptance of support, warranty, indemnity, or + other liability obligations and/or rights consistent with this License. However, + in accepting such obligations, You may act only on Your own behalf and on Your + sole responsibility, not on behalf of any other Contributor, and only if You + agree to indemnify, defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason of your + accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work + + To apply the Apache License to your work, attach the following boilerplate + notice, with the fields enclosed by brackets "[]" replaced with your own + identifying information. (Don't include the brackets!) The text should be + enclosed in the appropriate comment syntax for the file format. We also + recommend that a file or class name and description of purpose be included on + the same "printed page" as the copyright notice for easier identification within + third-party archives. + + Copyright 2014 Unknwon + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +- sources: README.md + text: This project is under Apache v2 License. See the [LICENSE](LICENSE) file for + the full license text. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/go-playground/locales.dep.yml b/.licenses/arduino-create-agent/go/github.com/go-playground/locales.dep.yml new file mode 100644 index 000000000..ee78f87a8 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/go-playground/locales.dep.yml @@ -0,0 +1,34 @@ +--- +name: github.com/go-playground/locales +version: v0.14.1 +type: go +summary: +homepage: https://pkg.go.dev/github.com/go-playground/locales +license: mit +licenses: +- sources: LICENSE + text: |- + The MIT License (MIT) + + Copyright (c) 2016 Go Playground + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: README.md + text: Distributed under MIT License, please see license file in code for more details. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/go-playground/locales/currency.dep.yml b/.licenses/arduino-create-agent/go/github.com/go-playground/locales/currency.dep.yml new file mode 100644 index 000000000..7e33d3e3f --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/go-playground/locales/currency.dep.yml @@ -0,0 +1,34 @@ +--- +name: github.com/go-playground/locales/currency +version: v0.14.1 +type: go +summary: +homepage: https://pkg.go.dev/github.com/go-playground/locales/currency +license: mit +licenses: +- sources: locales@v0.14.1/LICENSE + text: |- + The MIT License (MIT) + + Copyright (c) 2016 Go Playground + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: locales@v0.14.1/README.md + text: Distributed under MIT License, please see license file in code for more details. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/go-playground/universal-translator.dep.yml b/.licenses/arduino-create-agent/go/github.com/go-playground/universal-translator.dep.yml new file mode 100644 index 000000000..3efb0fc2b --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/go-playground/universal-translator.dep.yml @@ -0,0 +1,34 @@ +--- +name: github.com/go-playground/universal-translator +version: v0.18.1 +type: go +summary: +homepage: https://pkg.go.dev/github.com/go-playground/universal-translator +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2016 Go Playground + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: README.md + text: Distributed under MIT License, please see license file in code for more details. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/go-playground/validator/v10.dep.yml b/.licenses/arduino-create-agent/go/github.com/go-playground/validator/v10.dep.yml new file mode 100644 index 000000000..59a2acb5e --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/go-playground/validator/v10.dep.yml @@ -0,0 +1,38 @@ +--- +name: github.com/go-playground/validator/v10 +version: v10.20.0 +type: go +summary: Package validator implements value validations for structs and individual + fields based on tags. +homepage: https://pkg.go.dev/github.com/go-playground/validator/v10 +license: mit +licenses: +- sources: LICENSE + text: |+ + The MIT License (MIT) + + Copyright (c) 2015 Dean Karn + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +- sources: README.md + text: Distributed under MIT License, please see license file within the code for + more details. +notices: [] +... diff --git a/.licenses/arduino-create-agent/go/github.com/godbus/dbus/v5.dep.yml b/.licenses/arduino-create-agent/go/github.com/godbus/dbus/v5.dep.yml new file mode 100644 index 000000000..a8ef10a04 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/godbus/dbus/v5.dep.yml @@ -0,0 +1,42 @@ +--- +name: github.com/godbus/dbus/v5 +version: v5.0.4 +type: go +summary: Package dbus implements bindings to the D-Bus message bus system. +homepage: https://pkg.go.dev/github.com/godbus/dbus/v5 +license: bsd-2-clause +licenses: +- sources: LICENSE + text: | + Copyright (c) 2013, Georg Reinke (), Google + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: README.markdown + text: |- + go.dbus is available under the Simplified BSD License; see LICENSE for the full + text. + + Nearly all of the credit for this library goes to github.com/guelfey/go.dbus. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/godbus/dbus/v5/introspect.dep.yml b/.licenses/arduino-create-agent/go/github.com/godbus/dbus/v5/introspect.dep.yml new file mode 100644 index 000000000..fa1753274 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/godbus/dbus/v5/introspect.dep.yml @@ -0,0 +1,43 @@ +--- +name: github.com/godbus/dbus/v5/introspect +version: v5.0.4 +type: go +summary: Package introspect provides some utilities for dealing with the DBus introspection + format. +homepage: https://pkg.go.dev/github.com/godbus/dbus/v5/introspect +license: bsd-2-clause +licenses: +- sources: v5@v5.0.4/LICENSE + text: | + Copyright (c) 2013, Georg Reinke (), Google + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: v5@v5.0.4/README.markdown + text: |- + go.dbus is available under the Simplified BSD License; see LICENSE for the full + text. + + Nearly all of the credit for this library goes to github.com/guelfey/go.dbus. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/godbus/dbus/v5/prop.dep.yml b/.licenses/arduino-create-agent/go/github.com/godbus/dbus/v5/prop.dep.yml new file mode 100644 index 000000000..99695edeb --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/godbus/dbus/v5/prop.dep.yml @@ -0,0 +1,43 @@ +--- +name: github.com/godbus/dbus/v5/prop +version: v5.0.4 +type: go +summary: Package prop provides the Properties struct which can be used to implement + org.freedesktop.DBus.Properties. +homepage: https://pkg.go.dev/github.com/godbus/dbus/v5/prop +license: bsd-2-clause +licenses: +- sources: v5@v5.0.4/LICENSE + text: | + Copyright (c) 2013, Georg Reinke (), Google + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: v5@v5.0.4/README.markdown + text: |- + go.dbus is available under the Simplified BSD License; see LICENSE for the full + text. + + Nearly all of the credit for this library goes to github.com/guelfey/go.dbus. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/google/uuid.dep.yml b/.licenses/arduino-create-agent/go/github.com/google/uuid.dep.yml new file mode 100644 index 000000000..e01f5c108 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/google/uuid.dep.yml @@ -0,0 +1,38 @@ +--- +name: github.com/google/uuid +version: v1.6.0 +type: go +summary: Package uuid generates and inspects UUIDs. +homepage: https://pkg.go.dev/github.com/google/uuid +license: bsd-3-clause +licenses: +- sources: LICENSE + text: | + Copyright (c) 2009,2014 Google Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io.dep.yml new file mode 100644 index 000000000..3d65daba3 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/googollee/go-engine.io +version: v0.0.0-20180829091931-e2f255711dcb +type: go +summary: +homepage: https://pkg.go.dev/github.com/googollee/go-engine.io +license: bsd-3-clause +licenses: +- sources: LICENSE + text: |- + Copyright (c) 2014-2014 Googol Lee + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: README.md + text: The 3-clause BSD License - see LICENSE for more details +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/message.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/message.dep.yml new file mode 100644 index 000000000..55490cf08 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/message.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/googollee/go-engine.io/message +version: v0.0.0-20180829091931-e2f255711dcb +type: go +summary: +homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/message +license: bsd-3-clause +licenses: +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/LICENSE + text: |- + Copyright (c) 2014-2014 Googol Lee + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/README.md + text: The 3-clause BSD License - see LICENSE for more details +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/parser.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/parser.dep.yml new file mode 100644 index 000000000..718fadade --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/parser.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/googollee/go-engine.io/parser +version: v0.0.0-20180829091931-e2f255711dcb +type: go +summary: +homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/parser +license: bsd-3-clause +licenses: +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/LICENSE + text: |- + Copyright (c) 2014-2014 Googol Lee + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/README.md + text: The 3-clause BSD License - see LICENSE for more details +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/polling.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/polling.dep.yml new file mode 100644 index 000000000..5692db014 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/polling.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/googollee/go-engine.io/polling +version: v0.0.0-20180829091931-e2f255711dcb +type: go +summary: +homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/polling +license: bsd-3-clause +licenses: +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/LICENSE + text: |- + Copyright (c) 2014-2014 Googol Lee + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/README.md + text: The 3-clause BSD License - see LICENSE for more details +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/transport.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/transport.dep.yml new file mode 100644 index 000000000..430ab5ad5 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/transport.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/googollee/go-engine.io/transport +version: v0.0.0-20180829091931-e2f255711dcb +type: go +summary: +homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/transport +license: bsd-3-clause +licenses: +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/LICENSE + text: |- + Copyright (c) 2014-2014 Googol Lee + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/README.md + text: The 3-clause BSD License - see LICENSE for more details +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/websocket.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/websocket.dep.yml new file mode 100644 index 000000000..3718a69b2 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/websocket.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/googollee/go-engine.io/websocket +version: v0.0.0-20180829091931-e2f255711dcb +type: go +summary: +homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/websocket +license: bsd-3-clause +licenses: +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/LICENSE + text: |- + Copyright (c) 2014-2014 Googol Lee + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-engine.io@v0.0.0-20180829091931-e2f255711dcb/README.md + text: The 3-clause BSD License - see LICENSE for more details +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-socket.io.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-socket.io.dep.yml new file mode 100644 index 000000000..fb650bfe3 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-socket.io.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/googollee/go-socket.io +version: v0.0.0-20181101151912-c8aeb1ed9b49 +type: go +summary: go-socket.io is a server implementation of socket.io in golang. +homepage: https://pkg.go.dev/github.com/googollee/go-socket.io +license: bsd-3-clause +licenses: +- sources: LICENSE + text: |- + Copyright (c) 2014-2014 Googol Lee + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: README.md + text: The 3-clause BSD License - see LICENSE for more details +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/gorilla/websocket.dep.yml b/.licenses/arduino-create-agent/go/github.com/gorilla/websocket.dep.yml new file mode 100644 index 000000000..0d0f4b6bb --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/gorilla/websocket.dep.yml @@ -0,0 +1,29 @@ +--- +name: github.com/gorilla/websocket +version: v1.5.1 +type: go +summary: Package websocket implements the WebSocket protocol defined in RFC 6455. +homepage: https://pkg.go.dev/github.com/gorilla/websocket +license: bsd-3-clause +licenses: +- sources: LICENSE + text: "Copyright (c) 2023 The Gorilla Authors. All rights reserved.\n\nRedistribution + and use in source and binary forms, with or without\nmodification, are permitted + provided that the following conditions are\nmet:\n\n\t * Redistributions of source + code must retain the above copyright\nnotice, this list of conditions and the + following disclaimer.\n\t * Redistributions in binary form must reproduce the + above\ncopyright notice, this list of conditions and the following disclaimer\nin + the documentation and/or other materials provided with the\ndistribution.\n\t + * Neither the name of Google Inc. nor the names of its\ncontributors may be used + to endorse or promote products derived from\nthis software without specific prior + written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT + NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/h2non/filetype.dep.yml b/.licenses/arduino-create-agent/go/github.com/h2non/filetype.dep.yml new file mode 100644 index 000000000..ce88ad732 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/h2non/filetype.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/h2non/filetype +version: v1.1.3 +type: go +summary: +homepage: https://pkg.go.dev/github.com/h2non/filetype +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License + + Copyright (c) Tomas Aparicio + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +- sources: README.md + text: MIT - Tomas Aparicio +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers.dep.yml b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers.dep.yml new file mode 100644 index 000000000..e441102a1 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/h2non/filetype/matchers +version: v1.1.3 +type: go +summary: +homepage: https://pkg.go.dev/github.com/h2non/filetype/matchers +license: mit +licenses: +- sources: filetype@v1.1.3/LICENSE + text: | + The MIT License + + Copyright (c) Tomas Aparicio + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +- sources: filetype@v1.1.3/README.md + text: MIT - Tomas Aparicio +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers/isobmff.dep.yml b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers/isobmff.dep.yml new file mode 100644 index 000000000..d18a56f5a --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers/isobmff.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/h2non/filetype/matchers/isobmff +version: v1.1.3 +type: go +summary: +homepage: https://pkg.go.dev/github.com/h2non/filetype/matchers/isobmff +license: mit +licenses: +- sources: filetype@v1.1.3/LICENSE + text: | + The MIT License + + Copyright (c) Tomas Aparicio + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +- sources: filetype@v1.1.3/README.md + text: MIT - Tomas Aparicio +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/h2non/filetype/types.dep.yml b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/types.dep.yml new file mode 100644 index 000000000..6a3e9ff8c --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/types.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/h2non/filetype/types +version: v1.1.3 +type: go +summary: +homepage: https://pkg.go.dev/github.com/h2non/filetype/types +license: mit +licenses: +- sources: filetype@v1.1.3/LICENSE + text: | + The MIT License + + Copyright (c) Tomas Aparicio + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +- sources: filetype@v1.1.3/README.md + text: MIT - Tomas Aparicio +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/juju/errors.dep.yml b/.licenses/arduino-create-agent/go/github.com/juju/errors.dep.yml new file mode 100644 index 000000000..670e3a0bc --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/juju/errors.dep.yml @@ -0,0 +1,203 @@ +--- +name: github.com/juju/errors +version: v1.0.0 +type: go +summary: Package errors provides an easy way to annotate errors without losing the + original error context. +homepage: https://pkg.go.dev/github.com/juju/errors +license: lgpl-3.0-only +licenses: +- sources: LICENSE + text: | + All files in this repository are licensed as follows. If you contribute + to this repository, it is assumed that you license your contribution + under the same license unless you state otherwise. + + All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. + + This software is licensed under the LGPLv3, included below. + + As a special exception to the GNU Lesser General Public License version 3 + ("LGPL3"), the copyright holders of this Library give you permission to + convey to a third party a Combined Work that links statically or dynamically + to this Library without providing any Minimal Corresponding Source or + Minimal Application Code as set out in 4d or providing the installation + information set out in section 4e, provided that you comply with the other + provisions of LGPL3 and provided that you meet, for the Application the + terms and conditions of the license(s) which apply to the Application. + + Except as stated in this special exception, the provisions of LGPL3 will + continue to comply in full to this Library. If you modify this Library, you + may apply this exception to your version of this Library, but you are not + obliged to do so. If you do not wish to do so, delete this exception + statement from your version. This exception does not (and cannot) modify any + license terms which apply to the Application, with which you must still + comply. + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates + the terms and conditions of version 3 of the GNU General Public + License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser + General Public License, and the "GNU GPL" refers to version 3 of the GNU + General Public License. + + "The Library" refers to a covered work governed by this License, + other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided + by the Library, but which is not otherwise based on the Library. + Defining a subclass of a class defined by the Library is deemed a mode + of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an + Application with the Library. The particular version of the Library + with which the Combined Work was made is also called the "Linked + Version". + + The "Minimal Corresponding Source" for a Combined Work means the + Corresponding Source for the Combined Work, excluding any source code + for portions of the Combined Work that, considered in isolation, are + based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the + object code and/or source code for the Application, including any data + and utility programs needed for reproducing the Combined Work from the + Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License + without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a + facility refers to a function or data to be supplied by an Application + that uses the facility (other than as an argument passed when the + facility is invoked), then you may convey a copy of the modified + version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from + a header file that is part of the Library. You may convey such object + code under terms of your choice, provided that, if the incorporated + material is not limited to numerical parameters, data structure + layouts and accessors, or small macros, inline functions and templates + (ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, + taken together, effectively do not restrict modification of the + portions of the Library contained in the Combined Work and reverse + engineering for debugging such modifications, if you also do each of + the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the + Library side by side in a single library together with other library + facilities that are not Applications and are not covered by this + License, and convey such a combined library under terms of your + choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions + of the GNU Lesser General Public License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Library as you received it specifies that a certain numbered version + of the GNU Lesser General Public License "or any later version" + applies to it, you have the option of following the terms and + conditions either of that published version or of any later version + published by the Free Software Foundation. If the Library as you + received it does not specify a version number of the GNU Lesser + General Public License, you may choose any version of the GNU Lesser + General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide + whether future versions of the GNU Lesser General Public License shall + apply, that proxy's public statement of acceptance of any version is + permanent authorization for you to choose that version for the + Library. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/kardianos/osext.dep.yml b/.licenses/arduino-create-agent/go/github.com/kardianos/osext.dep.yml new file mode 100644 index 000000000..d7afd8fad --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/kardianos/osext.dep.yml @@ -0,0 +1,38 @@ +--- +name: github.com/kardianos/osext +version: v0.0.0-20190222173326-2bc1f35cddc0 +type: go +summary: Extensions to the standard "os" package. +homepage: https://pkg.go.dev/github.com/kardianos/osext +license: bsd-3-clause +licenses: +- sources: LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/klauspost/compress.dep.yml b/.licenses/arduino-create-agent/go/github.com/klauspost/compress.dep.yml new file mode 100644 index 000000000..6015c205c --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/klauspost/compress.dep.yml @@ -0,0 +1,318 @@ +--- +name: github.com/klauspost/compress +version: v1.17.0 +type: go +summary: +homepage: https://pkg.go.dev/github.com/klauspost/compress +license: bsd-3-clause +licenses: +- sources: LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- sources: README.md + text: This code is licensed under the same conditions as the original Go code. See + LICENSE file. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/klauspost/compress/fse.dep.yml b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/fse.dep.yml new file mode 100644 index 000000000..8d885e97e --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/fse.dep.yml @@ -0,0 +1,315 @@ +--- +name: github.com/klauspost/compress/fse +version: v1.17.0 +type: go +summary: Package fse provides Finite State Entropy encoding and decoding. +homepage: https://pkg.go.dev/github.com/klauspost/compress/fse +license: bsd-3-clause +licenses: +- sources: compress@v1.17.0/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/klauspost/compress/huff0.dep.yml b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/huff0.dep.yml new file mode 100644 index 000000000..30901b047 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/huff0.dep.yml @@ -0,0 +1,316 @@ +--- +name: github.com/klauspost/compress/huff0 +version: v1.17.0 +type: go +summary: This file contains the specialisation of Decoder.Decompress4X and Decoder.Decompress1X + that use an asm implementation of thir main loops. +homepage: https://pkg.go.dev/github.com/klauspost/compress/huff0 +license: bsd-3-clause +licenses: +- sources: compress@v1.17.0/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/klauspost/compress/internal/cpuinfo.dep.yml b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/internal/cpuinfo.dep.yml new file mode 100644 index 000000000..9b6923997 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/internal/cpuinfo.dep.yml @@ -0,0 +1,318 @@ +--- +name: github.com/klauspost/compress/internal/cpuinfo +version: v1.17.0 +type: go +summary: Package cpuinfo gives runtime info about the current CPU. +homepage: https://pkg.go.dev/github.com/klauspost/compress/internal/cpuinfo +license: bsd-3-clause +licenses: +- sources: compress@v1.17.0/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- sources: compress@v1.17.0/README.md + text: This code is licensed under the same conditions as the original Go code. See + LICENSE file. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/klauspost/compress/internal/snapref.dep.yml b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/internal/snapref.dep.yml new file mode 100644 index 000000000..76d6e0025 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/internal/snapref.dep.yml @@ -0,0 +1,347 @@ +--- +name: github.com/klauspost/compress/internal/snapref +version: v1.17.0 +type: go +summary: Package snapref implements the Snappy compression format. +homepage: https://pkg.go.dev/github.com/klauspost/compress/internal/snapref +license: bsd-3-clause +licenses: +- sources: LICENSE + text: | + Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: compress@v1.17.0/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- sources: compress@v1.17.0/README.md + text: This code is licensed under the same conditions as the original Go code. See + LICENSE file. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/klauspost/compress/zstd.dep.yml b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/zstd.dep.yml new file mode 100644 index 000000000..e7dc8db67 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/zstd.dep.yml @@ -0,0 +1,315 @@ +--- +name: github.com/klauspost/compress/zstd +version: v1.17.0 +type: go +summary: Package zstd provides decompression of zstandard files. +homepage: https://pkg.go.dev/github.com/klauspost/compress/zstd +license: bsd-3-clause +licenses: +- sources: compress@v1.17.0/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/klauspost/compress/zstd/internal/xxhash.dep.yml b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/zstd/internal/xxhash.dep.yml new file mode 100644 index 000000000..6fc4c211b --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/klauspost/compress/zstd/internal/xxhash.dep.yml @@ -0,0 +1,339 @@ +--- +name: github.com/klauspost/compress/zstd/internal/xxhash +version: v1.17.0 +type: go +summary: +homepage: https://pkg.go.dev/github.com/klauspost/compress/zstd/internal/xxhash +license: bsd-3-clause +licenses: +- sources: compress@v1.17.0/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- sources: LICENSE.txt + text: | + Copyright (c) 2016 Caleb Spare + + MIT License + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/kr/binarydist.dep.yml b/.licenses/arduino-create-agent/go/github.com/kr/binarydist.dep.yml new file mode 100644 index 000000000..9487d6f08 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/kr/binarydist.dep.yml @@ -0,0 +1,33 @@ +--- +name: github.com/kr/binarydist +version: v0.1.0 +type: go +summary: Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/. +homepage: https://pkg.go.dev/github.com/kr/binarydist +license: mit +licenses: +- sources: License + text: | + Copyright 2012 Keith Rarick + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/leodido/go-urn.dep.yml b/.licenses/arduino-create-agent/go/github.com/leodido/go-urn.dep.yml new file mode 100644 index 000000000..5c146cf19 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/leodido/go-urn.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/leodido/go-urn +version: v1.4.0 +type: go +summary: +homepage: https://pkg.go.dev/github.com/leodido/go-urn +license: mit +licenses: +- sources: LICENSE + text: | + MIT License + + Copyright (c) 2018 Leonardo Di Donato + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/leodido/go-urn/scim/schema.dep.yml b/.licenses/arduino-create-agent/go/github.com/leodido/go-urn/scim/schema.dep.yml new file mode 100644 index 000000000..db9fe5292 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/leodido/go-urn/scim/schema.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/leodido/go-urn/scim/schema +version: v1.4.0 +type: go +summary: +homepage: https://pkg.go.dev/github.com/leodido/go-urn/scim/schema +license: mit +licenses: +- sources: go-urn@v1.4.0/LICENSE + text: | + MIT License + + Copyright (c) 2018 Leonardo Di Donato + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/mattn/go-isatty.dep.yml b/.licenses/arduino-create-agent/go/github.com/mattn/go-isatty.dep.yml new file mode 100644 index 000000000..fcf391275 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/mattn/go-isatty.dep.yml @@ -0,0 +1,22 @@ +--- +name: github.com/mattn/go-isatty +version: v0.0.20 +type: go +summary: Package isatty implements interface to isatty +homepage: https://pkg.go.dev/github.com/mattn/go-isatty +license: mit +licenses: +- sources: LICENSE + text: | + Copyright (c) Yasuhiro MATSUMOTO + + MIT License (Expat) + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- sources: README.md + text: MIT +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/mattn/go-shellwords.dep.yml b/.licenses/arduino-create-agent/go/github.com/mattn/go-shellwords.dep.yml new file mode 100644 index 000000000..742e6604f --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/mattn/go-shellwords.dep.yml @@ -0,0 +1,34 @@ +--- +name: github.com/mattn/go-shellwords +version: v1.0.12 +type: go +summary: +homepage: https://pkg.go.dev/github.com/mattn/go-shellwords +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2017 Yasuhiro Matsumoto + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: README.md + text: 'under the MIT License: http://mattn.mit-license.org/2017' +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2.dep.yml new file mode 100644 index 000000000..44cb14185 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2.dep.yml @@ -0,0 +1,35 @@ +--- +name: github.com/pelletier/go-toml/v2 +version: v2.2.2 +type: go +summary: Package toml is a library to read and write TOML documents. +homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2 +license: other +licenses: +- sources: LICENSE + text: | + The MIT License (MIT) + + go-toml v2 + Copyright (c) 2021 - 2023 Thomas Pelletier + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: README.md + text: The MIT License (MIT). Read [LICENSE](LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml new file mode 100644 index 000000000..59a3269ba --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml @@ -0,0 +1,35 @@ +--- +name: github.com/pelletier/go-toml/v2/internal/characters +version: v2.2.2 +type: go +summary: +homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/characters +license: other +licenses: +- sources: v2@v2.2.2/LICENSE + text: | + The MIT License (MIT) + + go-toml v2 + Copyright (c) 2021 - 2023 Thomas Pelletier + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: v2@v2.2.2/README.md + text: The MIT License (MIT). Read [LICENSE](LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml new file mode 100644 index 000000000..36075df83 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml @@ -0,0 +1,35 @@ +--- +name: github.com/pelletier/go-toml/v2/internal/danger +version: v2.2.2 +type: go +summary: +homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/danger +license: other +licenses: +- sources: v2@v2.2.2/LICENSE + text: | + The MIT License (MIT) + + go-toml v2 + Copyright (c) 2021 - 2023 Thomas Pelletier + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: v2@v2.2.2/README.md + text: The MIT License (MIT). Read [LICENSE](LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml new file mode 100644 index 000000000..954011183 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml @@ -0,0 +1,35 @@ +--- +name: github.com/pelletier/go-toml/v2/internal/tracker +version: v2.2.2 +type: go +summary: +homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/tracker +license: other +licenses: +- sources: v2@v2.2.2/LICENSE + text: | + The MIT License (MIT) + + go-toml v2 + Copyright (c) 2021 - 2023 Thomas Pelletier + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: v2@v2.2.2/README.md + text: The MIT License (MIT). Read [LICENSE](LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/unstable.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/unstable.dep.yml new file mode 100644 index 000000000..4fc5a61cb --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/unstable.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/pelletier/go-toml/v2/unstable +version: v2.2.2 +type: go +summary: Package unstable provides APIs that do not meet the backward compatibility + guarantees yet. +homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/unstable +license: other +licenses: +- sources: v2@v2.2.2/LICENSE + text: | + The MIT License (MIT) + + go-toml v2 + Copyright (c) 2021 - 2023 Thomas Pelletier + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: v2@v2.2.2/README.md + text: The MIT License (MIT). Read [LICENSE](LICENSE). +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/pkg/errors.dep.yml b/.licenses/arduino-create-agent/go/github.com/pkg/errors.dep.yml new file mode 100644 index 000000000..a9b72bc4b --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/pkg/errors.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/pkg/errors +version: v0.9.1 +type: go +summary: Package errors provides simple error handling primitives. +homepage: https://pkg.go.dev/github.com/pkg/errors +license: bsd-2-clause +licenses: +- sources: LICENSE + text: | + Copyright (c) 2015, Dave Cheney + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: README.md + text: BSD-2-Clause +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/sirupsen/logrus.dep.yml b/.licenses/arduino-create-agent/go/github.com/sirupsen/logrus.dep.yml new file mode 100644 index 000000000..07801f93d --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/sirupsen/logrus.dep.yml @@ -0,0 +1,33 @@ +--- +name: github.com/sirupsen/logrus +version: v1.9.3 +type: go +summary: Package logrus is a structured logger for Go, completely API compatible with + the standard library logger. +homepage: https://pkg.go.dev/github.com/sirupsen/logrus +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2014 Simon Eskildsen + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/skratchdot/open-golang/open.dep.yml b/.licenses/arduino-create-agent/go/github.com/skratchdot/open-golang/open.dep.yml new file mode 100644 index 000000000..2cd61387d --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/skratchdot/open-golang/open.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/skratchdot/open-golang/open +version: v0.0.0-20200116055534-eef842397966 +type: go +summary: Open a file, directory, or URI using the OS's default application for that + object type. +homepage: https://pkg.go.dev/github.com/skratchdot/open-golang/open +license: mit +licenses: +- sources: open-golang@v0.0.0-20200116055534-eef842397966/LICENSE + text: | + Copyright (c) 2013 skratchdot + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +- sources: open-golang@v0.0.0-20200116055534-eef842397966/README.md + text: "Copyright (c) 2013 skratchdot \nLicensed under the MIT license." +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ugorji/go/codec.dep.yml b/.licenses/arduino-create-agent/go/github.com/ugorji/go/codec.dep.yml new file mode 100644 index 000000000..eb52f1cb0 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ugorji/go/codec.dep.yml @@ -0,0 +1,34 @@ +--- +name: github.com/ugorji/go/codec +version: v1.1.6 +type: go +summary: Package codec provides a High Performance, Feature-Rich Idiomatic Go 1.4+ + codec/encoding library for binc, msgpack, cbor, json. +homepage: https://pkg.go.dev/github.com/ugorji/go/codec +license: mit +licenses: +- sources: go@v1.1.6/LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2012-2015 Ugorji Nwoke. + All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz.dep.yml b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz.dep.yml new file mode 100644 index 000000000..b02e158ff --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/ulikunitz/xz +version: v0.5.12 +type: go +summary: Package xz supports the compression and decompression of xz files. +homepage: https://pkg.go.dev/github.com/ulikunitz/xz +license: bsd-3-clause +licenses: +- sources: LICENSE + text: | + Copyright (c) 2014-2022 Ulrich Kunitz + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * My name, Ulrich Kunitz, may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/hash.dep.yml b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/hash.dep.yml new file mode 100644 index 000000000..c9a34e7af --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/hash.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/ulikunitz/xz/internal/hash +version: v0.5.12 +type: go +summary: Package hash provides rolling hashes. +homepage: https://pkg.go.dev/github.com/ulikunitz/xz/internal/hash +license: bsd-3-clause +licenses: +- sources: xz@v0.5.12/LICENSE + text: | + Copyright (c) 2014-2022 Ulrich Kunitz + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * My name, Ulrich Kunitz, may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/xlog.dep.yml b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/xlog.dep.yml new file mode 100644 index 000000000..a5ec30088 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/xlog.dep.yml @@ -0,0 +1,38 @@ +--- +name: github.com/ulikunitz/xz/internal/xlog +version: v0.5.12 +type: go +summary: Package xlog provides a simple logging package that allows to disable certain + message categories. +homepage: https://pkg.go.dev/github.com/ulikunitz/xz/internal/xlog +license: bsd-3-clause +licenses: +- sources: xz@v0.5.12/LICENSE + text: | + Copyright (c) 2014-2022 Ulrich Kunitz + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * My name, Ulrich Kunitz, may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/lzma.dep.yml b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/lzma.dep.yml new file mode 100644 index 000000000..66a937e5e --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/lzma.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/ulikunitz/xz/lzma +version: v0.5.12 +type: go +summary: Package lzma supports the decoding and encoding of LZMA streams. +homepage: https://pkg.go.dev/github.com/ulikunitz/xz/lzma +license: bsd-3-clause +licenses: +- sources: xz@v0.5.12/LICENSE + text: | + Copyright (c) 2014-2022 Ulrich Kunitz + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * My name, Ulrich Kunitz, may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/xrash/smetrics.dep.yml b/.licenses/arduino-create-agent/go/github.com/xrash/smetrics.dep.yml new file mode 100644 index 000000000..cbd322a2e --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/xrash/smetrics.dep.yml @@ -0,0 +1,32 @@ +--- +name: github.com/xrash/smetrics +version: v0.0.0-20170218160415-a3153f7040e9 +type: go +summary: +homepage: https://pkg.go.dev/github.com/xrash/smetrics +license: mit +licenses: +- sources: LICENSE + text: | + Copyright (C) 2016 Felipe da Cunha Gonçalves + All Rights Reserved. + + MIT LICENSE + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml new file mode 100644 index 000000000..73d434109 --- /dev/null +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml @@ -0,0 +1,50 @@ +--- +name: go.bug.st/serial +version: v1.6.4 +type: go +summary: Package serial is a cross-platform serial library for the go language. +homepage: https://pkg.go.dev/go.bug.st/serial +license: bsd-3-clause +licenses: +- sources: LICENSE + text: |2+ + + Copyright (c) 2014-2024, Cristian Maglie. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +- sources: README.md + text: |- + This software is released under the [BSD 3-clause license]. + + [contributors]: https://github.com/bugst/go-serial/graphs/contributors + [BSD 3-clause license]: https://github.com/bugst/go-serial/blob/master/LICENSE +notices: [] diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml new file mode 100644 index 000000000..d7b0b63e1 --- /dev/null +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml @@ -0,0 +1,51 @@ +--- +name: go.bug.st/serial/enumerator +version: v1.6.4 +type: go +summary: Package enumerator is a golang cross-platform library for USB serial port + discovery. +homepage: https://pkg.go.dev/go.bug.st/serial/enumerator +license: bsd-3-clause +licenses: +- sources: serial@v1.6.4/LICENSE + text: |2+ + + Copyright (c) 2014-2024, Cristian Maglie. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +- sources: serial@v1.6.4/README.md + text: |- + This software is released under the [BSD 3-clause license]. + + [contributors]: https://github.com/bugst/go-serial/graphs/contributors + [BSD 3-clause license]: https://github.com/bugst/go-serial/blob/master/LICENSE +notices: [] diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml new file mode 100644 index 000000000..ac5bb6bb1 --- /dev/null +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml @@ -0,0 +1,50 @@ +--- +name: go.bug.st/serial/unixutils +version: v1.6.4 +type: go +summary: +homepage: https://pkg.go.dev/go.bug.st/serial/unixutils +license: bsd-3-clause +licenses: +- sources: serial@v1.6.4/LICENSE + text: |2+ + + Copyright (c) 2014-2024, Cristian Maglie. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +- sources: serial@v1.6.4/README.md + text: |- + This software is released under the [BSD 3-clause license]. + + [contributors]: https://github.com/bugst/go-serial/graphs/contributors + [BSD 3-clause license]: https://github.com/bugst/go-serial/blob/master/LICENSE +notices: [] diff --git a/.licenses/arduino-create-agent/go/goa.design/goa/v3/http.dep.yml b/.licenses/arduino-create-agent/go/goa.design/goa/v3/http.dep.yml new file mode 100644 index 000000000..5b8731876 --- /dev/null +++ b/.licenses/arduino-create-agent/go/goa.design/goa/v3/http.dep.yml @@ -0,0 +1,33 @@ +--- +name: goa.design/goa/v3/http +version: v3.16.1 +type: go +summary: Package http contains HTTP specific constructs that complement the code generated + by Goa. +homepage: https://pkg.go.dev/goa.design/goa/v3/http +license: mit +licenses: +- sources: v3@v3.16.1/LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2015 Raphael Simon and goa Contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/goa.design/goa/v3/http/middleware.dep.yml b/.licenses/arduino-create-agent/go/goa.design/goa/v3/http/middleware.dep.yml new file mode 100644 index 000000000..193108077 --- /dev/null +++ b/.licenses/arduino-create-agent/go/goa.design/goa/v3/http/middleware.dep.yml @@ -0,0 +1,34 @@ +--- +name: goa.design/goa/v3/http/middleware +version: v3.16.1 +type: go +summary: Package middleware contains HTTP middlewares that wrap a HTTP handler to + provide ancilliary functionality such as capturing HTTP details into the request + context or printing debug information on incoming requests. +homepage: https://pkg.go.dev/goa.design/goa/v3/http/middleware +license: mit +licenses: +- sources: v3@v3.16.1/LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2015 Raphael Simon and goa Contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/goa.design/goa/v3/middleware.dep.yml b/.licenses/arduino-create-agent/go/goa.design/goa/v3/middleware.dep.yml new file mode 100644 index 000000000..f84516f4f --- /dev/null +++ b/.licenses/arduino-create-agent/go/goa.design/goa/v3/middleware.dep.yml @@ -0,0 +1,32 @@ +--- +name: goa.design/goa/v3/middleware +version: v3.16.1 +type: go +summary: Package middleware contains transport independent middlewares. +homepage: https://pkg.go.dev/goa.design/goa/v3/middleware +license: mit +licenses: +- sources: v3@v3.16.1/LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2015 Raphael Simon and goa Contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/goa.design/goa/v3/pkg.dep.yml b/.licenses/arduino-create-agent/go/goa.design/goa/v3/pkg.dep.yml new file mode 100644 index 000000000..fc7a78b9d --- /dev/null +++ b/.licenses/arduino-create-agent/go/goa.design/goa/v3/pkg.dep.yml @@ -0,0 +1,34 @@ +--- +name: goa.design/goa/v3/pkg +version: v3.16.1 +type: go +summary: Package goa implements a Go framework for writing microservices that promotes + best practice by providing a single source of truth from which server code, client + code, and documentation is derived. +homepage: https://pkg.go.dev/goa.design/goa/v3/pkg +license: mit +licenses: +- sources: v3@v3.16.1/LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2015 Raphael Simon and goa Contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/crypto/argon2.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/crypto/argon2.dep.yml new file mode 100644 index 000000000..cc73f399f --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/crypto/argon2.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/crypto/argon2 +version: v0.23.0 +type: go +summary: Package argon2 implements the key derivation function Argon2. +homepage: https://pkg.go.dev/golang.org/x/crypto/argon2 +license: bsd-3-clause +licenses: +- sources: crypto@v0.23.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: crypto@v0.23.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/crypto/blake2b.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/crypto/blake2b.dep.yml new file mode 100644 index 000000000..ef8816c59 --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/crypto/blake2b.dep.yml @@ -0,0 +1,63 @@ +--- +name: golang.org/x/crypto/blake2b +version: v0.23.0 +type: go +summary: Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 + and the extendable output function (XOF) BLAKE2Xb. +homepage: https://pkg.go.dev/golang.org/x/crypto/blake2b +license: bsd-3-clause +licenses: +- sources: crypto@v0.23.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: crypto@v0.23.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/crypto/cast5.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/crypto/cast5.dep.yml new file mode 100644 index 000000000..369aae2e1 --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/crypto/cast5.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/crypto/cast5 +version: v0.23.0 +type: go +summary: Package cast5 implements CAST5, as defined in RFC 2144. +homepage: https://pkg.go.dev/golang.org/x/crypto/cast5 +license: bsd-3-clause +licenses: +- sources: crypto@v0.23.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: crypto@v0.23.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/html.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/html.dep.yml new file mode 100644 index 000000000..be34abd7f --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/html.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/net/html +version: v0.25.0 +type: go +summary: Package html implements an HTML5-compliant tokenizer and parser. +homepage: https://pkg.go.dev/golang.org/x/net/html +license: other +licenses: +- sources: net@v0.25.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: net@v0.25.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/html/atom.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/html/atom.dep.yml new file mode 100644 index 000000000..49ddaa0f3 --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/html/atom.dep.yml @@ -0,0 +1,64 @@ +--- +name: golang.org/x/net/html/atom +version: v0.25.0 +type: go +summary: 'Package atom provides integer codes (also known as atoms) for a fixed set + of frequently occurring HTML strings: tag names and attribute keys such as "p" and + "id".' +homepage: https://pkg.go.dev/golang.org/x/net/html/atom +license: other +licenses: +- sources: net@v0.25.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: net@v0.25.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/http2.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/http2.dep.yml new file mode 100644 index 000000000..4e442b810 --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/http2.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/net/http2 +version: v0.25.0 +type: go +summary: Package http2 implements the HTTP/2 protocol. +homepage: https://pkg.go.dev/golang.org/x/net/http2 +license: bsd-3-clause +licenses: +- sources: net@v0.25.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: net@v0.25.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/http2/h2c.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/http2/h2c.dep.yml new file mode 100644 index 000000000..38586be25 --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/http2/h2c.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/net/http2/h2c +version: v0.25.0 +type: go +summary: Package h2c implements the unencrypted "h2c" form of HTTP/2. +homepage: https://pkg.go.dev/golang.org/x/net/http2/h2c +license: bsd-3-clause +licenses: +- sources: net@v0.25.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: net@v0.25.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/internal/socks.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/internal/socks.dep.yml new file mode 100644 index 000000000..5e49f37c5 --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/internal/socks.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/net/internal/socks +version: v0.25.0 +type: go +summary: Package socks provides a SOCKS version 5 client implementation. +homepage: https://pkg.go.dev/golang.org/x/net/internal/socks +license: other +licenses: +- sources: net@v0.25.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: net@v0.25.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/proxy.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/proxy.dep.yml new file mode 100644 index 000000000..a87c7e359 --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/proxy.dep.yml @@ -0,0 +1,63 @@ +--- +name: golang.org/x/net/proxy +version: v0.25.0 +type: go +summary: Package proxy provides support for a variety of protocols to proxy network + data. +homepage: https://pkg.go.dev/golang.org/x/net/proxy +license: other +licenses: +- sources: net@v0.25.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: net@v0.25.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml new file mode 100644 index 000000000..5c4780a8d --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/sys/unix +version: v0.23.0 +type: go +summary: Package unix contains an interface to the low-level operating system primitives. +homepage: https://pkg.go.dev/golang.org/x/sys/unix +license: other +licenses: +- sources: sys@v0.23.0/LICENSE + text: | + Copyright 2009 The Go Authors. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: sys@v0.23.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml new file mode 100644 index 000000000..4a392d8cf --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/text/internal/language +version: v0.15.0 +type: go +summary: +homepage: https://pkg.go.dev/golang.org/x/text/internal/language +license: bsd-3-clause +licenses: +- sources: text@v0.15.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: text@v0.15.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language/compact.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language/compact.dep.yml new file mode 100644 index 000000000..d6e0022d2 --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language/compact.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/text/internal/language/compact +version: v0.15.0 +type: go +summary: Package compact defines a compact representation of language tags. +homepage: https://pkg.go.dev/golang.org/x/text/internal/language/compact +license: bsd-3-clause +licenses: +- sources: text@v0.15.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: text@v0.15.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/tag.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/tag.dep.yml new file mode 100644 index 000000000..f5b00b4eb --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/tag.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/text/internal/tag +version: v0.15.0 +type: go +summary: Package tag contains functionality handling tags and related data. +homepage: https://pkg.go.dev/golang.org/x/text/internal/tag +license: bsd-3-clause +licenses: +- sources: text@v0.15.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: text@v0.15.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/text/language.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/text/language.dep.yml new file mode 100644 index 000000000..ee9e1f0d0 --- /dev/null +++ b/.licenses/arduino-create-agent/go/golang.org/x/text/language.dep.yml @@ -0,0 +1,62 @@ +--- +name: golang.org/x/text/language +version: v0.15.0 +type: go +summary: Package language implements BCP 47 language tags and related functionality. +homepage: https://pkg.go.dev/golang.org/x/text/language +license: bsd-3-clause +licenses: +- sources: text@v0.15.0/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: text@v0.15.0/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/encoding/protowire.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/encoding/protowire.dep.yml new file mode 100644 index 000000000..d935d1df6 --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/encoding/protowire.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/encoding/protowire +version: v1.34.1 +type: go +summary: Package protowire parses and formats the raw wire encoding. +homepage: https://pkg.go.dev/google.golang.org/protobuf/encoding/protowire +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/detrand.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/detrand.dep.yml new file mode 100644 index 000000000..1b4a97a55 --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/detrand.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/internal/detrand +version: v1.34.1 +type: go +summary: Package detrand provides deterministically random functionality. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/detrand +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml new file mode 100644 index 000000000..8cf22dded --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/internal/encoding/messageset +version: v1.34.1 +type: go +summary: Package messageset encodes and decodes the obsolete MessageSet wire format. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/encoding/messageset +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/errors.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/errors.dep.yml new file mode 100644 index 000000000..ee63cc3d2 --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/errors.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/internal/errors +version: v1.34.1 +type: go +summary: Package errors implements functions to manipulate errors. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/errors +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/flags.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/flags.dep.yml new file mode 100644 index 000000000..4ad5ad854 --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/flags.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/internal/flags +version: v1.34.1 +type: go +summary: Package flags provides a set of flags controlled by build tags. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/flags +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/genid.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/genid.dep.yml new file mode 100644 index 000000000..74669222b --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/genid.dep.yml @@ -0,0 +1,63 @@ +--- +name: google.golang.org/protobuf/internal/genid +version: v1.34.1 +type: go +summary: Package genid contains constants for declarations in descriptor.proto and + the well-known types. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/genid +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/order.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/order.dep.yml new file mode 100644 index 000000000..43e239a6b --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/order.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/internal/order +version: v1.34.1 +type: go +summary: Package order provides ordered access to messages and maps. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/order +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/pragma.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/pragma.dep.yml new file mode 100644 index 000000000..b8f4d4e96 --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/pragma.dep.yml @@ -0,0 +1,63 @@ +--- +name: google.golang.org/protobuf/internal/pragma +version: v1.34.1 +type: go +summary: Package pragma provides types that can be embedded into a struct to statically + enforce or prevent certain language properties. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/pragma +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/strs.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/strs.dep.yml new file mode 100644 index 000000000..a2137bf66 --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/strs.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/internal/strs +version: v1.34.1 +type: go +summary: Package strs provides string manipulation functionality specific to protobuf. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/strs +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/proto.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/proto.dep.yml new file mode 100644 index 000000000..bcbae244e --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/proto.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/proto +version: v1.34.1 +type: go +summary: Package proto provides functions operating on protocol buffer messages. +homepage: https://pkg.go.dev/google.golang.org/protobuf/proto +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml new file mode 100644 index 000000000..d38294499 --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/reflect/protoreflect +version: v1.34.1 +type: go +summary: Package protoreflect provides interfaces to dynamically manipulate messages. +homepage: https://pkg.go.dev/google.golang.org/protobuf/reflect/protoreflect +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml new file mode 100644 index 000000000..737474192 --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml @@ -0,0 +1,63 @@ +--- +name: google.golang.org/protobuf/reflect/protoregistry +version: v1.34.1 +type: go +summary: Package protoregistry provides data structures to register and lookup protobuf + descriptor types. +homepage: https://pkg.go.dev/google.golang.org/protobuf/reflect/protoregistry +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/runtime/protoiface.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/runtime/protoiface.dep.yml new file mode 100644 index 000000000..559ff53fc --- /dev/null +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/runtime/protoiface.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/runtime/protoiface +version: v1.34.1 +type: go +summary: Package protoiface contains types referenced or implemented by messages. +homepage: https://pkg.go.dev/google.golang.org/protobuf/runtime/protoiface +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.1/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.1/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0.dep.yml b/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0.dep.yml new file mode 100644 index 000000000..9aaf42dd7 --- /dev/null +++ b/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0.dep.yml @@ -0,0 +1,27 @@ +--- +name: gopkg.in/inconshreveable/go-update.v0 +version: v0.0.0-20150814200126-d8b0b1d421aa +type: go +summary: go-update allows a program to update itself by replacing its executable file + with a new version. +homepage: https://pkg.go.dev/gopkg.in/inconshreveable/go-update.v0 +license: apache-2.0 +licenses: +- sources: LICENSE + text: | + Copyright 2014 Alan Shreve + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +- sources: README.md + text: Apache +notices: [] diff --git a/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0/download.dep.yml b/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0/download.dep.yml new file mode 100644 index 000000000..12e0b1dcf --- /dev/null +++ b/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0/download.dep.yml @@ -0,0 +1,26 @@ +--- +name: gopkg.in/inconshreveable/go-update.v0/download +version: v0.0.0-20150814200126-d8b0b1d421aa +type: go +summary: +homepage: https://pkg.go.dev/gopkg.in/inconshreveable/go-update.v0/download +license: apache-2.0 +licenses: +- sources: go-update.v0@v0.0.0-20150814200126-d8b0b1d421aa/LICENSE + text: | + Copyright 2014 Alan Shreve + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +- sources: go-update.v0@v0.0.0-20150814200126-d8b0b1d421aa/README.md + text: Apache +notices: [] diff --git a/.licenses/arduino-create-agent/go/gopkg.in/yaml.v3.dep.yml b/.licenses/arduino-create-agent/go/gopkg.in/yaml.v3.dep.yml new file mode 100644 index 000000000..cef0ee501 --- /dev/null +++ b/.licenses/arduino-create-agent/go/gopkg.in/yaml.v3.dep.yml @@ -0,0 +1,80 @@ +--- +name: gopkg.in/yaml.v3 +version: v3.0.1 +type: go +summary: Package yaml implements YAML support for the Go language. +homepage: https://pkg.go.dev/gopkg.in/yaml.v3 +license: mit +licenses: +- sources: LICENSE + text: |2 + + This project is covered by two different licenses: MIT and Apache. + + #### MIT License #### + + The following files were ported to Go from C files of libyaml, and thus + are still covered by their original MIT license, with the additional + copyright staring in 2011 when the project was ported over: + + apic.go emitterc.go parserc.go readerc.go scannerc.go + writerc.go yamlh.go yamlprivateh.go + + Copyright (c) 2006-2010 Kirill Simonov + Copyright (c) 2006-2011 Kirill Simonov + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do + so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + ### Apache License ### + + All the remaining project files are covered by the Apache license: + + Copyright (c) 2011-2019 Canonical Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +- sources: README.md + text: |- + The yaml package is licensed under the MIT and Apache License 2.0 licenses. + Please see the LICENSE file for details. +notices: +- sources: NOTICE + text: |- + Copyright 2011-2016 Canonical Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/ArduinoCreateAgent.xml b/ArduinoCreateAgent.xml deleted file mode 100644 index 0b601a9b1..000000000 --- a/ArduinoCreateAgent.xml +++ /dev/null @@ -1,332 +0,0 @@ - - ArduinoCreateAgent - arduino-create-agent - 1.0 - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/LICENSE.md - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/installer_icons/Installer.png - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/installer_icons/InstallerIcon.png - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/installer_icons/InstallerSplash.png - auto - - - default - Default Component - 1 - 1 - 1 - - - - ${installdir}/Arduino_Create_Bridge - ${installdir}/InstallerIcon.png - Arduino Create Agent - - linux-x64 - 0 - 0 - - - - - - - - - Program Files - ${installdir} - programfiles - all - - - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/fakecerts/cert.pem - - - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/fakecerts/key.pem - - - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/config.ini - - - - - Uninstall - ${installdir}/${uninstallerName} - - Uninstall ${product_fullname} - ${installdir} - all - 0 - 0 - ${installdir}/${uninstallerName}.exe - - - ${installdir} - - - - - Program Files - ${installdir} - programfileslinux - linux-x64 - - - 1 - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/snapshot/linux_amd64/Arduino_Create_Bridge - - - /tmp/linux/arduino/arduino - - - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/installer_icons/InstallerIcon.png - - - - - Program Files - ${installdir} - programfileswindows - windows - - - 1 - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/snapshot/windows_386/Arduino_Create_Bridge.exe - - - /tmp/windows/arduino/arduino - - - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/installer_icons/tray_iconWin.ico - - - - - Program Files - ${installdir} - programfilesosx - osx - - - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/snapshot/darwin_amd64/Arduino_Create_Bridge - - - /tmp/macosx/arduino/arduino - - - - - Autostart - ${user_home_directory}/.config/autostart/ - xdgautostart - linux-x64 - - - - ${installdir}/Arduino_Create_Bridge - ${installdir}/InstallerIcon.png - arduino-create-agent - - linux-x64 - 0 - 0 - - - - - - - - - Autostart - ${windows_folder_common_startup} - winautostart - windows - - - - - - Arduino Create Agent - - windows - 0 - 0 - ${installdir}/Arduino_Create_Bridge.exe - - - - - - - - - - Uninstall ${product_fullname} - Uninstall ${product_fullname} - 0 - 0 - ${installdir}/${uninstallerName}.exe - - - ${installdir}/ - - - - Arduino Create Agent - 0 - 0 - ${installdir}/Arduino_Create_Bridge - - ${installdir}/tray_IconWin.ico - - - - - - - - /tmp/linux/arduino - - - /tmp/macosx/arduino - - - /tmp/windows/arduino - - - /tmp/linux/Arduino_Create_Bridge - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/snapshot/linux_amd64/Arduino_Create_Bridge - - - /tmp/macosx/Arduino_Create_Bridge - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/snapshot/darwin_amd64/Arduino_Create_Bridge - - - /tmp/windows/Arduino_Create_Bridge.exe - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/snapshot/windows_386/Arduino_Create_Bridge.exe - - - /tmp/linux/arduino/ - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/snapshot/linux_amd64/arduino.zip - - - /tmp/macosx/arduino/ - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/snapshot/darwin_amd64/arduino.zip - - - /tmp/windows/arduino/ - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/snapshot/windows_386/arduino.zip - - - - - 0 - tar - czvf ${product_shortname}-${product_version}-${platform_name}-installer.tar.gz ${product_shortname}-${product_version}-${platform_name}-installer.run - 0 - ${installbuilder_output_directory} - - - - - - 0 - ${installdir}/Arduino_Create_Bridge - - ${product_shortname} - - - - ${installdir}/Arduino_Create_Bridge - & - 0 - - - 1 - windows - - - - - ${installdir}/Arduino_Create_Bridge.exe - & - Launching Agent - 0 - - - windows - - - - - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run - ArduinoCreateAgent - REG_SZ - "${installdir}/Arduino_Create_Bridge.exe" - - - windows - - - - - 1 - 0 - - - - ArduinoCreateAgent - - 1 - Arduino_Create_Bridge.exe - - 0 - 1 - - - ONLOGON - * - ${installdir} - - - - - ${product_shortname} - - - ArduinoCreateAgent - - - 1 - 1 - 1 - 1 - Arduino LLC - /home/jenkins/jenkins/jobs/Create_Bridge_test/workspace/src/github.com/facchinm/systray/example/icon/iconwin.ico - - - installdir - Installer.Parameter.installdir.description - Installer.Parameter.installdir.explanation - - ${platform_install_prefix}/${product_shortname}-${product_version} - 0 - yes - prefix - yes - 0 - 30 - - - - - linux - 0 - - - linux-x64 - 0 - - - - diff --git a/ArduinoCreateAgent_autoupdate.xml b/ArduinoCreateAgent_autoupdate.xml deleted file mode 100644 index 899f102a7..000000000 --- a/ArduinoCreateAgent_autoupdate.xml +++ /dev/null @@ -1,343 +0,0 @@ - - ArduinoCreateAgent - arduino-create-agent - 1.0 - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/LICENSE.md - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/installer_icons/Installer.png - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/installer_icons/InstallerIcon.png - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/installer_icons/InstallerSplash.png - auto - - - default - Default Component - 1 - 1 - 1 - - - - ${installdir}/Arduino_Create_Bridge - ${installdir}/InstallerIcon.png - Arduino Create Agent - - linux-x64 - 0 - 0 - - - - - - - - - Program Files - ${installdir} - programfiles - all - - - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/fakecerts/cert.pem - - - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/fakecerts/key.pem - - - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/config.ini - - - - - Uninstall - ${installdir}/${uninstallerName} - - Uninstall ${product_fullname} - ${installdir} - all - 0 - 0 - ${installdir}/${uninstallerName}.exe - - - ${installdir} - - - - - Program Files - ${installdir} - programfileslinux - linux-x64 - - - 1 - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/snapshot/linux_amd64/Arduino_Create_Bridge - - - /tmp/linux/arduino/arduino - - - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/installer_icons/InstallerIcon.png - - - - - Program Files - ${installdir} - programfileswindows - windows - - - 1 - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/snapshot/windows_386/Arduino_Create_Bridge.exe - - - /tmp/windows/arduino/arduino - - - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/installer_icons/tray_iconWin.ico - - - - - Program Files - ${installdir} - programfilesosx - osx - - - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/snapshot/darwin_amd64/Arduino_Create_Bridge - - - /tmp/macosx/arduino/arduino - - - - - Autostart - ${user_home_directory}/.config/autostart/ - xdgautostart - linux-x64 - - - - ${installdir}/Arduino_Create_Bridge - ${installdir}/InstallerIcon.png - arduino-create-agent - - linux-x64 - 0 - 0 - - - - - - - - - Autostart - ${windows_folder_startup} - winautostart - windows - - - - - - Arduino Create Agent - - windows - 0 - 0 - ${installdir}/Arduino_Create_Bridge.exe - - - - - - - - - - Uninstall ${product_fullname} - Uninstall ${product_fullname} - 0 - 0 - ${installdir}/${uninstallerName}.exe - - - ${installdir}/ - - - - Arduino Create Agent - 0 - 0 - ${installdir}/Arduino_Create_Bridge - - ${installdir}/tray_IconWin.ico - - - - - - - - /tmp/linux/arduino - - - /tmp/macosx/arduino - - - /tmp/windows/arduino - - - /tmp/linux/Arduino_Create_Bridge - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/snapshot/linux_amd64/Arduino_Create_Bridge - - - /tmp/macosx/Arduino_Create_Bridge - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/snapshot/darwin_amd64/Arduino_Create_Bridge - - - /tmp/windows/Arduino_Create_Bridge.exe - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/snapshot/windows_386/Arduino_Create_Bridge.exe - - - /tmp/linux/arduino/ - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/snapshot/linux_amd64/arduino.zip - - - /tmp/macosx/arduino/ - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/snapshot/darwin_amd64/arduino.zip - - - /tmp/windows/arduino/ - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/snapshot/windows_386/arduino.zip - - - - - 0 - tar - czvf ${product_shortname}-${product_version}-${platform_name}-installer.tar.gz ${product_shortname}-${product_version}-${platform_name}-installer.run - 0 - ${installbuilder_output_directory} - - - - - installdir - ${windows_folder_appdata}/${product_shortname} - - - windows - - - - - installdir - /Users/${system_username}/Applications/${product_shortname} - - - osx - - - - - - - - 0 - ${installdir}/Arduino_Create_Bridge - - ${product_shortname} - - - - ${installdir}/Arduino_Create_Bridge - & - ${system_username} - 0 - - - 1 - windows - - - - - ${installdir}/Arduino_Create_Bridge.exe - & - Launching Agent - ${system_username} - 0 - - - windows - - - - - /Users/${system_username}/Library/LaunchAgents/${product_shortname}.plist - exact - - - exists - ${product_shortname} - - - - - <key>RunAtLoad</key> - -<key>RunAtLoad</key> -<true/> -<key>AbandonProcessGroup</key> - - - - - - - ${product_shortname} - - - 1 - 0 - 1 - Arduino Create Agent - Arduino LLC - /home/jenkins/jenkins/jobs/Create_Bridge_autoupdate/workspace/src/github.com/facchinm/systray/example/icon/icon_win.ico - - - installdir - Installer.Parameter.installdir.description - Installer.Parameter.installdir.explanation - - ${platform_install_prefix}/${product_shortname}-${product_version} - 0 - prefix - 1 - 0 - 30 - - - - - linux - 0 - - - linux-x64 - 0 - - - osx - 0 - - - - diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json deleted file mode 100644 index e01712aa6..000000000 --- a/Godeps/Godeps.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "ImportPath": "github.com/arduino/arduino-create-agent", - "GoVersion": "go1.4.2", - "Deps": [ - { - "ImportPath": "github.com/facchinm/go-serial", - "Rev": "3cfbd2fab741f7c9d238cb3bd17980110c81bd46" - }, - { - "ImportPath": "github.com/facchinm/systray", - "Rev": "b32308b0b662e45cde7c5986bc29def5d48bafbb" - }, - { - "ImportPath": "github.com/getlantern/golog", - "Rev": "5245e761fd1c8e9ccba87de802a0f666ed55980f" - }, - { - "ImportPath": "github.com/gin-gonic/gin", - "Comment": "v1.0rc1-128-gfc5e355", - "Rev": "fc5e3557242901e24016d4474168515434871dd5" - }, - { - "ImportPath": "github.com/googollee/go-engine.io", - "Rev": "597faf3df88a01780a5881fafbcbccd9d5c3fab0" - }, - { - "ImportPath": "github.com/googollee/go-socket.io", - "Comment": "0.9.x-33-g9c83c02", - "Rev": "9c83c02fa6172eaea8252b6428e3cef3576c9746" - }, - { - "ImportPath": "github.com/gorilla/websocket", - "Rev": "a3ec486e6a7a41858210b0fc5d7b5df593b3c4a3" - }, - { - "ImportPath": "github.com/inconshreveable/go-update", - "Rev": "68f5725818189545231c1fd8694793d45f2fc529" - }, - { - "ImportPath": "github.com/itsjamie/gin-cors", - "Rev": "bd9551838cd52133960a2f44ab990be71744b663" - }, - { - "ImportPath": "github.com/kardianos/osext", - "Rev": "6e7f843663477789fac7c02def0d0909e969b4e5" - }, - { - "ImportPath": "github.com/kardianos/service", - "Rev": "1ab12303aaf4cf68a53a5717a31b5acd72c57019" - }, - { - "ImportPath": "github.com/kr/binarydist", - "Rev": "9955b0ab8708602d411341e55fffd7e0700f86bd" - }, - { - "ImportPath": "github.com/manucorporat/sse", - "Rev": "c142f0f1baea5cef7f98a8a6c222f6134368c1f5" - }, - { - "ImportPath": "github.com/mattn/go-colorable", - "Rev": "40e4aedc8fabf8c23e040057540867186712faa5" - }, - { - "ImportPath": "github.com/miekg/dns", - "Rev": "7864d445e5087e8d761dbefec43f29b92f7650eb" - }, - { - "ImportPath": "github.com/oleksandr/bonjour", - "Rev": "415cafc6ab8894ea7b7bcbed933ce2d8c611683c" - }, - { - "ImportPath": "github.com/sanderhahn/gozip/patchzip", - "Rev": "85893825032e0136f506cc9e3f36d42d56305ee9" - }, - { - "ImportPath": "github.com/skratchdot/open-golang/open", - "Rev": "c8748311a7528d0ba7330d302adbc5a677ef9c9e" - }, - { - "ImportPath": "github.com/termie/go-shutil", - "Rev": "bcacb06fecaeec8dc42af03c87c6949f4a05c74c" - }, - { - "ImportPath": "github.com/vharitonsky/iniflags", - "Comment": "v.1.0-21-g14f4b95", - "Rev": "14f4b95d09b99e2475e82c37a2f943ef2469a890" - }, - { - "ImportPath": "golang.org/x/net/context", - "Rev": "d9558e5c97f85372afee28cf2b6059d7d3818919" - }, - { - "ImportPath": "golang.org/x/net/internal/iana", - "Rev": "d9558e5c97f85372afee28cf2b6059d7d3818919" - }, - { - "ImportPath": "golang.org/x/net/ipv4", - "Rev": "d9558e5c97f85372afee28cf2b6059d7d3818919" - }, - { - "ImportPath": "golang.org/x/net/ipv6", - "Rev": "d9558e5c97f85372afee28cf2b6059d7d3818919" - }, - { - "ImportPath": "gopkg.in/bluesuncorp/validator.v5", - "Comment": "v5.10", - "Rev": "d2748d5ae5e5af5ec3a85e3a59bf0db9d741c82d" - } - ] -} diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 23cb79033..000000000 --- a/LICENSE.md +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 000000000..0ad25db4b --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/README.md b/README.md index 1c8921a25..db5e92c65 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,86 @@ -arduino-create-agent -==================== +# arduino-cloud-agent + +[![License: AGPL v3.0](https://img.shields.io/badge/License-AGPL%20v3.0-blue)](https://www.gnu.org/licenses/agpl-3.0.html) +[![Test Go status](https://github.com/arduino/arduino-create-agent/actions/workflows/test-go-task.yml/badge.svg)](https://github.com/arduino/arduino-create-agent/actions/workflows/test-go-task.yml) +[![Codecov](https://codecov.io/gh/arduino/arduino-create-agent/branch/main/graph/badge.svg)](https://codecov.io/gh/arduino/arduino-create-agent) +[![Test Integration status](https://github.com/arduino/arduino-create-agent/actions/workflows/test-go-integration-task.yml/badge.svg)](https://github.com/arduino/arduino-create-agent/actions/workflows/test-go-integration-task.yml) +[![Check License status](https://github.com/arduino/arduino-create-agent/actions/workflows/check-license.yml/badge.svg)](https://github.com/arduino/arduino-create-agent/actions/workflows/check-license.yml) +[![Check Go Dependencies status](https://github.com/arduino/arduino-create-agent/actions/workflows/check-go-dependencies-task.yml/badge.svg)](https://github.com/arduino/arduino-create-agent/actions/workflows/check-go-dependencies-task.yml) +[![Check Go status](https://github.com/arduino/arduino-create-agent/actions/workflows/check-go-task.yml/badge.svg)](https://github.com/arduino/arduino-create-agent/actions/workflows/check-go-task.yml) + +The Arduino Cloud Agent is a single binary that will sit on the traybar and work in the background. It allows you to use the [Arduino Cloud](https://app.arduino.cc/) to seamlessly upload code to any USB connected Arduino board (or Yún in LAN) directly from the browser. + +## Architecture + +```text ++-------------------------------+ +| | +| Browser | +| | Web socket +----------------------+ flashes +---------------+ +| +---------------------------+ |<-------------->| +------------>| | +| | | | | Arduino Cloud Agent | | Arduino Board | +| | Arduino Cloud | +--------------->| |<------------+ | +| | | | REST API +----------------------+ serial +---------------+ +| +---------------------------+ | ++-------------------------------+ +``` -Version X.XX +## Installation -Get the latest version of the Agent for all supported platforms: +Get the [latest version](https://github.com/arduino/arduino-create-agent/releases) of the Agent for all supported platforms or complete the [Getting Started](https://cloud.arduino.cc/download-agent/). -* [Windows](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer.exe) -* [MacOSX](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer.dmg) -* [Linux x64](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-linux-x64-installer.run) +## Apple silicon support -arduino-create-agent is a fork of @johnlauer's serial-port-json-server (which we really want to thank for his kindness and great work) +The Arduino Agent is supported both on Intel and Apple silicon computers. This includes devices with the M1, M2 and M3 processors. +The Arduino Agent is built both for Intel architectures and Apple silicon devices, but distributed as a single universal executable for macOS. -The history has been rewritten to keep the repo small (thus removing all binaries committed in the past) +## Documentation + +The documentation has been moved to the [wiki](https://github.com/arduino/arduino-create-agent/wiki) page. There you can find: -# Contributing +- [Advanced usage](https://github.com/arduino/arduino-create-agent/wiki/Advanced-usage): explaining how to use multiple configurations and how to use the agent with a proxy. +- [Agent Beta Program](https://github.com/arduino/arduino-create-agent/wiki/Agent-Beta-Program) +- [Development](https://github.com/arduino/arduino-create-agent/wiki/Development): containing useful info to help in development +- [Disable Autostart](https://github.com/arduino/arduino-create-agent/wiki/Disable-Autostart) +- [How to compile on Raspberry Pi](https://github.com/arduino/arduino-create-agent/wiki/How-to-compile-on-Raspberry-Pi) +- [How to use crashreport functionality](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-crashreport-functionality) +- [How to use the agent](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-the-agent) -Please use the current latest version: +## Contributing -* [Windows dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer.exe) -* [MacOSX dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer.dmg) -* [Linux x64 dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-linux-x64-installer.run) +### Submitting an issue -## Submitting an issue +When submitting a new issue please search for duplicates before creating a new one. Help us by providing useful context and information. Please attach the output of the commands running at the debug console or attach [crash reports](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-crashreport-functionality) if useful. -Please attach the output of the commands running at the debug console if useful. +#### Security -## Submitting a pull request +If you think you found a vulnerability or other security-related bug in this project, please read our +[security policy](https://github.com/arduino/arduino-create-agent/security/policy) and report the bug to our Security Team 🛡️ +Thank you! + +e-mail contact: security@arduino.cc + +### Submitting a pull request We are glad you want to contribute with code: that's the best way to help this software. -Your contribution is adding or modifying existing behaviour, please always refer to an existing issue or open a new one before contributing. We are are trying to use [Test Driven Development](https://en.wikipedia.org/wiki/Test-driven_development) in the near future: please add one or more tests that prove that your contribution is good and is working as expected, it will help us a lot. +Your contribution is adding or modifying existing behaviour, please always refer to an existing issue or open a new one before contributing. We are trying to use [Test Driven Development](https://en.wikipedia.org/wiki/Test-driven_development) in the near future: please add one or more tests that prove that your contribution is good and is working as expected, it will help us a lot. Be sure to use `go vet` and `go fmt` on every file before each commit: it ensures your code is properly formatted. -Also, for your contribution to be accepted, everyone of your commits must be "Signed-off". This is done by commiting using this command: `git commit --signoff` +Also, for your contribution to be accepted, every one of your commits must be "Signed-off". This is done by committing using this command: `git commit --signoff` By signing off your commits, you agree to the following agreement, also known as [Developer Certificate of Origin](http://developercertificate.org/): it assures everyone that the code you're submitting is yours or that you have rights to submit it. -``` +## Authors and acknowledgment + +arduino-cloud-agent is a fork of @[johnlauer](https://github.com/johnlauer)'s [serial-port-json-server](https://github.com/johnlauer/serial-port-json-server) (which we really want to thank for his kindness and great work) + +The history has been rewritten to keep the repo small (thus removing all binaries committed in the past) + +## License + +```text Developer Certificate of Origin Version 1.1 @@ -48,7 +91,6 @@ San Francisco, CA 94110 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 000000000..681c8274d --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,188 @@ +version: "3" + +tasks: + + install: + desc: Install dependencies for local development + cmds: + - go install github.com/githubnemo/CompileDaemon@v1.4.0 + + run: + desc: Run the project locally with auto-reload and data race detector + cmds: + - CompileDaemon -build="go build -race" -command="./arduino-create-agent" -graceful-kill=true + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml + general:cache-dep-licenses: + desc: Cache dependency license metadata + cmds: + - | + if ! which licensed &>/dev/null; then + if [[ {{OS}} == "windows" ]]; then + echo "Licensed does not have Windows support." + echo "Please use Linux/macOS or download the dependencies cache from the GitHub Actions workflow artifact." + else + echo "licensed not found or not in PATH. Please install: https://github.com/github/licensed#as-an-executable" + fi + exit 1 + fi + - licensed cache + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml + general:check-dep-licenses: + desc: Check for unapproved dependency licenses + deps: + - task: general:cache-dep-licenses + cmds: + - licensed status + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/go-task/Taskfile.yml + go:build: + desc: Build the project, to use a specific version use `task build TAG_VERSION=x.x.x` + dir: "{{.DEFAULT_GO_MODULE_PATH}}" + cmds: + - go build -v {{.ADDITIONAL_FLAGS}} -o {{.PROJECT_NAME}} {{.LDFLAGS}} {{.WIN_FLAGS}}' + + go:build-cli: + desc: Build the project without tray icon support + cmds: + - task: go:build + vars: + PROJECT_NAME: arduino-cloud-agent_cli + ADDITIONAL_FLAGS: -tags cli + + go:build-win: + desc: Build the project for win, to build 32bit `export GOARCH=386` and for 64 bit `export GOARCH=amd64` before `task build-win` + cmds: + - rsrc -arch {{.GOARCH}} -manifest manifest.xml # GOARCH shoud be either amd64 or 386 + - task: go:build + vars: + PROJECT_NAME: arduino-cloud-agent.exe + WIN_FLAGS: -H=windowsgui + - rm *.syso # rm file to avoid compilation problems on other platforms + vars: + GOARCH: + sh: go env GOARCH + + go:build-win-cli: + desc: Build the project for win without tray icon support + cmds: + - task: go:build + vars: + PROJECT_NAME: arduino-cloud-agent_cli.exe + ADDITIONAL_FLAGS: -tags cli + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-go-task/Taskfile.yml + go:test: + desc: Run unit tests + dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" + cmds: + - | + go test \ + -v \ + -short \ + -run '{{default ".*" .GO_TEST_REGEX}}' \ + {{default "-timeout 10m -coverpkg=./... -covermode=atomic" .GO_TEST_FLAGS}} \ + -coverprofile=coverage_unit.txt \ + {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}} + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-go-integration-task/Taskfile.yml + go:test-integration: + desc: Run integration tests + deps: + # - task: go:build # we build it in the CI and not in the task because _cli version is required and build procedure is different on win + - task: poetry:install-deps + cmds: + - poetry run pytest tests + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml + poetry:install-deps: + desc: Install dependencies managed by Poetry + cmds: + - poetry install --no-root + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml + poetry:update-deps: + desc: Update all dependencies managed by Poetry to their newest versions + cmds: + - poetry update + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml + go:fix: + desc: Modernize usages of outdated APIs + dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" + cmds: + - go fix {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}} + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml + go:format: + desc: Format Go code + dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" + cmds: + - go fmt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}} + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml + go:lint: + desc: Lint Go code + dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" + cmds: + - | + if ! which golint &>/dev/null; then + echo "golint not installed or not in PATH. Please install: https://github.com/golang/lint#installation" + exit 1 + fi + - | + golint \ + {{default "-min_confidence 0.8 -set_exit_status" .GO_LINT_FLAGS}} \ + {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}} + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml + go:vet: + desc: Check for errors in Go code + dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" + cmds: + - go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}} + + check: + desc: Check fmt and lint + cmds: + - task: go:vet + - task: go:lint + + autoupdate:demo: + desc: Demo the local auto-update workflow for the Agent (for linux and mac user) + prompt: Before continuing, please make sure you’ve opened the "Open Configuration" option from the Agent menu and set the updateUrl=http://127.0.0.1:3000/ + cmds: + - task: go:build + - go install github.com/sanbornm/go-selfupdate/...@latest + # NOTE: the path 'CreateAgent/Stable' is important to keep as is + # because agent searches the update files into "CreateAgent/Stable/{platform}.json" and "https://downloads.arduino.cc/CreateAgent/Stable/{version}/{platform}.gz" + - go-selfupdate -o public/CreateAgent/Stable ./arduino-cloud-agent {{.VERSION}} + - docker rm -f agent-static-server + - docker run --rm -d -v "$PWD/public:/usr/share/nginx/html:ro" -p 3000:80 --name agent-static-server nginx:alpine + - sleep 5 # wait the server is up before starting the update + - curl -X POST http://127.0.0.1:8991/update + +vars: + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml + PROJECT_NAME: arduino-cloud-agent + # build vars + COMMIT: + sh: echo "$(git log --no-show-signature -n 1 --format=%h)" + TIMESTAMP_SHORT: + sh: echo "{{now | date "20060102"}}" + TAG: + sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1)" + TAG_TEST: "0.0.0-dev" + VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.TAG_TEST}}{{end}}" + CONFIGURATION_PACKAGE: main + LDFLAGS: >- + -ldflags + ' + -X {{.CONFIGURATION_PACKAGE}}.version={{.VERSION}} + -X {{.CONFIGURATION_PACKAGE}}.commit={{.COMMIT}} + # Path of the project's primary Go module: + DEFAULT_GO_MODULE_PATH: ./ + DEFAULT_GO_PACKAGES: + sh: | + echo $(cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} && go list ./... | grep -v 'arduino-create-agent/gen/' | grep -v 'arduino-create-agent/design' | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"') diff --git a/bufferflow.go b/bufferflow.go index ff5bcf1b7..a9fef8e51 100644 --- a/bufferflow.go +++ b/bufferflow.go @@ -1,49 +1,23 @@ -package main - -import ( -//"log" -//"time" -) - -var availableBufferAlgorithms = []string{"default", "timed"} +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . -type BufferMsg struct { - Cmd string - Port string - TriggeringResponse string - //Desc string - //Desc string -} +package main +// Bufferflow interface type Bufferflow interface { Init() - BlockUntilReady(cmd string, id string) (bool, bool) // implement this method - //JustQueue(cmd string, id string) bool // implement this method - OnIncomingData(data string) // implement this method - ClearOutSemaphore() // implement this method - BreakApartCommands(cmd string) []string // implement this method - Pause() // implement this method - Unpause() // implement this method - SeeIfSpecificCommandsShouldSkipBuffer(cmd string) bool // implement this method - SeeIfSpecificCommandsShouldPauseBuffer(cmd string) bool // implement this method - SeeIfSpecificCommandsShouldUnpauseBuffer(cmd string) bool // implement this method - SeeIfSpecificCommandsShouldWipeBuffer(cmd string) bool // implement this method - SeeIfSpecificCommandsReturnNoResponse(cmd string) bool // implement this method - ReleaseLock() // implement this method - IsBufferGloballySendingBackIncomingData() bool // implement this method - Close() // implement this method -} - -/*data packets returned to client*/ -type DataCmdComplete struct { - Cmd string - Id string - P string - BufSize int `json:"-"` - D string `json:"-"` -} - -type DataPerLine struct { - P string - D string + OnIncomingData(data string) // implement this method + Close() // implement this method } diff --git a/bufferflow_default.go b/bufferflow_default.go index 4294fb824..959737d54 100644 --- a/bufferflow_default.go +++ b/bufferflow_default.go @@ -1,71 +1,72 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + package main import ( - log "github.com/Sirupsen/logrus" + "encoding/json" + + log "github.com/sirupsen/logrus" ) +// BufferflowDefault is the default bufferflow, whick means no buffering type BufferflowDefault struct { - Name string - Port string + port string + output chan<- []byte + input chan string + done chan bool } -var () +// NewBufferflowDefault create a new default bufferflow +func NewBufferflowDefault(port string, output chan<- []byte) *BufferflowDefault { + return &BufferflowDefault{ + port: port, + output: output, + input: make(chan string), + done: make(chan bool), + } +} +// Init will initialize the bufferflow func (b *BufferflowDefault) Init() { log.Println("Initting default buffer flow (which means no buffering)") + go b.consumeInput() } -func (b *BufferflowDefault) BlockUntilReady(cmd string, id string) (bool, bool) { - //log.Printf("BlockUntilReady() start\n") - return true, false +func (b *BufferflowDefault) consumeInput() { +Loop: + for { + select { + case data := <-b.input: + m := SpPortMessage{b.port, data} + message, _ := json.Marshal(m) + b.output <- message + case <-b.done: + break Loop //this is required, a simple break statement would only exit the innermost switch statement + } + } + close(b.input) // close the input channel at the end of the computation } +// OnIncomingData will forward the data func (b *BufferflowDefault) OnIncomingData(data string) { - //log.Printf("OnIncomingData() start. data:%v\n", data) -} - -// Clean out b.sem so it can truly block -func (b *BufferflowDefault) ClearOutSemaphore() { -} - -func (b *BufferflowDefault) BreakApartCommands(cmd string) []string { - return []string{cmd} -} - -func (b *BufferflowDefault) Pause() { - return -} - -func (b *BufferflowDefault) Unpause() { - return -} - -func (b *BufferflowDefault) SeeIfSpecificCommandsShouldSkipBuffer(cmd string) bool { - return false -} - -func (b *BufferflowDefault) SeeIfSpecificCommandsShouldPauseBuffer(cmd string) bool { - return false -} - -func (b *BufferflowDefault) SeeIfSpecificCommandsShouldUnpauseBuffer(cmd string) bool { - return false -} - -func (b *BufferflowDefault) SeeIfSpecificCommandsShouldWipeBuffer(cmd string) bool { - return false -} - -func (b *BufferflowDefault) SeeIfSpecificCommandsReturnNoResponse(cmd string) bool { - return false -} - -func (b *BufferflowDefault) ReleaseLock() { -} - -func (b *BufferflowDefault) IsBufferGloballySendingBackIncomingData() bool { - return false + b.input <- data } +// Close will close the bufferflow func (b *BufferflowDefault) Close() { + b.done <- true + close(b.done) } diff --git a/bufferflow_timed.go b/bufferflow_timed.go index 3ce3b6a85..36aaf08bf 100644 --- a/bufferflow_timed.go +++ b/bufferflow_timed.go @@ -1,101 +1,88 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + package main import ( "encoding/json" "time" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" ) +// BufferflowTimed sends data once every 16ms type BufferflowTimed struct { - Name string - Port string - Output chan []byte - Input chan string - ticker *time.Ticker + port string + output chan<- []byte + input chan string + done chan bool + ticker *time.Ticker + sPort string + bufferedOutput string } -var ( - bufferedOutput string -) +// NewBufferflowTimed will create a new timed bufferflow +func NewBufferflowTimed(port string, output chan<- []byte) *BufferflowTimed { + return &BufferflowTimed{ + port: port, + output: output, + input: make(chan string), + done: make(chan bool), + ticker: time.NewTicker(16 * time.Millisecond), + sPort: "", + bufferedOutput: "", + } +} +// Init will initialize the bufferflow func (b *BufferflowTimed) Init() { log.Println("Initting timed buffer flow (output once every 16ms)") - bufferedOutput = "" - - go func() { - for data := range b.Input { - bufferedOutput = bufferedOutput + data - } - }() - - go func() { - b.ticker = time.NewTicker(16 * time.Millisecond) - for _ = range b.ticker.C { - if bufferedOutput != "" { - m := SpPortMessage{bufferedOutput} + go b.consumeInput() +} + +func (b *BufferflowTimed) consumeInput() { +Loop: + for { + select { + case data := <-b.input: // use the buffer and append data to it + b.bufferedOutput = b.bufferedOutput + data + b.sPort = b.port + case <-b.ticker.C: // after 16ms send the buffered output message + if b.bufferedOutput != "" { + m := SpPortMessage{b.sPort, b.bufferedOutput} buf, _ := json.Marshal(m) - b.Output <- []byte(buf) - bufferedOutput = "" + b.output <- buf + // reset the buffer and the port + b.bufferedOutput = "" + b.sPort = "" } + case <-b.done: + break Loop //this is required, a simple break statement would only exit the innermost switch statement } - }() - -} - -func (b *BufferflowTimed) BlockUntilReady(cmd string, id string) (bool, bool) { - //log.Printf("BlockUntilReady() start\n") - return true, false + } + close(b.input) } +// OnIncomingData will forward the data func (b *BufferflowTimed) OnIncomingData(data string) { - b.Input <- data -} - -// Clean out b.sem so it can truly block -func (b *BufferflowTimed) ClearOutSemaphore() { -} - -func (b *BufferflowTimed) BreakApartCommands(cmd string) []string { - return []string{cmd} -} - -func (b *BufferflowTimed) Pause() { - return -} - -func (b *BufferflowTimed) Unpause() { - return -} - -func (b *BufferflowTimed) SeeIfSpecificCommandsShouldSkipBuffer(cmd string) bool { - return false -} - -func (b *BufferflowTimed) SeeIfSpecificCommandsShouldPauseBuffer(cmd string) bool { - return false -} - -func (b *BufferflowTimed) SeeIfSpecificCommandsShouldUnpauseBuffer(cmd string) bool { - return false -} - -func (b *BufferflowTimed) SeeIfSpecificCommandsShouldWipeBuffer(cmd string) bool { - return false -} - -func (b *BufferflowTimed) SeeIfSpecificCommandsReturnNoResponse(cmd string) bool { - return false -} - -func (b *BufferflowTimed) ReleaseLock() { -} - -func (b *BufferflowTimed) IsBufferGloballySendingBackIncomingData() bool { - return true + b.input <- data } +// Close will close the bufferflow func (b *BufferflowTimed) Close() { b.ticker.Stop() - close(b.Input) + b.done <- true + close(b.done) } diff --git a/bufferflow_timedraw.go b/bufferflow_timedraw.go new file mode 100644 index 000000000..08b34cab6 --- /dev/null +++ b/bufferflow_timedraw.go @@ -0,0 +1,89 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package main + +import ( + "encoding/json" + "time" + + log "github.com/sirupsen/logrus" +) + +// BufferflowTimedRaw sends raw data once every 16ms +type BufferflowTimedRaw struct { + port string + output chan<- []byte + input chan string + done chan bool + ticker *time.Ticker + bufferedOutputRaw []byte + sPortRaw string +} + +// NewBufferflowTimedRaw will create a new raw bufferflow +func NewBufferflowTimedRaw(port string, output chan<- []byte) *BufferflowTimedRaw { + return &BufferflowTimedRaw{ + port: port, + output: output, + input: make(chan string), + done: make(chan bool), + ticker: time.NewTicker(16 * time.Millisecond), + bufferedOutputRaw: nil, + sPortRaw: "", + } +} + +// Init will initialize the bufferflow +func (b *BufferflowTimedRaw) Init() { + log.Println("Initting timed buffer raw flow (output once every 16ms)") + go b.consumeInput() +} + +func (b *BufferflowTimedRaw) consumeInput() { +Loop: + for { + select { + case data := <-b.input: // use the buffer and append data to it + b.bufferedOutputRaw = append(b.bufferedOutputRaw, []byte(data)...) + b.sPortRaw = b.port + case <-b.ticker.C: // after 16ms send the buffered output message + if b.bufferedOutputRaw != nil { + m := SpPortMessageRaw{b.sPortRaw, b.bufferedOutputRaw} + buf, _ := json.Marshal(m) + // since bufferedOutputRaw is a []byte is base64-encoded by json.Marshal() function automatically + b.output <- buf + // reset the buffer and the port + b.bufferedOutputRaw = nil + b.sPortRaw = "" + } + case <-b.done: + break Loop //this is required, a simple break statement would only exit the innermost switch statement + } + } + close(b.input) +} + +// OnIncomingData will forward the data +func (b *BufferflowTimedRaw) OnIncomingData(data string) { + b.input <- data +} + +// Close will close the bufferflow +func (b *BufferflowTimedRaw) Close() { + b.ticker.Stop() + b.done <- true + close(b.done) +} diff --git a/certificates/certificates.go b/certificates/certificates.go new file mode 100644 index 000000000..ae2843d22 --- /dev/null +++ b/certificates/certificates.go @@ -0,0 +1,291 @@ +// Copyright 2023 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Generate a self-signed X.509 certificate for a TLS server. Outputs to +// 'cert.pem' and 'key.pem' and will overwrite existing files. + +package certificates + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "crypto/x509/pkix" + "encoding/pem" + "fmt" + "math/big" + "net" + "os" + "time" + + "github.com/arduino/arduino-create-agent/utilities" + "github.com/arduino/go-paths-helper" + log "github.com/sirupsen/logrus" +) + +var ( + validFrom = "" + validFor = 365 * 24 * time.Hour * 2 // 2 years + rsaBits = 2048 +) + +func publicKey(priv interface{}) interface{} { + switch k := priv.(type) { + case *rsa.PrivateKey: + return &k.PublicKey + case *ecdsa.PrivateKey: + return &k.PublicKey + default: + return nil + } +} + +func pemBlockForKey(priv interface{}) *pem.Block { + switch k := priv.(type) { + case *rsa.PrivateKey: + return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)} + case *ecdsa.PrivateKey: + b, err := x509.MarshalECPrivateKey(k) + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to marshal ECDSA private key: %v", err) + os.Exit(2) + } + return &pem.Block{Type: "EC PRIVATE KEY", Bytes: b} + default: + return nil + } +} + +func generateKey(ecdsaCurve string) (interface{}, error) { + switch ecdsaCurve { + case "": + return rsa.GenerateKey(rand.Reader, rsaBits) + case "P224": + return ecdsa.GenerateKey(elliptic.P224(), rand.Reader) + case "P256": + return ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + case "P384": + return ecdsa.GenerateKey(elliptic.P384(), rand.Reader) + case "P521": + return ecdsa.GenerateKey(elliptic.P521(), rand.Reader) + default: + return nil, fmt.Errorf("unrecognized elliptic curve: %q", ecdsaCurve) + } +} + +func generateSingleCertificate(isCa bool) (*x509.Certificate, error) { + var notBefore time.Time + var err error + if len(validFrom) == 0 { + notBefore = time.Now() + } else { + notBefore, err = time.Parse("Jan 2 15:04:05 2006", validFrom) + if err != nil { + return nil, fmt.Errorf("failed to parse creation date: %s", err.Error()) + } + } + + notAfter := notBefore.Add(validFor) + + serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) + serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) + if err != nil { + return nil, fmt.Errorf("failed to generate serial number: %s", err.Error()) + } + + template := x509.Certificate{ + SerialNumber: serialNumber, + Subject: pkix.Name{ + Organization: []string{"Arduino LLC US"}, + Country: []string{"US"}, + CommonName: "127.0.0.1", + OrganizationalUnit: []string{"IT"}, + }, + NotBefore: notBefore, + NotAfter: notAfter, + + KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, + BasicConstraintsValid: true, + } + + template.IPAddresses = append(template.IPAddresses, net.ParseIP("127.0.0.1")) + template.DNSNames = append(template.DNSNames, "localhost") + + if isCa { + template.IsCA = true + template.KeyUsage |= x509.KeyUsageCertSign + template.Subject.CommonName = "Arduino" + } + + return &template, nil +} + +// MigrateCertificatesGeneratedWithOldAgentVersions checks if certificates generated +// with an old version of the Agent needs to be migrated to the current certificates +// directory, and performs the migration if needed. +func MigrateCertificatesGeneratedWithOldAgentVersions(certsDir *paths.Path) { + if certsDir.Join("ca.cert.pem").Exist() { + // The new certificates are already set-up, nothing to do + return + } + + fileList := []string{ + "ca.key.pem", + "ca.cert.pem", + "ca.cert.cer", + "key.pem", + "cert.pem", + "cert.cer", + } + oldCertsDirPath, _ := os.Executable() + oldCertsDir := paths.New(oldCertsDirPath) + for _, fileName := range fileList { + oldCert := oldCertsDir.Join(fileName) + if oldCert.Exist() { + oldCert.CopyTo(certsDir.Join(fileName)) + } + } +} + +// GenerateCertificates will generate the required certificates useful for a HTTPS connection on localhost +func GenerateCertificates(certsDir *paths.Path) { + + // Create the key for the certification authority + caKey, err := generateKey("P256") + if err != nil { + log.Error(err.Error()) + os.Exit(1) + } + + { + keyOutPath := certsDir.Join("ca.key.pem").String() + keyOut, err := os.OpenFile(keyOutPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) // Save key with user-only permission 0600 + if err != nil { + log.Error(err.Error()) + os.Exit(1) + } + pem.Encode(keyOut, pemBlockForKey(caKey)) + keyOut.Close() + log.Printf("written %s", keyOutPath) + } + + // Create the certification authority + caTemplate, err := generateSingleCertificate(true) + if err != nil { + log.Error(err.Error()) + os.Exit(1) + } + + derBytes, _ := x509.CreateCertificate(rand.Reader, caTemplate, caTemplate, publicKey(caKey), caKey) + + { + caCertOutPath := certsDir.Join("ca.cert.pem") + caCertOut, err := caCertOutPath.Create() + if err != nil { + log.Error(err.Error()) + os.Exit(1) + } + pem.Encode(caCertOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}) + caCertOut.Close() + log.Printf("written %s", caCertOutPath) + } + + { + caCertPath := certsDir.Join("ca.cert.cer") + caCertPath.WriteFile(derBytes) + log.Printf("written %s", caCertPath) + } + + // Create the key for the final certificate + key, err := generateKey("P256") + if err != nil { + log.Error(err.Error()) + os.Exit(1) + } + + { + keyOutPath := certsDir.Join("key.pem").String() + keyOut, err := os.OpenFile(keyOutPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) // Save key with user-only permission 0600 + if err != nil { + log.Error(err.Error()) + os.Exit(1) + } + pem.Encode(keyOut, pemBlockForKey(key)) + keyOut.Close() + log.Printf("written %s", keyOutPath) + } + + // Create the final certificate + template, err := generateSingleCertificate(false) + if err != nil { + log.Error(err.Error()) + os.Exit(1) + } + + derBytes, _ = x509.CreateCertificate(rand.Reader, template, caTemplate, publicKey(key), caKey) + + { + certOutPath := certsDir.Join("cert.pem").String() + certOut, err := os.Create(certOutPath) + if err != nil { + log.Error(err.Error()) + os.Exit(1) + } + pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}) + certOut.Close() + log.Printf("written %s", certOutPath) + } + + { + certPath := certsDir.Join("cert.cer") + certPath.WriteFile(derBytes) + log.Printf("written %s", certPath) + } +} + +// DeleteCertificates will delete the certificates +func DeleteCertificates(certDir *paths.Path) { + certDir.Join("ca.key.pem").Remove() + certDir.Join("ca.cert.pem").Remove() + certDir.Join("ca.cert.cer").Remove() + certDir.Join("key.pem").Remove() + certDir.Join("cert.pem").Remove() + certDir.Join("cert.cer").Remove() +} + +// IsExpired checks if a certificate is expired or about to expire (less than 1 month) +func IsExpired() (bool, error) { + bound := time.Now().AddDate(0, 1, 0) + date, err := GetExpirationDate() + if err != nil { + return false, err + } + return date.Before(bound), nil +} + +// GenerateAndInstallCertificates generates and installs the certificates +func GenerateAndInstallCertificates(certDir *paths.Path) { + GenerateCertificates(certDir) + err := InstallCertificate(certDir.Join("ca.cert.cer")) + // if something goes wrong during the cert install we remove them, so the user is able to retry + if err != nil { + log.Errorf("cannot install certificates something went wrong: %s", err) + DeleteCertificates(certDir) + } + utilities.UserPrompt("The HTTPS certificate has been installed correctly.", "{\"OK\"}", "OK", "OK", "Arduino Agent: HTTPS certificate installation") +} diff --git a/certificates/certificates_darwin.h b/certificates/certificates_darwin.h new file mode 100644 index 000000000..78ba0ae5f --- /dev/null +++ b/certificates/certificates_darwin.h @@ -0,0 +1,7 @@ +const char *getDefaultBrowserName(); + +const char *installCert(const char *path); +const char *uninstallCert(); +const bool certInKeychain(); + +const char *getExpirationDate(long *expirationDate); \ No newline at end of file diff --git a/certificates/certificates_darwin.m b/certificates/certificates_darwin.m new file mode 100644 index 000000000..0ac511833 --- /dev/null +++ b/certificates/certificates_darwin.m @@ -0,0 +1,137 @@ +#import +#import +#include "certificates_darwin.h" + +// Used to return error strings (as NSString) as a C-string to the Go code. +const char *toErrorString(NSString *errString) { + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; +} + +// Returns a string describing the name of the default browser set for the user, nil in case of error. +const char *getDefaultBrowserName() { + NSURL *defaultBrowserURL = [[NSWorkspace sharedWorkspace] URLForApplicationToOpenURL:[NSURL URLWithString:@"http://"]]; + if (defaultBrowserURL) { + NSBundle *defaultBrowserBundle = [NSBundle bundleWithURL:defaultBrowserURL]; + NSString *defaultBrowser = [defaultBrowserBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"]; + + return [defaultBrowser cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + + return ""; +} + +// inspired by https://stackoverflow.com/questions/12798950/ios-install-ssl-certificate-programmatically +const char *installCert(const char *path) { + NSURL *url = [NSURL fileURLWithPath:@(path) isDirectory:NO]; + NSData *rootCertData = [NSData dataWithContentsOfURL:url]; + + OSStatus err = noErr; + SecCertificateRef rootCert = SecCertificateCreateWithData(kCFAllocatorDefault, (CFDataRef) rootCertData); + + CFTypeRef result; + + NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: + (id)kSecClassCertificate, kSecClass, + rootCert, kSecValueRef, + nil]; + + err = SecItemAdd((CFDictionaryRef)dict, &result); + + if (err == noErr) { + NSLog(@"Install root certificate success"); + } else if (err == errSecDuplicateItem) { + NSString *errString = [@"duplicate root certificate entry. Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } else { + NSString *errString = [@"install root certificate failure. Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + + NSDictionary *newTrustSettings = @{(id)kSecTrustSettingsResult: [NSNumber numberWithInt:kSecTrustSettingsResultTrustRoot]}; + err = SecTrustSettingsSetTrustSettings(rootCert, kSecTrustSettingsDomainUser, (__bridge CFTypeRef)(newTrustSettings)); + if (err != errSecSuccess) { + NSString *errString = [@"Could not change the trust setting for a certificate. Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + + return ""; +} + +const char *uninstallCert() { + // Each line is a key-value of the dictionary. Note: the the inverted order, value first then key. + NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: + (id)kSecClassCertificate, kSecClass, + CFSTR("Arduino"), kSecAttrLabel, + kSecMatchLimitOne, kSecMatchLimit, + kCFBooleanTrue, kSecReturnAttributes, + nil]; + + OSStatus err = noErr; + // Use this function to check for errors + err = SecItemCopyMatching((CFDictionaryRef)dict, nil); + if (err == noErr) { + err = SecItemDelete((CFDictionaryRef)dict); + if (err != noErr) { + NSString *errString = [@"Could not delete the certificates. Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + } else if (err != errSecItemNotFound){ + NSString *errString = [@"Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + return ""; +} + +const bool certInKeychain() { + // Create a key-value dictionary used to query the Keychain and look for the "Arduino" root certificate. + NSDictionary *getquery = @{ + (id)kSecClass: (id)kSecClassCertificate, + (id)kSecAttrLabel: @"Arduino", + (id)kSecReturnRef: @YES, + }; + + OSStatus err = SecItemCopyMatching((CFDictionaryRef)getquery, nil); + return (err == noErr); // No error means the certificate was found, otherwise err will be "errSecItemNotFound". +} + +// Returns the expiration date "kSecOIDX509V1ValidityNotAfter" of the Arduino certificate. +// The value is returned as a CFAbsoluteTime: a long number of seconds from the date of 1 Jan 2001 00:00:00 GMT. +const char *getExpirationDate(long *expirationDate) { + // Create a key-value dictionary used to query the Keychain and look for the "Arduino" root certificate. + NSDictionary *getquery = @{ + (id)kSecClass: (id)kSecClassCertificate, + (id)kSecAttrLabel: @"Arduino", + (id)kSecReturnRef: @YES, + }; + + SecCertificateRef cert = NULL; + + // Search the keychain for certificates matching the query above. + OSStatus err = SecItemCopyMatching((CFDictionaryRef)getquery, (CFTypeRef *)&cert); + if (err != noErr) return toErrorString([@"Error getting the certificate: " stringByAppendingFormat:@"%d", err]); + + // Get data from the certificate, as a dictionary of properties. We just need the "invalidity not after" property. + CFDictionaryRef certDict = SecCertificateCopyValues(cert, + (__bridge CFArrayRef)@[(__bridge id)kSecOIDX509V1ValidityNotAfter], NULL); + if (certDict == NULL) return toErrorString(@"SecCertificateCopyValues failed"); + + + // Get the "validity not after" property as a dictionary, and get the "value" key (that is a number). + CFDictionaryRef validityNotAfterDict = CFDictionaryGetValue(certDict, kSecOIDX509V1ValidityNotAfter); + if (validityNotAfterDict == NULL) return toErrorString(@"CFDictionaryGetValue (validity) failed"); + + CFNumberRef number = (CFNumberRef)CFDictionaryGetValue(validityNotAfterDict, kSecPropertyKeyValue); + if (number == NULL) return toErrorString(@"CFDictionaryGetValue (keyValue) failed"); + + CFNumberGetValue(number, kCFNumberSInt64Type, expirationDate); + // NSLog(@"Certificate validity not after: %ld", *expirationDate); + + CFRelease(certDict); + return ""; // No error. +} \ No newline at end of file diff --git a/certificates/install_darwin.go b/certificates/install_darwin.go new file mode 100644 index 000000000..515c9f7d4 --- /dev/null +++ b/certificates/install_darwin.go @@ -0,0 +1,101 @@ +// Copyright 2023 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package certificates + +/* +// Explicitly tell the GCC compiler that the language is Objective-C. +#cgo CFLAGS: -x objective-c + +// Pass the list of macOS frameworks needed by this piece of Objective-C code. +#cgo LDFLAGS: -framework Foundation -framework Security -framework AppKit + +#import +#include "certificates_darwin.h" +*/ +import "C" +import ( + "errors" + "time" + "unsafe" + + log "github.com/sirupsen/logrus" + + "github.com/arduino/arduino-create-agent/utilities" + "github.com/arduino/go-paths-helper" +) + +// InstallCertificate will install the certificates in the system keychain on macos, +// if something goes wrong will show a dialog with the error and return an error +func InstallCertificate(cert *paths.Path) error { + log.Infof("Installing certificate: %s", cert) + ccert := C.CString(cert.String()) + defer C.free(unsafe.Pointer(ccert)) + p := C.installCert(ccert) + s := C.GoString(p) + if len(s) != 0 { + utilities.UserPrompt(s, "\"OK\"", "OK", "OK", "Arduino Agent: Error installing certificates") + UninstallCertificates() + return errors.New(s) + } + return nil +} + +// UninstallCertificates will uninstall the certificates from the system keychain on macos, +// if something goes wrong will show a dialog with the error and return an error +func UninstallCertificates() error { + log.Infof("Uninstalling certificates") + p := C.uninstallCert() + s := C.GoString(p) + if len(s) != 0 { + utilities.UserPrompt(s, "\"OK\"", "OK", "OK", "Arduino Agent: Error uninstalling certificates") + return errors.New(s) + } + return nil +} + +// GetExpirationDate returns the expiration date of a certificate stored in the keychain +func GetExpirationDate() (time.Time, error) { + log.Infof("Retrieving certificate's expiration date") + + expirationDateLong := C.long(0) + + err := C.getExpirationDate(&expirationDateLong) + errString := C.GoString(err) + if len(errString) > 0 { + utilities.UserPrompt(errString, "\"OK\"", "OK", "OK", "Arduino Agent: Error retrieving expiration date") + return time.Time{}, errors.New(errString) + } + + // The expirationDate is the number of seconds from the date of 1 Jan 2001 00:00:00 GMT. + // Add 31 years to convert it to Unix Epoch. + expirationDate := int64(expirationDateLong) + return time.Unix(expirationDate, 0).AddDate(31, 0, 0), nil +} + +// GetDefaultBrowserName returns the name of the default browser +func GetDefaultBrowserName() string { + log.Infof("Retrieving default browser name") + p := C.getDefaultBrowserName() + return C.GoString(p) +} + +// CertInKeychain checks if the certificate is stored inside the keychain +func CertInKeychain() bool { + log.Infof("Checking if the Arduino certificate is in the keychain") + + certInKeychain := C.certInKeychain() + return bool(certInKeychain) +} diff --git a/certificates/install_default.go b/certificates/install_default.go new file mode 100644 index 000000000..533574d69 --- /dev/null +++ b/certificates/install_default.go @@ -0,0 +1,57 @@ +// Copyright 2023 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +//go:build !darwin + +package certificates + +import ( + "errors" + "time" + + log "github.com/sirupsen/logrus" + + "github.com/arduino/go-paths-helper" +) + +// InstallCertificate won't do anything on unsupported Operative Systems +func InstallCertificate(cert *paths.Path) error { + log.Warn("platform not supported for the certificate install") + return errors.New("platform not supported for the certificate install") +} + +// UninstallCertificates won't do anything on unsupported Operative Systems +func UninstallCertificates() error { + log.Warn("platform not supported for the certificates uninstall") + return errors.New("platform not supported for the certificates uninstall") +} + +// GetExpirationDate won't do anything on unsupported Operative Systems +func GetExpirationDate() (time.Time, error) { + log.Warn("platform not supported for retrieving certificates expiration date") + return time.Time{}, errors.New("platform not supported for retrieving certificates expiration date") +} + +// GetDefaultBrowserName won't do anything on unsupported Operative Systems +func GetDefaultBrowserName() string { + log.Warn("platform not supported for retrieving default browser name") + return "" +} + +// CertInKeychain won't do anything on unsupported Operative Systems +func CertInKeychain() bool { + log.Warn("platform not supported for verifying the certificate existence") + return false +} diff --git a/compile_webidebridge.sh b/compile_webidebridge.sh deleted file mode 100755 index a66a3f8be..000000000 --- a/compile_webidebridge.sh +++ /dev/null @@ -1,90 +0,0 @@ -# git submodule init -# git submodule update - -#dependencies -#go install github.com/sanbornm/go-selfupdate - -VERSION=xxx -APP_NAME=Arduino_Create_Bridge - -# OUTPUT-COLORING -red='\e[0;31m' -green='\e[0;32m' -NC='\e[0m' # No Color - -extractVersionFromMain() -{ - VERSION=`grep version main.go | cut -d "\"" -f2 | cut -d "\"" -f1 | head -1` -} - -createZipEmbeddableFileArduino() -{ - echo 'In createZipEmbeddableFileArduino' - GOOS=$1 - GOARCH=$2 - - # start clean - rm arduino/arduino.zip - rm -r arduino/arduino - mkdir arduino/arduino - cp -r arduino/hardware arduino/tools\_$GOOS\_$GOARCH arduino/boards.json arduino/arduino - cp config.ini arduino - cp fakecerts/*.pem fakecerts/*.cer arduino/ - mv arduino/arduino/tools* arduino/arduino/tools - cd arduino - zip -r arduino.zip config.ini *.pem *.cer > /dev/null - cd .. - #cat arduino/arduino.zip >> $3 - #zip --adjust-sfx $3 - mkdir -p snapshot/$GOOS\_$GOARCH - cp $3 snapshot/$GOOS\_$GOARCH/$3 - cp arduino/arduino.zip snapshot/$GOOS\_$GOARCH - ls -la snapshot/$GOOS\_$GOARCH/$3 -} - -bootstrapPlatforms() -{ - echo 'In bootstrapPlatforms' - #export PATH=$PATH:/opt/osxcross/target/bin - cd $GOROOT/src - env CC_FOR_TARGET=o64-clang CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 ./make.bash --no-clean - env CC_FOR_TARGET=gcc CGO_ENABLED=1 GOOS=linux GOARCH=amd64 ./make.bash --no-clean - env CC_FOR_TARGET=gcc CGO_ENABLED=1 GOOS=linux GOARCH=386 ./make.bash --no-clean - env CGO_ENABLED=0 GOOS=linux GOARCH=arm ./make.bash --no-clean - env CC_FOR_TARGET=i686-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=386 ./make.bash --no-clean -} - -compilePlatform() -{ - echo 'In compilePlatform' - GOOS=$1 - GOARCH=$2 - CC=$3 - CGO_ENABLED=$4 - NAME=$APP_NAME - if [ $GOOS == "windows" ] - then - NAME=$NAME".exe" - EXTRAFLAGS="-ldflags -H=windowsgui" - fi - env GOOS=$GOOS GOARCH=$GOARCH CC=$CC CXX=$CC CGO_ENABLED=$CGO_ENABLED go build -o=$NAME $EXTRAFLAGS - if [ $? != 0 ] - then - echo -e "${red}Target $GOOS, $GOARCH failed${NC}" - exit 1 - fi - echo createZipEmbeddableFileArduino $GOOS $GOARCH $NAME - createZipEmbeddableFileArduino $GOOS $GOARCH $NAME - GOOS=$GOOS GOARCH=$GOARCH go-selfupdate $NAME $VERSION - rm -rf $NAME* -} - -extractVersionFromMain -compilePlatform darwin amd64 o64-clang 1 -#compilePlatformLinux linux 386 gcc -compilePlatform linux amd64 gcc 1 -compilePlatform linux arm 0 -compilePlatform windows 386 i686-w64-mingw32-gcc 1 - - -exit 0 diff --git a/config/ArduinoCreateAgent.plist b/config/ArduinoCreateAgent.plist new file mode 100644 index 000000000..7e85cc3b5 --- /dev/null +++ b/config/ArduinoCreateAgent.plist @@ -0,0 +1,16 @@ + + + + + KeepAlive + + Label + cc.arduino.arduino-create-agent + Program + {{.Program}} + RunAtLoad + <{{.RunAtLoad}}/> + AbandonProcessGroup + + + \ No newline at end of file diff --git a/config/autostart.go b/config/autostart.go new file mode 100644 index 000000000..e45333d5b --- /dev/null +++ b/config/autostart.go @@ -0,0 +1,158 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package config + +import ( + "bytes" + // we need this for the ArduinoCreateAgent.plist in this package + _ "embed" + "os" + "os/exec" + "text/template" + + "github.com/arduino/go-paths-helper" + log "github.com/sirupsen/logrus" +) + +//go:embed ArduinoCreateAgent.plist +var launchdAgentDefinition []byte + +// getLaunchdAgentPath will return the path of the launchd agent default path +func getLaunchdAgentPath() *paths.Path { + homeDir := GetDefaultHomeDir() + launchAgentsPath := homeDir.Join("Library", "LaunchAgents") + agentPlistPath := launchAgentsPath.Join("ArduinoCreateAgent.plist") + + if err := os.MkdirAll(launchAgentsPath.String(), 0755); err != nil { + log.Panicf("Could not create ~/Library/LaunchAgents directory: %s", err) + } + + return agentPlistPath +} + +// InstallPlistFile will handle the process of creating the plist file required for the autostart +// and loading it using launchd +func InstallPlistFile() { + launchdAgentPath := getLaunchdAgentPath() + if !launchdAgentPath.Exist() { + writeAndLoadPlistFile(launchdAgentPath) + log.Info("Quitting, another instance of the agent has been started by launchd") + os.Exit(0) + } else { + // we already have an existing launchd plist file, so we check if it's updated + launchAgentContent, _ := launchdAgentPath.ReadFile() + launchAgentContentNew, _ := getLaunchdAgentDefinition() + if bytes.Equal(launchAgentContent, launchAgentContentNew) { + log.Infof("the autostart file %s already exists: nothing to do", launchdAgentPath) + } else { + log.Infof("the autostart file %s needs to be updated", launchdAgentPath) + removePlistFile() + writeAndLoadPlistFile(launchdAgentPath) + } + + } +} + +// writeAndLoadPlistFile function will write the plist file, load it, and then exit, because launchd will start a new instance. +func writeAndLoadPlistFile(launchdAgentPath *paths.Path) { + err := writePlistFile(launchdAgentPath) + if err != nil { + log.Error(err) + } else { + err = loadLaunchdAgent() // this will load the agent: basically starting a new instance + if err != nil { + log.Error(err) + } + } +} + +// writePlistFile function will write the required plist file to launchdAgentPath +// it will return nil in case of success, +// it will error in any other case +func writePlistFile(launchdAgentPath *paths.Path) error { + definition, err := getLaunchdAgentDefinition() + if err != nil { + return err + } + // we need to create a new launchd plist file + return launchdAgentPath.WriteFile(definition) +} + +// getLaunchdAgentDefinition will return the definition of the new LaunchdAgent +func getLaunchdAgentDefinition() ([]byte, error) { + src, err := os.Executable() + + if err != nil { + return nil, err + } + data := struct { + Program string + RunAtLoad bool + }{ + Program: src, + RunAtLoad: true, // This will start the agent right after login (and also after `launchctl load ...`) + } + + t := template.Must(template.New("launchdConfig").Parse(string(launchdAgentDefinition))) + + buf := bytes.NewBuffer(nil) + err = t.Execute(buf, data) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// loadLaunchdAgent will use launchctl to load the agent, will return an error if something goes wrong +func loadLaunchdAgent() error { + // https://www.launchd.info/ + oscmd := exec.Command("launchctl", "load", getLaunchdAgentPath().String()) + err := oscmd.Run() + return err +} + +// UninstallPlistFile will handle the process of unloading (unsing launchd) the file required for the autostart +// and removing the file +func UninstallPlistFile() { + err := unloadLaunchdAgent() + if err != nil { + log.Error(err) + } else { + err = removePlistFile() + if err != nil { + log.Error(err) + } + } +} + +// unloadLaunchdAgent will use launchctl to load the agent, will return an error if something goes wrong +func unloadLaunchdAgent() error { + // https://www.launchd.info/ + oscmd := exec.Command("launchctl", "unload", getLaunchdAgentPath().String()) + err := oscmd.Run() + return err +} + +// removePlistFile function will remove the plist file from $HOME/Library/LaunchAgents/ArduinoCreateAgent.plist and return an error +// it will not do anything if the file is not there +func removePlistFile() error { + launchdAgentPath := getLaunchdAgentPath() + if launchdAgentPath.Exist() { + log.Infof("removing: %s", launchdAgentPath) + return launchdAgentPath.Remove() + } + log.Infof("the autostart file %s do not exists: nothing to do", launchdAgentPath) + return nil +} diff --git a/config/config.go b/config/config.go new file mode 100644 index 000000000..69d29eeee --- /dev/null +++ b/config/config.go @@ -0,0 +1,144 @@ +// Copyright 2023 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package config + +import ( + // we need this for the config ini in this package + _ "embed" + "os" + + "github.com/arduino/go-paths-helper" + "github.com/go-ini/ini" + log "github.com/sirupsen/logrus" +) + +// GetCertificatesDir return the directory where SSL certificates are saved +func GetCertificatesDir() *paths.Path { + return GetDataDir() +} + +// CertsExist checks if the certs have already been generated +func CertsExist() bool { + certFile := GetCertificatesDir().Join("cert.pem") + return certFile.Exist() //if the certFile is not present we assume there are no certs +} + +// GetDataDir returns the full path to the default Arduino Create Agent data directory. +func GetDataDir() *paths.Path { + userDir, err := os.UserHomeDir() + if err != nil { + log.Panicf("Could not get user dir: %s", err) + } + dataDir := paths.New(userDir, ".arduino-create") + if err := dataDir.MkdirAll(); err != nil { + log.Panicf("Could not create data dir: %s", err) + } + return dataDir +} + +// GetLogsDir return the directory where logs are saved +func GetLogsDir() *paths.Path { + logsDir := GetDataDir().Join("logs") + if err := logsDir.MkdirAll(); err != nil { + log.Panicf("Can't create logs dir: %s", err) + } + return logsDir +} + +// LogsIsEmpty checks if the folder containing crash-reports is empty +func LogsIsEmpty() bool { + return GetLogsDir().NotExist() // if the logs directory is empty we assume there are no crashreports +} + +// GetDefaultConfigDir returns the full path to the default Arduino Create Agent configuration directory. +func GetDefaultConfigDir() *paths.Path { + // UserConfigDir returns the default root directory to use + // for user-specific configuration data. Users should create + // their own application-specific subdirectory within this + // one and use that. + // + // On Unix systems, it returns $XDG_CONFIG_HOME as specified by + // https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html + // if non-empty, else $HOME/.config. + // + // On Darwin, it returns $HOME/Library/Application Support. + // On Windows, it returns %AppData%. + // On Plan 9, it returns $home/lib. + // + // If the location cannot be determined (for example, $HOME + // is not defined), then it will return an error. + configDir, err := os.UserConfigDir() + if err != nil { + log.Panicf("Can't get user home dir: %s", err) + } + + agentConfigDir := paths.New(configDir, "ArduinoCreateAgent") + if err := agentConfigDir.MkdirAll(); err != nil { + log.Panicf("Can't create config dir: %s", err) + } + return agentConfigDir +} + +// GetDefaultHomeDir returns the full path to the user's home directory. +func GetDefaultHomeDir() *paths.Path { + // UserHomeDir returns the current user's home directory. + + // On Unix, including macOS, it returns the $HOME environment variable. + // On Windows, it returns %USERPROFILE%. + // On Plan 9, it returns the $home environment variable. + + homeDir, err := os.UserHomeDir() + if err != nil { + log.Panicf("Can't get user home dir: %s", err) + } + + return paths.New(homeDir) +} + +//go:embed config.ini +var configContent []byte + +// GenerateConfig function will take a directory path as an input +// and will write the default config,ini file to that directory, +// it will panic if something goes wrong +func GenerateConfig(destDir *paths.Path) *paths.Path { + configPath := destDir.Join("config.ini") + + // generate the config.ini file directly in destDir + if err := configPath.WriteFile(configContent); err != nil { + // if we do not have a config there's nothing else we can do + panic("cannot generate config: " + err.Error()) + } + log.Infof("generated config in %s", configPath) + return configPath +} + +// SetInstallCertsIni sets installCerts value to true in the config +func SetInstallCertsIni(filename string, value string) error { + cfg, err := ini.LoadSources(ini.LoadOptions{IgnoreInlineComment: false, AllowPythonMultilineValues: true}, filename) + if err != nil { + return err + } + _, err = cfg.Section("").NewKey("installCerts", value) + if err != nil { + return err + } + err = cfg.SaveTo(filename) + if err != nil { + return err + } + return nil +} diff --git a/config.ini b/config/config.ini similarity index 68% rename from config.ini rename to config/config.ini index dae4bce0e..f63377db5 100644 --- a/config.ini +++ b/config/config.ini @@ -1,10 +1,10 @@ -configUpdateInterval = 0 # Update interval for re-reading config file set via -config flag. Zero disables config file re-reading. gc = std # Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage) hostname = unknown-hostname # Override the hostname we get from the OS -ls = false # launch self 5 seconds later regex = usb|acm|com # Regular expression to filter serial port list v = true # show debug logging -appName = CreateBridge -updateUrl = http://downloads.arduino.cc/ -#updateUrl = http://localhost/ -origins = http://webide.arduino.cc:8080 \ No newline at end of file +appName = CreateAgent/Stable +updateUrl = https://downloads.arduino.cc/ +origins = https://local.arduino.cc:8000 +#httpProxy = http://your.proxy:port # Proxy server for HTTP requests +crashreport = false # enable crashreport logging +autostartMacOS = true # the Arduino Create Agent is able to start automatically after login on macOS (launchd agent) \ No newline at end of file diff --git a/conn.go b/conn.go index f8285633a..8c71c54c4 100644 --- a/conn.go +++ b/conn.go @@ -1,13 +1,37 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + // Supports Windows, Linux, Mac, and Raspberry Pi package main import ( - log "github.com/Sirupsen/logrus" - "github.com/gin-gonic/gin" - "github.com/googollee/go-socket.io" + "bytes" + "crypto/rsa" + "encoding/json" + "errors" + "fmt" "net/http" - "strconv" + "os" + "path/filepath" + + "github.com/arduino/arduino-create-agent/upload" + "github.com/arduino/arduino-create-agent/utilities" + "github.com/gin-gonic/gin" + socketio "github.com/googollee/go-socket.io" + log "github.com/sirupsen/logrus" ) type connection struct { @@ -15,8 +39,7 @@ type connection struct { ws socketio.Socket // Buffered channel of outbound messages. - send chan []byte - incoming chan []byte + send chan []byte } func (c *connection) writer() { @@ -37,58 +60,160 @@ func (s *WsServer) ServeHTTP(c *gin.Context) { s.Server.ServeHTTP(c.Writer, c.Request) } -func uploadHandler(c *gin.Context) { - log.Print("Received a upload") - port := c.PostForm("port") - if port == "" { - c.String(http.StatusBadRequest, "port is required") - return - } - board := c.PostForm("board") - if board == "" { - c.String(http.StatusBadRequest, "board is required") - log.Error("board is required") - return - } - board_rewrite := c.PostForm("board_rewrite") +type additionalFile struct { + Hex []byte `json:"hex"` + Filename string `json:"filename"` +} - var extraInfo boardExtraInfo +// Upload contains the data to upload a sketch onto a board +type Upload struct { + Port string `json:"port"` + Board string `json:"board"` + Rewrite string `json:"rewrite"` + Commandline string `json:"commandline"` + Signature string `json:"signature"` + Extra upload.Extra `json:"extra"` + Hex []byte `json:"hex"` + Filename string `json:"filename"` + ExtraFiles []additionalFile `json:"extrafiles"` +} - extraInfo.authdata.UserName = c.PostForm("auth_user") - extraInfo.authdata.Password = c.PostForm("auth_pass") - commandline := c.PostForm("commandline") - if commandline == "undefined" { - commandline = "" - } - extraInfo.use_1200bps_touch, _ = strconv.ParseBool(c.PostForm("use_1200bps_touch")) - extraInfo.wait_for_upload_port, _ = strconv.ParseBool(c.PostForm("wait_for_upload_port")) - extraInfo.networkPort, _ = strconv.ParseBool(c.PostForm("network")) - - if extraInfo.networkPort == false && commandline == "" { - c.String(http.StatusBadRequest, "commandline is required for local board") - log.Error("commandline is required for local board") - return - } +var uploadStatusStr = "ProgrammerStatus" - sketch, header, err := c.Request.FormFile("sketch_hex") - if err != nil { - c.String(http.StatusBadRequest, err.Error()) - } +func uploadHandler(pubKey *rsa.PublicKey) func(*gin.Context) { + return func(c *gin.Context) { + data := new(Upload) + if err := c.BindJSON(data); err != nil { + c.String(http.StatusBadRequest, fmt.Sprintf("err with the payload. %v", err.Error())) + return + } + + log.Printf("%+v %+v %+v %+v %+v %+v", data.Port, data.Board, data.Rewrite, data.Commandline, data.Extra, data.Filename) + + if data.Port == "" { + c.String(http.StatusBadRequest, "port is required") + return + } + + if data.Board == "" { + c.String(http.StatusBadRequest, "board is required") + log.Error("board is required") + return + } + + if !data.Extra.Network { + if data.Signature == "" { + c.String(http.StatusBadRequest, "signature is required") + return + } + + if data.Commandline == "" { + c.String(http.StatusBadRequest, "commandline is required for local board") + return + } - if header != nil { - path, err := saveFileonTempDir(header.Filename, sketch) + err := utilities.VerifyInput(data.Commandline, data.Signature, pubKey) + + if err != nil { + log.WithField("err", err).Error("Error verifying the command") + c.String(http.StatusBadRequest, "signature is invalid") + return + } + } + + buffer := bytes.NewBuffer(data.Hex) + + filePath, err := utilities.SaveFileonTempDir(data.Filename, buffer) + if err != nil { + c.String(http.StatusBadRequest, err.Error()) + return + } + + tmpdir, err := os.MkdirTemp("", "extrafiles") if err != nil { c.String(http.StatusBadRequest, err.Error()) + return + } + + for _, extraFile := range data.ExtraFiles { + path, err := utilities.SafeJoin(tmpdir, extraFile.Filename) + if err != nil { + c.String(http.StatusBadRequest, err.Error()) + return + } + log.Printf("Saving %s on %s", extraFile.Filename, path) + + err = os.MkdirAll(filepath.Dir(path), 0744) + if err != nil { + c.String(http.StatusBadRequest, err.Error()) + return + } + + err = os.WriteFile(path, extraFile.Hex, 0644) + if err != nil { + c.String(http.StatusBadRequest, err.Error()) + return + } } - if board_rewrite != "" { - board = board_rewrite + if data.Rewrite != "" { + data.Board = data.Rewrite } - go spProgramRW(port, board, path, commandline, extraInfo) + go func() { + // Resolve commandline + commandline, err := upload.PartiallyResolve(data.Board, filePath, tmpdir, data.Commandline, data.Extra, Tools) + if err != nil { + send(map[string]string{uploadStatusStr: "Error", "Msg": err.Error()}) + return + } + + l := PLogger{Verbose: true} + + // Upload + if data.Extra.Network { + err = errors.New("network upload is not supported anymore, pease use OTA instead") + } else { + send(map[string]string{uploadStatusStr: "Starting", "Cmd": "Serial"}) + err = upload.Serial(data.Port, commandline, data.Extra, l) + } + + // Handle result + if err != nil { + send(map[string]string{uploadStatusStr: "Error", "Msg": err.Error()}) + return + } + send(map[string]string{uploadStatusStr: "Done", "Flash": "Ok"}) + }() + + c.String(http.StatusAccepted, "") } } +// PLogger sends the info from the upload to the websocket +type PLogger struct { + Verbose bool +} + +// Debug only sends messages if verbose is true (always true for now) +func (l PLogger) Debug(args ...interface{}) { + if l.Verbose { + l.Info(args...) + } +} + +// Info always send messages +func (l PLogger) Info(args ...interface{}) { + output := fmt.Sprint(args...) + log.Println(output) + send(map[string]string{uploadStatusStr: "Busy", "Msg": output}) +} + +func send(args map[string]string) { + mapB, _ := json.Marshal(args) + h.broadcastSys <- mapB +} + func wsHandler() *WsServer { server, err := socketio.NewServer(nil) if err != nil { @@ -101,6 +226,7 @@ func wsHandler() *WsServer { so.On("command", func(message string) { h.broadcast <- []byte(message) }) + so.On("disconnection", func() { h.unregister <- c }) diff --git a/design/design.go b/design/design.go new file mode 100644 index 000000000..b690a40e4 --- /dev/null +++ b/design/design.go @@ -0,0 +1,30 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package design + +import . "goa.design/goa/v3/dsl" + +var _ = API("arduino-create-agent", func() { + Title("Arduino Create Agent") + Description(`A companion of Arduino Create. + Allows the website to perform operations on the user computer, + such as detecting which boards are connected and upload sketches on them.`) + HTTP(func() { + Path("/v2") + Consumes("application/json") + Consumes("plain/text") + }) +}) diff --git a/design/pkgs.go b/design/pkgs.go new file mode 100644 index 000000000..21c30d217 --- /dev/null +++ b/design/pkgs.go @@ -0,0 +1,123 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package design + +import . "goa.design/goa/v3/dsl" + +var _ = Service("tools", func() { + Description("The tools service manages the available and installed tools") + + Method("available", func() { + Result(CollectionOf(Tool)) + HTTP(func() { + GET("/pkgs/tools/available") + Response(StatusOK) + }) + }) + + Method("installedhead", func() { + HTTP(func() { + HEAD("/pkgs/tools/installed") + Response(StatusOK) + }) + }) + + Method("installed", func() { + Result(CollectionOf(Tool)) + HTTP(func() { + GET("/pkgs/tools/installed") + Response(StatusOK) + }) + }) + + Method("install", func() { + Error("not_found", ErrorResult, "tool not found") + HTTP(func() { + Response("not_found", StatusBadRequest) + }) + Payload(ToolPayload) + Result(Operation) + HTTP(func() { + POST("/pkgs/tools/installed") + Response(StatusOK) + }) + }) + + Method("remove", func() { + Payload(ToolPayload) + Result(Operation) + + HTTP(func() { + DELETE("/pkgs/tools/installed/{packager}/{name}/{version}") + Response(StatusOK) + }) + }) +}) + +var ToolPayload = Type("arduino.tool", func() { + Description(`A tool is an executable program that can upload sketches. + If url is absent the tool will be searched among the package index installed`) + TypeName("ToolPayload") + + Attribute("name", String, "The name of the tool", func() { + Example("bossac") + }) + Attribute("version", String, "The version of the tool", func() { + Example("1.7.0-arduino3") + }) + Attribute("packager", String, "The packager of the tool", func() { + Example("arduino") + }) + + Attribute("url", String, `The url where the package can be found. Optional. + If present checksum must also be present.`, func() { + Example("http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz") + }) + + Attribute("checksum", String, `A checksum of the archive. Mandatory when url is present. + This ensures that the package is downloaded correcly.`, func() { + Example("SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100") + }) + + Attribute("signature", String, `The signature used to sign the url. Mandatory when url is present. + This ensure the security of the file downloaded`, func() { + Example("382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0") + }) + + Required("name", "version", "packager") +}) + +var Tool = ResultType("application/vnd.arduino.tool", func() { + Description("A tool is an executable program that can upload sketches.") + TypeName("Tool") + Reference(ToolPayload) + + Attribute("name") + Attribute("version") + Attribute("packager") + + Required("name", "version", "packager") +}) + +var Operation = ResultType("application/vnd.arduino.operation", func() { + Description("Describes the result of an operation.") + TypeName("Operation") + + Attribute("status", String, "The status of the operation", func() { + Example("ok") + }) + Required("status") +}) diff --git a/discovery.go b/discovery.go deleted file mode 100644 index 88becff59..000000000 --- a/discovery.go +++ /dev/null @@ -1,145 +0,0 @@ -// -// discovery.go -// -// Created by Martino Facchin -// Copyright (c) 2015 Arduino LLC -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -package main - -import ( - log "github.com/Sirupsen/logrus" - "github.com/oleksandr/bonjour" - "net" - "strings" - "time" -) - -const timeoutConst = 2 - -// SavedNetworkPorts contains the ports which we know are already connected -var SavedNetworkPorts []OsSerialPort - -// GetNetworkList returns a list of Network Ports -// The research of network ports is articulated in two phases. First we add new ports coming from -// the bonjour module, then we prune the boards who don't respond to a ping -func GetNetworkList() ([]OsSerialPort, error) { - newPorts, err := getPorts() - if err != nil { - return nil, err - } - - SavedNetworkPorts = Filter(SavedNetworkPorts, func(port OsSerialPort) bool { - any := true - for _, p := range newPorts { - if p.Name == port.Name { - any = false - return any - } - } - return any - }) - - SavedNetworkPorts, err = pruneUnreachablePorts(SavedNetworkPorts) - if err != nil { - return nil, err - } - - SavedNetworkPorts = append(SavedNetworkPorts, newPorts...) - - return SavedNetworkPorts, nil -} - -func checkAvailability(ip string) bool { - timeout := time.Duration(1500 * time.Millisecond) - // Check if the port 80 is open - conn, err := net.DialTimeout("tcp", ip+":80", timeout) - if err != nil { - log.Println(err) - // Check if the port 22 is open - conn, err = net.DialTimeout("tcp", ip+":22", timeout) - if err != nil { - log.Println(err) - return false - } - conn.Close() - return true - } - conn.Close() - return true -} - -func pruneUnreachablePorts(ports []OsSerialPort) ([]OsSerialPort, error) { - times := 2 - - ports = Filter(ports, func(port OsSerialPort) bool { - any := false - for i := 0; i < times; i++ { - if checkAvailability(port.Name) { - any = true - } - } - return any - }) - - return ports, nil -} - -func getPorts() ([]OsSerialPort, error) { - resolver, err := bonjour.NewResolver(nil) - if err != nil { - log.Println("Failed to initialize resolver:", err.Error()) - return nil, err - } - - results := make(chan *bonjour.ServiceEntry) - - timeout := make(chan bool, 1) - go func(exitCh chan<- bool) { - time.Sleep(timeoutConst * time.Second) - exitCh <- true - close(results) - }(resolver.Exit) - - arrPorts := []OsSerialPort{} - go func(results chan *bonjour.ServiceEntry, exitCh chan<- bool) { - for e := range results { - if e.AddrIPv4 != nil { - arrPorts = append(arrPorts, OsSerialPort{Name: e.AddrIPv4.String(), IdProduct: e.Instance, IdVendor: strings.Join(e.Text[:], " "), NetworkPort: true}) - } - } - timeout <- true - }(results, resolver.Exit) - - err = resolver.Browse("_arduino._tcp", "", results) - if err != nil { - log.Println("Failed to browse:", err.Error()) - return nil, err - } - // wait for some kind of timeout and return arrPorts - select { - case <-timeout: - return arrPorts, nil - } -} diff --git a/docs/tools.md b/docs/tools.md new file mode 100644 index 000000000..93ac8e3f8 --- /dev/null +++ b/docs/tools.md @@ -0,0 +1,66 @@ +# tools +-- + import "github.com/arduino/arduino-create-agent/tools" + + +## Usage + +#### type Tools + +```go +type Tools struct { + Directory string + IndexURL string + LastRefresh time.Time + Logger log.StdLogger +} +``` + +Tools handle the tools necessary for an upload on a board. It provides a means +to download a tool from the arduino servers. + +- *Directory* contains the location where the tools are downloaded. +- *IndexURL* contains the url where the tools description is contained. +- *LastRefresh* contains the last update time +- *Logger* is a StdLogger used for reporting debug and info messages +- *installed* contains a map of the tools and their exact location + +Usage: You have to instantiate the struct by passing it the required parameters: + + _tools := tools.Tools{ + Directory: "/home/user/.arduino-create", + IndexURL: "https://downloads.arduino.cc/packages/package_index.json" + Logger: log.Logger + } + +#### func (*Tools) Download + +```go +func (t *Tools) Download(name, version, behaviour string) error +``` +Download will parse the index at the indexURL for the tool to download. It will +extract it in a folder in .arduino-create, and it will update the Installed map. + +name contains the name of the tool. version contains the version of the tool. +behaviour contains the strategy to use when there is already a tool installed + +If version is "latest" it will always download the latest version (regardless of +the value of behaviour) + +If version is not "latest" and behaviour is "replace", it will download the +version again. If instead behaviour is "keep" it will not download the version +if it already exists. + +#### func (*Tools) GetLocation + +```go +func (t *Tools) GetLocation(command string) (string, error) +``` +GetLocation extracts the toolname from a command like + +#### func (*Tools) Init + +```go +func (t *Tools) Init() +``` +Init creates the Installed map and populates it from a file in .arduino-create diff --git a/download.go b/download.go deleted file mode 100644 index ecce08aac..000000000 --- a/download.go +++ /dev/null @@ -1,124 +0,0 @@ -// download.go -package main - -import ( - "encoding/json" - "errors" - log "github.com/Sirupsen/logrus" - "io" - "io/ioutil" - "net/http" - "os" - "path/filepath" - "runtime" - "strings" -) - -func saveFileonTempDir(filename string, sketch io.Reader) (path string, err error) { - // create tmp dir - tmpdir, err := ioutil.TempDir("", "arduino-create-agent") - if err != nil { - return "", errors.New("Could not create temp directory to store downloaded file. Do you have permissions?") - } - - filename, _ = filepath.Abs(tmpdir + "/" + filename) - - output, err := os.Create(filename) - if err != nil { - log.Println("Error while creating", filename, "-", err) - return filename, err - } - defer output.Close() - - n, err := io.Copy(output, sketch) - if err != nil { - log.Println("Error while copying", err) - return filename, err - } - - log.Println(n, "bytes saved") - - return filename, nil - -} - -func downloadFromUrl(url string) (filename string, err error) { - - // clean up url - // remove newlines and space at end - url = strings.TrimSpace(url) - - // create tmp dir - tmpdir, err := ioutil.TempDir("", "arduino-create-agent") - if err != nil { - return "", errors.New("Could not create temp directory to store downloaded file. Do you have permissions?") - } - tokens := strings.Split(url, "/") - filePrefix := tokens[len(tokens)-1] - log.Println("The filePrefix is", filePrefix) - - fileName, _ := filepath.Abs(tmpdir + "/" + filePrefix) - log.Println("Downloading", url, "to", fileName) - - // TODO: check file existence first with io.IsExist - output, err := os.Create(fileName) - if err != nil { - log.Println("Error while creating", fileName, "-", err) - return fileName, err - } - defer output.Close() - - response, err := http.Get(url) - if err != nil { - log.Println("Error while downloading", url, "-", err) - return fileName, err - } - defer response.Body.Close() - - n, err := io.Copy(output, response.Body) - if err != nil { - log.Println("Error while downloading", url, "-", err) - return fileName, err - } - - log.Println(n, "bytes downloaded.") - - return fileName, nil -} - -func spDownloadTool(name string, url string) { - - if _, err := os.Stat(tempToolsPath + "/" + name); err != nil { - - fileName, err := downloadFromUrl(url + "/" + name + "-" + runtime.GOOS + "-" + runtime.GOARCH + ".zip") - if err != nil { - log.Error("Could not download flashing tools!") - mapD := map[string]string{"DownloadStatus": "Error", "Msg": err.Error()} - mapB, _ := json.Marshal(mapD) - h.broadcastSys <- mapB - return - } - err = UnzipWrapper(fileName, tempToolsPath) - if err != nil { - log.Error("Could not unzip flashing tools!") - mapD := map[string]string{"DownloadStatus": "Error", "Msg": err.Error()} - mapB, _ := json.Marshal(mapD) - h.broadcastSys <- mapB - return - } - } else { - log.Info("Tool already present, skipping download") - } - - folders, _ := ioutil.ReadDir(tempToolsPath) - for _, f := range folders { - globalToolsMap["{runtime.tools."+f.Name()+".path}"] = filepath.ToSlash(tempToolsPath + "/" + f.Name()) - } - - log.Info("Map Updated") - mapD := map[string]string{"DownloadStatus": "Success", "Msg": "Map Updated"} - mapB, _ := json.Marshal(mapD) - h.broadcastSys <- mapB - return - -} diff --git a/fakecerts/cert.cer b/fakecerts/cert.cer deleted file mode 100644 index 2e62ff04d..000000000 Binary files a/fakecerts/cert.cer and /dev/null differ diff --git a/fakecerts/cert.pem b/fakecerts/cert.pem deleted file mode 100644 index 7f648b91c..000000000 --- a/fakecerts/cert.pem +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDBDCCAewCCQD9LvUUyrKRXzANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJV -UzEUMBIGA1UEChMLQXJkdWlubyBMTEMxCzAJBgNVBAsTAklUMRIwEAYDVQQDEwls -b2NhbGhvc3QwHhcNMTUwNjExMDcyNTM2WhcNMTYwNjEwMDcyNTM2WjBEMQswCQYD -VQQGEwJVUzEUMBIGA1UEChMLQXJkdWlubyBMTEMxCzAJBgNVBAsTAklUMRIwEAYD -VQQDEwlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7 -3UTunwOvcw1hgFDN6bdHxssg/H33faLILjUJIBZwyRCVLc8zcExk7D0YLxnMBaxs -t4DoPfMlAXiJ+GT3fiOaYTKHmGT3Qz85WC6Yngz9A/usDQSSYe9rI4k3oLNA4F+b -6VU5FBj1V3nj79gs3IMEkTMnit+9HZ8PNlJEZSzEuxbrQdIV530H8MvHpUoCkinP -uPur9zGFysIS1euoVybNKmVXcxmy0QHDNfOddH2SBaFD6QriucOIMW6AVHjseL9E -A4IKKum88LLDiKPeu3gr12vNnjydLFGnNg+wlTnXUeeuXgMfNVaTDaIC8NEA+mSQ -M6Ag6CymhWqpe/cqa45hAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBABCXfQZLhYI4 -B0VjgwDDRohTAhsSyaQvFEhGOx2Oo28RhKgY2xRtfjDlm7IzTLga4ApsHqIMf85F -z4bpDDciwPhQDJ6a0ueXJv+xb6RGBnGAbnOiHPfgdd/P2vGfsR7mRaTdXJC4r9PI -C3kzjwTlplaulLbHs5XIXImGvAvRX5sPmkqlBAQs8PVG4I71pKXo1M4kl7uzr96+ -+DKnVz2oACAPCW6zTlT/MlBH4nSeCQfGiE8iWAqODviONOQjFnaTKLw6d1YnbnLp -1gokB8sk1TAM3qjb6giZpe945xISSNUDAVRW+3NIKag+qOURnN+QGi9ac3cPepXb -4Kr4QM+kV+g= ------END CERTIFICATE----- diff --git a/fakecerts/key.pem b/fakecerts/key.pem deleted file mode 100644 index 26c54a281..000000000 --- a/fakecerts/key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEAu91E7p8Dr3MNYYBQzem3R8bLIPx9932iyC41CSAWcMkQlS3P -M3BMZOw9GC8ZzAWsbLeA6D3zJQF4ifhk934jmmEyh5hk90M/OVgumJ4M/QP7rA0E -kmHvayOJN6CzQOBfm+lVORQY9Vd54+/YLNyDBJEzJ4rfvR2fDzZSRGUsxLsW60HS -Fed9B/DLx6VKApIpz7j7q/cxhcrCEtXrqFcmzSplV3MZstEBwzXznXR9kgWhQ+kK -4rnDiDFugFR47Hi/RAOCCirpvPCyw4ij3rt4K9drzZ48nSxRpzYPsJU511Hnrl4D -HzVWkw2iAvDRAPpkkDOgIOgspoVqqXv3KmuOYQIDAQABAoIBADzL4df7W/z2ldj8 -5qmMvkSbP/d/3uAuJ3TzBzTZzolXeGdeuNRjvkVW8nqWG5ocJ+3TAQOnsL1EGZdE -7J/vkWQPmoOpPNuMRrSvJf08AOYM2PCYEeexjAK3MFvxRLF1K1vQikT7jQww8ABl -CSeTgU8EEnL0jW2tXWFV6g+6Ul+jwfq5IvbUpMsMOPuUEQy85rm04bCw/vUnhZXk -gFSpAp5mKPI6J/v2fkJTjgxi0wURxHKFdH/dFr69k9G7Vv9L8meiZYwA0QsYcmeJ -EAGpZHQXpTCmmmzWM85vz9vg4qUBwF8ypXcWjuqfjAopXvuenyIkfa9paDriRnNM -A3JmUQECgYEA66fdY8cU1cJw5jmhc10mi6lDz0Xswba4kaYnb2fwr7tlkBFzYYVn -GY6f2fNxdx8ZpOCYzembJ67qCXODw4LLle1slgHzOWHQ4RJd2EDw/i9woPHGsT3a -TIk0tX3wOjtJJEXNzQEiqcDqGqrpY3pnm4lFGR4RSE6vIYfPwyO9y7ECgYEAzBUv -hKy19GSFK8tkYa/WcmNMCGwLJB0pEMuT3heDjSEKYNaTh8YcIpeEY3aCWbMKxWdu -O5TIouyNJHtm4Q0umG08ZGekLTZy22it2UJabROvHVHeSnPki9a12Uc3KgB6mBzb -nnHXQ8hR60o0GTPMudVW12aZh9gy+EcGWQEwibECgYAIdQ3M9ugYg9HpcUgKC93G -RVzZo3jLuvMExyHDLcfFhsQuV3H8nf0FPcke2U3JKKSS9jyFp0yaL/zWOf8QlTEZ -QFwVRhykgo4shaw4hpwfgzRXklW/Jqke9g2eNdbZQCdv1dF8+f10eifsrRWTLGFr -g5GnRRz5q1k9qtIZ/r5hAQKBgCegMXLMaiQC5IylWF9TWgsp1piICf3AH7ogHRzx -adycPrygzVJ+l/Xrf4wkdZjfF8dOluvArthbn+gmgcpO2e5Ev4YrTYht2w1ZHPBj -XtVxDf5eaBACwqyYSwTePArOvv8ME2SHbCnAGo/Z/5WpJiYrE0qNpF/pDbSBbe0Y -OwlxAoGAdPEjpeeCpyUcoJMVnIxM7AtsOqomd0lBrRgRq05FYvGMAygoKzz+OBp+ -VgptcGJp+6t5MY9R3asRaFp3rOcXvX5R4wBMfijlzoezMEFZN/+xpm7LN2E0domO -xyku5Kcn9G/KTxCduepOtjqoNYkKYAcrdkmRfZ9C9xvuB2lKjk8= ------END RSA PRIVATE KEY----- diff --git a/gen/http/cli/arduino_create_agent/cli.go b/gen/http/cli/arduino_create_agent/cli.go new file mode 100644 index 000000000..a4d856292 --- /dev/null +++ b/gen/http/cli/arduino_create_agent/cli.go @@ -0,0 +1,249 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// arduino-create-agent HTTP client CLI support package +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package cli + +import ( + "flag" + "fmt" + "net/http" + "os" + + toolsc "github.com/arduino/arduino-create-agent/gen/http/tools/client" + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" +) + +// UsageCommands returns the set of commands and sub-commands using the format +// +// command (subcommand1|subcommand2|...) +func UsageCommands() string { + return `tools (available|installedhead|installed|install|remove) +` +} + +// UsageExamples produces an example of a valid invocation of the CLI tool. +func UsageExamples() string { + return os.Args[0] + ` tools available` + "\n" + + "" +} + +// ParseEndpoint returns the endpoint and payload as specified on the command +// line. +func ParseEndpoint( + scheme, host string, + doer goahttp.Doer, + enc func(*http.Request) goahttp.Encoder, + dec func(*http.Response) goahttp.Decoder, + restore bool, +) (goa.Endpoint, any, error) { + var ( + toolsFlags = flag.NewFlagSet("tools", flag.ContinueOnError) + + toolsAvailableFlags = flag.NewFlagSet("available", flag.ExitOnError) + + toolsInstalledheadFlags = flag.NewFlagSet("installedhead", flag.ExitOnError) + + toolsInstalledFlags = flag.NewFlagSet("installed", flag.ExitOnError) + + toolsInstallFlags = flag.NewFlagSet("install", flag.ExitOnError) + toolsInstallBodyFlag = toolsInstallFlags.String("body", "REQUIRED", "") + + toolsRemoveFlags = flag.NewFlagSet("remove", flag.ExitOnError) + toolsRemoveBodyFlag = toolsRemoveFlags.String("body", "REQUIRED", "") + toolsRemovePackagerFlag = toolsRemoveFlags.String("packager", "REQUIRED", "The packager of the tool") + toolsRemoveNameFlag = toolsRemoveFlags.String("name", "REQUIRED", "The name of the tool") + toolsRemoveVersionFlag = toolsRemoveFlags.String("version", "REQUIRED", "The version of the tool") + ) + toolsFlags.Usage = toolsUsage + toolsAvailableFlags.Usage = toolsAvailableUsage + toolsInstalledheadFlags.Usage = toolsInstalledheadUsage + toolsInstalledFlags.Usage = toolsInstalledUsage + toolsInstallFlags.Usage = toolsInstallUsage + toolsRemoveFlags.Usage = toolsRemoveUsage + + if err := flag.CommandLine.Parse(os.Args[1:]); err != nil { + return nil, nil, err + } + + if flag.NArg() < 2 { // two non flag args are required: SERVICE and ENDPOINT (aka COMMAND) + return nil, nil, fmt.Errorf("not enough arguments") + } + + var ( + svcn string + svcf *flag.FlagSet + ) + { + svcn = flag.Arg(0) + switch svcn { + case "tools": + svcf = toolsFlags + default: + return nil, nil, fmt.Errorf("unknown service %q", svcn) + } + } + if err := svcf.Parse(flag.Args()[1:]); err != nil { + return nil, nil, err + } + + var ( + epn string + epf *flag.FlagSet + ) + { + epn = svcf.Arg(0) + switch svcn { + case "tools": + switch epn { + case "available": + epf = toolsAvailableFlags + + case "installedhead": + epf = toolsInstalledheadFlags + + case "installed": + epf = toolsInstalledFlags + + case "install": + epf = toolsInstallFlags + + case "remove": + epf = toolsRemoveFlags + + } + + } + } + if epf == nil { + return nil, nil, fmt.Errorf("unknown %q endpoint %q", svcn, epn) + } + + // Parse endpoint flags if any + if svcf.NArg() > 1 { + if err := epf.Parse(svcf.Args()[1:]); err != nil { + return nil, nil, err + } + } + + var ( + data any + endpoint goa.Endpoint + err error + ) + { + switch svcn { + case "tools": + c := toolsc.NewClient(scheme, host, doer, enc, dec, restore) + switch epn { + case "available": + endpoint = c.Available() + data = nil + case "installedhead": + endpoint = c.Installedhead() + data = nil + case "installed": + endpoint = c.Installed() + data = nil + case "install": + endpoint = c.Install() + data, err = toolsc.BuildInstallPayload(*toolsInstallBodyFlag) + case "remove": + endpoint = c.Remove() + data, err = toolsc.BuildRemovePayload(*toolsRemoveBodyFlag, *toolsRemovePackagerFlag, *toolsRemoveNameFlag, *toolsRemoveVersionFlag) + } + } + } + if err != nil { + return nil, nil, err + } + + return endpoint, data, nil +} + +// toolsUsage displays the usage of the tools command and its subcommands. +func toolsUsage() { + fmt.Fprintf(os.Stderr, `The tools service manages the available and installed tools +Usage: + %[1]s [globalflags] tools COMMAND [flags] + +COMMAND: + available: Available implements available. + installedhead: Installedhead implements installedhead. + installed: Installed implements installed. + install: Install implements install. + remove: Remove implements remove. + +Additional help: + %[1]s tools COMMAND --help +`, os.Args[0]) +} +func toolsAvailableUsage() { + fmt.Fprintf(os.Stderr, `%[1]s [flags] tools available + +Available implements available. + +Example: + %[1]s tools available +`, os.Args[0]) +} + +func toolsInstalledheadUsage() { + fmt.Fprintf(os.Stderr, `%[1]s [flags] tools installedhead + +Installedhead implements installedhead. + +Example: + %[1]s tools installedhead +`, os.Args[0]) +} + +func toolsInstalledUsage() { + fmt.Fprintf(os.Stderr, `%[1]s [flags] tools installed + +Installed implements installed. + +Example: + %[1]s tools installed +`, os.Args[0]) +} + +func toolsInstallUsage() { + fmt.Fprintf(os.Stderr, `%[1]s [flags] tools install -body JSON + +Install implements install. + -body JSON: + +Example: + %[1]s tools install --body '{ + "checksum": "SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100", + "name": "bossac", + "packager": "arduino", + "signature": "382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz", + "version": "1.7.0-arduino3" + }' +`, os.Args[0]) +} + +func toolsRemoveUsage() { + fmt.Fprintf(os.Stderr, `%[1]s [flags] tools remove -body JSON -packager STRING -name STRING -version STRING + +Remove implements remove. + -body JSON: + -packager STRING: The packager of the tool + -name STRING: The name of the tool + -version STRING: The version of the tool + +Example: + %[1]s tools remove --body '{ + "checksum": "SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100", + "signature": "382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz" + }' --packager "arduino" --name "bossac" --version "1.7.0-arduino3" +`, os.Args[0]) +} diff --git a/gen/http/openapi.json b/gen/http/openapi.json new file mode 100644 index 000000000..c0e427331 --- /dev/null +++ b/gen/http/openapi.json @@ -0,0 +1 @@ +{"swagger":"2.0","info":{"title":"Arduino Create Agent","description":"A companion of Arduino Create. \n\tAllows the website to perform operations on the user computer, \n\tsuch as detecting which boards are connected and upload sketches on them.","version":"0.0.1"},"host":"localhost:80","basePath":"/v2","consumes":["application/json","plain/text"],"produces":["application/json","application/xml","application/gob"],"paths":{"/pkgs/tools/available":{"get":{"tags":["tools"],"summary":"available tools","operationId":"tools#available","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ToolsToolResponseCollection"}}},"schemes":["http"]}},"/pkgs/tools/installed":{"get":{"tags":["tools"],"summary":"installed tools","operationId":"tools#installed","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ToolsToolResponseCollection"}}},"schemes":["http"]},"post":{"tags":["tools"],"summary":"install tools","operationId":"tools#install","parameters":[{"name":"InstallRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/ToolsInstallRequestBody","required":["name","version","packager"]}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ToolsInstallResponseBody"}}},"schemes":["http"]},"head":{"tags":["tools"],"summary":"installedhead tools","operationId":"tools#installedhead","responses":{"200":{"description":"OK response."}},"schemes":["http"]}},"/pkgs/tools/installed/{packager}/{name}/{version}":{"delete":{"tags":["tools"],"summary":"remove tools","operationId":"tools#remove","parameters":[{"name":"packager","in":"path","description":"The packager of the tool","required":true,"type":"string"},{"name":"name","in":"path","description":"The name of the tool","required":true,"type":"string"},{"name":"version","in":"path","description":"The version of the tool","required":true,"type":"string"},{"name":"RemoveRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/ToolsRemoveRequestBody"}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ToolsRemoveResponseBody"}}},"schemes":["http"]}}},"definitions":{"ToolResponse":{"title":"Mediatype identifier: application/vnd.arduino.tool; view=default","type":"object","properties":{"name":{"type":"string","description":"The name of the tool","example":"bossac"},"packager":{"type":"string","description":"The packager of the tool","example":"arduino"},"version":{"type":"string","description":"The version of the tool","example":"1.7.0-arduino3"}},"description":"A tool is an executable program that can upload sketches. (default view)","example":{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},"required":["name","version","packager"]},"ToolsInstallRequestBody":{"title":"ToolsInstallRequestBody","type":"object","properties":{"checksum":{"type":"string","description":"A checksum of the archive. Mandatory when url is present. \n\tThis ensures that the package is downloaded correcly.","example":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100"},"name":{"type":"string","description":"The name of the tool","example":"bossac"},"packager":{"type":"string","description":"The packager of the tool","example":"arduino"},"signature":{"type":"string","description":"The signature used to sign the url. Mandatory when url is present.\n\tThis ensure the security of the file downloaded","example":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0"},"url":{"type":"string","description":"The url where the package can be found. Optional. \n\tIf present checksum must also be present.","example":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz"},"version":{"type":"string","description":"The version of the tool","example":"1.7.0-arduino3"}},"example":{"checksum":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100","name":"bossac","packager":"arduino","signature":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0","url":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz","version":"1.7.0-arduino3"},"required":["name","version","packager"]},"ToolsInstallResponseBody":{"title":"Mediatype identifier: application/vnd.arduino.operation; view=default","type":"object","properties":{"status":{"type":"string","description":"The status of the operation","example":"ok"}},"description":"InstallResponseBody result type (default view)","example":{"status":"ok"},"required":["status"]},"ToolsRemoveRequestBody":{"title":"ToolsRemoveRequestBody","type":"object","properties":{"checksum":{"type":"string","description":"A checksum of the archive. Mandatory when url is present. \n\tThis ensures that the package is downloaded correcly.","example":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100"},"signature":{"type":"string","description":"The signature used to sign the url. Mandatory when url is present.\n\tThis ensure the security of the file downloaded","example":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0"},"url":{"type":"string","description":"The url where the package can be found. Optional. \n\tIf present checksum must also be present.","example":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz"}},"example":{"checksum":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100","signature":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0","url":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz"}},"ToolsRemoveResponseBody":{"title":"Mediatype identifier: application/vnd.arduino.operation; view=default","type":"object","properties":{"status":{"type":"string","description":"The status of the operation","example":"ok"}},"description":"RemoveResponseBody result type (default view)","example":{"status":"ok"},"required":["status"]},"ToolsToolResponseCollection":{"title":"Mediatype identifier: application/vnd.arduino.tool; type=collection; view=default","type":"array","items":{"$ref":"#/definitions/ToolResponse"},"description":"AvailableResponseBody is the result type for an array of ToolResponse (default view)","example":[{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"}]}}} \ No newline at end of file diff --git a/gen/http/openapi.yaml b/gen/http/openapi.yaml new file mode 100644 index 000000000..3e5aeffd0 --- /dev/null +++ b/gen/http/openapi.yaml @@ -0,0 +1,241 @@ +swagger: "2.0" +info: + title: Arduino Create Agent + description: "A companion of Arduino Create. \n\tAllows the website to perform operations on the user computer, \n\tsuch as detecting which boards are connected and upload sketches on them." + version: 0.0.1 +host: localhost:80 +basePath: /v2 +consumes: + - application/json + - plain/text +produces: + - application/json + - application/xml + - application/gob +paths: + /pkgs/tools/available: + get: + tags: + - tools + summary: available tools + operationId: tools#available + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ToolsToolResponseCollection' + schemes: + - http + /pkgs/tools/installed: + get: + tags: + - tools + summary: installed tools + operationId: tools#installed + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ToolsToolResponseCollection' + schemes: + - http + post: + tags: + - tools + summary: install tools + operationId: tools#install + parameters: + - name: InstallRequestBody + in: body + required: true + schema: + $ref: '#/definitions/ToolsInstallRequestBody' + required: + - name + - version + - packager + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ToolsInstallResponseBody' + schemes: + - http + head: + tags: + - tools + summary: installedhead tools + operationId: tools#installedhead + responses: + "200": + description: OK response. + schemes: + - http + /pkgs/tools/installed/{packager}/{name}/{version}: + delete: + tags: + - tools + summary: remove tools + operationId: tools#remove + parameters: + - name: packager + in: path + description: The packager of the tool + required: true + type: string + - name: name + in: path + description: The name of the tool + required: true + type: string + - name: version + in: path + description: The version of the tool + required: true + type: string + - name: RemoveRequestBody + in: body + required: true + schema: + $ref: '#/definitions/ToolsRemoveRequestBody' + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/ToolsRemoveResponseBody' + schemes: + - http +definitions: + ToolResponse: + title: 'Mediatype identifier: application/vnd.arduino.tool; view=default' + type: object + properties: + name: + type: string + description: The name of the tool + example: bossac + packager: + type: string + description: The packager of the tool + example: arduino + version: + type: string + description: The version of the tool + example: 1.7.0-arduino3 + description: A tool is an executable program that can upload sketches. (default view) + example: + name: bossac + packager: arduino + version: 1.7.0-arduino3 + required: + - name + - version + - packager + ToolsInstallRequestBody: + title: ToolsInstallRequestBody + type: object + properties: + checksum: + type: string + description: "A checksum of the archive. Mandatory when url is present. \n\tThis ensures that the package is downloaded correcly." + example: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + name: + type: string + description: The name of the tool + example: bossac + packager: + type: string + description: The packager of the tool + example: arduino + signature: + type: string + description: |- + The signature used to sign the url. Mandatory when url is present. + This ensure the security of the file downloaded + example: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: + type: string + description: "The url where the package can be found. Optional. \n\tIf present checksum must also be present." + example: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + version: + type: string + description: The version of the tool + example: 1.7.0-arduino3 + example: + checksum: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + name: bossac + packager: arduino + signature: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + version: 1.7.0-arduino3 + required: + - name + - version + - packager + ToolsInstallResponseBody: + title: 'Mediatype identifier: application/vnd.arduino.operation; view=default' + type: object + properties: + status: + type: string + description: The status of the operation + example: ok + description: InstallResponseBody result type (default view) + example: + status: ok + required: + - status + ToolsRemoveRequestBody: + title: ToolsRemoveRequestBody + type: object + properties: + checksum: + type: string + description: "A checksum of the archive. Mandatory when url is present. \n\tThis ensures that the package is downloaded correcly." + example: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + signature: + type: string + description: |- + The signature used to sign the url. Mandatory when url is present. + This ensure the security of the file downloaded + example: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: + type: string + description: "The url where the package can be found. Optional. \n\tIf present checksum must also be present." + example: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + example: + checksum: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + signature: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + ToolsRemoveResponseBody: + title: 'Mediatype identifier: application/vnd.arduino.operation; view=default' + type: object + properties: + status: + type: string + description: The status of the operation + example: ok + description: RemoveResponseBody result type (default view) + example: + status: ok + required: + - status + ToolsToolResponseCollection: + title: 'Mediatype identifier: application/vnd.arduino.tool; type=collection; view=default' + type: array + items: + $ref: '#/definitions/ToolResponse' + description: AvailableResponseBody is the result type for an array of ToolResponse (default view) + example: + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 diff --git a/gen/http/openapi3.json b/gen/http/openapi3.json new file mode 100644 index 000000000..de7209e7a --- /dev/null +++ b/gen/http/openapi3.json @@ -0,0 +1 @@ +{"openapi":"3.0.3","info":{"title":"Arduino Create Agent","description":"A companion of Arduino Create. \n\tAllows the website to perform operations on the user computer, \n\tsuch as detecting which boards are connected and upload sketches on them.","version":"0.0.1"},"servers":[{"url":"http://localhost:80","description":"Default server for arduino-create-agent"}],"paths":{"/v2/pkgs/tools/available":{"get":{"tags":["tools"],"summary":"available tools","operationId":"tools#available","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCollection"},"example":[{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"}]}}}}}},"/v2/pkgs/tools/installed":{"get":{"tags":["tools"],"summary":"installed tools","operationId":"tools#installed","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCollection"},"example":[{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"}]}}}}},"head":{"tags":["tools"],"summary":"installedhead tools","operationId":"tools#installedhead","responses":{"200":{"description":"OK response."}}},"post":{"tags":["tools"],"summary":"install tools","operationId":"tools#install","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstallRequestBody"},"example":{"checksum":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100","name":"bossac","packager":"arduino","signature":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0","url":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz","version":"1.7.0-arduino3"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"},"example":{"status":"ok"}}}}}}},"/v2/pkgs/tools/installed/{packager}/{name}/{version}":{"delete":{"tags":["tools"],"summary":"remove tools","operationId":"tools#remove","parameters":[{"name":"packager","in":"path","description":"The packager of the tool","required":true,"schema":{"type":"string","description":"The packager of the tool","example":"arduino"},"example":"arduino"},{"name":"name","in":"path","description":"The name of the tool","required":true,"schema":{"type":"string","description":"The name of the tool","example":"bossac"},"example":"bossac"},{"name":"version","in":"path","description":"The version of the tool","required":true,"schema":{"type":"string","description":"The version of the tool","example":"1.7.0-arduino3"},"example":"1.7.0-arduino3"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveRequestBody"},"example":{"checksum":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100","signature":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0","url":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"},"example":{"status":"ok"}}}}}}}},"components":{"schemas":{"ArduinoTool":{"type":"object","properties":{"name":{"type":"string","description":"The name of the tool","example":"bossac"},"packager":{"type":"string","description":"The packager of the tool","example":"arduino"},"version":{"type":"string","description":"The version of the tool","example":"1.7.0-arduino3"}},"description":"A tool is an executable program that can upload sketches.","example":{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},"required":["name","version","packager"]},"InstallRequestBody":{"type":"object","properties":{"checksum":{"type":"string","description":"A checksum of the archive. Mandatory when url is present. \n\tThis ensures that the package is downloaded correcly.","example":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100"},"name":{"type":"string","description":"The name of the tool","example":"bossac"},"packager":{"type":"string","description":"The packager of the tool","example":"arduino"},"signature":{"type":"string","description":"The signature used to sign the url. Mandatory when url is present.\n\tThis ensure the security of the file downloaded","example":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0"},"url":{"type":"string","description":"The url where the package can be found. Optional. \n\tIf present checksum must also be present.","example":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz"},"version":{"type":"string","description":"The version of the tool","example":"1.7.0-arduino3"}},"example":{"checksum":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100","name":"bossac","packager":"arduino","signature":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0","url":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz","version":"1.7.0-arduino3"},"required":["name","version","packager"]},"Operation":{"type":"object","properties":{"status":{"type":"string","description":"The status of the operation","example":"ok"}},"example":{"status":"ok"},"required":["status"]},"RemoveRequestBody":{"type":"object","properties":{"checksum":{"type":"string","description":"A checksum of the archive. Mandatory when url is present. \n\tThis ensures that the package is downloaded correcly.","example":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100"},"signature":{"type":"string","description":"The signature used to sign the url. Mandatory when url is present.\n\tThis ensure the security of the file downloaded","example":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0"},"url":{"type":"string","description":"The url where the package can be found. Optional. \n\tIf present checksum must also be present.","example":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz"}},"example":{"checksum":"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100","signature":"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0","url":"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz"}},"ToolCollection":{"type":"array","items":{"$ref":"#/components/schemas/ArduinoTool"},"example":[{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"},{"name":"bossac","packager":"arduino","version":"1.7.0-arduino3"}]}}},"tags":[{"name":"tools","description":"The tools service manages the available and installed tools"}]} \ No newline at end of file diff --git a/gen/http/openapi3.yaml b/gen/http/openapi3.yaml new file mode 100644 index 000000000..4759cbca9 --- /dev/null +++ b/gen/http/openapi3.yaml @@ -0,0 +1,261 @@ +openapi: 3.0.3 +info: + title: Arduino Create Agent + description: "A companion of Arduino Create. \n\tAllows the website to perform operations on the user computer, \n\tsuch as detecting which boards are connected and upload sketches on them." + version: 0.0.1 +servers: + - url: http://localhost:80 + description: Default server for arduino-create-agent +paths: + /v2/pkgs/tools/available: + get: + tags: + - tools + summary: available tools + operationId: tools#available + responses: + "200": + description: OK response. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolCollection' + example: + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + /v2/pkgs/tools/installed: + get: + tags: + - tools + summary: installed tools + operationId: tools#installed + responses: + "200": + description: OK response. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolCollection' + example: + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + head: + tags: + - tools + summary: installedhead tools + operationId: tools#installedhead + responses: + "200": + description: OK response. + post: + tags: + - tools + summary: install tools + operationId: tools#install + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/InstallRequestBody' + example: + checksum: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + name: bossac + packager: arduino + signature: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + version: 1.7.0-arduino3 + responses: + "200": + description: OK response. + content: + application/json: + schema: + $ref: '#/components/schemas/Operation' + example: + status: ok + /v2/pkgs/tools/installed/{packager}/{name}/{version}: + delete: + tags: + - tools + summary: remove tools + operationId: tools#remove + parameters: + - name: packager + in: path + description: The packager of the tool + required: true + schema: + type: string + description: The packager of the tool + example: arduino + example: arduino + - name: name + in: path + description: The name of the tool + required: true + schema: + type: string + description: The name of the tool + example: bossac + example: bossac + - name: version + in: path + description: The version of the tool + required: true + schema: + type: string + description: The version of the tool + example: 1.7.0-arduino3 + example: 1.7.0-arduino3 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RemoveRequestBody' + example: + checksum: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + signature: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + responses: + "200": + description: OK response. + content: + application/json: + schema: + $ref: '#/components/schemas/Operation' + example: + status: ok +components: + schemas: + ArduinoTool: + type: object + properties: + name: + type: string + description: The name of the tool + example: bossac + packager: + type: string + description: The packager of the tool + example: arduino + version: + type: string + description: The version of the tool + example: 1.7.0-arduino3 + description: A tool is an executable program that can upload sketches. + example: + name: bossac + packager: arduino + version: 1.7.0-arduino3 + required: + - name + - version + - packager + InstallRequestBody: + type: object + properties: + checksum: + type: string + description: "A checksum of the archive. Mandatory when url is present. \n\tThis ensures that the package is downloaded correcly." + example: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + name: + type: string + description: The name of the tool + example: bossac + packager: + type: string + description: The packager of the tool + example: arduino + signature: + type: string + description: |- + The signature used to sign the url. Mandatory when url is present. + This ensure the security of the file downloaded + example: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: + type: string + description: "The url where the package can be found. Optional. \n\tIf present checksum must also be present." + example: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + version: + type: string + description: The version of the tool + example: 1.7.0-arduino3 + example: + checksum: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + name: bossac + packager: arduino + signature: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + version: 1.7.0-arduino3 + required: + - name + - version + - packager + Operation: + type: object + properties: + status: + type: string + description: The status of the operation + example: ok + example: + status: ok + required: + - status + RemoveRequestBody: + type: object + properties: + checksum: + type: string + description: "A checksum of the archive. Mandatory when url is present. \n\tThis ensures that the package is downloaded correcly." + example: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + signature: + type: string + description: |- + The signature used to sign the url. Mandatory when url is present. + This ensure the security of the file downloaded + example: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: + type: string + description: "The url where the package can be found. Optional. \n\tIf present checksum must also be present." + example: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + example: + checksum: SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100 + signature: 382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0 + url: http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz + ToolCollection: + type: array + items: + $ref: '#/components/schemas/ArduinoTool' + example: + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 + - name: bossac + packager: arduino + version: 1.7.0-arduino3 +tags: + - name: tools + description: The tools service manages the available and installed tools diff --git a/gen/http/tools/client/cli.go b/gen/http/tools/client/cli.go new file mode 100644 index 000000000..0f02f74bd --- /dev/null +++ b/gen/http/tools/client/cli.go @@ -0,0 +1,73 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools HTTP client CLI support package +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package client + +import ( + "encoding/json" + "fmt" + + tools "github.com/arduino/arduino-create-agent/gen/tools" +) + +// BuildInstallPayload builds the payload for the tools install endpoint from +// CLI flags. +func BuildInstallPayload(toolsInstallBody string) (*tools.ToolPayload, error) { + var err error + var body InstallRequestBody + { + err = json.Unmarshal([]byte(toolsInstallBody), &body) + if err != nil { + return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"checksum\": \"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100\",\n \"name\": \"bossac\",\n \"packager\": \"arduino\",\n \"signature\": \"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0\",\n \"url\": \"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz\",\n \"version\": \"1.7.0-arduino3\"\n }'") + } + } + v := &tools.ToolPayload{ + Name: body.Name, + Version: body.Version, + Packager: body.Packager, + URL: body.URL, + Checksum: body.Checksum, + Signature: body.Signature, + } + + return v, nil +} + +// BuildRemovePayload builds the payload for the tools remove endpoint from CLI +// flags. +func BuildRemovePayload(toolsRemoveBody string, toolsRemovePackager string, toolsRemoveName string, toolsRemoveVersion string) (*tools.ToolPayload, error) { + var err error + var body RemoveRequestBody + { + err = json.Unmarshal([]byte(toolsRemoveBody), &body) + if err != nil { + return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"checksum\": \"SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100\",\n \"signature\": \"382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0\",\n \"url\": \"http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz\"\n }'") + } + } + var packager string + { + packager = toolsRemovePackager + } + var name string + { + name = toolsRemoveName + } + var version string + { + version = toolsRemoveVersion + } + v := &tools.ToolPayload{ + URL: body.URL, + Checksum: body.Checksum, + Signature: body.Signature, + } + v.Packager = packager + v.Name = name + v.Version = version + + return v, nil +} diff --git a/gen/http/tools/client/client.go b/gen/http/tools/client/client.go new file mode 100644 index 000000000..70e5ec54b --- /dev/null +++ b/gen/http/tools/client/client.go @@ -0,0 +1,175 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools client HTTP transport +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package client + +import ( + "context" + "net/http" + + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" +) + +// Client lists the tools service endpoint HTTP clients. +type Client struct { + // Available Doer is the HTTP client used to make requests to the available + // endpoint. + AvailableDoer goahttp.Doer + + // Installedhead Doer is the HTTP client used to make requests to the + // installedhead endpoint. + InstalledheadDoer goahttp.Doer + + // Installed Doer is the HTTP client used to make requests to the installed + // endpoint. + InstalledDoer goahttp.Doer + + // Install Doer is the HTTP client used to make requests to the install + // endpoint. + InstallDoer goahttp.Doer + + // Remove Doer is the HTTP client used to make requests to the remove endpoint. + RemoveDoer goahttp.Doer + + // RestoreResponseBody controls whether the response bodies are reset after + // decoding so they can be read again. + RestoreResponseBody bool + + scheme string + host string + encoder func(*http.Request) goahttp.Encoder + decoder func(*http.Response) goahttp.Decoder +} + +// NewClient instantiates HTTP clients for all the tools service servers. +func NewClient( + scheme string, + host string, + doer goahttp.Doer, + enc func(*http.Request) goahttp.Encoder, + dec func(*http.Response) goahttp.Decoder, + restoreBody bool, +) *Client { + return &Client{ + AvailableDoer: doer, + InstalledheadDoer: doer, + InstalledDoer: doer, + InstallDoer: doer, + RemoveDoer: doer, + RestoreResponseBody: restoreBody, + scheme: scheme, + host: host, + decoder: dec, + encoder: enc, + } +} + +// Available returns an endpoint that makes HTTP requests to the tools service +// available server. +func (c *Client) Available() goa.Endpoint { + var ( + decodeResponse = DecodeAvailableResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v any) (any, error) { + req, err := c.BuildAvailableRequest(ctx, v) + if err != nil { + return nil, err + } + resp, err := c.AvailableDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("tools", "available", err) + } + return decodeResponse(resp) + } +} + +// Installedhead returns an endpoint that makes HTTP requests to the tools +// service installedhead server. +func (c *Client) Installedhead() goa.Endpoint { + var ( + decodeResponse = DecodeInstalledheadResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v any) (any, error) { + req, err := c.BuildInstalledheadRequest(ctx, v) + if err != nil { + return nil, err + } + resp, err := c.InstalledheadDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("tools", "installedhead", err) + } + return decodeResponse(resp) + } +} + +// Installed returns an endpoint that makes HTTP requests to the tools service +// installed server. +func (c *Client) Installed() goa.Endpoint { + var ( + decodeResponse = DecodeInstalledResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v any) (any, error) { + req, err := c.BuildInstalledRequest(ctx, v) + if err != nil { + return nil, err + } + resp, err := c.InstalledDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("tools", "installed", err) + } + return decodeResponse(resp) + } +} + +// Install returns an endpoint that makes HTTP requests to the tools service +// install server. +func (c *Client) Install() goa.Endpoint { + var ( + encodeRequest = EncodeInstallRequest(c.encoder) + decodeResponse = DecodeInstallResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v any) (any, error) { + req, err := c.BuildInstallRequest(ctx, v) + if err != nil { + return nil, err + } + err = encodeRequest(req, v) + if err != nil { + return nil, err + } + resp, err := c.InstallDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("tools", "install", err) + } + return decodeResponse(resp) + } +} + +// Remove returns an endpoint that makes HTTP requests to the tools service +// remove server. +func (c *Client) Remove() goa.Endpoint { + var ( + encodeRequest = EncodeRemoveRequest(c.encoder) + decodeResponse = DecodeRemoveResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v any) (any, error) { + req, err := c.BuildRemoveRequest(ctx, v) + if err != nil { + return nil, err + } + err = encodeRequest(req, v) + if err != nil { + return nil, err + } + resp, err := c.RemoveDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("tools", "remove", err) + } + return decodeResponse(resp) + } +} diff --git a/gen/http/tools/client/encode_decode.go b/gen/http/tools/client/encode_decode.go new file mode 100644 index 000000000..b39e94bbe --- /dev/null +++ b/gen/http/tools/client/encode_decode.go @@ -0,0 +1,348 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools HTTP client encoders and decoders +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package client + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + + tools "github.com/arduino/arduino-create-agent/gen/tools" + toolsviews "github.com/arduino/arduino-create-agent/gen/tools/views" + goahttp "goa.design/goa/v3/http" +) + +// BuildAvailableRequest instantiates a HTTP request object with method and +// path set to call the "tools" service "available" endpoint +func (c *Client) BuildAvailableRequest(ctx context.Context, v any) (*http.Request, error) { + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: AvailableToolsPath()} + req, err := http.NewRequest("GET", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("tools", "available", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// DecodeAvailableResponse returns a decoder for responses returned by the +// tools available endpoint. restoreBody controls whether the response body +// should be restored after having been read. +func DecodeAvailableResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) { + return func(resp *http.Response) (any, error) { + if restoreBody { + b, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body AvailableResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("tools", "available", err) + } + p := NewAvailableToolCollectionOK(body) + view := "default" + vres := toolsviews.ToolCollection{Projected: p, View: view} + if err = toolsviews.ValidateToolCollection(vres); err != nil { + return nil, goahttp.ErrValidationError("tools", "available", err) + } + res := tools.NewToolCollection(vres) + return res, nil + default: + body, _ := io.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("tools", "available", resp.StatusCode, string(body)) + } + } +} + +// BuildInstalledheadRequest instantiates a HTTP request object with method and +// path set to call the "tools" service "installedhead" endpoint +func (c *Client) BuildInstalledheadRequest(ctx context.Context, v any) (*http.Request, error) { + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: InstalledheadToolsPath()} + req, err := http.NewRequest("HEAD", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("tools", "installedhead", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// DecodeInstalledheadResponse returns a decoder for responses returned by the +// tools installedhead endpoint. restoreBody controls whether the response body +// should be restored after having been read. +func DecodeInstalledheadResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) { + return func(resp *http.Response) (any, error) { + if restoreBody { + b, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + return nil, nil + default: + body, _ := io.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("tools", "installedhead", resp.StatusCode, string(body)) + } + } +} + +// BuildInstalledRequest instantiates a HTTP request object with method and +// path set to call the "tools" service "installed" endpoint +func (c *Client) BuildInstalledRequest(ctx context.Context, v any) (*http.Request, error) { + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: InstalledToolsPath()} + req, err := http.NewRequest("GET", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("tools", "installed", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// DecodeInstalledResponse returns a decoder for responses returned by the +// tools installed endpoint. restoreBody controls whether the response body +// should be restored after having been read. +func DecodeInstalledResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) { + return func(resp *http.Response) (any, error) { + if restoreBody { + b, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body InstalledResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("tools", "installed", err) + } + p := NewInstalledToolCollectionOK(body) + view := "default" + vres := toolsviews.ToolCollection{Projected: p, View: view} + if err = toolsviews.ValidateToolCollection(vres); err != nil { + return nil, goahttp.ErrValidationError("tools", "installed", err) + } + res := tools.NewToolCollection(vres) + return res, nil + default: + body, _ := io.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("tools", "installed", resp.StatusCode, string(body)) + } + } +} + +// BuildInstallRequest instantiates a HTTP request object with method and path +// set to call the "tools" service "install" endpoint +func (c *Client) BuildInstallRequest(ctx context.Context, v any) (*http.Request, error) { + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: InstallToolsPath()} + req, err := http.NewRequest("POST", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("tools", "install", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// EncodeInstallRequest returns an encoder for requests sent to the tools +// install server. +func EncodeInstallRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error { + return func(req *http.Request, v any) error { + p, ok := v.(*tools.ToolPayload) + if !ok { + return goahttp.ErrInvalidType("tools", "install", "*tools.ToolPayload", v) + } + body := NewInstallRequestBody(p) + if err := encoder(req).Encode(&body); err != nil { + return goahttp.ErrEncodingError("tools", "install", err) + } + return nil + } +} + +// DecodeInstallResponse returns a decoder for responses returned by the tools +// install endpoint. restoreBody controls whether the response body should be +// restored after having been read. +func DecodeInstallResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) { + return func(resp *http.Response) (any, error) { + if restoreBody { + b, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body InstallResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("tools", "install", err) + } + p := NewInstallOperationOK(&body) + view := "default" + vres := &toolsviews.Operation{Projected: p, View: view} + if err = toolsviews.ValidateOperation(vres); err != nil { + return nil, goahttp.ErrValidationError("tools", "install", err) + } + res := tools.NewOperation(vres) + return res, nil + default: + body, _ := io.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("tools", "install", resp.StatusCode, string(body)) + } + } +} + +// BuildRemoveRequest instantiates a HTTP request object with method and path +// set to call the "tools" service "remove" endpoint +func (c *Client) BuildRemoveRequest(ctx context.Context, v any) (*http.Request, error) { + var ( + packager string + name string + version string + ) + { + p, ok := v.(*tools.ToolPayload) + if !ok { + return nil, goahttp.ErrInvalidType("tools", "remove", "*tools.ToolPayload", v) + } + packager = p.Packager + name = p.Name + version = p.Version + } + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: RemoveToolsPath(packager, name, version)} + req, err := http.NewRequest("DELETE", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("tools", "remove", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// EncodeRemoveRequest returns an encoder for requests sent to the tools remove +// server. +func EncodeRemoveRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error { + return func(req *http.Request, v any) error { + p, ok := v.(*tools.ToolPayload) + if !ok { + return goahttp.ErrInvalidType("tools", "remove", "*tools.ToolPayload", v) + } + body := NewRemoveRequestBody(p) + if err := encoder(req).Encode(&body); err != nil { + return goahttp.ErrEncodingError("tools", "remove", err) + } + return nil + } +} + +// DecodeRemoveResponse returns a decoder for responses returned by the tools +// remove endpoint. restoreBody controls whether the response body should be +// restored after having been read. +func DecodeRemoveResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) { + return func(resp *http.Response) (any, error) { + if restoreBody { + b, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = io.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body RemoveResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("tools", "remove", err) + } + p := NewRemoveOperationOK(&body) + view := "default" + vres := &toolsviews.Operation{Projected: p, View: view} + if err = toolsviews.ValidateOperation(vres); err != nil { + return nil, goahttp.ErrValidationError("tools", "remove", err) + } + res := tools.NewOperation(vres) + return res, nil + default: + body, _ := io.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("tools", "remove", resp.StatusCode, string(body)) + } + } +} + +// unmarshalToolResponseToToolsviewsToolView builds a value of type +// *toolsviews.ToolView from a value of type *ToolResponse. +func unmarshalToolResponseToToolsviewsToolView(v *ToolResponse) *toolsviews.ToolView { + res := &toolsviews.ToolView{ + Name: v.Name, + Version: v.Version, + Packager: v.Packager, + } + + return res +} diff --git a/gen/http/tools/client/paths.go b/gen/http/tools/client/paths.go new file mode 100644 index 000000000..b6f7666d5 --- /dev/null +++ b/gen/http/tools/client/paths.go @@ -0,0 +1,37 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// HTTP request path constructors for the tools service. +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package client + +import ( + "fmt" +) + +// AvailableToolsPath returns the URL path to the tools service available HTTP endpoint. +func AvailableToolsPath() string { + return "/v2/pkgs/tools/available" +} + +// InstalledheadToolsPath returns the URL path to the tools service installedhead HTTP endpoint. +func InstalledheadToolsPath() string { + return "/v2/pkgs/tools/installed" +} + +// InstalledToolsPath returns the URL path to the tools service installed HTTP endpoint. +func InstalledToolsPath() string { + return "/v2/pkgs/tools/installed" +} + +// InstallToolsPath returns the URL path to the tools service install HTTP endpoint. +func InstallToolsPath() string { + return "/v2/pkgs/tools/installed" +} + +// RemoveToolsPath returns the URL path to the tools service remove HTTP endpoint. +func RemoveToolsPath(packager string, name string, version string) string { + return fmt.Sprintf("/v2/pkgs/tools/installed/%v/%v/%v", packager, name, version) +} diff --git a/gen/http/tools/client/types.go b/gen/http/tools/client/types.go new file mode 100644 index 000000000..ed091792b --- /dev/null +++ b/gen/http/tools/client/types.go @@ -0,0 +1,161 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools HTTP client types +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package client + +import ( + tools "github.com/arduino/arduino-create-agent/gen/tools" + toolsviews "github.com/arduino/arduino-create-agent/gen/tools/views" + goa "goa.design/goa/v3/pkg" +) + +// InstallRequestBody is the type of the "tools" service "install" endpoint +// HTTP request body. +type InstallRequestBody struct { + // The name of the tool + Name string `form:"name" json:"name" xml:"name"` + // The version of the tool + Version string `form:"version" json:"version" xml:"version"` + // The packager of the tool + Packager string `form:"packager" json:"packager" xml:"packager"` + // The url where the package can be found. Optional. + // If present checksum must also be present. + URL *string `form:"url,omitempty" json:"url,omitempty" xml:"url,omitempty"` + // A checksum of the archive. Mandatory when url is present. + // This ensures that the package is downloaded correcly. + Checksum *string `form:"checksum,omitempty" json:"checksum,omitempty" xml:"checksum,omitempty"` + // The signature used to sign the url. Mandatory when url is present. + // This ensure the security of the file downloaded + Signature *string `form:"signature,omitempty" json:"signature,omitempty" xml:"signature,omitempty"` +} + +// RemoveRequestBody is the type of the "tools" service "remove" endpoint HTTP +// request body. +type RemoveRequestBody struct { + // The url where the package can be found. Optional. + // If present checksum must also be present. + URL *string `form:"url,omitempty" json:"url,omitempty" xml:"url,omitempty"` + // A checksum of the archive. Mandatory when url is present. + // This ensures that the package is downloaded correcly. + Checksum *string `form:"checksum,omitempty" json:"checksum,omitempty" xml:"checksum,omitempty"` + // The signature used to sign the url. Mandatory when url is present. + // This ensure the security of the file downloaded + Signature *string `form:"signature,omitempty" json:"signature,omitempty" xml:"signature,omitempty"` +} + +// AvailableResponseBody is the type of the "tools" service "available" +// endpoint HTTP response body. +type AvailableResponseBody []*ToolResponse + +// InstalledResponseBody is the type of the "tools" service "installed" +// endpoint HTTP response body. +type InstalledResponseBody []*ToolResponse + +// InstallResponseBody is the type of the "tools" service "install" endpoint +// HTTP response body. +type InstallResponseBody struct { + // The status of the operation + Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"` +} + +// RemoveResponseBody is the type of the "tools" service "remove" endpoint HTTP +// response body. +type RemoveResponseBody struct { + // The status of the operation + Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"` +} + +// ToolResponse is used to define fields on response body types. +type ToolResponse struct { + // The name of the tool + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // The version of the tool + Version *string `form:"version,omitempty" json:"version,omitempty" xml:"version,omitempty"` + // The packager of the tool + Packager *string `form:"packager,omitempty" json:"packager,omitempty" xml:"packager,omitempty"` +} + +// NewInstallRequestBody builds the HTTP request body from the payload of the +// "install" endpoint of the "tools" service. +func NewInstallRequestBody(p *tools.ToolPayload) *InstallRequestBody { + body := &InstallRequestBody{ + Name: p.Name, + Version: p.Version, + Packager: p.Packager, + URL: p.URL, + Checksum: p.Checksum, + Signature: p.Signature, + } + return body +} + +// NewRemoveRequestBody builds the HTTP request body from the payload of the +// "remove" endpoint of the "tools" service. +func NewRemoveRequestBody(p *tools.ToolPayload) *RemoveRequestBody { + body := &RemoveRequestBody{ + URL: p.URL, + Checksum: p.Checksum, + Signature: p.Signature, + } + return body +} + +// NewAvailableToolCollectionOK builds a "tools" service "available" endpoint +// result from a HTTP "OK" response. +func NewAvailableToolCollectionOK(body AvailableResponseBody) toolsviews.ToolCollectionView { + v := make([]*toolsviews.ToolView, len(body)) + for i, val := range body { + v[i] = unmarshalToolResponseToToolsviewsToolView(val) + } + + return v +} + +// NewInstalledToolCollectionOK builds a "tools" service "installed" endpoint +// result from a HTTP "OK" response. +func NewInstalledToolCollectionOK(body InstalledResponseBody) toolsviews.ToolCollectionView { + v := make([]*toolsviews.ToolView, len(body)) + for i, val := range body { + v[i] = unmarshalToolResponseToToolsviewsToolView(val) + } + + return v +} + +// NewInstallOperationOK builds a "tools" service "install" endpoint result +// from a HTTP "OK" response. +func NewInstallOperationOK(body *InstallResponseBody) *toolsviews.OperationView { + v := &toolsviews.OperationView{ + Status: body.Status, + } + + return v +} + +// NewRemoveOperationOK builds a "tools" service "remove" endpoint result from +// a HTTP "OK" response. +func NewRemoveOperationOK(body *RemoveResponseBody) *toolsviews.OperationView { + v := &toolsviews.OperationView{ + Status: body.Status, + } + + return v +} + +// ValidateToolResponse runs the validations defined on ToolResponse +func ValidateToolResponse(body *ToolResponse) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.Version == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("version", "body")) + } + if body.Packager == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("packager", "body")) + } + return +} diff --git a/gen/http/tools/server/encode_decode.go b/gen/http/tools/server/encode_decode.go new file mode 100644 index 000000000..c1ab298ca --- /dev/null +++ b/gen/http/tools/server/encode_decode.go @@ -0,0 +1,144 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools HTTP server encoders and decoders +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package server + +import ( + "context" + "io" + "net/http" + + toolsviews "github.com/arduino/arduino-create-agent/gen/tools/views" + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" +) + +// EncodeAvailableResponse returns an encoder for responses returned by the +// tools available endpoint. +func EncodeAvailableResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error { + return func(ctx context.Context, w http.ResponseWriter, v any) error { + res := v.(toolsviews.ToolCollection) + enc := encoder(ctx, w) + body := NewToolResponseCollection(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// EncodeInstalledheadResponse returns an encoder for responses returned by the +// tools installedhead endpoint. +func EncodeInstalledheadResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error { + return func(ctx context.Context, w http.ResponseWriter, v any) error { + w.WriteHeader(http.StatusOK) + return nil + } +} + +// EncodeInstalledResponse returns an encoder for responses returned by the +// tools installed endpoint. +func EncodeInstalledResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error { + return func(ctx context.Context, w http.ResponseWriter, v any) error { + res := v.(toolsviews.ToolCollection) + enc := encoder(ctx, w) + body := NewToolResponseCollection(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// EncodeInstallResponse returns an encoder for responses returned by the tools +// install endpoint. +func EncodeInstallResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error { + return func(ctx context.Context, w http.ResponseWriter, v any) error { + res := v.(*toolsviews.Operation) + enc := encoder(ctx, w) + body := NewInstallResponseBody(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeInstallRequest returns a decoder for requests sent to the tools +// install endpoint. +func DecodeInstallRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error) { + return func(r *http.Request) (any, error) { + var ( + body InstallRequestBody + err error + ) + err = decoder(r).Decode(&body) + if err != nil { + if err == io.EOF { + return nil, goa.MissingPayloadError() + } + return nil, goa.DecodePayloadError(err.Error()) + } + err = ValidateInstallRequestBody(&body) + if err != nil { + return nil, err + } + payload := NewInstallToolPayload(&body) + + return payload, nil + } +} + +// EncodeRemoveResponse returns an encoder for responses returned by the tools +// remove endpoint. +func EncodeRemoveResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error { + return func(ctx context.Context, w http.ResponseWriter, v any) error { + res := v.(*toolsviews.Operation) + enc := encoder(ctx, w) + body := NewRemoveResponseBody(res.Projected) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeRemoveRequest returns a decoder for requests sent to the tools remove +// endpoint. +func DecodeRemoveRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error) { + return func(r *http.Request) (any, error) { + var ( + body RemoveRequestBody + err error + ) + err = decoder(r).Decode(&body) + if err != nil { + if err == io.EOF { + return nil, goa.MissingPayloadError() + } + return nil, goa.DecodePayloadError(err.Error()) + } + + var ( + packager string + name string + version string + + params = mux.Vars(r) + ) + packager = params["packager"] + name = params["name"] + version = params["version"] + payload := NewRemoveToolPayload(&body, packager, name, version) + + return payload, nil + } +} + +// marshalToolsviewsToolViewToToolResponse builds a value of type *ToolResponse +// from a value of type *toolsviews.ToolView. +func marshalToolsviewsToolViewToToolResponse(v *toolsviews.ToolView) *ToolResponse { + res := &ToolResponse{ + Name: *v.Name, + Version: *v.Version, + Packager: *v.Packager, + } + + return res +} diff --git a/gen/http/tools/server/paths.go b/gen/http/tools/server/paths.go new file mode 100644 index 000000000..f071aff60 --- /dev/null +++ b/gen/http/tools/server/paths.go @@ -0,0 +1,37 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// HTTP request path constructors for the tools service. +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package server + +import ( + "fmt" +) + +// AvailableToolsPath returns the URL path to the tools service available HTTP endpoint. +func AvailableToolsPath() string { + return "/v2/pkgs/tools/available" +} + +// InstalledheadToolsPath returns the URL path to the tools service installedhead HTTP endpoint. +func InstalledheadToolsPath() string { + return "/v2/pkgs/tools/installed" +} + +// InstalledToolsPath returns the URL path to the tools service installed HTTP endpoint. +func InstalledToolsPath() string { + return "/v2/pkgs/tools/installed" +} + +// InstallToolsPath returns the URL path to the tools service install HTTP endpoint. +func InstallToolsPath() string { + return "/v2/pkgs/tools/installed" +} + +// RemoveToolsPath returns the URL path to the tools service remove HTTP endpoint. +func RemoveToolsPath(packager string, name string, version string) string { + return fmt.Sprintf("/v2/pkgs/tools/installed/%v/%v/%v", packager, name, version) +} diff --git a/gen/http/tools/server/server.go b/gen/http/tools/server/server.go new file mode 100644 index 000000000..ad339e3de --- /dev/null +++ b/gen/http/tools/server/server.go @@ -0,0 +1,331 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools HTTP server +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package server + +import ( + "context" + "net/http" + + tools "github.com/arduino/arduino-create-agent/gen/tools" + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" +) + +// Server lists the tools service endpoint HTTP handlers. +type Server struct { + Mounts []*MountPoint + Available http.Handler + Installedhead http.Handler + Installed http.Handler + Install http.Handler + Remove http.Handler +} + +// MountPoint holds information about the mounted endpoints. +type MountPoint struct { + // Method is the name of the service method served by the mounted HTTP handler. + Method string + // Verb is the HTTP method used to match requests to the mounted handler. + Verb string + // Pattern is the HTTP request path pattern used to match requests to the + // mounted handler. + Pattern string +} + +// New instantiates HTTP handlers for all the tools service endpoints using the +// provided encoder and decoder. The handlers are mounted on the given mux +// using the HTTP verb and path defined in the design. errhandler is called +// whenever a response fails to be encoded. formatter is used to format errors +// returned by the service methods prior to encoding. Both errhandler and +// formatter are optional and can be nil. +func New( + e *tools.Endpoints, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(ctx context.Context, err error) goahttp.Statuser, +) *Server { + return &Server{ + Mounts: []*MountPoint{ + {"Available", "GET", "/v2/pkgs/tools/available"}, + {"Installedhead", "HEAD", "/v2/pkgs/tools/installed"}, + {"Installed", "GET", "/v2/pkgs/tools/installed"}, + {"Install", "POST", "/v2/pkgs/tools/installed"}, + {"Remove", "DELETE", "/v2/pkgs/tools/installed/{packager}/{name}/{version}"}, + }, + Available: NewAvailableHandler(e.Available, mux, decoder, encoder, errhandler, formatter), + Installedhead: NewInstalledheadHandler(e.Installedhead, mux, decoder, encoder, errhandler, formatter), + Installed: NewInstalledHandler(e.Installed, mux, decoder, encoder, errhandler, formatter), + Install: NewInstallHandler(e.Install, mux, decoder, encoder, errhandler, formatter), + Remove: NewRemoveHandler(e.Remove, mux, decoder, encoder, errhandler, formatter), + } +} + +// Service returns the name of the service served. +func (s *Server) Service() string { return "tools" } + +// Use wraps the server handlers with the given middleware. +func (s *Server) Use(m func(http.Handler) http.Handler) { + s.Available = m(s.Available) + s.Installedhead = m(s.Installedhead) + s.Installed = m(s.Installed) + s.Install = m(s.Install) + s.Remove = m(s.Remove) +} + +// MethodNames returns the methods served. +func (s *Server) MethodNames() []string { return tools.MethodNames[:] } + +// Mount configures the mux to serve the tools endpoints. +func Mount(mux goahttp.Muxer, h *Server) { + MountAvailableHandler(mux, h.Available) + MountInstalledheadHandler(mux, h.Installedhead) + MountInstalledHandler(mux, h.Installed) + MountInstallHandler(mux, h.Install) + MountRemoveHandler(mux, h.Remove) +} + +// Mount configures the mux to serve the tools endpoints. +func (s *Server) Mount(mux goahttp.Muxer) { + Mount(mux, s) +} + +// MountAvailableHandler configures the mux to serve the "tools" service +// "available" endpoint. +func MountAvailableHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := h.(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("GET", "/v2/pkgs/tools/available", f) +} + +// NewAvailableHandler creates a HTTP handler which loads the HTTP request and +// calls the "tools" service "available" endpoint. +func NewAvailableHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(ctx context.Context, err error) goahttp.Statuser, +) http.Handler { + var ( + encodeResponse = EncodeAvailableResponse(encoder) + encodeError = goahttp.ErrorEncoder(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "available") + ctx = context.WithValue(ctx, goa.ServiceKey, "tools") + var err error + res, err := endpoint(ctx, nil) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountInstalledheadHandler configures the mux to serve the "tools" service +// "installedhead" endpoint. +func MountInstalledheadHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := h.(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("HEAD", "/v2/pkgs/tools/installed", f) +} + +// NewInstalledheadHandler creates a HTTP handler which loads the HTTP request +// and calls the "tools" service "installedhead" endpoint. +func NewInstalledheadHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(ctx context.Context, err error) goahttp.Statuser, +) http.Handler { + var ( + encodeResponse = EncodeInstalledheadResponse(encoder) + encodeError = goahttp.ErrorEncoder(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "installedhead") + ctx = context.WithValue(ctx, goa.ServiceKey, "tools") + var err error + res, err := endpoint(ctx, nil) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountInstalledHandler configures the mux to serve the "tools" service +// "installed" endpoint. +func MountInstalledHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := h.(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("GET", "/v2/pkgs/tools/installed", f) +} + +// NewInstalledHandler creates a HTTP handler which loads the HTTP request and +// calls the "tools" service "installed" endpoint. +func NewInstalledHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(ctx context.Context, err error) goahttp.Statuser, +) http.Handler { + var ( + encodeResponse = EncodeInstalledResponse(encoder) + encodeError = goahttp.ErrorEncoder(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "installed") + ctx = context.WithValue(ctx, goa.ServiceKey, "tools") + var err error + res, err := endpoint(ctx, nil) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountInstallHandler configures the mux to serve the "tools" service +// "install" endpoint. +func MountInstallHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := h.(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("POST", "/v2/pkgs/tools/installed", f) +} + +// NewInstallHandler creates a HTTP handler which loads the HTTP request and +// calls the "tools" service "install" endpoint. +func NewInstallHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(ctx context.Context, err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeInstallRequest(mux, decoder) + encodeResponse = EncodeInstallResponse(encoder) + encodeError = goahttp.ErrorEncoder(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "install") + ctx = context.WithValue(ctx, goa.ServiceKey, "tools") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountRemoveHandler configures the mux to serve the "tools" service "remove" +// endpoint. +func MountRemoveHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := h.(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("DELETE", "/v2/pkgs/tools/installed/{packager}/{name}/{version}", f) +} + +// NewRemoveHandler creates a HTTP handler which loads the HTTP request and +// calls the "tools" service "remove" endpoint. +func NewRemoveHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(ctx context.Context, err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeRemoveRequest(mux, decoder) + encodeResponse = EncodeRemoveResponse(encoder) + encodeError = goahttp.ErrorEncoder(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "remove") + ctx = context.WithValue(ctx, goa.ServiceKey, "tools") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} diff --git a/gen/http/tools/server/types.go b/gen/http/tools/server/types.go new file mode 100644 index 000000000..72bacd4e9 --- /dev/null +++ b/gen/http/tools/server/types.go @@ -0,0 +1,146 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools HTTP server types +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package server + +import ( + tools "github.com/arduino/arduino-create-agent/gen/tools" + toolsviews "github.com/arduino/arduino-create-agent/gen/tools/views" + goa "goa.design/goa/v3/pkg" +) + +// InstallRequestBody is the type of the "tools" service "install" endpoint +// HTTP request body. +type InstallRequestBody struct { + // The name of the tool + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // The version of the tool + Version *string `form:"version,omitempty" json:"version,omitempty" xml:"version,omitempty"` + // The packager of the tool + Packager *string `form:"packager,omitempty" json:"packager,omitempty" xml:"packager,omitempty"` + // The url where the package can be found. Optional. + // If present checksum must also be present. + URL *string `form:"url,omitempty" json:"url,omitempty" xml:"url,omitempty"` + // A checksum of the archive. Mandatory when url is present. + // This ensures that the package is downloaded correcly. + Checksum *string `form:"checksum,omitempty" json:"checksum,omitempty" xml:"checksum,omitempty"` + // The signature used to sign the url. Mandatory when url is present. + // This ensure the security of the file downloaded + Signature *string `form:"signature,omitempty" json:"signature,omitempty" xml:"signature,omitempty"` +} + +// RemoveRequestBody is the type of the "tools" service "remove" endpoint HTTP +// request body. +type RemoveRequestBody struct { + // The url where the package can be found. Optional. + // If present checksum must also be present. + URL *string `form:"url,omitempty" json:"url,omitempty" xml:"url,omitempty"` + // A checksum of the archive. Mandatory when url is present. + // This ensures that the package is downloaded correcly. + Checksum *string `form:"checksum,omitempty" json:"checksum,omitempty" xml:"checksum,omitempty"` + // The signature used to sign the url. Mandatory when url is present. + // This ensure the security of the file downloaded + Signature *string `form:"signature,omitempty" json:"signature,omitempty" xml:"signature,omitempty"` +} + +// ToolResponseCollection is the type of the "tools" service "available" +// endpoint HTTP response body. +type ToolResponseCollection []*ToolResponse + +// InstallResponseBody is the type of the "tools" service "install" endpoint +// HTTP response body. +type InstallResponseBody struct { + // The status of the operation + Status string `form:"status" json:"status" xml:"status"` +} + +// RemoveResponseBody is the type of the "tools" service "remove" endpoint HTTP +// response body. +type RemoveResponseBody struct { + // The status of the operation + Status string `form:"status" json:"status" xml:"status"` +} + +// ToolResponse is used to define fields on response body types. +type ToolResponse struct { + // The name of the tool + Name string `form:"name" json:"name" xml:"name"` + // The version of the tool + Version string `form:"version" json:"version" xml:"version"` + // The packager of the tool + Packager string `form:"packager" json:"packager" xml:"packager"` +} + +// NewToolResponseCollection builds the HTTP response body from the result of +// the "available" endpoint of the "tools" service. +func NewToolResponseCollection(res toolsviews.ToolCollectionView) ToolResponseCollection { + body := make([]*ToolResponse, len(res)) + for i, val := range res { + body[i] = marshalToolsviewsToolViewToToolResponse(val) + } + return body +} + +// NewInstallResponseBody builds the HTTP response body from the result of the +// "install" endpoint of the "tools" service. +func NewInstallResponseBody(res *toolsviews.OperationView) *InstallResponseBody { + body := &InstallResponseBody{ + Status: *res.Status, + } + return body +} + +// NewRemoveResponseBody builds the HTTP response body from the result of the +// "remove" endpoint of the "tools" service. +func NewRemoveResponseBody(res *toolsviews.OperationView) *RemoveResponseBody { + body := &RemoveResponseBody{ + Status: *res.Status, + } + return body +} + +// NewInstallToolPayload builds a tools service install endpoint payload. +func NewInstallToolPayload(body *InstallRequestBody) *tools.ToolPayload { + v := &tools.ToolPayload{ + Name: *body.Name, + Version: *body.Version, + Packager: *body.Packager, + URL: body.URL, + Checksum: body.Checksum, + Signature: body.Signature, + } + + return v +} + +// NewRemoveToolPayload builds a tools service remove endpoint payload. +func NewRemoveToolPayload(body *RemoveRequestBody, packager string, name string, version string) *tools.ToolPayload { + v := &tools.ToolPayload{ + URL: body.URL, + Checksum: body.Checksum, + Signature: body.Signature, + } + v.Packager = packager + v.Name = name + v.Version = version + + return v +} + +// ValidateInstallRequestBody runs the validations defined on InstallRequestBody +func ValidateInstallRequestBody(body *InstallRequestBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.Version == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("version", "body")) + } + if body.Packager == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("packager", "body")) + } + return +} diff --git a/gen/tools/client.go b/gen/tools/client.go new file mode 100644 index 000000000..54ee57cb3 --- /dev/null +++ b/gen/tools/client.go @@ -0,0 +1,83 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools client +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package tools + +import ( + "context" + + goa "goa.design/goa/v3/pkg" +) + +// Client is the "tools" service client. +type Client struct { + AvailableEndpoint goa.Endpoint + InstalledheadEndpoint goa.Endpoint + InstalledEndpoint goa.Endpoint + InstallEndpoint goa.Endpoint + RemoveEndpoint goa.Endpoint +} + +// NewClient initializes a "tools" service client given the endpoints. +func NewClient(available, installedhead, installed, install, remove goa.Endpoint) *Client { + return &Client{ + AvailableEndpoint: available, + InstalledheadEndpoint: installedhead, + InstalledEndpoint: installed, + InstallEndpoint: install, + RemoveEndpoint: remove, + } +} + +// Available calls the "available" endpoint of the "tools" service. +func (c *Client) Available(ctx context.Context) (res ToolCollection, err error) { + var ires any + ires, err = c.AvailableEndpoint(ctx, nil) + if err != nil { + return + } + return ires.(ToolCollection), nil +} + +// Installedhead calls the "installedhead" endpoint of the "tools" service. +func (c *Client) Installedhead(ctx context.Context) (err error) { + _, err = c.InstalledheadEndpoint(ctx, nil) + return +} + +// Installed calls the "installed" endpoint of the "tools" service. +func (c *Client) Installed(ctx context.Context) (res ToolCollection, err error) { + var ires any + ires, err = c.InstalledEndpoint(ctx, nil) + if err != nil { + return + } + return ires.(ToolCollection), nil +} + +// Install calls the "install" endpoint of the "tools" service. +// Install may return the following errors: +// - "not_found" (type *goa.ServiceError): tool not found +// - error: internal error +func (c *Client) Install(ctx context.Context, p *ToolPayload) (res *Operation, err error) { + var ires any + ires, err = c.InstallEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*Operation), nil +} + +// Remove calls the "remove" endpoint of the "tools" service. +func (c *Client) Remove(ctx context.Context, p *ToolPayload) (res *Operation, err error) { + var ires any + ires, err = c.RemoveEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*Operation), nil +} diff --git a/gen/tools/endpoints.go b/gen/tools/endpoints.go new file mode 100644 index 000000000..de609c5f9 --- /dev/null +++ b/gen/tools/endpoints.go @@ -0,0 +1,105 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools endpoints +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package tools + +import ( + "context" + + goa "goa.design/goa/v3/pkg" +) + +// Endpoints wraps the "tools" service endpoints. +type Endpoints struct { + Available goa.Endpoint + Installedhead goa.Endpoint + Installed goa.Endpoint + Install goa.Endpoint + Remove goa.Endpoint +} + +// NewEndpoints wraps the methods of the "tools" service with endpoints. +func NewEndpoints(s Service) *Endpoints { + return &Endpoints{ + Available: NewAvailableEndpoint(s), + Installedhead: NewInstalledheadEndpoint(s), + Installed: NewInstalledEndpoint(s), + Install: NewInstallEndpoint(s), + Remove: NewRemoveEndpoint(s), + } +} + +// Use applies the given middleware to all the "tools" service endpoints. +func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { + e.Available = m(e.Available) + e.Installedhead = m(e.Installedhead) + e.Installed = m(e.Installed) + e.Install = m(e.Install) + e.Remove = m(e.Remove) +} + +// NewAvailableEndpoint returns an endpoint function that calls the method +// "available" of service "tools". +func NewAvailableEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req any) (any, error) { + res, err := s.Available(ctx) + if err != nil { + return nil, err + } + vres := NewViewedToolCollection(res, "default") + return vres, nil + } +} + +// NewInstalledheadEndpoint returns an endpoint function that calls the method +// "installedhead" of service "tools". +func NewInstalledheadEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req any) (any, error) { + return nil, s.Installedhead(ctx) + } +} + +// NewInstalledEndpoint returns an endpoint function that calls the method +// "installed" of service "tools". +func NewInstalledEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req any) (any, error) { + res, err := s.Installed(ctx) + if err != nil { + return nil, err + } + vres := NewViewedToolCollection(res, "default") + return vres, nil + } +} + +// NewInstallEndpoint returns an endpoint function that calls the method +// "install" of service "tools". +func NewInstallEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req any) (any, error) { + p := req.(*ToolPayload) + res, err := s.Install(ctx, p) + if err != nil { + return nil, err + } + vres := NewViewedOperation(res, "default") + return vres, nil + } +} + +// NewRemoveEndpoint returns an endpoint function that calls the method +// "remove" of service "tools". +func NewRemoveEndpoint(s Service) goa.Endpoint { + return func(ctx context.Context, req any) (any, error) { + p := req.(*ToolPayload) + res, err := s.Remove(ctx, p) + if err != nil { + return nil, err + } + vres := NewViewedOperation(res, "default") + return vres, nil + } +} diff --git a/gen/tools/service.go b/gen/tools/service.go new file mode 100644 index 000000000..94440d66e --- /dev/null +++ b/gen/tools/service.go @@ -0,0 +1,178 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools service +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package tools + +import ( + "context" + + toolsviews "github.com/arduino/arduino-create-agent/gen/tools/views" + goa "goa.design/goa/v3/pkg" +) + +// The tools service manages the available and installed tools +type Service interface { + // Available implements available. + Available(context.Context) (res ToolCollection, err error) + // Installedhead implements installedhead. + Installedhead(context.Context) (err error) + // Installed implements installed. + Installed(context.Context) (res ToolCollection, err error) + // Install implements install. + Install(context.Context, *ToolPayload) (res *Operation, err error) + // Remove implements remove. + Remove(context.Context, *ToolPayload) (res *Operation, err error) +} + +// APIName is the name of the API as defined in the design. +const APIName = "arduino-create-agent" + +// APIVersion is the version of the API as defined in the design. +const APIVersion = "0.0.1" + +// ServiceName is the name of the service as defined in the design. This is the +// same value that is set in the endpoint request contexts under the ServiceKey +// key. +const ServiceName = "tools" + +// MethodNames lists the service method names as defined in the design. These +// are the same values that are set in the endpoint request contexts under the +// MethodKey key. +var MethodNames = [5]string{"available", "installedhead", "installed", "install", "remove"} + +// Operation is the result type of the tools service install method. +type Operation struct { + // The status of the operation + Status string +} + +// A tool is an executable program that can upload sketches. +type Tool struct { + // The name of the tool + Name string + // The version of the tool + Version string + // The packager of the tool + Packager string +} + +// ToolCollection is the result type of the tools service available method. +type ToolCollection []*Tool + +// ToolPayload is the payload type of the tools service install method. +type ToolPayload struct { + // The name of the tool + Name string + // The version of the tool + Version string + // The packager of the tool + Packager string + // The url where the package can be found. Optional. + // If present checksum must also be present. + URL *string + // A checksum of the archive. Mandatory when url is present. + // This ensures that the package is downloaded correcly. + Checksum *string + // The signature used to sign the url. Mandatory when url is present. + // This ensure the security of the file downloaded + Signature *string +} + +// MakeNotFound builds a goa.ServiceError from an error. +func MakeNotFound(err error) *goa.ServiceError { + return goa.NewServiceError(err, "not_found", false, false, false) +} + +// NewToolCollection initializes result type ToolCollection from viewed result +// type ToolCollection. +func NewToolCollection(vres toolsviews.ToolCollection) ToolCollection { + return newToolCollection(vres.Projected) +} + +// NewViewedToolCollection initializes viewed result type ToolCollection from +// result type ToolCollection using the given view. +func NewViewedToolCollection(res ToolCollection, view string) toolsviews.ToolCollection { + p := newToolCollectionView(res) + return toolsviews.ToolCollection{Projected: p, View: "default"} +} + +// NewOperation initializes result type Operation from viewed result type +// Operation. +func NewOperation(vres *toolsviews.Operation) *Operation { + return newOperation(vres.Projected) +} + +// NewViewedOperation initializes viewed result type Operation from result type +// Operation using the given view. +func NewViewedOperation(res *Operation, view string) *toolsviews.Operation { + p := newOperationView(res) + return &toolsviews.Operation{Projected: p, View: "default"} +} + +// newToolCollection converts projected type ToolCollection to service type +// ToolCollection. +func newToolCollection(vres toolsviews.ToolCollectionView) ToolCollection { + res := make(ToolCollection, len(vres)) + for i, n := range vres { + res[i] = newTool(n) + } + return res +} + +// newToolCollectionView projects result type ToolCollection to projected type +// ToolCollectionView using the "default" view. +func newToolCollectionView(res ToolCollection) toolsviews.ToolCollectionView { + vres := make(toolsviews.ToolCollectionView, len(res)) + for i, n := range res { + vres[i] = newToolView(n) + } + return vres +} + +// newTool converts projected type Tool to service type Tool. +func newTool(vres *toolsviews.ToolView) *Tool { + res := &Tool{} + if vres.Name != nil { + res.Name = *vres.Name + } + if vres.Version != nil { + res.Version = *vres.Version + } + if vres.Packager != nil { + res.Packager = *vres.Packager + } + return res +} + +// newToolView projects result type Tool to projected type ToolView using the +// "default" view. +func newToolView(res *Tool) *toolsviews.ToolView { + vres := &toolsviews.ToolView{ + Name: &res.Name, + Version: &res.Version, + Packager: &res.Packager, + } + return vres +} + +// newOperation converts projected type Operation to service type Operation. +func newOperation(vres *toolsviews.OperationView) *Operation { + res := &Operation{} + if vres.Status != nil { + res.Status = *vres.Status + } + return res +} + +// newOperationView projects result type Operation to projected type +// OperationView using the "default" view. +func newOperationView(res *Operation) *toolsviews.OperationView { + vres := &toolsviews.OperationView{ + Status: &res.Status, + } + return vres +} diff --git a/gen/tools/views/view.go b/gen/tools/views/view.go new file mode 100644 index 000000000..272e2449b --- /dev/null +++ b/gen/tools/views/view.go @@ -0,0 +1,132 @@ +// Code generated by goa v3.16.1, DO NOT EDIT. +// +// tools views +// +// Command: +// $ goa gen github.com/arduino/arduino-create-agent/design + +package views + +import ( + goa "goa.design/goa/v3/pkg" +) + +// ToolCollection is the viewed result type that is projected based on a view. +type ToolCollection struct { + // Type to project + Projected ToolCollectionView + // View to render + View string +} + +// Operation is the viewed result type that is projected based on a view. +type Operation struct { + // Type to project + Projected *OperationView + // View to render + View string +} + +// ToolCollectionView is a type that runs validations on a projected type. +type ToolCollectionView []*ToolView + +// ToolView is a type that runs validations on a projected type. +type ToolView struct { + // The name of the tool + Name *string + // The version of the tool + Version *string + // The packager of the tool + Packager *string +} + +// OperationView is a type that runs validations on a projected type. +type OperationView struct { + // The status of the operation + Status *string +} + +var ( + // ToolCollectionMap is a map indexing the attribute names of ToolCollection by + // view name. + ToolCollectionMap = map[string][]string{ + "default": { + "name", + "version", + "packager", + }, + } + // OperationMap is a map indexing the attribute names of Operation by view name. + OperationMap = map[string][]string{ + "default": { + "status", + }, + } + // ToolMap is a map indexing the attribute names of Tool by view name. + ToolMap = map[string][]string{ + "default": { + "name", + "version", + "packager", + }, + } +) + +// ValidateToolCollection runs the validations defined on the viewed result +// type ToolCollection. +func ValidateToolCollection(result ToolCollection) (err error) { + switch result.View { + case "default", "": + err = ValidateToolCollectionView(result.Projected) + default: + err = goa.InvalidEnumValueError("view", result.View, []any{"default"}) + } + return +} + +// ValidateOperation runs the validations defined on the viewed result type +// Operation. +func ValidateOperation(result *Operation) (err error) { + switch result.View { + case "default", "": + err = ValidateOperationView(result.Projected) + default: + err = goa.InvalidEnumValueError("view", result.View, []any{"default"}) + } + return +} + +// ValidateToolCollectionView runs the validations defined on +// ToolCollectionView using the "default" view. +func ValidateToolCollectionView(result ToolCollectionView) (err error) { + for _, item := range result { + if err2 := ValidateToolView(item); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateToolView runs the validations defined on ToolView using the +// "default" view. +func ValidateToolView(result *ToolView) (err error) { + if result.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "result")) + } + if result.Version == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("version", "result")) + } + if result.Packager == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("packager", "result")) + } + return +} + +// ValidateOperationView runs the validations defined on OperationView using +// the "default" view. +func ValidateOperationView(result *OperationView) (err error) { + if result.Status == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("status", "result")) + } + return +} diff --git a/globals/globals.go b/globals/globals.go new file mode 100644 index 000000000..ac4c14666 --- /dev/null +++ b/globals/globals.go @@ -0,0 +1,29 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package globals + +var ( + // ArduinoSignaturePubKey is the public key used to verify commands and url sent by the builder + ArduinoSignaturePubKey = `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvc0yZr1yUSen7qmE3cxF +IE12rCksDnqR+Hp7o0nGi9123eCSFcJ7CkIRC8F+8JMhgI3zNqn4cUEn47I3RKD1 +ZChPUCMiJCvbLbloxfdJrUi7gcSgUXrlKQStOKF5Iz7xv1M4XOP3JtjXLGo3EnJ1 +pFgdWTOyoSrA8/w1rck4c/ISXZSinVAggPxmLwVEAAln6Itj6giIZHKvA2fL2o8z +CeK057Lu8X6u2CG8tRWSQzVoKIQw/PKK6CNXCAy8vo4EkXudRutnEYHEJlPkVgPn +2qP06GI+I+9zKE37iqj0k1/wFaCVXHXIvn06YrmjQw6I0dDj/60Wvi500FuRVpn9 +twIDAQAB +-----END PUBLIC KEY-----` +) diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..3bffc09ed --- /dev/null +++ b/go.mod @@ -0,0 +1,85 @@ +module github.com/arduino/arduino-create-agent + +go 1.23.0 + +require ( + fyne.io/systray v1.10.0 + github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton + github.com/arduino/go-paths-helper v1.12.1 + github.com/arduino/go-serial-utils v0.1.2 + github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.1 + github.com/blang/semver v3.5.1+incompatible + github.com/codeclysm/extract/v4 v4.0.0 + github.com/gin-contrib/cors v1.7.2 + github.com/gin-gonic/gin v1.10.0 + github.com/go-ini/ini v1.62.0 + github.com/googollee/go-socket.io v0.0.0-20181101151912-c8aeb1ed9b49 + github.com/mattn/go-shellwords v1.0.12 + github.com/mitchellh/go-homedir v1.1.0 + github.com/pkg/errors v0.9.1 + github.com/sirupsen/logrus v1.9.3 + github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 + github.com/stretchr/testify v1.9.0 + github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9 + go.bug.st/serial v1.6.4 + goa.design/goa/v3 v3.16.1 + golang.org/x/sys v0.23.0 + gopkg.in/inconshreveable/go-update.v0 v0.0.0-20150814200126-d8b0b1d421aa +) + +require ( + github.com/AnatolyRugalev/goregen v0.1.0 // indirect + github.com/arduino/go-properties-orderedmap v1.8.0 // indirect + github.com/bytedance/sonic v1.11.6 // indirect + github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/creack/goselect v0.1.2 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-chi/chi/v5 v5.0.12 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.20.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect + github.com/godbus/dbus/v5 v5.0.4 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googollee/go-engine.io v0.0.0-20180829091931-e2f255711dcb // indirect + github.com/gorilla/websocket v1.5.1 // indirect + github.com/h2non/filetype v1.1.3 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/juju/errors v1.0.0 // indirect + github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect + github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect + github.com/kr/binarydist v0.1.0 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/manveru/faker v0.0.0-20171103152722-9fbc68a78c4d // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/sergi/go-diff v1.3.1 // indirect + github.com/smartystreets/goconvey v1.6.4 // indirect + github.com/tevino/abool v1.2.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go v1.1.6 // indirect + github.com/ulikunitz/xz v0.5.12 // indirect + golang.org/x/arch v0.8.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/tools v0.20.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..676649d56 --- /dev/null +++ b/go.sum @@ -0,0 +1,208 @@ +fyne.io/systray v1.10.0 h1:Yr1D9Lxeiw3+vSuZWPlaHC8BMjIHZXJKkek706AfYQk= +fyne.io/systray v1.10.0/go.mod h1:oM2AQqGJ1AMo4nNqZFYU8xYygSBZkW2hmdJ7n4yjedE= +github.com/AnatolyRugalev/goregen v0.1.0 h1:xrdXkLaskMnbxW0x4FWNj2yoednv0X2bcTBWpuJGYfE= +github.com/AnatolyRugalev/goregen v0.1.0/go.mod h1:sVlY1tjcirqLBRZnCcIq1+7/Lwmqz5g7IK8AStjOVzI= +github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton h1:KVBEgU3CJpmzLChnLiSuEyCuhGhcMt3eOST+7A+ckto= +github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= +github.com/arduino/go-paths-helper v1.12.1 h1:WkxiVUxBjKWlLMiMuYy8DcmVrkxdP7aKxQOAq7r2lVM= +github.com/arduino/go-paths-helper v1.12.1/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM= +github.com/arduino/go-properties-orderedmap v1.8.0 h1:wEfa6hHdpezrVOh787OmClsf/Kd8qB+zE3P2Xbrn0CQ= +github.com/arduino/go-properties-orderedmap v1.8.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= +github.com/arduino/go-serial-utils v0.1.2 h1:MRFwME4w/uaVkJ1R+wzz4KSbI9cF9IDVrYorazvjpTk= +github.com/arduino/go-serial-utils v0.1.2/go.mod h1:kzIsNPgz8DFAd1sAFKve4ubxrdGcwQ4XzvRLlztsgnE= +github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.1 h1:Fw8zKj1b/FkcQrWgN7aBw3ubSxpKIUtdANLXvd1Qdzw= +github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.1/go.mod h1:1dgblsmK2iBx3L5iNTyRIokeaxbTLUrYiUbHBK6yC3Y= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= +github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= +github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/codeclysm/extract/v4 v4.0.0 h1:H87LFsUNaJTu2e/8p/oiuiUsOK/TaPQ5wxsjPnwPEIY= +github.com/codeclysm/extract/v4 v4.0.0/go.mod h1:SFju1lj6as7FvUgalpSct7torJE0zttbJUWtryPRG6s= +github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0= +github.com/creack/goselect v0.1.2/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598 h1:MGKhKyiYrvMDZsmLR/+RGffQSXwEkXgfLSA08qDn9AI= +github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598/go.mod h1:0FpDmbrt36utu8jEmeU05dPC9AB5tsLYVVi+ZHfyuwI= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/gin-contrib/cors v1.7.2 h1:oLDHxdg8W/XDoN/8zamqk/Drgt4oVZDvaV0YmvVICQw= +github.com/gin-contrib/cors v1.7.2/go.mod h1:SUJVARKgQ40dmrzgXEVxj2m7Ig1v1qIboQkPDTQ9t2E= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= +github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= +github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-ini/ini v1.62.0 h1:7VJT/ZXjzqSrvtraFp4ONq80hTcRQth1c9ZnQ3uNQvU= +github.com/go-ini/ini v1.62.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= +github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googollee/go-engine.io v0.0.0-20180829091931-e2f255711dcb h1:n22Aukg/TjoypWc37dbKIpCsz0VMFPD36HQk1WKvg3A= +github.com/googollee/go-engine.io v0.0.0-20180829091931-e2f255711dcb/go.mod h1:MBpz1MS3P4HtRcBpQU4HcjvWXZ9q+JWacMEh2/BFYbg= +github.com/googollee/go-socket.io v0.0.0-20181101151912-c8aeb1ed9b49 h1:vKXGRzlhWE9TUVhLqAOcgQbfYvReAnsvQQIcnvWMfcg= +github.com/googollee/go-socket.io v0.0.0-20181101151912-c8aeb1ed9b49/go.mod h1:ftBGBMhSYToR5oV4ImIPKvAIsNaTkLC+tTvoNafqxlQ= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= +github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/errors v1.0.0 h1:yiq7kjCLll1BiaRuNY53MGI0+EQ3rF6GB+wvboZDefM= +github.com/juju/errors v1.0.0/go.mod h1:B5x9thDqx0wIMH3+aLIMP9HjItInYWObRovoCFM5Qe8= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kr/binarydist v0.1.0 h1:6kAoLA9FMMnNGSehX0s1PdjbEaACznAv/W219j2uvyo= +github.com/kr/binarydist v0.1.0/go.mod h1:DY7S//GCoz1BCd0B0EVrinCKAZN3pXe+MDaIZbXQVgM= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/manveru/faker v0.0.0-20171103152722-9fbc68a78c4d h1:Zj+PHjnhRYWBK6RqCDBcAhLXoi3TzC27Zad/Vn+gnVQ= +github.com/manveru/faker v0.0.0-20171103152722-9fbc68a78c4d/go.mod h1:WZy8Q5coAB1zhY9AOBJP0O6J4BuDfbupUDavKY+I3+s= +github.com/manveru/gobdd v0.0.0-20131210092515-f1a17fdd710b h1:3E44bLeN8uKYdfQqVQycPnaVviZdBLbizFhU49mtbe4= +github.com/manveru/gobdd v0.0.0-20131210092515-f1a17fdd710b/go.mod h1:Bj8LjjP0ReT1eKt5QlKjwgi5AFm5mI6O1A2G4ChI0Ag= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= +github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/tevino/abool v1.2.0 h1:heAkClL8H6w+mK5md9dzsuohKeXHUpY7Vw0ZCKW+huA= +github.com/tevino/abool v1.2.0/go.mod h1:qc66Pna1RiIsPa7O4Egxxs9OqkuxDX55zznh9K07Tzg= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go v1.1.6 h1:zoJUBK8kLIUDNJ9LGB04qOQRfoDRoWBBpl0X7pZyi5I= +github.com/ugorji/go v1.1.6/go.mod h1:RaaajvHwnCbhlqWLTIB78hyPWp24YUXhQ3YXM7Hg7os= +github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= +github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9 h1:w8V9v0qVympSF6GjdjIyeqR7+EVhAF9CBQmkmW7Zw0w= +github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +go.bug.st/serial v1.6.4 h1:7FmqNPgVp3pu2Jz5PoPtbZ9jJO5gnEnZIvnI1lzve8A= +go.bug.st/serial v1.6.4/go.mod h1:nofMJxTeNVny/m6+KaafC6vJGj3miwQZ6vW4BZUGJPI= +goa.design/goa/v3 v3.16.1 h1:yZwbKrfMpE8+sz0uf+n+BtArVOFQ0kNSC0twQKwQb04= +goa.design/goa/v3 v3.16.1/go.mod h1:Yd42LR0PYDbHSbsbF3vNd4YY/O+LG20Jb7+IyNdkQic= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/inconshreveable/go-update.v0 v0.0.0-20150814200126-d8b0b1d421aa h1:drvf2JoUL1fz3ttkGNkw+rf3kZa2//7XkYGpSO4NHNA= +gopkg.in/inconshreveable/go-update.v0 v0.0.0-20150814200126-d8b0b1d421aa/go.mod h1:tuNm0ntQ7IH9VSA39XxzLMpee5c2DwgIbjD4x3ydo8Y= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/home.html b/home.html index ebf93768f..ee523981a 100644 --- a/home.html +++ b/home.html @@ -1,91 +1,346 @@ - - -Arduino Create Agent Debug Interface - - + + - - - -
-
- - -
- + } + + function clearLogs() { + const log1 = document.getElementById("log"); + const log2 = document.getElementById("log-list"); + + messages = []; + log1.innerHTML = ""; + log2.innerHTML = ""; + } + + function exportLogs() { + const link = document.createElement("a"); + link.setAttribute("download", "agent-log.txt"); + const text = document.getElementById("log").textContent; + link.setAttribute( + "href", + "data:text/plain;charset=utf-8," + encodeURIComponent(text) + ); + link.click(); + } + + + + + +
+
+

+        

+      
+ +
+ diff --git a/hub.go b/hub.go index b03ec0a75..a162dd01a 100755 --- a/hub.go +++ b/hub.go @@ -1,22 +1,33 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + package main import ( - "fmt" - log "github.com/Sirupsen/logrus" - "github.com/kardianos/osext" - //"os" - "os/exec" - //"path" - //"path/filepath" - //"runtime" - //"debug" "encoding/json" + "fmt" + "html" "io" "os" "runtime" "runtime/debug" "strconv" "strings" + + "github.com/arduino/arduino-create-agent/upload" + log "github.com/sirupsen/logrus" ) type hub struct { @@ -37,15 +48,50 @@ type hub struct { } var h = hub{ - // buffered. go with 1000 cuz should never surpass that broadcast: make(chan []byte, 1000), broadcastSys: make(chan []byte, 1000), - // non-buffered - //broadcast: make(chan []byte), - //broadcastSys: make(chan []byte), - register: make(chan *connection), - unregister: make(chan *connection), - connections: make(map[*connection]bool), + register: make(chan *connection), + unregister: make(chan *connection), + connections: make(map[*connection]bool), +} + +const commands = `{ + "Commands": [ + "list", + "open [bufferAlgorithm: ({default}, timed, timedraw)]", + "(send, sendnobuf, sendraw) ", + "close ", + "restart", + "exit", + "killupload", + "downloadtool ", + "log", + "memorystats", + "gc", + "hostname", + "version" + ] +}` + +func (h *hub) unregisterConnection(c *connection) { + if _, contains := h.connections[c]; !contains { + return + } + delete(h.connections, c) + close(c.send) +} + +func (h *hub) sendToRegisteredConnections(data []byte) { + for c := range h.connections { + select { + case c.send <- data: + //log.Print("did broadcast to ") + //log.Print(c.ws.RemoteAddr()) + //c.send <- []byte("hello world") + default: + h.unregisterConnection(c) + } + } } func (h *hub) run() { @@ -54,57 +100,19 @@ func (h *hub) run() { case c := <-h.register: h.connections[c] = true // send supported commands - c.send <- []byte("{\"Version\" : \"" + version + "\"} ") - c.send <- []byte("{\"Commands\" : [\"list\", \"open [portName] [baud] [bufferAlgorithm (optional)]\", \"send [portName] [cmd]\", \"sendnobuf [portName] [cmd]\", \"close [portName]\", \"bufferalgorithms\", \"baudrates\", \"restart\", \"exit\", \"program [portName] [board:name] [$path/to/filename/without/extension]\", \"programfromurl [portName] [board:name] [urlToHexFile]\"]} ") - c.send <- []byte("{\"Hostname\" : \"" + *hostname + "\"} ") - c.send <- []byte("{\"OS\" : \"" + runtime.GOOS + "\"} ") + c.send <- []byte(fmt.Sprintf(`{"Version" : "%s"} `, version)) + c.send <- []byte(html.EscapeString(commands)) + c.send <- []byte(fmt.Sprintf(`{"Hostname" : "%s"} `, *hostname)) + c.send <- []byte(fmt.Sprintf(`{"OS" : "%s"} `, runtime.GOOS)) case c := <-h.unregister: - delete(h.connections, c) - // put close in func cuz it was creating panics and want - // to isolate - func() { - // this method can panic if websocket gets disconnected - // from users browser and we see we need to unregister a couple - // of times, i.e. perhaps from incoming data from serial triggering - // an unregister. (NOT 100% sure why seeing c.send be closed twice here) - defer func() { - if e := recover(); e != nil { - log.Println("Got panic: ", e) - } - }() - close(c.send) - }() + h.unregisterConnection(c) case m := <-h.broadcast: if len(m) > 0 { - //log.Print(string(m)) - //log.Print(h.broadcast) checkCmd(m) - //log.Print("-----") - - for c := range h.connections { - select { - case c.send <- m: - //log.Print("did broadcast to ") - //log.Print(c.ws.RemoteAddr()) - //c.send <- []byte("hello world") - default: - delete(h.connections, c) - close(c.send) - } - } + h.sendToRegisteredConnections(m) } case m := <-h.broadcastSys: - for c := range h.connections { - select { - case c.send <- m: - //log.Print("did broadcast to ") - //log.Print(c.ws.RemoteAddr()) - //c.send <- []byte("hello world") - default: - delete(h.connections, c) - close(c.send) - } - } + h.sendToRegisteredConnections(m) } } } @@ -115,23 +123,13 @@ func checkCmd(m []byte) { sl := strings.ToLower(strings.Trim(s, "\n")) - if *hibernate == true { + if *hibernate { //do nothing return } if strings.HasPrefix(sl, "open") { - // check if user wants to open this port as a secondary port - // this doesn't mean much other than allowing the UI to show - // a port as primary and make other ports sort of act less important - isSecondary := false - if strings.HasPrefix(s, "open secondary") { - isSecondary = true - // swap out the word secondary - s = strings.Replace(s, "open secondary", "open", 1) - } - args := strings.Split(s, " ") if len(args) < 3 { go spErr("You did not specify a port and baud rate in your open cmd") @@ -150,13 +148,13 @@ func checkCmd(m []byte) { } // pass in buffer type now as string. if user does not // ask for a buffer type pass in empty string - bufferAlgorithm := "" + bufferAlgorithm := "default" // use the default buffer if none is specified if len(args) > 3 { // cool. we got a buffer type request buftype := strings.Replace(args[3], "\n", "", -1) bufferAlgorithm = buftype } - go spHandlerOpen(args[1], baud, bufferAlgorithm, isSecondary) + go spHandlerOpen(args[1], baud, bufferAlgorithm) } else if strings.HasPrefix(sl, "close") { @@ -167,41 +165,67 @@ func checkCmd(m []byte) { go spErr("You did not specify a port to close") } - } else if strings.HasPrefix(sl, "killprogrammer") { + } else if strings.HasPrefix(sl, "killupload") { // kill the running process (assumes singleton for now) - go spHandlerProgramKill() - - } else if strings.HasPrefix(sl, "sendjson") { - // will catch sendjson - go spWriteJson(s) + go func() { + upload.Kill() + h.broadcastSys <- []byte("{\"uploadStatus\": \"Killed\"}") + log.Println("{\"uploadStatus\": \"Killed\"}") + }() } else if strings.HasPrefix(sl, "send") { - // will catch send and sendnobuf - - //args := strings.Split(s, "send ") + // will catch send and sendnobuf and sendraw go spWrite(s) - } else if strings.HasPrefix(sl, "list") { - go spList(false) - go spList(true) + go serialPorts.List() } else if strings.HasPrefix(sl, "downloadtool") { - args := strings.Split(s, " ") - if len(args) > 2 { - go spDownloadTool(args[1], args[2]) - } - } else if strings.HasPrefix(sl, "bufferalgorithm") { - go spBufferAlgorithms() + go func() { + args := strings.Split(s, " ") + var tool, toolVersion, pack, behaviour string + toolVersion = "latest" + pack = "arduino" + behaviour = "keep" + if len(args) <= 1 { + mapD := map[string]string{"DownloadStatus": "Error", "Msg": "Not enough arguments"} + mapB, _ := json.Marshal(mapD) + h.broadcastSys <- mapB + return + } + if len(args) > 1 { + tool = args[1] + } + if len(args) > 2 { + if strings.HasPrefix(args[2], "http") { + //old APIs, ignore this field + } else { + toolVersion = args[2] + } + } + if len(args) > 3 { + pack = args[3] + } + if len(args) > 4 { + behaviour = args[4] + } + + err := Tools.Download(pack, tool, toolVersion, behaviour) + if err != nil { + mapD := map[string]string{"DownloadStatus": "Error", "Msg": err.Error()} + mapB, _ := json.Marshal(mapD) + h.broadcastSys <- mapB + } else { + mapD := map[string]string{"DownloadStatus": "Success", "Msg": "Map Updated"} + mapB, _ := json.Marshal(mapD) + h.broadcastSys <- mapB + } + }() } else if strings.HasPrefix(sl, "log") { go logAction(sl) - } else if strings.HasPrefix(sl, "baudrate") { - go spBaudRates() - } else if strings.HasPrefix(sl, "broadcast") { - go broadcast(s) } else if strings.HasPrefix(sl, "restart") { log.Println("Received restart from the daemon. Why? Boh") - restart("") + Systray.Restart() } else if strings.HasPrefix(sl, "exit") { - exit() + Systray.Quit() } else if strings.HasPrefix(sl, "memstats") { memoryStats() } else if strings.HasPrefix(sl, "gc") { @@ -213,19 +237,17 @@ func checkCmd(m []byte) { } else { go spErr("Could not understand command.") } - - //log.Print("Done with checkCmd") } func logAction(sl string) { if strings.HasPrefix(sl, "log on") { *logDump = "on" - multi_writer := io.MultiWriter(&logger_ws, os.Stderr) - log.SetOutput(multi_writer) + multiWriter := io.MultiWriter(&loggerWs, os.Stderr) + log.SetOutput(multiWriter) } else if strings.HasPrefix(sl, "log off") { *logDump = "off" log.SetOutput(os.Stderr) - } else if strings.HasPrefix(sl, "log show") { + // } else if strings.HasPrefix(sl, "log show") { // TODO: send all the saved log to websocket //h.broadcastSys <- []byte("{\"BufFlowDebug\" : \"" + *logDump + "\"}") } @@ -258,114 +280,3 @@ func garbageCollection() { h.broadcastSys <- []byte("{\"gc\":\"done\"}") memoryStats() } - -func exit() { - log.Println("Starting new spjs process") - h.broadcastSys <- []byte("{\"Exiting\" : true}") - log.Fatal("Exited current spjs cuz asked to") - -} - -func restart(path string) { - log.Println("called restart", path) - // relaunch ourself and exit - // the relaunch works because we pass a cmdline in - // that has serial-port-json-server only initialize 5 seconds later - // which gives us time to exit and unbind from serial ports and TCP/IP - // sockets like :8989 - log.Println("Starting new spjs process") - h.broadcastSys <- []byte("{\"Restarting\" : true}") - - // figure out current path of executable so we know how to restart - // this process - /* - dir, err2 := filepath.Abs(filepath.Dir(os.Args[0])) - if err2 != nil { - //log.Fatal(err2) - fmt.Printf("Error getting executable file path. err: %v\n", err2) - } - fmt.Printf("The path to this exe is: %v\n", dir) - - // alternate approach - _, filename, _, _ := runtime.Caller(1) - f, _ := os.Open(path.Join(path.Dir(filename), "serial-port-json-server")) - fmt.Println(f) - */ - - // using osext - exePath, err3 := osext.Executable() - if err3 != nil { - log.Printf("Error getting exe path using osext lib. err: %v\n", err3) - } - - if path == "" { - log.Printf("exePath using osext: %v\n", exePath) - } else { - exePath = path - } - - exePath = strings.Trim(exePath, "\n") - // figure out garbageCollection flag - //isGcFlag := "false" - - var cmd *exec.Cmd - - /*if *isGC { - //isGcFlag = "true" - cmd = exec.Command(exePath, "-ls", "-addr", *addr, "-regex", *regExpFilter, "-gc") - } else { - cmd = exec.Command(exePath, "-ls", "-addr", *addr, "-regex", *regExpFilter) - - }*/ - - hiberString := "" - if *hibernate == true { - hiberString = "-hibernate" - } - - cmd = exec.Command(exePath, "-ls", "-regex", *regExpFilter, "-gc", *gcType, hiberString) - - fmt.Println(cmd) - - //cmd := exec.Command("./serial-port-json-server", "ls") - err := cmd.Start() - if err != nil { - log.Printf("Got err restarting spjs: %v\n", err) - h.broadcastSys <- []byte("{\"Error\" : \"" + fmt.Sprintf("%v", err) + "\"}") - } else { - h.broadcastSys <- []byte("{\"Restarted\" : true}") - } - log.Fatal("Exited current spjs for restart") - //log.Printf("Waiting for command to finish...") - //err = cmd.Wait() - //log.Printf("Command finished with error: %v", err) -} - -type CmdBroadcast struct { - Cmd string - Msg string -} - -func broadcast(arg string) { - // we will get a string of broadcast asdf asdf asdf - log.Println("Inside broadcast arg: " + arg) - arg = strings.TrimPrefix(arg, " ") - //log.Println("arg after trim: " + arg) - args := strings.SplitN(arg, " ", 2) - if len(args) != 2 { - errstr := "Could not parse broadcast command: " + arg - log.Println(errstr) - spErr(errstr) - return - } - broadcastcmd := strings.Trim(args[1], " ") - log.Println("The broadcast cmd is:" + broadcastcmd + "---") - - bcmd := CmdBroadcast{ - Cmd: "Broadcast", - Msg: broadcastcmd, - } - json, _ := json.Marshal(bcmd) - log.Printf("bcmd:%v\n", string(json)) - h.broadcastSys <- json -} diff --git a/icon/icon.svg b/icon/icon.svg new file mode 100644 index 000000000..8bc6f5fb2 --- /dev/null +++ b/icon/icon.svg @@ -0,0 +1,63 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/icon/icon_darwin.go b/icon/icon_darwin.go new file mode 100644 index 000000000..dfdfa34a7 --- /dev/null +++ b/icon/icon_darwin.go @@ -0,0 +1,23 @@ +package icon + +import _ "embed" // import embed to embed the icon + +// GetIcon will return the icon +func GetIcon() []byte { + return data +} + +// GetIconHiber will return the hibernated icon +func GetIconHiber() []byte { + return dataHibernate +} + +// data represents the icon +// +//go:embed icon_mac.png +var data []byte + +// dataHibernate represents the icon hibernated +// +//go:embed icon_mac_hiber.png +var dataHibernate []byte diff --git a/icon/icon_hiber.svg b/icon/icon_hiber.svg new file mode 100644 index 000000000..91021711e --- /dev/null +++ b/icon/icon_hiber.svg @@ -0,0 +1,63 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/icon/icon_linux.go b/icon/icon_linux.go new file mode 100644 index 000000000..b00f743aa --- /dev/null +++ b/icon/icon_linux.go @@ -0,0 +1,23 @@ +package icon + +import _ "embed" // import embed to embed the icon + +// GetIcon will return the icon +func GetIcon() []byte { + return data +} + +// GetIconHiber will return the hibernated icon +func GetIconHiber() []byte { + return dataHibernate +} + +// data represents the icon +// +//go:embed icon_linux.png +var data []byte + +// dataHibernate represents the icon hibernated +// +//go:embed icon_linux_hiber.png +var dataHibernate []byte diff --git a/icon/icon_linux.png b/icon/icon_linux.png new file mode 100644 index 000000000..b32940840 Binary files /dev/null and b/icon/icon_linux.png differ diff --git a/icon/icon_linux_hiber.png b/icon/icon_linux_hiber.png new file mode 100644 index 000000000..5995ce96a Binary files /dev/null and b/icon/icon_linux_hiber.png differ diff --git a/icon/icon_mac.png b/icon/icon_mac.png new file mode 100644 index 000000000..24dd8ae1b Binary files /dev/null and b/icon/icon_mac.png differ diff --git a/icon/icon_mac_hiber.png b/icon/icon_mac_hiber.png new file mode 100644 index 000000000..b57292690 Binary files /dev/null and b/icon/icon_mac_hiber.png differ diff --git a/icon/icon_win.ico b/icon/icon_win.ico new file mode 100644 index 000000000..de577ec75 Binary files /dev/null and b/icon/icon_win.ico differ diff --git a/icon/icon_win_hiber.ico b/icon/icon_win_hiber.ico new file mode 100644 index 000000000..652370e13 Binary files /dev/null and b/icon/icon_win_hiber.ico differ diff --git a/icon/icon_windows.go b/icon/icon_windows.go new file mode 100644 index 000000000..2cf75b5e3 --- /dev/null +++ b/icon/icon_windows.go @@ -0,0 +1,23 @@ +package icon + +import _ "embed" // import embed to embed the icon + +// GetIcon will return the icon +func GetIcon() []byte { + return data +} + +// GetIconHiber will return the hibernated icon +func GetIconHiber() []byte { + return dataHibernate +} + +// data represents the icon +// +//go:embed icon_win.ico +var data []byte + +// dataHibernate represents the icon hibernated +// +//go:embed icon_win_hiber.ico +var dataHibernate []byte diff --git a/images/linux/01.png b/images/linux/01.png new file mode 100644 index 000000000..0745e2c6c Binary files /dev/null and b/images/linux/01.png differ diff --git a/images/linux/02.png b/images/linux/02.png new file mode 100644 index 000000000..9ff5d24d9 Binary files /dev/null and b/images/linux/02.png differ diff --git a/images/linux/03.png b/images/linux/03.png new file mode 100644 index 000000000..228c3acf9 Binary files /dev/null and b/images/linux/03.png differ diff --git a/images/linux/04.png b/images/linux/04.png new file mode 100644 index 000000000..c45f03564 Binary files /dev/null and b/images/linux/04.png differ diff --git a/images/linux/tray-icon-multiple-profiles.png b/images/linux/tray-icon-multiple-profiles.png new file mode 100644 index 000000000..120bd9610 Binary files /dev/null and b/images/linux/tray-icon-multiple-profiles.png differ diff --git a/images/mac/01.png b/images/mac/01.png new file mode 100644 index 000000000..307b53886 Binary files /dev/null and b/images/mac/01.png differ diff --git a/images/mac/02.png b/images/mac/02.png new file mode 100644 index 000000000..410c379d4 Binary files /dev/null and b/images/mac/02.png differ diff --git a/images/mac/03.png b/images/mac/03.png new file mode 100644 index 000000000..771585bf4 Binary files /dev/null and b/images/mac/03.png differ diff --git a/images/mac/04.png b/images/mac/04.png new file mode 100644 index 000000000..2b74ea64c Binary files /dev/null and b/images/mac/04.png differ diff --git a/images/windows/01.png b/images/windows/01.png new file mode 100644 index 000000000..1670ba142 Binary files /dev/null and b/images/windows/01.png differ diff --git a/images/windows/02.png b/images/windows/02.png new file mode 100644 index 000000000..eac805055 Binary files /dev/null and b/images/windows/02.png differ diff --git a/images/windows/03.png b/images/windows/03.png new file mode 100644 index 000000000..c832e87fc Binary files /dev/null and b/images/windows/03.png differ diff --git a/images/windows/04.png b/images/windows/04.png new file mode 100644 index 000000000..37e048df7 Binary files /dev/null and b/images/windows/04.png differ diff --git a/index/hidefile_default.go b/index/hidefile_default.go new file mode 100644 index 000000000..b777bcd5d --- /dev/null +++ b/index/hidefile_default.go @@ -0,0 +1,23 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +//go:build !windows + +package index + +// hideFile will do nothing in this platform +func hideFile(path string) error { + return nil +} diff --git a/index/hidefile_windows.go b/index/hidefile_windows.go new file mode 100644 index 000000000..78a613d46 --- /dev/null +++ b/index/hidefile_windows.go @@ -0,0 +1,33 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package index + +import ( + "syscall" +) + +// hideFile will set the hidden attribute on the file +func hideFile(path string) error { + filenameW, err := syscall.UTF16PtrFromString(path) + if err != nil { + return err + } + err = syscall.SetFileAttributes(filenameW, syscall.FILE_ATTRIBUTE_HIDDEN) + if err != nil { + return err + } + return nil +} diff --git a/index/index.go b/index/index.go new file mode 100644 index 000000000..8e9c01191 --- /dev/null +++ b/index/index.go @@ -0,0 +1,146 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package index + +import ( + "bytes" + "encoding/hex" + "io" + "log" + "net/http" + "net/url" + "path" + "time" + + "github.com/ProtonMail/go-crypto/openpgp" + "github.com/arduino/go-paths-helper" +) + +// Resource represent the index of the system +type Resource struct { + LastRefresh time.Time // Last time the index was downloaded + IndexURL url.URL // The URL used to host the index.json + IndexFile paths.Path // The location of the index on the filesystem + IndexSignature paths.Path // The location of the signature on the filesystem +} + +// gpg --export YOURKEYID --export-options export-minimal,no-export-attributes | hexdump /dev/stdin -v -e '/1 "%02X"' +var publicKeyHex string = "99020D0452FAA2FA011000D0C5604932111750628F171E4E612D599ABEA8E4309888B9B9E87CCBD3AAD014B27454B0AF08E7CDD019DA72D492B6CF882AD7FA8571E985C538582DA096C371E7FCD95B71BC00C0E92BDDC26801F1B11C86814E0EA849E5973F630FC426E6A5F262C22986CB489B5304005202BA729D519725E3E6042C9199C8ECE734052B7376CF40A864679C3594C93203EBFB3F82CD42CD956F961792233B4C7C1A28252360F48F1D6D8662F2CF93F87DB40A99304F61828AF8A3EB07239E984629DC0B1D5C6494C9AFB5C8F8B9A53F1324C254A1AEA4CD9219AB4DF8667653AC9A6E76C3DB37CE8F60B546F78ECA43A90CB82A2278A291D2E98D66753B56F0595280C6E33B274F631846806D97447DD5C9438E7EC85779D9FA2173E088CE6FA156E291FAFD432C4FC2B1EB251DAFD13C721FF6618F696B77C122FB75E3CBCB446FAAA7FFFDD071C81C6C3D2360D495964C623617352915BBB30FA7C903EA096BF01E77FC84C8B51C02EB11BC9F03F19C7E81254F1F786E64A7A9F7F438873583CFA40F49C0F041432EAECCEC7EE9BA465A30320306F0E2E65EBE01E533CBBD8B1C1C04222213D5D05F4B689193DB60A68A6F1FC8B2ADD9E58A104E482AAD3869CCC42236EDC9CBE8561E105837AB6F7A764DCE5D8CB62608E8133F0FDD5F8FAFBE3BC57EE551ADC7386AADD443B331716EC032ACF9C639BF9DFE62301D4F197221F10DEF0011010001B42041726475696E6F204C4C43203C737570706F72744061726475696E6F2E63633E890238041301020022050252FAA2FA021B03060B090807030206150802090A0B0416020301021E01021780000A09107BAF404C2DFAB4AEF8090FFE20C3B36BF786D692969DA2ECFD7BCA3961E735D3CBB5585D7AB04BB8A0B64B64528ED76DB4752FA24523AA1E07B69A6A66CDDAE074A6A572800228194DD5916A956BF22606D866C7FD81F32878E06FEC200DDB0703D805E1A61006EB0B5BDB3AA89C095BB259BD93C7AAE8BDB18468A6DBE30F85BD6A3271F5456EB22BC2BCE99DB3A054D9BCA8F562C01B99E6BF4C2136B62771EEF54CB2AE95F8E2FE543284C37EB77E5104D49939ABAEF323CA5F1A66CA48ED423DBB3A2CFF12792CCA71ACD1E3032186CC7D05A13E0D66A3258E443527AAF921B7EA70C6CC10E2A51FCAB4DD130A10D3D29B1B01FB4207EF6501D3A9186BDB652ECCC9F354599A114DD3F80F9ED3493AC51A5C4F1F3BB59049EE7EC61411E90E02F27789E87B18A860551DFDFFA870E8542F6128E167CE1875C5C5B1128259347B85265487006B173AA631F1CDA1EDC68C54978E1D0FE3B310CC0F49F9AE84F37B1472437B69DA125BAFDC99AE57C2245F70747E1EFD52849C40469247CF13CB679A31AF4700468E09ED1ECFE5A53F67C80C48A0B0C1334FAE9650584DFD406ADA30FFBEED659256D40924432B029BBB24CEF22195D389381F0B1EB964C6494942335E74A373D869D1FB0C7967F30F79D71AB06929CEBB660514C2567284BD9EC32470B263539B3AFF5D3FBA9A275D4665E6B502B4031B63F511C1DFDD16B617A6FB046FCEB018A7A01CEFB9020D0452FAA2FA011000D6DE1747395EB3836103D30FA5CF555F6FBC982FB8B0FD72389CD6E99A88ACA1BCBD8BAD35211929AB5AB7F656BA1AFFA8C9A5AF83436FC8FE36AB403453E3E6EC679371AD81657FA1506956B1165D8887E3FB7EF366EFCCA82EE543E0B22170D0164A6702EF5280398A901CB6262E63C0AE378FD8CA1957EEED9CE48AA3D481BD117A2CA0341C3E16FE20CB6A5C3130A19B364F656CDC45E2216DE7ACFAD429967D71D101CADE10BA64F4075801ED2E9E3A3293114543456A26236CCA459DC7700D2E9C692BADCA9BA0CDE7189CD594B20CA4D1F20A70B02B9B50F70CFC6F7697B1D500702CE29492C7CD28C5D555475788DDE57482BC39E8465A720E25866AC931D5D7030AB61136BF702B25BC850A5089D1E6F0F68B8AE894ADFC3C92BB836888E3DB5A940426DBE7BBC5BDD3DDD6F5123627D1CE6FD1845CC66A920094391BE783069CB05746C0A55DAFC869FDAF0A08F81099E4F4CD07D05C7269C538C341CF1EDB94114B8CD97B44214EA58EEDB93FAB772013A1D77A08B9208082F9617A6CFE39B56F0078406C6267ABF5CF1078C49B1AB9B60EA1451351CF889EF72D7D696B23B22F753B28979AF10237B579A350FA5596A3B22244FA91402562AE530E814EF19A9E3448F465F78C16220DE0663F7B97C7F0EF1629E2F64A76B21BB695A3DE505B22B09B3459A3CE2180424BD67C8482EBD5EBC8128F98634EEE8707001101000189021F041801020009050252FAA2FA021B0C000A09107BAF404C2DFAB4AE050B1000C1434E8CC0D6F8E60E2FB091AA5EA04E7612B29D3823E09914F704DE1835A7B202D3F619183BD3A16439BFA31A6AF342672E8F59184333C4F56D18AF3B7CE8326F655F7C8DD1D4B38A1964E6A4D7550D159CE1B5EC44BC2091B1097CABE724C0E8C4942C2CF82672E3F209322270D133313CF601E07756B705946A45235DAF7294BCD34292D989EFDFDA2F46AF0AEAEC72F55DC6B2940C7C6A409B7FAD3354D5CA30C3E4EE29F9218A56EF8D7FBA2A7BB8E6304110A21DF0C847C4B761CDE408CE156D53091535A800C1C522CA33C71105B11550A145FD0E41B464146B46D46F08DFAEF9B03D313D54A1E4A82E8749895AB78521DAA8E66EEF6F7B17A0CA4B4CBFCB937713B9806269556EBD88AE87996EFAC0846ACBA0D3412FC0A5E90923C261CD443E4D6C1AE93D83166937C5F606A14FD73DB4919A0ED416D4B3163420F57FACCE9C9347BD5501BE3FC830472B64068E5FF5B09E7425030625246720D21608DEE829F84E8365527F764C91DA93372C72AA4054B458104CAFC2BDCED63DC80F36E7BD4BE0D3A19E20E3FED90F80F9E1584853B971B8E847C27027123B9AA19C3E90B41B3A643D3D5BE2FC134ADA8396D072D37E7101B64CE83E1802D0D5DDA9150B6C21564987950C9601FC2147F139C7A9906640A0883981B452F25AF7A0F32FAA2148ECDD9B04B93AFCED00F11AA0E6695C2F92676B8DB9E93172FD7779B9020D04530B05A7011000CAA1A8FF4BF9D0F0AC9EDBCA3B4D26E3E569DFEA04341F3E6ACE23AE5D87D62C2600DFF10B106144A1B52FF8B695A590D65C681F69DEE454800C235160EBE3FC1436193E1278D56C86E2BBB2187BEAAC1E1D04D40A392B1457471D10A2B6BF39CDF35D1A090A9406BCB06BDEF83A12A490C5E17D68884AD2686042669E2B458AD3CC0377DDA9C58D7070CE29A53E0E7C876D61B29A2DE2A9D73F914D0FF3B0E35E2ED361B60A8C3C3D4C7E77E17A939283BFDA2EC5725A2BFAAC18C6A64ACBEC776760D7086EA42BD93031E8B59FB8DFEFF77E5F80DBEB84ADE74B3A6F9E4D0F3140A8D0F576ED00548883C85271AA7F2450D1061F56CB839786038861D5A2473B7F58EBC00D2BB9EFEB1A2DF612A7B9087C326FBB08F2879102253316784272967A886089D61D5AB0FDB33737D35F27C2886ABB4D4E88F541D0BBAD04AEF7BD3ED66A1282B762BD6F8EEDC3760773B157C1A2D4E4586E43B28879C54E7599F9A34E1524E6E7F9B8EA13CC5A2DF5C1920AF74833EDDEC8EB9A8BE33196702DFD656D81ACBBFE3A10DA882EAA3065D9C9476C0A7B66C15D0063CB7AD1A2EB31537CB443F21B81642436943FE6C45E6AF9C2B595D4DFCB64B83F2CA6B4DD536726C6EC4761A340C18E32B2D7210640B9AB1D8E2165C0DD38BC9FD9DB6A30B380DF08C3F10002A6636FDC79CD2312B606F5F116AC665618A56BBE46C494FC7E23C7001101000189043E0418010200090502530B05A7021B02022909107BAF404C2DFAB4AEC15D200419010200060502530B05A7000A091024A26BAD7F29429187700FFE30ED1B7C96B3846AC7B363F9602D2886F7913A9C451C31E043AD75597024D460B59E6A60A6EE3D58E656901237A2465F8402169A816B38170AF550284EB420B7E827386D66852D68125A27FA6770F139EE7FCAEF43000673B7C7D168614877603C875AD593E333AE9237DB77065FB8375CE98FA1BF7FB1733034AAC61F1D23A3EFF8665702C10968C7991458F88D151B3448C7D9334059431A63D30A9C8E636A99D88DA8DB04CB8C64F1183AC873FF0942EF9555B6B3F192AD5F221AC9737F875CCAE21E88EC45CB35E40C0FF1AAF0A8FE44876D93A930A03CC4846A29102C956F39F2AC5808CCBCD7F4868A8E8E8B9A66EA18C275CEF9C371AB0592796ED57D757A3BAB31FF8E3887F6041E61BDA433E7D68CB2D5F28E81F57843D5032D73BF67119C137FC4CE8BEF4F705D690E47A530B1A85B8B6A09A4AE16A2973C11D69031B89BE92B0751DB7FE74F6F1C219C8B93E5C68EC1403856DF28E96E27737A7FB9C80F6EE9EC485A0609DC4EB8DF444F61C76A97F32ADFA2D8B4784DF3ABA4DE1B57894B9CF89934A143451308D73CF79ECC8BF382B8A34F24DC335238D8353767B363F5432D9A81C84F7D2FAB6E36E7188FA911120A905C67342A996251EBECAC13BD543A9B3C2C063AE294FDD15C66D5DD9224F3E936325F525700F2129D0B31CE8CCD4EBA5DEDB89F0A2BFC0C43E732F695161E4F33CE5DED14B1E98654547B110FFF7CBC2BA513721A96DD18964635069343FA8EEF4D492BFA55C930F9C78DF1F7454F1BDD40F4B04BDE9F9B9A9923A303D96D0CBFA361921AFEF13AED098D0CF70E84C0DDB20C58821351D2359B131671AAF5D2484717A4CAF385DB0CC19FBC37A3FC04F4F387D6934C1E84B9C1291231A14F69A1BF6708875C7DE00E3EFE3C7855A2459C96245C5F0D21FC00E87A0C18F80A3B79C0E28EA27493309C535254421BE7CDFBEFB5B44DAEA56B6859430FCCBEE766048F891AD5CB503866B98E521ED69B37E4165012A45E29836E2A0380728C1108E4C8A32EA186E1A855F78DA5506B6CF86DB888A87FAB6E15A90E3416469522DF5BD8872D729B35E6D82C974CD80076C26008015AB216C83FAF64E488F07D2BD01F51B0963F87BE0AB8392B442227BF7215148038B0C55189024D7C1B032DB1B3C56C66953E530C5B323634FC584A476CAD285EF1108011D14D9D180A75A9DFC936AFC7EF9E6C3F3CFEDD894894CE60358E7156B3A65ED7644DEA343A133F5D4DE4D33B74281086A0C20515AC4151CFED93C56DD574E578FDEE72C4115C25CAEC5EAD97C147F27F4EAE67FEFFEA0DC1CDF5D636AC331CB74DF477C9C3B3706F9DAF50C2E13AC8DE8CC9DD3C79E59EC779EE489D915CF22FDC53E3B3C7710FE8368DF11B9ACDF5F3CAE1F43CB7312E5E9F57F248692B3681CBA3E49207878FD33ED2A47CE9CE9B4E4A6EFD8F0AD2CD" + +// Init will initialize the IndexResource structure and will return it. +// It will take indexString as a paramenter. +func Init(indexString string, directory *paths.Path) *Resource { + if directory == nil { + log.Fatalf("configuration directory not provided") + } + if !directory.Exist() { + err := directory.Mkdir() + if err != nil { + log.Fatalf("cannot create config dir: %s", err) + } + err = hideFile(directory.String()) + if err != nil { + log.Printf("cannot make config dir hidden: %s", err) + } + } + indexParsed, err := url.Parse(indexString) + if err != nil { + log.Fatalf("cannot parse provided index: %s", indexString) + } + + indexFile := path.Base(indexParsed.Path) // == package_index.json + signatureFile := indexFile + ".sig" + + var ir = Resource{ + IndexURL: *indexParsed, + IndexFile: *directory.Join(indexFile), + IndexSignature: *directory.Join(signatureFile), + } + + if err := ir.DownloadAndVerify(); err != nil { + log.Fatalf("cannot download index: %s", err) + } + + return &ir +} + +// DownloadAndVerify will download an index file located at IndexURL and verify the signature +// if everything matches the files are overwritten +func (ir *Resource) DownloadAndVerify() error { + // Fetch the index + resp, err := http.Get(ir.IndexURL.String()) + if err != nil { + return err + } + defer resp.Body.Close() + + // Read the index body + body, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + + // Fetch the signature + signature, err := http.Get(ir.IndexURL.String() + ".sig") + if err != nil { + return err + } + defer signature.Body.Close() + + // Read the signature body + signatureBody, err := io.ReadAll(signature.Body) + if err != nil { + return err + } + + err = checkGPGSig(bytes.NewReader(body), bytes.NewReader(signatureBody)) + if err != nil { + return err + } + + // we overwrite the files if the signature is valid + ir.IndexFile.WriteFile(body) + ir.IndexSignature.WriteFile(signatureBody) + + ir.LastRefresh = time.Now() + + return nil +} + +// checkGPGSign takes a signed io.Reader and a detached signature io.Reader +// and returns if the signature is valid +func checkGPGSig(signed, signature io.Reader) error { + publicKeyBin, err := hex.DecodeString(publicKeyHex) + if err != nil { + return err + } + keyring, _ := openpgp.ReadKeyRing(bytes.NewReader(publicKeyBin)) + + _, err = openpgp.CheckDetachedSignature(keyring, signed, signature, nil) + return err +} + +// Read will read the index file. In case it doesn't exists or the latest downloaded +// version is older than 1 hour, it will be downloaded again. +func (ir *Resource) Read() ([]byte, error) { + if !ir.IndexFile.Exist() || time.Since(ir.LastRefresh) > 1*time.Hour { + // Download the file again and save it + if err := ir.DownloadAndVerify(); err != nil { + return nil, err + } + } + return ir.IndexFile.ReadFile() +} diff --git a/index/index_test.go b/index/index_test.go new file mode 100644 index 000000000..4a19a02be --- /dev/null +++ b/index/index_test.go @@ -0,0 +1,25 @@ +package index + +import ( + "net/url" + "testing" + + "github.com/arduino/go-paths-helper" + "github.com/stretchr/testify/require" +) + +func TestInit(t *testing.T) { + indexURL := "https://downloads.arduino.cc/packages/package_index.json" + // Instantiate Index + tempDir := paths.New(t.TempDir()).Join(".arduino-create") + Index := Init(indexURL, tempDir) + require.DirExists(t, tempDir.String()) + fileName := "package_index.json" + signatureName := fileName + ".sig" + parsedURL, _ := url.Parse(indexURL) + require.Equal(t, Index.IndexURL, *parsedURL) + require.Contains(t, Index.IndexFile.String(), fileName) + require.Contains(t, Index.IndexSignature.String(), signatureName) + require.FileExists(t, tempDir.Join(fileName).String()) + require.FileExists(t, tempDir.Join(signatureName).String()) +} diff --git a/info.go b/info.go index 194d46e4c..88145c02b 100644 --- a/info.go +++ b/info.go @@ -1,14 +1,53 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + package main import ( + "runtime" + "strings" + "github.com/gin-gonic/gin" + "go.bug.st/serial" ) func infoHandler(c *gin.Context) { + host := c.Request.Host + parts := strings.Split(host, ":") + host = parts[0] + c.JSON(200, gin.H{ - "http": "http://localhost" + port, - "https": "https://localhost" + port, - "ws": "ws://localhost" + port, - "wss": "wss://localhost" + portSSL, + "version": version, + "http": "http://" + host + port, + "https": "https://localhost" + portSSL, + "ws": "ws://" + host + port, + "wss": "wss://localhost" + portSSL, + "origins": origins, + "update_url": updateURL, + "os": runtime.GOOS + ":" + runtime.GOARCH, }) } + +func pauseHandler(c *gin.Context) { + go func() { + ports, _ := serial.GetPortsList() + for _, element := range ports { + spClose(element) + } + *hibernate = true + Systray.Pause() + }() + c.JSON(200, nil) +} diff --git a/installer_icons/Installer.png b/installer_icons/Installer.png deleted file mode 100644 index ccdf286dd..000000000 Binary files a/installer_icons/Installer.png and /dev/null differ diff --git a/installer_icons/InstallerIcon.png b/installer_icons/InstallerIcon.png deleted file mode 100644 index 8951a1a8c..000000000 Binary files a/installer_icons/InstallerIcon.png and /dev/null differ diff --git a/installer_icons/InstallerSplash.png b/installer_icons/InstallerSplash.png deleted file mode 100644 index 0eeeed06c..000000000 Binary files a/installer_icons/InstallerSplash.png and /dev/null differ diff --git a/installer_icons/tray_iconWin.ico b/installer_icons/tray_iconWin.ico deleted file mode 100644 index a0893f67d..000000000 Binary files a/installer_icons/tray_iconWin.ico and /dev/null differ diff --git a/main.go b/main.go index a95038a96..41f824b1b 100755 --- a/main.go +++ b/main.go @@ -1,54 +1,111 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + // Version 1.82 // Supports Windows, Linux, Mac, and Raspberry Pi, Beagle Bone Black package main import ( + _ "embed" + "encoding/json" "flag" + "html/template" + "io" "os" - "os/user" - "path/filepath" + "regexp" + "runtime" "runtime/debug" "strconv" - "text/template" + "strings" "time" - log "github.com/Sirupsen/logrus" - "github.com/carlescere/scheduler" + cert "github.com/arduino/arduino-create-agent/certificates" + "github.com/arduino/arduino-create-agent/config" + "github.com/arduino/arduino-create-agent/globals" + "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/systray" + "github.com/arduino/arduino-create-agent/tools" + "github.com/arduino/arduino-create-agent/updater" + "github.com/arduino/arduino-create-agent/utilities" + v2 "github.com/arduino/arduino-create-agent/v2" + paths "github.com/arduino/go-paths-helper" + cors "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" - "github.com/itsjamie/gin-cors" - "github.com/kardianos/osext" - "github.com/vharitonsky/iniflags" + "github.com/go-ini/ini" + log "github.com/sirupsen/logrus" //"github.com/sanbornm/go-selfupdate/selfupdate" #included in update.go to change heavily ) var ( - version = "x.x.x-dev" //don't modify it, Jenkins will take care - git_revision = "xxxxxxxx" //don't modify it, Jenkins will take care - embedded_autoupdate = true - embedded_autoextract = false - hibernate = flag.Bool("hibernate", false, "start hibernated") - verbose = flag.Bool("v", true, "show debug logging") - //verbose = flag.Bool("v", false, "show debug logging") - isLaunchSelf = flag.Bool("ls", false, "launch self 5 seconds later") - configIni = flag.String("configFile", "config.ini", "config file path") - regExpFilter = flag.String("regex", "usb|acm|com", "Regular expression to filter serial port list") - gcType = flag.String("gc", "std", "Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)") - logDump = flag.String("log", "off", "off = (default)") - // hostname. allow user to override, otherwise we look it up - hostname = flag.String("hostname", "unknown-hostname", "Override the hostname we get from the OS") - updateUrl = flag.String("updateUrl", "", "") - appName = flag.String("appName", "", "") - globalToolsMap = make(map[string]string) - tempToolsPath = createToolsDir() - port string - portSSL string - origins = flag.String("origins", "", "Allowed origin list for CORS") + version = "x.x.x-dev" //don't modify it, Jenkins will take care + commit = "xxxxxxxx" //don't modify it, Jenkins will take care + port string + portSSL string +) + +// regular flags +var ( + hibernate = flag.Bool("hibernate", false, "start hibernated") + genCert = flag.Bool("generateCert", false, "") + additionalConfig = flag.String("additional-config", "config.ini", "config file path") + isLaunchSelf = flag.Bool("ls", false, "launch self 5 seconds later") + + // Ignored flags for compatibility + _ = flag.String("gc", "std", "Deprecated. Use the config.ini file") + _ = flag.String("regex", "usb|acm|com", "Deprecated. Use the config.ini file") +) + +// iniflags +var ( + address = iniConf.String("address", "127.0.0.1", "The address where to listen. Defaults to localhost") + appName = iniConf.String("appName", "", "") + gcType = iniConf.String("gc", "std", "Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)") + hostname = iniConf.String("hostname", "unknown-hostname", "Override the hostname we get from the OS") + httpProxy = iniConf.String("httpProxy", "", "Proxy server for HTTP requests") + httpsProxy = iniConf.String("httpsProxy", "", "Proxy server for HTTPS requests") + indexURL = iniConf.String("indexURL", "https://downloads.arduino.cc/packages/package_index.json", "The address from where to download the index json containing the location of upload tools") + iniConf = flag.NewFlagSet("ini", flag.ContinueOnError) + logDump = iniConf.String("log", "off", "off = (default)") + origins = iniConf.String("origins", "", "Allowed origin list for CORS") + portsFilterRegexp = iniConf.String("regex", "usb|acm|com", "Regular expression to filter serial port list") + signatureKey = iniConf.String("signatureKey", globals.ArduinoSignaturePubKey, "Pem-encoded public key to verify signed commandlines") + updateURL = iniConf.String("updateUrl", "", "") + verbose = iniConf.Bool("v", true, "show debug logging") + crashreport = iniConf.Bool("crashreport", false, "enable crashreport logging") + autostartMacOS = iniConf.Bool("autostartMacOS", true, "the Arduino Create Agent is able to start automatically after login on macOS (launchd agent)") + installCerts = iniConf.Bool("installCerts", false, "install the HTTPS certificate for Safari and keep it updated") ) -type NullWriter int +// the ports filter provided by the user via the -regex flag, if any +var portsFilter *regexp.Regexp -func (NullWriter) Write([]byte) (int, error) { return 0, nil } +var homeTemplate = template.Must(template.New("home").Parse(homeTemplateHTML)) + +// If you navigate to this server's homepage, you'll get this HTML +// so you can directly interact with the serial port server +// +//go:embed home.html +var homeTemplateHTML string + +// global clients +var ( + Tools *tools.Tools + Systray systray.Systray + Index *index.Resource +) type logWriter struct{} @@ -57,12 +114,7 @@ func (u *logWriter) Write(p []byte) (n int, err error) { return len(p), nil } -var logger_ws logWriter - -func createToolsDir() string { - usr, _ := user.Current() - return usr.HomeDir + "/.arduino-create" -} +var loggerWs logWriter func homeHandler(c *gin.Context) { homeTemplate.Execute(c.Writer, c.Request.Host) @@ -75,315 +127,441 @@ func launchSelfLater() { } func main() { + // prevents bad errors in OSX, such as '[NS...] is only safe to invoke on the main thread'. + runtime.LockOSThread() + // Parse regular flags flag.Parse() - if *hibernate == false { - - go func() { - - // autoextract self - src, _ := osext.Executable() - dest := filepath.Dir(src) + // Generate certificates + if *genCert { + cert.GenerateCertificates(config.GetCertificatesDir()) + os.Exit(0) + } + // Check if certificates made with Agent <=1.2.7 needs to be moved over the new location + cert.MigrateCertificatesGeneratedWithOldAgentVersions(config.GetCertificatesDir()) + + // Launch main loop in a goroutine + go loop() + + // SetupSystray is the main thread + configDir := config.GetDefaultConfigDir() + Systray = systray.Systray{ + Hibernate: *hibernate, + Version: version + "-" + commit, + DebugURL: func() string { + return "http://" + *address + port + }, + AdditionalConfig: *additionalConfig, + ConfigDir: configDir, + } - os.Mkdir(tempToolsPath, 0777) - hideFile(tempToolsPath) + if src, err := os.Executable(); err != nil { + panic(err) + } else if restartPath := updater.Start(src); restartPath != "" { + Systray.RestartWith(restartPath) + } else { + Systray.Start() + } +} - if embedded_autoextract { - // save the config.ini (if it exists) - if _, err := os.Stat(dest + "/" + *configIni); os.IsNotExist(err) { - log.Println("First run, unzipping self") - err := Unzip(src, dest) - log.Println("Self extraction, err:", err) - } +func loop() { + if *hibernate { + return + } - if _, err := os.Stat(dest + "/" + *configIni); os.IsNotExist(err) { - flag.Parse() - log.Println("No config.ini at", *configIni) - } else { - flag.Parse() - flag.Set("config", dest+"/"+*configIni) - iniflags.Parse() - } - } else { - flag.Set("config", dest+"/"+*configIni) - iniflags.Parse() - } + log.SetLevel(log.InfoLevel) + log.SetOutput(os.Stdout) - // move CORS to config file compatibility, Vagrant version - if *origins == "" { - log.Println("Patching config.ini for compatibility") - f, err := os.OpenFile(dest+"/"+*configIni, os.O_APPEND|os.O_WRONLY, 0666) - if err != nil { - panic(err) - } - _, err = f.WriteString("\norigins = http://webide.arduino.cc:8080\n") - if err != nil { - panic(err) - } - f.Close() - restart("") - } - //log.SetFormatter(&log.JSONFormatter{}) + // We used to install the agent in $HOME/Applications before versions <= 1.2.7-ventura + // With version > 1.3.0 we changed the install path of the agent in /Applications. + // If we are updating manually from 1.2.7 to 1.3.0 we have to uninstall the old agent manually first. + // This check will inform the user if he needs to run the uninstall first + if runtime.GOOS == "darwin" && oldInstallExists() { + utilities.UserPrompt("Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one", "\"OK\"", "OK", "OK", "Error") + os.Exit(0) + } - log.SetLevel(log.InfoLevel) + logger := func(msg string) { + mapD := map[string]string{"DownloadStatus": "Pending", "Msg": msg} + mapB, _ := json.Marshal(mapD) + h.broadcastSys <- mapB + } - log.SetOutput(os.Stderr) + // Let's handle the config + configDir := config.GetDefaultConfigDir() + var configPath *paths.Path - // see if we are supposed to wait 5 seconds - if *isLaunchSelf { - launchSelfLater() + // see if the env var is defined, if it is take the config from there, this will override the default path + if envConfig := os.Getenv("ARDUINO_CREATE_AGENT_CONFIG"); envConfig != "" { + configPath = paths.New(envConfig) + if configPath.NotExist() { + log.Panicf("config from env var %s does not exists", envConfig) + } + log.Infof("using config from env variable: %s", configPath) + } else if defaultConfigPath := configDir.Join("config.ini"); defaultConfigPath.Exist() { + // by default take the config from the ~/.arduino-create/config.ini file + configPath = defaultConfigPath + log.Infof("using config from default: %s", configPath) + } else { + // Fall back to the old config.ini location + src, _ := os.Executable() + oldConfigPath := paths.New(src).Parent().Join("config.ini") + if oldConfigPath.Exist() { + err := oldConfigPath.CopyTo(defaultConfigPath) + if err != nil { + log.Errorf("cannot copy old %s, to %s, generating new config", oldConfigPath, configPath) + } else { + configPath = defaultConfigPath + log.Infof("copied old %s, to %s", oldConfigPath, configPath) } + } + } + if configPath == nil { + configPath = config.GenerateConfig(configDir) + } - if embedded_autoupdate { - - var updater = &Updater{ - CurrentVersion: version, - ApiURL: *updateUrl, - BinURL: *updateUrl, - DiffURL: "", - Dir: "update/", - CmdName: *appName, + // if the default browser is Safari, prompt the user to install HTTPS certificates + // and eventually install them + if runtime.GOOS == "darwin" { + if exist, err := installCertsKeyExists(configPath.String()); err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } else if !exist { + if cert.CertInKeychain() || config.CertsExist() { + err = config.SetInstallCertsIni(configPath.String(), "true") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) } - - if updater != nil { - updater_job := func() { - go updater.BackgroundRun() + } else if cert.GetDefaultBrowserName() == "Safari" { + if promptInstallCertsSafari() { + err = config.SetInstallCertsIni(configPath.String(), "true") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } + cert.GenerateAndInstallCertificates(config.GetCertificatesDir()) + } else { + err = config.SetInstallCertsIni(configPath.String(), "false") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) } - scheduler.Every(5).Minutes().Run(updater_job) } } + } + } - log.Println("Version:" + version) - - // hostname - hn, _ := os.Hostname() - if *hostname == "unknown-hostname" { - *hostname = hn + // Parse the config.ini + args, err := parseIni(configPath.String()) + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } + err = iniConf.Parse(args) + if err != nil { + log.Panicf("cannot parse arguments: %s", err) + } + Systray.SetCurrentConfigFile(configPath) + + // Parse additional ini config if defined + if len(*additionalConfig) > 0 { + additionalConfigPath := paths.New(*additionalConfig) + if additionalConfigPath.NotExist() { + log.Infof("additional config file not found in %s", additionalConfigPath.String()) + } else { + args, err = parseIni(additionalConfigPath.String()) + if err != nil { + log.Panicf("additional config cannot be parsed: %s", err) } - log.Println("Hostname:", *hostname) - - // turn off garbage collection - // this is dangerous, as u could overflow memory - //if *isGC { - if *gcType == "std" { - log.Println("Garbage collection is on using Standard mode, meaning we just let Golang determine when to garbage collect.") - } else if *gcType == "max" { - log.Println("Garbage collection is on for MAXIMUM real-time collecting on each send/recv from serial port. Higher CPU, but less stopping of the world to garbage collect since it is being done on a constant basis.") - } else { - log.Println("Garbage collection is off. Memory use will grow unbounded. You WILL RUN OUT OF RAM unless you send in the gc command to manually force garbage collection. Lower CPU, but progressive memory footprint.") - debug.SetGCPercent(-1) + err = iniConf.Parse(args) + if err != nil { + log.Panicf("cannot parse arguments: %s", err) } + log.Infof("using additional config from %s", additionalConfigPath.String()) + } + } - // see if they provided a regex filter - if len(*regExpFilter) > 0 { - log.Printf("You specified a serial port regular expression filter: %v\n", *regExpFilter) - } + if signatureKey == nil || len(*signatureKey) == 0 { + log.Panicf("signature public key should be set") + } + signaturePubKey, err := utilities.ParseRsaPublicKey([]byte(*signatureKey)) + if err != nil { + log.Panicf("cannot parse signature key '%s'. %s", *signatureKey, err) + } - // list serial ports - portList, _ := GetList(false) - log.Println("Your serial ports:") - if len(portList) == 0 { - log.Println("\tThere are no serial ports to list.") - } - for _, element := range portList { - log.Printf("\t%v\n", element) + // Instantiate Index and Tools + Index = index.Init(*indexURL, config.GetDataDir()) + Tools = tools.New(config.GetDataDir(), Index, logger, signaturePubKey) - } + // see if we are supposed to wait 5 seconds + if *isLaunchSelf { + launchSelfLater() + } - if !*verbose { - log.Println("You can enter verbose mode to see all logging by starting with the -v command line switch.") - log.SetOutput(new(NullWriter)) //route all logging to nullwriter - } + log.Println("Version:" + version) - // launch the hub routine which is the singleton for the websocket server - go h.run() - // launch our serial port routine - go sh.run() - // launch our dummy data routine - //go d.run() + // hostname + hn, _ := os.Hostname() + if *hostname == "unknown-hostname" { + *hostname = hn + } + log.Println("Hostname:", *hostname) + + // turn off garbage collection + // this is dangerous, as u could overflow memory + //if *isGC { + if *gcType == "std" { + log.Println("Garbage collection is on using Standard mode, meaning we just let Golang determine when to garbage collect.") + } else if *gcType == "max" { + log.Println("Garbage collection is on for MAXIMUM real-time collecting on each send/recv from serial port. Higher CPU, but less stopping of the world to garbage collect since it is being done on a constant basis.") + } else { + log.Println("Garbage collection is off. Memory use will grow unbounded. You WILL RUN OUT OF RAM unless you send in the gc command to manually force garbage collection. Lower CPU, but progressive memory footprint.") + debug.SetGCPercent(-1) + } + + // If the httpProxy setting is set, use its value to override the + // HTTP_PROXY environment variable. Setting this environment + // variable ensures that all HTTP requests using net/http use this + // proxy server. + if *httpProxy != "" { + log.Printf("Setting HTTP_PROXY variable to %v", *httpProxy) + err := os.Setenv("HTTP_PROXY", *httpProxy) + if err != nil { + // The os.Setenv documentation doesn't specify how it can + // fail, so I don't know how to handle this error + // appropriately. + panic(err) + } + } - go discoverLoop() + if *httpsProxy != "" { + log.Printf("Setting HTTPS_PROXY variable to %v", *httpProxy) + err := os.Setenv("HTTPS_PROXY", *httpProxy) + if err != nil { + // The os.Setenv documentation doesn't specify how it can + // fail, so I don't know how to handle this error + // appropriately. + panic(err) + } + } - r := gin.New() + // see if they provided a regex filter + if len(*portsFilterRegexp) > 0 { + log.Printf("You specified a serial port regular expression filter: %v\n", *portsFilterRegexp) + if filter, err := regexp.Compile("(?i)" + *portsFilterRegexp); err != nil { + log.Panicf("Error compiling the regex filter: %v\n", err) + } else { + portsFilter = filter + } + } - socketHandler := wsHandler().ServeHTTP + if !*verbose { + log.Println("You can enter verbose mode to see all logging by setting the v key in the configuration file to true.") + log.SetOutput(io.Discard) + } - extraOriginStr := "https://create.arduino.cc, http://create.arduino.cc, https://create-dev.arduino.cc, http://create-dev.arduino.cc, http://create-staging.arduino.cc, https://create-staging.arduino.cc" + // save crashreport to file + if *crashreport { + logFilename := "crashreport_" + time.Now().Format("20060102150405") + ".log" + // handle logs directory creation + logsDir := config.GetLogsDir() + logFile, err := os.OpenFile(logsDir.Join(logFilename).String(), os.O_WRONLY|os.O_CREATE|os.O_SYNC|os.O_APPEND, 0644) + if err != nil { + log.Print("Cannot create file used for crash-report") + } else { + redirectStderr(logFile) + } + } - for i := 8990; i < 9001; i++ { - extraOriginStr = extraOriginStr + ", http://localhost:" + strconv.Itoa(i) + ", https://localhost:" + strconv.Itoa(i) - } + // macos agent launchd autostart + if runtime.GOOS == "darwin" { + if *autostartMacOS { + config.InstallPlistFile() + } else { + config.UninstallPlistFile() + } + } - r.Use(cors.Middleware(cors.Config{ - Origins: *origins + "," + extraOriginStr, - Methods: "GET, PUT, POST, DELETE", - RequestHeaders: "Origin, Authorization, Content-Type", - ExposedHeaders: "", - MaxAge: 50 * time.Second, - Credentials: true, - ValidateHeaders: false, - })) - - r.GET("/", homeHandler) - r.POST("/upload", uploadHandler) - r.GET("/socket.io/", socketHandler) - r.POST("/socket.io/", socketHandler) - r.Handle("WS", "/socket.io/", socketHandler) - r.Handle("WSS", "/socket.io/", socketHandler) - r.GET("/info", infoHandler) - go func() { - start := 8990 - end := 9000 - i := start - for i < end { - i = i + 1 - portSSL = ":" + strconv.Itoa(i) - if err := r.RunTLS(portSSL, filepath.Join(dest, "cert.pem"), filepath.Join(dest, "key.pem")); err != nil { - log.Printf("Error trying to bind to port: %v, so exiting...", err) - continue + // check if the HTTPS certificates are expired or expiring and prompt the user to update them on macOS + if runtime.GOOS == "darwin" && *installCerts { + if cert.CertInKeychain() || config.CertsExist() { + certDir := config.GetCertificatesDir() + if expired, err := cert.IsExpired(); err != nil { + log.Errorf("cannot check if certificates are expired something went wrong: %s", err) + } else if expired { + buttonPressed := utilities.UserPrompt("The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nYour certificate is expired or close to expiration. Do you want to update it?", "{\"Do not update\", \"Update the certificate for Safari\"}", "Update the certificate for Safari", "Update the certificate for Safari", "Arduino Agent: Update certificate") + if buttonPressed { + err := cert.UninstallCertificates() + if err != nil { + log.Errorf("cannot uninstall certificates something went wrong: %s", err) } else { - ip := "0.0.0.0" - log.Print("Starting server and websocket (SSL) on " + ip + "" + port) - break + cert.DeleteCertificates(certDir) + cert.GenerateAndInstallCertificates(certDir) } - } - }() - - go func() { - start := 8990 - end := 9000 - i := start - for i < end { - i = i + 1 - port = ":" + strconv.Itoa(i) - if err := r.Run(port); err != nil { - log.Printf("Error trying to bind to port: %v, so exiting...", err) - continue - } else { - ip := "0.0.0.0" - log.Print("Starting server and websocket on " + ip + "" + port) - break + } else { + err = config.SetInstallCertsIni(configPath.String(), "false") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) } } - }() + } + } else if promptInstallCertsSafari() { + // installing the certificates from scratch at this point should only happen if + // something went wrong during previous installation attempts + cert.GenerateAndInstallCertificates(config.GetCertificatesDir()) + } else { + err = config.SetInstallCertsIni(configPath.String(), "false") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } + } + } + + // launch the discoveries for the running system + go serialPorts.Run() + // launch the hub routine which is the singleton for the websocket server + go h.run() + // launch our dummy data routine + //go d.run() - }() + r := gin.New() + + socketHandler := wsHandler().ServeHTTP + + extraOrigins := []string{ + "https://create.arduino.cc", + "https://cloud.arduino.cc", + "https://app.arduino.cc", + "https://board-registration.arduino.cc", + "https://*.app.arduino.cc", } - setupSysTray() -} -var homeTemplate = template.Must(template.New("home").Parse(homeTemplateHtml)) + for i := 8990; i < 9001; i++ { + port := strconv.Itoa(i) + extraOrigins = append(extraOrigins, "http://localhost:"+port) + extraOrigins = append(extraOrigins, "https://localhost:"+port) + extraOrigins = append(extraOrigins, "http://127.0.0.1:"+port) + extraOrigins = append(extraOrigins, "https://127.0.0.1:"+port) + } -// If you navigate to this server's homepage, you'll get this HTML -// so you can directly interact with the serial port server -const homeTemplateHtml = ` - - -Serial Port Example - - - - - - -
-
- - - Pause
-
- - -` +func promptInstallCertsSafari() bool { + return utilities.UserPrompt("The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nIf you use Safari, you need to install it.", "{\"Do not install\", \"Install the certificate for Safari\"}", "Install the certificate for Safari", "Install the certificate for Safari", "Arduino Agent: Install certificate") +} diff --git a/main_test.go b/main_test.go new file mode 100644 index 000000000..1387fd221 --- /dev/null +++ b/main_test.go @@ -0,0 +1,226 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package main + +import ( + "bytes" + "crypto/x509" + "encoding/base64" + "encoding/json" + "encoding/pem" + "fmt" + "io" + "net/http" + "net/http/httptest" + "path/filepath" + "testing" + + "github.com/arduino/arduino-create-agent/config" + "github.com/arduino/arduino-create-agent/gen/tools" + "github.com/arduino/arduino-create-agent/globals" + "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/upload" + "github.com/arduino/arduino-create-agent/utilities" + v2 "github.com/arduino/arduino-create-agent/v2" + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/require" +) + +func TestValidSignatureKey(t *testing.T) { + testfile := filepath.Join("tests", "testdata", "test.ini") + args, err := parseIni(testfile) + require.NoError(t, err) + require.NotNil(t, args) + err = iniConf.Parse(args) + require.NoError(t, err) + print(*signatureKey) + block, _ := pem.Decode([]byte(*signatureKey)) + require.NotNil(t, block) + key, err := x509.ParsePKIXPublicKey(block.Bytes) + require.NoError(t, err) + require.NotNil(t, key) +} + +func TestUploadHandlerAgainstEvilFileNames(t *testing.T) { + r := gin.New() + r.POST("/", uploadHandler(utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey)))) + ts := httptest.NewServer(r) + + uploadEvilFileName := Upload{ + Port: "/dev/ttyACM0", + Board: "arduino:avr:uno", + Extra: upload.Extra{Network: true}, + Hex: []byte("test"), + Filename: "../evil.txt", + ExtraFiles: []additionalFile{{Hex: []byte("test"), Filename: "../evil.txt"}}, + } + uploadEvilExtraFile := Upload{ + Port: "/dev/ttyACM0", + Board: "arduino:avr:uno", + Extra: upload.Extra{Network: true}, + Hex: []byte("test"), + Filename: "file.txt", + ExtraFiles: []additionalFile{{Hex: []byte("test"), Filename: "../evil.txt"}}, + } + + for _, request := range []Upload{uploadEvilFileName, uploadEvilExtraFile} { + payload, err := json.Marshal(request) + require.NoError(t, err) + + resp, err := http.Post(ts.URL, "encoding/json", bytes.NewBuffer(payload)) + require.NoError(t, err) + require.Equal(t, http.StatusBadRequest, resp.StatusCode) + + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Contains(t, string(body), "unsafe path join") + } +} + +func TestUploadHandlerAgainstBase64WithoutPaddingMustFail(t *testing.T) { + r := gin.New() + r.POST("/", uploadHandler(utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey)))) + ts := httptest.NewServer(r) + defer ts.Close() + + // When calling the `BindJSON` func, when a json field will be Unmarshaled + // in a []byte type, we expect to receive a base64 padded string in input. + // In case we receive a base64 unpadded string BindJSON fails. + // The expectation here is that the upload handler won't continue with the + // upload operation. + base64ContentWithoutPadding := base64.RawStdEncoding.EncodeToString([]byte("test")) + payload := fmt.Sprintf(`{"hex": "%s"}`, base64ContentWithoutPadding) + + resp, err := http.Post(ts.URL, "encoding/json", bytes.NewBufferString(payload)) + require.NoError(t, err) + require.Equal(t, http.StatusBadRequest, resp.StatusCode) + + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Contains(t, string(body), "err with the payload. illegal base64 data at input") +} + +func TestInstallToolV2(t *testing.T) { + + indexURL := "https://downloads.arduino.cc/packages/package_index.json" + // Instantiate Index + Index := index.Init(indexURL, config.GetDataDir()) + + r := gin.New() + goa := v2.Server(config.GetDataDir().String(), Index, utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) + r.Any("/v2/*path", gin.WrapH(goa)) + ts := httptest.NewServer(r) + + type test struct { + request tools.ToolPayload + responseCode int + responseBody string + } + + bossacURL := "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz" + bossacChecksum := "SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100" + bossacSignature := "382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0" + bossacInstallURLOK := tools.ToolPayload{ + Name: "bossac", + Version: "1.7.0-arduino3", + Packager: "arduino", + URL: &bossacURL, + Checksum: &bossacChecksum, + Signature: &bossacSignature, + } + + esptoolURL := "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-linux-gnu.esptool-f80ae31.tar.gz" + esptoolChecksum := "SHA-256:bded1dca953377838b6086a9bcd40a1dc5286ba5f69f2372c22a1d1819baad24" + esptoolSignature := "852b58871419ce5e5633ecfaa72c0f0fa890ceb51164b362b8133bc0e3e003a21cec48935b8cdc078f4031219cbf17fb7edd9d7c9ca8ed85492911c9ca6353c9aa4691eb91fda99563a6bd49aeca0d9981fb05ec76e45c6024f8a6822862ad1e34ddc652fbbf4fa909887a255d4f087398ec386577efcec523c21203be3d10fc9e9b0f990a7536875a77dc2bc5cbffea7734b62238e31719111b718bacccebffc9be689545540e81d23b81caa66214376f58a0d6a45cf7efc5d3af62ab932b371628162fffe403906f41d5534921e5be081c5ac2ecc9db5caec03a105cc44b00ce19a95ad079843501eb8182e0717ce327867380c0e39d2b48698547fc1d0d66" + esptoolInstallURLOK := tools.ToolPayload{ + Name: "esptool", + Version: "2.5.0-3-20ed2b9", + Packager: "esp8266", + URL: &esptoolURL, + Checksum: &esptoolChecksum, + Signature: &esptoolSignature, + } + + wrongSignature := "wr0ngs1gn4tur3" + bossacInstallWrongSig := tools.ToolPayload{ + Name: "bossac", + Version: "1.7.0-arduino3", + Packager: "arduino", + URL: &bossacURL, + Checksum: &bossacChecksum, + Signature: &wrongSignature, + } + + wrongChecksum := "wr0ngch3cksum" + bossacInstallWrongCheck := tools.ToolPayload{ + Name: "bossac", + Version: "1.7.0-arduino3", + Packager: "arduino", + URL: &bossacURL, + Checksum: &wrongChecksum, + Signature: &bossacSignature, + } + + bossacInstallNoURL := tools.ToolPayload{ + Name: "bossac", + Version: "1.7.0-arduino3", + Packager: "arduino", + } + + tests := []test{ + {bossacInstallURLOK, http.StatusOK, "ok"}, + {bossacInstallWrongSig, http.StatusInternalServerError, "verification error"}, + {bossacInstallWrongCheck, http.StatusInternalServerError, "checksum of downloaded file doesn't match"}, + {bossacInstallNoURL, http.StatusOK, "ok"}, + {esptoolInstallURLOK, http.StatusOK, "ok"}, + } + + for _, test := range tests { + t.Run(fmt.Sprintf("Installing %s", test.request.Name), func(t *testing.T) { + payload, err := json.Marshal(test.request) + require.NoError(t, err) + + // for some reason the fronted sends requests with "text/plain" content type. + // Even if the request body contains a json object. + // With this test we verify is parsed correctly. + for _, encoding := range []string{"encoding/json", "text/plain"} { + resp, err := http.Post(ts.URL+"/v2/pkgs/tools/installed", encoding, bytes.NewBuffer(payload)) + require.NoError(t, err) + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Contains(t, string(body), test.responseBody) + require.Equal(t, test.responseCode, resp.StatusCode) + } + }) + } +} + +func TestInstalledHead(t *testing.T) { + indexURL := "https://downloads.arduino.cc/packages/package_index.json" + // Instantiate Index + Index := index.Init(indexURL, config.GetDataDir()) + + r := gin.New() + goa := v2.Server(config.GetDataDir().String(), Index, utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) + r.Any("/v2/*path", gin.WrapH(goa)) + ts := httptest.NewServer(r) + + resp, err := http.Head(ts.URL + "/v2/pkgs/tools/installed") + require.NoError(t, err) + require.NotEqual(t, resp.StatusCode, http.StatusMethodNotAllowed) + require.Equal(t, resp.StatusCode, http.StatusOK) +} diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 000000000..18843e033 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + PerMonitorV2, PerMonitor + True + + + \ No newline at end of file diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 000000000..8d932e078 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,345 @@ +[[package]] +name = "asyncio" +version = "3.4.3" +description = "reference implementation of PEP 3156" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "atomicwrites" +version = "1.4.0" +description = "Atomic file writes." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "attrs" +version = "20.3.0" +description = "Classes Without Boilerplate" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.extras] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"] +docs = ["furo", "sphinx", "zope.interface"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] + +[[package]] +name = "certifi" +version = "2020.12.5" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "chardet" +version = "3.0.4" +description = "Universal encoding detector for Python 2 and 3" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "colorama" +version = "0.4.4" +description = "Cross-platform colored terminal text." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "idna" +version = "2.10" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "iniconfig" +version = "1.1.1" +description = "iniconfig: brain-dead simple config-ini parsing" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "invoke" +version = "1.5.0" +description = "Pythonic task execution" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "packaging" +version = "20.9" +description = "Core utilities for Python packages" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +pyparsing = ">=2.0.2" + +[[package]] +name = "pluggy" +version = "0.13.1" +description = "plugin and hook calling mechanisms for python" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.extras] +dev = ["pre-commit", "tox"] + +[[package]] +name = "psutil" +version = "5.8.0" +description = "Cross-platform lib for process and system monitoring in Python." +category = "main" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.extras] +test = ["ipaddress", "mock", "unittest2", "enum34", "pywin32", "wmi"] + +[[package]] +name = "py" +version = "1.10.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "pyparsing" +version = "2.4.7" +description = "Python parsing module" +category = "main" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "pytest" +version = "6.2.5" +description = "pytest: simple powerful testing with Python" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} +attrs = ">=19.2.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +py = ">=1.8.2" +toml = "*" + +[package.extras] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] + +[[package]] +name = "python-engineio" +version = "3.14.2" +description = "Engine.IO server" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +six = ">=1.9.0" + +[package.extras] +asyncio_client = ["aiohttp (>=3.4)"] +client = ["requests (>=2.21.0)", "websocket-client (>=0.54.0)"] + +[[package]] +name = "python-socketio" +version = "4.6.1" +description = "Socket.IO server" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +python-engineio = ">=3.13.0,<4" +six = ">=1.9.0" + +[package.extras] +asyncio_client = ["aiohttp (>=3.4)", "websockets (>=7.0)"] +client = ["requests (>=2.21.0)", "websocket-client (>=0.54.0)"] + +[[package]] +name = "requests" +version = "2.25.1" +description = "Python HTTP for Humans." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +certifi = ">=2017.4.17" +chardet = ">=3.0.2,<5" +idna = ">=2.5,<3" +urllib3 = ">=1.21.1,<1.27" + +[package.extras] +security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)"] +socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] + +[[package]] +name = "six" +version = "1.15.0" +description = "Python 2 and 3 compatibility utilities" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +category = "main" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "urllib3" +version = "1.26.3" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" + +[package.extras] +brotli = ["brotlipy (>=0.6.0)"] +secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + +[metadata] +lock-version = "1.1" +python-versions = "^3.9" +content-hash = "d0635b74687a82bc83a3454d4ebc35c19a80d49cc28a6c632b47a54596ab31a3" + +[metadata.files] +asyncio = [ + {file = "asyncio-3.4.3-cp33-none-win32.whl", hash = "sha256:b62c9157d36187eca799c378e572c969f0da87cd5fc42ca372d92cdb06e7e1de"}, + {file = "asyncio-3.4.3-cp33-none-win_amd64.whl", hash = "sha256:c46a87b48213d7464f22d9a497b9eef8c1928b68320a2fa94240f969f6fec08c"}, + {file = "asyncio-3.4.3-py3-none-any.whl", hash = "sha256:c4d18b22701821de07bd6aea8b53d21449ec0ec5680645e5317062ea21817d2d"}, + {file = "asyncio-3.4.3.tar.gz", hash = "sha256:83360ff8bc97980e4ff25c964c7bd3923d333d177aa4f7fb736b019f26c7cb41"}, +] +atomicwrites = [ + {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, + {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, +] +attrs = [ + {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, + {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, +] +certifi = [ + {file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"}, + {file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"}, +] +chardet = [ + {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, + {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, +] +colorama = [ + {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, + {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, +] +idna = [ + {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, + {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, +] +iniconfig = [ + {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, + {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, +] +invoke = [ + {file = "invoke-1.5.0-py2-none-any.whl", hash = "sha256:da7c2d0be71be83ffd6337e078ef9643f41240024d6b2659e7b46e0b251e339f"}, + {file = "invoke-1.5.0-py3-none-any.whl", hash = "sha256:7e44d98a7dc00c91c79bac9e3007276965d2c96884b3c22077a9f04042bd6d90"}, + {file = "invoke-1.5.0.tar.gz", hash = "sha256:f0c560075b5fb29ba14dad44a7185514e94970d1b9d57dcd3723bec5fed92650"}, +] +packaging = [ + {file = "packaging-20.9-py2.py3-none-any.whl", hash = "sha256:67714da7f7bc052e064859c05c595155bd1ee9f69f76557e21f051443c20947a"}, + {file = "packaging-20.9.tar.gz", hash = "sha256:5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5"}, +] +pluggy = [ + {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, + {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, +] +psutil = [ + {file = "psutil-5.8.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:0066a82f7b1b37d334e68697faba68e5ad5e858279fd6351c8ca6024e8d6ba64"}, + {file = "psutil-5.8.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:0ae6f386d8d297177fd288be6e8d1afc05966878704dad9847719650e44fc49c"}, + {file = "psutil-5.8.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:12d844996d6c2b1d3881cfa6fa201fd635971869a9da945cf6756105af73d2df"}, + {file = "psutil-5.8.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:02b8292609b1f7fcb34173b25e48d0da8667bc85f81d7476584d889c6e0f2131"}, + {file = "psutil-5.8.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:6ffe81843131ee0ffa02c317186ed1e759a145267d54fdef1bc4ea5f5931ab60"}, + {file = "psutil-5.8.0-cp27-none-win32.whl", hash = "sha256:ea313bb02e5e25224e518e4352af4bf5e062755160f77e4b1767dd5ccb65f876"}, + {file = "psutil-5.8.0-cp27-none-win_amd64.whl", hash = "sha256:5da29e394bdedd9144c7331192e20c1f79283fb03b06e6abd3a8ae45ffecee65"}, + {file = "psutil-5.8.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:74fb2557d1430fff18ff0d72613c5ca30c45cdbfcddd6a5773e9fc1fe9364be8"}, + {file = "psutil-5.8.0-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:74f2d0be88db96ada78756cb3a3e1b107ce8ab79f65aa885f76d7664e56928f6"}, + {file = "psutil-5.8.0-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:99de3e8739258b3c3e8669cb9757c9a861b2a25ad0955f8e53ac662d66de61ac"}, + {file = "psutil-5.8.0-cp36-cp36m-win32.whl", hash = "sha256:36b3b6c9e2a34b7d7fbae330a85bf72c30b1c827a4366a07443fc4b6270449e2"}, + {file = "psutil-5.8.0-cp36-cp36m-win_amd64.whl", hash = "sha256:52de075468cd394ac98c66f9ca33b2f54ae1d9bff1ef6b67a212ee8f639ec06d"}, + {file = "psutil-5.8.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c6a5fd10ce6b6344e616cf01cc5b849fa8103fbb5ba507b6b2dee4c11e84c935"}, + {file = "psutil-5.8.0-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:61f05864b42fedc0771d6d8e49c35f07efd209ade09a5afe6a5059e7bb7bf83d"}, + {file = "psutil-5.8.0-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:0dd4465a039d343925cdc29023bb6960ccf4e74a65ad53e768403746a9207023"}, + {file = "psutil-5.8.0-cp37-cp37m-win32.whl", hash = "sha256:1bff0d07e76114ec24ee32e7f7f8d0c4b0514b3fae93e3d2aaafd65d22502394"}, + {file = "psutil-5.8.0-cp37-cp37m-win_amd64.whl", hash = "sha256:fcc01e900c1d7bee2a37e5d6e4f9194760a93597c97fee89c4ae51701de03563"}, + {file = "psutil-5.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6223d07a1ae93f86451d0198a0c361032c4c93ebd4bf6d25e2fb3edfad9571ef"}, + {file = "psutil-5.8.0-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d225cd8319aa1d3c85bf195c4e07d17d3cd68636b8fc97e6cf198f782f99af28"}, + {file = "psutil-5.8.0-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:28ff7c95293ae74bf1ca1a79e8805fcde005c18a122ca983abf676ea3466362b"}, + {file = "psutil-5.8.0-cp38-cp38-win32.whl", hash = "sha256:ce8b867423291cb65cfc6d9c4955ee9bfc1e21fe03bb50e177f2b957f1c2469d"}, + {file = "psutil-5.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:90f31c34d25b1b3ed6c40cdd34ff122b1887a825297c017e4cbd6796dd8b672d"}, + {file = "psutil-5.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6323d5d845c2785efb20aded4726636546b26d3b577aded22492908f7c1bdda7"}, + {file = "psutil-5.8.0-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:245b5509968ac0bd179287d91210cd3f37add77dad385ef238b275bad35fa1c4"}, + {file = "psutil-5.8.0-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:90d4091c2d30ddd0a03e0b97e6a33a48628469b99585e2ad6bf21f17423b112b"}, + {file = "psutil-5.8.0-cp39-cp39-win32.whl", hash = "sha256:ea372bcc129394485824ae3e3ddabe67dc0b118d262c568b4d2602a7070afdb0"}, + {file = "psutil-5.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:f4634b033faf0d968bb9220dd1c793b897ab7f1189956e1aa9eae752527127d3"}, + {file = "psutil-5.8.0.tar.gz", hash = "sha256:0c9ccb99ab76025f2f0bbecf341d4656e9c1351db8cc8a03ccd62e318ab4b5c6"}, +] +py = [ + {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, + {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, +] +pyparsing = [ + {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, + {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, +] +pytest = [ + {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, + {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, +] +python-engineio = [ + {file = "python-engineio-3.14.2.tar.gz", hash = "sha256:eab4553f2804c1ce97054c8b22cf0d5a9ab23128075248b97e1a5b2f29553085"}, + {file = "python_engineio-3.14.2-py2.py3-none-any.whl", hash = "sha256:5a9e6086d192463b04a1428ff1f85b6ba631bbb19d453b144ffc04f530542b84"}, +] +python-socketio = [ + {file = "python-socketio-4.6.1.tar.gz", hash = "sha256:cd1f5aa492c1eb2be77838e837a495f117e17f686029ebc03d62c09e33f4fa10"}, + {file = "python_socketio-4.6.1-py2.py3-none-any.whl", hash = "sha256:5a21da53fdbdc6bb6c8071f40e13d100e0b279ad997681c2492478e06f370523"}, +] +requests = [ + {file = "requests-2.25.1-py2.py3-none-any.whl", hash = "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e"}, + {file = "requests-2.25.1.tar.gz", hash = "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"}, +] +six = [ + {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, + {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, +] +toml = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] +urllib3 = [ + {file = "urllib3-1.26.3-py2.py3-none-any.whl", hash = "sha256:1b465e494e3e0d8939b50680403e3aedaa2bc434b7d5af64dfd3c958d7f5ae80"}, + {file = "urllib3-1.26.3.tar.gz", hash = "sha256:de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73"}, +] diff --git a/programmer.go b/programmer.go deleted file mode 100644 index 8d4a5b04f..000000000 --- a/programmer.go +++ /dev/null @@ -1,481 +0,0 @@ -package main - -import ( - "bufio" - "bytes" - "encoding/json" - "fmt" - log "github.com/Sirupsen/logrus" - "github.com/facchinm/go-serial" - "github.com/mattn/go-shellwords" - "github.com/sfreiberg/simplessh" - "io" - "mime/multipart" - "net/http" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - "strconv" - "strings" - "time" -) - -var compiling = false - -func colonToUnderscore(input string) string { - output := strings.Replace(input, ":", "_", -1) - return output -} - -type basicAuthData struct { - UserName string - Password string -} - -type boardExtraInfo struct { - use_1200bps_touch bool - wait_for_upload_port bool - networkPort bool - authdata basicAuthData -} - -// Scp uploads sourceFile to remote machine like native scp console app. -func Scp(client *simplessh.Client, sourceFile, targetFile string) error { - - session, err := client.SSHClient.NewSession() - if err != nil { - return err - } - defer session.Close() - - src, srcErr := os.Open(sourceFile) - - if srcErr != nil { - return srcErr - } - - srcStat, statErr := src.Stat() - - if statErr != nil { - return statErr - } - - go func() { - w, _ := session.StdinPipe() - - fmt.Fprintln(w, "C0644", srcStat.Size(), filepath.Base(targetFile)) - - if srcStat.Size() > 0 { - io.Copy(w, src) - fmt.Fprint(w, "\x00") - w.Close() - } else { - fmt.Fprint(w, "\x00") - w.Close() - } - - }() - - if err := session.Run("scp -t " + targetFile); err != nil { - return err - } - - return nil -} - -func spProgramSSHNetwork(portname string, boardname string, filePath string, commandline string, authdata basicAuthData) error { - log.Println("Starting network upload") - log.Println("Board Name: " + boardname) - - if authdata.UserName == "" { - authdata.UserName = "root" - } - - if authdata.Password == "" { - authdata.Password = "arduino" - } - - ssh_client, err := simplessh.ConnectWithPassword(portname+":22", authdata.UserName, authdata.Password) - if err != nil { - log.Println("Error connecting via ssh") - return err - } - defer ssh_client.Close() - - err = Scp(ssh_client, filePath, "/tmp/sketch"+filepath.Ext(filePath)) - if err != nil { - log.Printf("Upload: %s\n", err) - return err - } - - if commandline == "" { - // very special case for Yun (remove once AVR boards.txt is fixed) - commandline = "merge-sketch-with-bootloader.lua /tmp/sketch.hex && /usr/bin/run-avrdude /tmp/sketch.hex" - } - - fmt.Println(commandline) - - ssh_output, err := ssh_client.Exec(commandline) - if err == nil { - log.Printf("Flash: %s\n", ssh_output) - mapD := map[string]string{"ProgrammerStatus": "Busy", "Msg": string(ssh_output)} - mapB, _ := json.Marshal(mapD) - h.broadcastSys <- mapB - } - return err -} - -func spProgramNetwork(portname string, boardname string, filePath string, authdata basicAuthData) error { - - log.Println("Starting network upload") - log.Println("Board Name: " + boardname) - - if authdata.UserName == "" { - authdata.UserName = "root" - } - - if authdata.Password == "" { - authdata.Password = "arduino" - } - - // Prepare a form that you will submit to that URL. - _url := "http://" + portname + "/data/upload_sketch_silent" - var b bytes.Buffer - w := multipart.NewWriter(&b) - // Add your image file - filePath = strings.Trim(filePath, "\n") - f, err := os.Open(filePath) - if err != nil { - log.Println("Error opening file" + filePath + " err: " + err.Error()) - return err - } - fw, err := w.CreateFormFile("sketch_hex", filePath) - if err != nil { - log.Println("Error creating form file") - return err - } - if _, err = io.Copy(fw, f); err != nil { - log.Println("Error copying form file") - return err - } - // Add the other fields - if fw, err = w.CreateFormField("board"); err != nil { - log.Println("Error creating form field") - return err - } - if _, err = fw.Write([]byte(colonToUnderscore(boardname))); err != nil { - log.Println("Error writing form field") - return err - } - // Don't forget to close the multipart writer. - // If you don't close it, your request will be missing the terminating boundary. - w.Close() - - // Now that you have a form, you can submit it to your handler. - req, err := http.NewRequest("POST", _url, &b) - if err != nil { - log.Println("Error creating post request") - return err - } - // Don't forget to set the content type, this will contain the boundary. - req.Header.Set("Content-Type", w.FormDataContentType()) - if authdata.UserName != "" { - req.SetBasicAuth(authdata.UserName, authdata.Password) - } - - //h.broadcastSys <- []byte("Start flashing with command " + cmdString) - log.Printf("Network flashing on " + portname) - mapD := map[string]string{"ProgrammerStatus": "Starting", "Cmd": "POST"} - mapB, _ := json.Marshal(mapD) - h.broadcastSys <- mapB - - // Submit the request - client := &http.Client{} - res, err := client.Do(req) - if err != nil { - log.Println("Error during post request") - return err - } - - // Check the response - if res.StatusCode != http.StatusOK { - log.Errorf("bad status: %s", res.Status) - err = fmt.Errorf("bad status: %s", res.Status) - } - return err -} - -func spProgramLocal(portname string, boardname string, filePath string, commandline string, extraInfo boardExtraInfo) error { - - var err error - if extraInfo.use_1200bps_touch { - portname, err = touch_port_1200bps(portname, extraInfo.wait_for_upload_port) - } - - if err != nil { - log.Println("Could not touch the port") - return err - } - - log.Printf("Received commandline (unresolved):" + commandline) - - commandline = strings.Replace(commandline, "{build.path}", filepath.ToSlash(filepath.Dir(filePath)), 1) - commandline = strings.Replace(commandline, "{build.project_name}", strings.TrimSuffix(filepath.Base(filePath), filepath.Ext(filepath.Base(filePath))), 1) - commandline = strings.Replace(commandline, "{serial.port}", portname, 1) - commandline = strings.Replace(commandline, "{serial.port.file}", filepath.Base(portname), 1) - - // search for runtime variables and replace with values from globalToolsMap - var runtimeRe = regexp.MustCompile("\\{(.*?)\\}") - runtimeVars := runtimeRe.FindAllString(commandline, -1) - - fmt.Println(runtimeVars) - - for _, element := range runtimeVars { - commandline = strings.Replace(commandline, element, globalToolsMap[element], 1) - } - - z, _ := shellwords.Parse(commandline) - return spHandlerProgram(z[0], z[1:]) -} - -func spProgramRW(portname string, boardname string, filePath string, commandline string, extraInfo boardExtraInfo) { - compiling = true - - defer func() { - time.Sleep(1500 * time.Millisecond) - compiling = false - }() - - var err error - - if extraInfo.networkPort { - err = spProgramNetwork(portname, boardname, filePath, extraInfo.authdata) - if err != nil { - // no http method available, try ssh upload - err = spProgramSSHNetwork(portname, boardname, filePath, commandline, extraInfo.authdata) - } - } else { - err = spProgramLocal(portname, boardname, filePath, commandline, extraInfo) - } - - if err != nil { - log.Printf("Command finished with error: %v", err) - mapD := map[string]string{"ProgrammerStatus": "Error", "Msg": "Could not program the board"} - mapB, _ := json.Marshal(mapD) - h.broadcastSys <- mapB - } else { - log.Printf("Finished without error. Good stuff") - mapD := map[string]string{"ProgrammerStatus": "Done", "Flash": "Ok"} - mapB, _ := json.Marshal(mapD) - h.broadcastSys <- mapB - // analyze stdin - } -} - -var oscmd *exec.Cmd - -func spHandlerProgram(flasher string, cmdString []string) error { - - // if runtime.GOOS == "darwin" { - // sh, _ := exec.LookPath("sh") - // // prepend the flasher to run it via sh - // cmdString = append([]string{flasher}, cmdString...) - // oscmd = exec.Command(sh, cmdString...) - // } else { - - // remove quotes form flasher command and cmdString - flasher = strings.Replace(flasher, "\"", "", -1) - - for index, _ := range cmdString { - cmdString[index] = strings.Replace(cmdString[index], "\"", "", -1) - } - - extension := "" - if runtime.GOOS == "windows" { - extension = ".exe" - } - - oscmd = exec.Command(flasher, cmdString...) - - tellCommandNotToSpawnShell(oscmd) - - stdout, err := oscmd.StdoutPipe() - if err != nil { - return err - } - - stderr, err := oscmd.StderrPipe() - if err != nil { - return err - } - - multi := io.MultiReader(stderr, stdout) - - // Stdout buffer - //var cmdOutput []byte - - //h.broadcastSys <- []byte("Start flashing with command " + cmdString) - log.Printf("Flashing with command:" + flasher + extension + " " + strings.Join(cmdString, " ")) - mapD := map[string]string{"ProgrammerStatus": "Starting", "Cmd": strings.Join(cmdString, " ")} - mapB, _ := json.Marshal(mapD) - h.broadcastSys <- mapB - - err = oscmd.Start() - - in := bufio.NewScanner(multi) - - in.Split(bufio.ScanLines) - - for in.Scan() { - log.Info(in.Text()) - mapD := map[string]string{"ProgrammerStatus": "Busy", "Msg": in.Text()} - mapB, _ := json.Marshal(mapD) - h.broadcastSys <- mapB - } - - err = oscmd.Wait() - - return err -} - -func spHandlerProgramKill() { - - // Kill the process if there is one running - if oscmd != nil && oscmd.Process.Pid > 0 { - h.broadcastSys <- []byte("{\"ProgrammerStatus\": \"PreKilled\", \"Pid\": " + strconv.Itoa(oscmd.Process.Pid) + ", \"ProcessState\": \"" + oscmd.ProcessState.String() + "\"}") - oscmd.Process.Kill() - h.broadcastSys <- []byte("{\"ProgrammerStatus\": \"Killed\", \"Pid\": " + strconv.Itoa(oscmd.Process.Pid) + ", \"ProcessState\": \"" + oscmd.ProcessState.String() + "\"}") - - } else { - if oscmd != nil { - h.broadcastSys <- []byte("{\"ProgrammerStatus\": \"KilledError\", \"Msg\": \"No current process\", \"Pid\": " + strconv.Itoa(oscmd.Process.Pid) + ", \"ProcessState\": \"" + oscmd.ProcessState.String() + "\"}") - } else { - h.broadcastSys <- []byte("{\"ProgrammerStatus\": \"KilledError\", \"Msg\": \"No current process\"}") - } - } -} - -func formatCmdline(cmdline string, boardOptions map[string]string) (string, bool) { - - list := strings.Split(cmdline, "{") - if len(list) == 1 { - return cmdline, false - } - cmdline = "" - for _, item := range list { - item_s := strings.Split(item, "}") - item = boardOptions[item_s[0]] - if len(item_s) == 2 { - cmdline += item + item_s[1] - } else { - if item != "" { - cmdline += item - } else { - cmdline += item_s[0] - } - } - } - log.Println(cmdline) - return cmdline, true -} - -func containsStr(s []string, e string) bool { - for _, a := range s { - if a == e { - return true - } - } - return false -} - -func findNewPortName(slice1 []string, slice2 []string) string { - m := map[string]int{} - - for _, s1Val := range slice1 { - m[s1Val] = 1 - } - for _, s2Val := range slice2 { - m[s2Val] = m[s2Val] + 1 - } - - for mKey, mVal := range m { - if mVal == 1 { - return mKey - } - } - - return "" -} - -func touch_port_1200bps(portname string, wait_for_upload_port bool) (string, error) { - initialPortName := portname - log.Println("Restarting in bootloader mode") - - before_reset_ports, _ := serial.GetPortsList() - log.Println(before_reset_ports) - - var ports []string - - mode := &serial.Mode{ - BaudRate: 1200, - Vmin: 0, - Vtimeout: 1, - } - port, err := serial.OpenPort(portname, mode) - if err != nil { - log.Println(err) - return "", err - } - err = port.SetDTR(false) - if err != nil { - log.Println(err) - } - port.Close() - - timeout := false - go func() { - time.Sleep(10 * time.Second) - timeout = true - }() - - // wait for port to disappear - if wait_for_upload_port { - for { - ports, _ = serial.GetPortsList() - log.Println(ports) - portname = findNewPortName(ports, before_reset_ports) - if portname != "" { - break - } - if timeout { - break - } - time.Sleep(time.Millisecond * 100) - } - } - - // wait for port to reappear - if wait_for_upload_port { - after_reset_ports, _ := serial.GetPortsList() - log.Println(after_reset_ports) - for { - ports, _ = serial.GetPortsList() - log.Println(ports) - portname = findNewPortName(ports, after_reset_ports) - if portname != "" { - break - } - if timeout { - break - } - time.Sleep(time.Millisecond * 100) - } - } - - if portname == "" { - portname = initialPortName - } - return portname, nil -} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..9e087f2fb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[tool.poetry] +name = "arduino-create-agent" +version = "0.1.0" +description = "Project used to run end-to-end test for the Arduino Create Agent" +authors = ["Umberto Baldi ", "Maurizio Branca "] +license = "GPLv2" + +[tool.poetry.dependencies] +python = "^3.9" +psutil = "^5.8.0" +pytest = "^6.2.2" +requests = "^2.25.1" +invoke = "^1.5.0" +asyncio = "^3.4.3" +python-socketio = "^4" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +filterwarnings = [ + "ignore::DeprecationWarning:invoke.loader" # https://github.com/pyinvoke/invoke/issues/675 +] \ No newline at end of file diff --git a/queue.go b/queue.go deleted file mode 100644 index 014835116..000000000 --- a/queue.go +++ /dev/null @@ -1,143 +0,0 @@ -// -// queue.go -// -// Created by Hicham Bouabdallah -// Copyright (c) 2012 SimpleRocket LLC -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -package main - -import "sync" - -type queuenode struct { - data string - id string - next *queuenode -} - -// A go-routine safe FIFO (first in first out) data stucture. -type Queue struct { - head *queuenode - tail *queuenode - count int - lock *sync.Mutex - lenOfCmds int -} - -// Creates a new pointer to a new queue. -func NewQueue() *Queue { - q := &Queue{} - q.lock = &sync.Mutex{} - return q -} - -// Returns the number of elements in the queue (i.e. size/length) -// go-routine safe. -func (q *Queue) Len() int { - q.lock.Lock() - defer q.lock.Unlock() - return q.count -} - -// Returns the length of the data (gcode cmd) in the queue (i.e. size/length) -// go-routine safe. -func (q *Queue) LenOfCmds() int { - q.lock.Lock() - defer q.lock.Unlock() - return q.lenOfCmds -} - -// Pushes/inserts a value at the end/tail of the queue. -// Note: this function does mutate the queue. -// go-routine safe. -func (q *Queue) Push(item string, id string) { - q.lock.Lock() - defer q.lock.Unlock() - - n := &queuenode{data: item, id: id} - - if q.tail == nil { - q.tail = n - q.head = n - } else { - q.tail.next = n - q.tail = n - } - q.count++ - q.lenOfCmds += len(item) -} - -// Returns the value at the front of the queue. -// i.e. the oldest value in the queue. -// Note: this function does mutate the queue. -// go-routine safe. -func (q *Queue) Poll() (string, string) { - q.lock.Lock() - defer q.lock.Unlock() - - if q.head == nil { - return "", "" - } - - n := q.head - q.head = n.next - - if q.head == nil { - q.tail = nil - } - q.count-- - q.lenOfCmds -= len(n.data) - - return n.data, n.id -} - -// Returns a read value at the front of the queue. -// i.e. the oldest value in the queue. -// Note: this function does NOT mutate the queue. -// go-routine safe. -func (q *Queue) Peek() (string, string) { - q.lock.Lock() - defer q.lock.Unlock() - - n := q.head - if n == nil || n.data == "" { - return "", "" - } - - return n.data, n.id -} - -// Returns a read value at the front of the queue. -// i.e. the oldest value in the queue. -// Note: this function does NOT mutate the queue. -// go-routine safe. -func (q *Queue) Delete() { - q.lock.Lock() - defer q.lock.Unlock() - - q.head = nil - q.tail = nil - q.count = 0 - q.lenOfCmds = 0 -} diff --git a/redirect_stderr_unix.go b/redirect_stderr_unix.go new file mode 100644 index 000000000..ed3e3f988 --- /dev/null +++ b/redirect_stderr_unix.go @@ -0,0 +1,35 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Log the panic under unix to the log file + +//go:build !windows + +package main + +import ( + "log" + "os" + + "golang.org/x/sys/unix" +) + +// redirectStderr to the file passed in +func redirectStderr(f *os.File) { + err := unix.Dup2(int(f.Fd()), int(os.Stderr.Fd())) + if err != nil { + log.Fatalf("Failed to redirect stderr to file: %v", err) + } +} diff --git a/redirect_stderr_win.go b/redirect_stderr_win.go new file mode 100644 index 000000000..19279c756 --- /dev/null +++ b/redirect_stderr_win.go @@ -0,0 +1,41 @@ +// Log the panic under windows to the log file +// +// Code from minix, via +// +// https://play.golang.org/p/kLtct7lSUg + +//go:build windows + +package main + +import ( + "log" + "os" + "syscall" +) + +var ( + kernel32 = syscall.MustLoadDLL("kernel32.dll") + procSetStdHandle = kernel32.MustFindProc("SetStdHandle") +) + +func setStdHandle(stdhandle int32, handle syscall.Handle) error { + r0, _, e1 := syscall.Syscall(procSetStdHandle.Addr(), 2, uintptr(stdhandle), uintptr(handle), 0) + if r0 == 0 { + if e1 != 0 { + return error(e1) + } + return syscall.EINVAL + } + return nil +} + +// redirectStderr to the file passed in +func redirectStderr(f *os.File) { + err := setStdHandle(syscall.STD_ERROR_HANDLE, syscall.Handle(f.Fd())) + if err != nil { + log.Fatalf("Failed to redirect stderr to file: %v", err) + } + // SetStdHandle does not affect prior references to stderr + os.Stderr = f +} diff --git a/serial.go b/serial.go index c111ee016..1a43f3644 100755 --- a/serial.go +++ b/serial.go @@ -1,86 +1,48 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + // Supports Windows, Linux, Mac, BeagleBone Black, and Raspberry Pi package main import ( "encoding/json" - "fmt" - log "github.com/Sirupsen/logrus" - "regexp" - "runtime/debug" + "slices" "strconv" "strings" + "sync" "time" -) - -type writeRequest struct { - p *serport - d string - buffer bool - id string -} - -type writeRequestJson struct { - p *serport - P string - Data []writeRequestJsonData -} - -type writeRequestJsonData struct { - D string - Id string - Buf string -} -type qReportJson struct { - Cmd string - QCnt int - P string - Data []qReportJsonData -} - -type qReportJsonData struct { - D string - Id string - Buf string `json:"-"` - Parts int `json:"-"` -} - -type qReport struct { - Cmd string - QCnt int - Type []string `json:"-"` - Ids []string - D []string //`json:"-"` - Port string -} + discovery "github.com/arduino/pluggable-discovery-protocol-handler/v2" + "github.com/sirupsen/logrus" +) type serialhub struct { // Opened serial ports. - ports map[*serport]bool - - //open chan *io.ReadWriteCloser - //write chan *serport, chan []byte - write chan writeRequest - //read chan []byte + ports map[string]*serport - writeJson chan writeRequestJson - - // Register requests from the connections. - register chan *serport - - // Unregister requests from connections. - unregister chan *serport - - // regexp for json trimming - reJsonTrim *regexp.Regexp + mu sync.Mutex } -type SpPortList struct { - Ports []SpPortItem - Network bool +// SerialPortList is the serial port list +type SerialPortList struct { + Ports []*SpPortItem + portsLock sync.Mutex } +// SpPortItem is the serial port item type SpPortItem struct { Name string SerialNumber string @@ -90,620 +52,253 @@ type SpPortItem struct { Baud int BufferAlgorithm string Ver string - NetworkPort bool VendorID string ProductID string } -// SerialPorts contains the ports attached to the machine -var SerialPorts SpPortList - -// NetworkPorts contains the ports on the network -var NetworkPorts SpPortList +// serialPorts contains the ports attached to the machine +var serialPorts SerialPortList var sh = serialhub{ - //write: make(chan *serport, chan []byte), - write: make(chan writeRequest), - writeJson: make(chan writeRequestJson), - register: make(chan *serport), - unregister: make(chan *serport), - ports: make(map[*serport]bool), - reJsonTrim: regexp.MustCompile("sendjson"), + ports: make(map[string]*serport), } -func (sh *serialhub) run() { - - log.Print("Inside run of serialhub") - //cmdIdCtr := 0 - - //s := ser.open() - //ser.s := s - //ser.write(s, []byte("hello serial data")) - for { - select { - case p := <-sh.register: - log.Print("Registering a port: ", p.portConf.Name) - isPrimary := "false" - if p.IsPrimary { - isPrimary = "true" - } - h.broadcastSys <- []byte("{\"Cmd\":\"Open\",\"Desc\":\"Got register/open on port.\",\"Port\":\"" + p.portConf.Name + "\",\"IsPrimary\":" + isPrimary + ",\"Baud\":" + strconv.Itoa(p.portConf.Baud) + ",\"BufferType\":\"" + p.BufferType + "\"}") - //log.Print(p.portConf.Name) - sh.ports[p] = true - case p := <-sh.unregister: - log.Print("Unregistering a port: ", p.portConf.Name) - h.broadcastSys <- []byte("{\"Cmd\":\"Close\",\"Desc\":\"Got unregister/close on port.\",\"Port\":\"" + p.portConf.Name + "\",\"Baud\":" + strconv.Itoa(p.portConf.Baud) + "}") - delete(sh.ports, p) - close(p.sendBuffered) - close(p.sendNoBuf) - case wrj := <-sh.writeJson: - // if the user sent in the commands as json - writeJson(wrj) - - case wr := <-sh.write: - // if user sent in the commands as one text mode line - write(wr, "") - } - } +// Register serial ports from the connections. +func (sh *serialhub) Register(port *serport) { + sh.mu.Lock() + //log.Print("Registering a port: ", p.portConf.Name) + h.broadcastSys <- []byte("{\"Cmd\":\"Open\",\"Desc\":\"Got register/open on port.\",\"Port\":\"" + port.portConf.Name + "\",\"Baud\":" + strconv.Itoa(port.portConf.Baud) + ",\"BufferType\":\"" + port.BufferType + "\"}") + sh.ports[port.portName] = port + sh.mu.Unlock() } -func writeJson(wrj writeRequestJson) { - // we'll parse this json request and then do a write() as if - // the cmd was sent in as text mode - - // create array to hold our qReportJsonData - qReportDataArr := []qReportJsonData{} - - for _, cmdJson := range wrj.Data { - var wr writeRequest - wr.d = cmdJson.D //[]byte(cmdJson.D) - //wr.id = cmdJson.Id - wr.p = wrj.p - if cmdJson.Buf == "Buf" { - wr.buffer = true - } else if cmdJson.Buf == "NoBuf" { - wr.buffer = false - } else { - wr.buffer = true - } - //write(wr, cmdJson.Id, true) - - // we are sending 1 cmd in, but we may get back multiple cmds - // because the BreakApartCommands() can add/modify stuff, so keep - // that in mind - cmds, idArr, bufTypeArr := createCommands(wr, cmdJson.Id) - - for index, _ := range cmds { - // create q report data - cmdId := idArr[index] - // append stuff to the id if this cmd was one line and just got broken up - // the first line will have a normal id like "123" - // the 2nd, 3rd,e tc line will have id like "123-part-2-3", "123-part-3-3" - if index > 0 { - cmdId = fmt.Sprintf("%v-part-%v-%v", cmdId, (index + 1), len(cmds)) - } - qrd := qReportJsonData{D: cmds[index], Id: cmdId, Parts: len(cmds)} - // if user forced the buffer type, just use it - if cmdJson.Buf == "Buf" || cmdJson.Buf == "NoBuf" { - qrd.Buf = cmdJson.Buf - } else { - // else use the buffer type figured out in createCommands() - qrd.Buf = bufTypeArr[index] - } - qReportDataArr = append(qReportDataArr, qrd) +// Unregister requests from connections. +func (sh *serialhub) Unregister(port *serport) { + sh.mu.Lock() + //log.Print("Unregistering a port: ", p.portConf.Name) + h.broadcastSys <- []byte("{\"Cmd\":\"Close\",\"Desc\":\"Got unregister/close on port.\",\"Port\":\"" + port.portConf.Name + "\",\"Baud\":" + strconv.Itoa(port.portConf.Baud) + "}") + delete(sh.ports, port.portName) + close(port.sendBuffered) + close(port.sendNoBuf) + sh.mu.Unlock() +} - } +func (sh *serialhub) FindPortByName(portname string) (*serport, bool) { + sh.mu.Lock() + defer sh.mu.Unlock() + port, ok := sh.ports[portname] + return port, ok +} - } +// List broadcasts a Json representation of the ports found +func (sp *SerialPortList) List() { + sp.portsLock.Lock() + ls, err := json.MarshalIndent(sp, "", "\t") + sp.portsLock.Unlock() - // do our own report - qr := qReportJson{ - Cmd: "Queued", - Data: qReportDataArr, - QCnt: wrj.p.itemsInBuffer, - P: wrj.p.portConf.Name, - } - json, _ := json.Marshal(qr) - h.broadcastSys <- json - - // now send off the commands to the appropriate channel - for _, qrd := range qReportDataArr { - - if qrd.Buf == "Buf" { - //log.Println("Json sending to wr.p.sendBuffered") - wrj.p.sendBuffered <- Cmd{qrd.D, qrd.Id, false, false} - } else { - log.Println("Json sending to wr.p.sendNoBuf") - wrj.p.sendNoBuf <- Cmd{qrd.D, qrd.Id, true, false} - } + if err != nil { + //log.Println(err) + h.broadcastSys <- []byte("Error creating json on port list " + + err.Error()) + } else { + h.broadcastSys <- ls } +} + +// Run is the main loop for port discovery and management +func (sp *SerialPortList) Run() { + for retries := 0; retries < 10; retries++ { + sp.runSerialDiscovery() - // garbage collect - if *gcType == "max" { - debug.FreeOSMemory() + logrus.Errorf("Serial discovery stopped working, restarting it in 10 seconds...") + time.Sleep(10 * time.Second) } + logrus.Errorf("Failed restarting serial discovery. Giving up...") } -func write(wr writeRequest, id string) { - cmds, idArr, bufTypeArr := createCommands(wr, id) - - qr := qReport{ - Cmd: "Queued", - //Type: bufTypeArr, - Ids: idArr, - D: cmds, - QCnt: wr.p.itemsInBuffer, - Port: wr.p.portConf.Name, +func (sp *SerialPortList) runSerialDiscovery() { + // First ensure that all the discoveries are available + if err := Tools.Download("builtin", "serial-discovery", "latest", "keep"); err != nil { + logrus.Errorf("Error downloading serial-discovery: %s", err) + panic(err) } - json, _ := json.Marshal(qr) - h.broadcastSys <- json - - // now send off the commands to the appropriate channel - for index, cmdToSendToChannel := range cmds { - //cmdIdCtr++ - //cmdId := "fakeid-" + strconv.Itoa(cmdIdCtr) - cmdId := idArr[index] - if bufTypeArr[index] == "Buf" { - log.Println("Send was normal send, so sending to wr.p.sendBuffered") - wr.p.sendBuffered <- Cmd{cmdToSendToChannel, cmdId, false, false} - } else { - log.Println("Send was sendnobuf, so sending to wr.p.sendNoBuf") - wr.p.sendNoBuf <- Cmd{cmdToSendToChannel, cmdId, true, false} - } + sd, err := Tools.GetLocation("serial-discovery") + if err != nil { + logrus.Errorf("Error downloading serial-discovery: %s", err) + panic(err) + } + d := discovery.NewClient("serial", sd+"/serial-discovery") + dLogger := logrus.WithField("discovery", "serial") + if *verbose { + d.SetLogger(dLogger) } + d.SetUserAgent("arduino-create-agent/" + version) + if err := d.Run(); err != nil { + logrus.Errorf("Error running serial-discovery: %s", err) + panic(err) + } + defer d.Quit() - // garbage collect - if *gcType == "max" { - debug.FreeOSMemory() + events, err := d.StartSync(10) + if err != nil { + logrus.Errorf("Error starting event watcher on serial-discovery: %s", err) + panic(err) } -} + logrus.Infof("Serial discovery started, watching for events") + for ev := range events { + logrus.WithField("event", ev).Debugf("Serial discovery event") + switch ev.Type { + case "add": + sp.add(ev.Port) + case "remove": + sp.remove(ev.Port) + } + } -func createCommands(wr writeRequest, id string) ([]string, []string, []string) { - //log.Print("Got a write to a port") - //log.Print("Port: ", string(wr.p.portConf.Name)) - //log.Print(wr.p) - //log.Print("Data is: ") - //log.Println(wr.d) - //log.Print("Data:" + string(wr.d)) - //log.Print("-----") - log.Printf("Got write to id:%v, port:%v, buffer:%v, data:%v", id, wr.p.portConf.Name, wr.buffer, string(wr.d)) - - dataCmd := string(wr.d) - - // break the data into individual commands for queuing - // this is important because: - // 1) we could be sent multiple serial commands at once and the - // serial device may want them sent in smaller chunks to give - // better feedback. For example, if we're sent G0 X0\nG0 Y10\n we - // could happily send that to a CNC controller like a TinyG. However, - // on something like TinyG that would chew up 2 buffer planners. So, - // to better match what will happen, we break those into 2 commands - // so we get a better granularity of getting back qr responses or - // other feedback. - // 2) we need to break apart specific commands potentially that do - // not need newlines. For example, on TinyG we need !~% to be different - // commands because we need to pivot off of what they mean. ! means pause - // the sending. So, we need that command as its own command in order of - // how they were sent to us. - cmds := wr.p.bufferwatcher.BreakApartCommands(dataCmd) - dataArr := []string{} - bufTypeArr := []string{} - idArr := []string{} - for _, cmd := range cmds { - - // push this cmd onto dataArr for reporting - dataArr = append(dataArr, cmd) - idArr = append(idArr, id) - - // do extra check to see if certain command should wipe out - // the entire internal serial port buffer we're holding in wr.p.sendBuffered - wipeBuf := wr.p.bufferwatcher.SeeIfSpecificCommandsShouldWipeBuffer(cmd) - if wipeBuf { - log.Printf("We got a command that is asking us to wipe the sendBuffered buf. cmd:%v\n", cmd) - // just wipe out the current channel and create new - // hopefully garbage collection works here - - // close the channel - //close(wr.p.sendBuffered) - - // consume all stuff queued - func() { - ctr := 0 - /* - for data := range wr.p.sendBuffered { - log.Printf("Consuming sendBuffered queue. d:%v\n", string(data)) - ctr++ - }*/ - - keepLooping := true - for keepLooping { - select { - case d, ok := <-wr.p.sendBuffered: - log.Printf("Consuming sendBuffered queue. ok:%v, d:%v, id:%v\n", ok, string(d.data), string(d.id)) - ctr++ - // since we just consumed a buffer item, we need to decrement bufcount - // we are doing this artificially because we artifically threw - // away what was in the bufer - wr.p.itemsInBuffer-- - if ok == false { - keepLooping = false - } - default: - keepLooping = false - log.Println("Hit default in select clause") - } - } - log.Printf("Done consuming sendBuffered cmds. ctr:%v\n", ctr) - }() - - // we still will likely have a sendBuffered that is in the BlockUntilReady() - // that we have to deal with so it doesn't send to the serial port - // when we release it - // send semaphore release if there is one on the BlockUntilReady() - // this method will release the BlockUntilReady() but with an unblock - // of type 2 which means cancel the send - wr.p.bufferwatcher.ReleaseLock() - - // let user know we wiped queue - log.Printf("itemsInBuffer:%v\n", wr.p.itemsInBuffer) - h.broadcastSys <- []byte("{\"Cmd\":\"WipedQueue\",\"QCnt\":" + strconv.Itoa(wr.p.itemsInBuffer) + ",\"Port\":\"" + wr.p.portConf.Name + "\"}") + sp.reset() + logrus.Errorf("Serial discovery stopped.") +} - } +func (sp *SerialPortList) reset() { + sp.portsLock.Lock() + defer sp.portsLock.Unlock() + sp.Ports = []*SpPortItem{} +} - // do extra check to see if any specific commands should pause - // the buffer. this means we'll trigger a BlockUntilReady() block - pauseBuf := wr.p.bufferwatcher.SeeIfSpecificCommandsShouldPauseBuffer(cmd) - if pauseBuf { - log.Printf("We need to pause our internal buffer.\n") - wr.p.bufferwatcher.Pause() - } +func (sp *SerialPortList) add(addedPort *discovery.Port) { + if addedPort.Protocol != "serial" { + return + } + props := addedPort.Properties + if !props.ContainsKey("vid") { + return + } + vid, pid := props.Get("vid"), props.Get("pid") + if vid == "0x0000" || pid == "0x0000" { + return + } + if portsFilter != nil && !portsFilter.MatchString(addedPort.Address) { + logrus.Debugf("ignoring port not matching filter. port: %v\n", addedPort.Address) + return + } - // do extra check to see if any specific commands should unpause - // the buffer. this means we'll release the BlockUntilReady() block - unpauseBuf := wr.p.bufferwatcher.SeeIfSpecificCommandsShouldUnpauseBuffer(cmd) - if unpauseBuf { - log.Printf("We need to unpause our internal buffer.\n") - wr.p.bufferwatcher.Unpause() - } + sp.portsLock.Lock() + defer sp.portsLock.Unlock() - // do extra check to see if certain commands for this buffer type - // should skip the internal serial port buffering - // for example ! on tinyg and grbl should skip - typeBuf := "" // set in if stmt below for reporting afterwards - - if wr.buffer { - bufferSkip := wr.p.bufferwatcher.SeeIfSpecificCommandsShouldSkipBuffer(cmd) - if bufferSkip { - log.Printf("Forcing this cmd to skip buffer. cmd:%v\n", cmd) - //wr.buffer = false - typeBuf = "NoBuf" - } else { - typeBuf = "Buf" - } - } else { - typeBuf = "NoBuf" + // If the port is already in the list, just update the metadata... + for _, oldPort := range sp.Ports { + if oldPort.Name == addedPort.Address { + oldPort.SerialNumber = props.Get("serialNumber") + oldPort.VendorID = vid + oldPort.ProductID = pid + return } - - /* - if wr.buffer { - //log.Println("Send was normal send, so sending to wr.p.sendBuffered") - //wr.p.sendBuffered <- []byte(cmd) - typeBuf = "Buf" - } else { - //log.Println("Send was sendnobuf, so sending to wr.p.sendNoBuf") - //wr.p.sendNoBuf <- []byte(cmd) - typeBuf = "NoBuf" - } - */ - // increment queue counter for reporting - wr.p.itemsInBuffer++ - log.Printf("itemsInBuffer:%v\n", wr.p.itemsInBuffer) - - // push the type of this command to bufTypeArr - bufTypeArr = append(bufTypeArr, typeBuf) - - } // for loop on broken apart commands - - return cmds, idArr, bufTypeArr + } + // ...otherwise, add it to the list + sp.Ports = append(sp.Ports, &SpPortItem{ + Name: addedPort.Address, + SerialNumber: props.Get("serialNumber"), + VendorID: vid, + ProductID: pid, + Ver: version, + IsOpen: false, + IsPrimary: false, + Baud: 0, + BufferAlgorithm: "", + }) } -func writeToChannels(cmds []string, idArr []string, bufTypeArr []string) { +func (sp *SerialPortList) remove(removedPort *discovery.Port) { + sp.portsLock.Lock() + defer sp.portsLock.Unlock() + // Remove the port from the list + sp.Ports = slices.DeleteFunc(sp.Ports, func(oldPort *SpPortItem) bool { + return oldPort.Name == removedPort.Address + }) } -// spList broadcasts a Json representation of the ports found -func spList(network bool) { - var list SpPortList - if network { - list = NetworkPorts - } else { - list = SerialPorts - } - ls, err := json.MarshalIndent(list, "", "\t") - if err != nil { - log.Println(err) - h.broadcastSys <- []byte("Error creating json on port list " + - err.Error()) - } else { - h.broadcastSys <- ls +// MarkPortAsOpened marks a port as opened by the user +func (sp *SerialPortList) MarkPortAsOpened(portname string) { + sp.portsLock.Lock() + defer sp.portsLock.Unlock() + port := sp.getPortByName(portname) + if port != nil { + port.IsOpen = true } } -// discoverLoop periodically update the list of ports found -func discoverLoop() { - SerialPorts.Network = false - SerialPorts.Ports = make([]SpPortItem, 0) - NetworkPorts.Network = true - NetworkPorts.Ports = make([]SpPortItem, 0) - - go func() { - for { - if !compiling { - spListDual(false) - } - time.Sleep(2 * time.Second) - } - }() - go func() { - for { - spListDual(true) - time.Sleep(2 * time.Second) - } - }() +// MarkPortAsClosed marks a port as no more opened by the user +func (sp *SerialPortList) MarkPortAsClosed(portname string) { + sp.portsLock.Lock() + defer sp.portsLock.Unlock() + port := sp.getPortByName(portname) + if port != nil { + port.IsOpen = false + } } -func spListDual(network bool) { - - // call our os specific implementation of getting the serial list - list, _ := GetList(network) - - // do a quick loop to see if any of our open ports - // did not end up in the list port list. this can - // happen on windows in a fallback scenario where an - // open port can't be identified because it is locked, - // so just solve that by manually inserting - // if network { - // for port := range sh.ports { - - // isFound := false - // for _, item := range list { - // if strings.ToLower(port.portConf.Name) == strings.ToLower(item.Name) { - // isFound = true - // } - // } - - // if !isFound { - // // artificially push to front of port list - // log.Println(fmt.Sprintf("Did not find an open port in the serial port list. We are going to artificially push it onto the list. port:%v", port.portConf.Name)) - // var ossp OsSerialPort - // ossp.Name = port.portConf.Name - // ossp.FriendlyName = port.portConf.Name - // list = append([]OsSerialPort{ossp}, list...) - // } - // } - // } - - // we have a full clean list of ports now. iterate thru them - // to append the open/close state, baud rates, etc to make - // a super clean nice list to send back to browser - n := len(list) - spl := SpPortList{make([]SpPortItem, n, n), network} - - ctr := 0 - for _, item := range list { - - /* - Name string - Friendly string - IsOpen bool - IsPrimary bool - RelatedNames []string - Baud int - RtsOn bool - DtrOn bool - BufferAlgorithm string - AvailableBufferAlgorithms []string - Ver string - */ - spl.Ports[ctr] = SpPortItem{ - Name: item.Name, - SerialNumber: item.SerialNumber, - DeviceClass: item.DeviceClass, - IsOpen: false, - IsPrimary: false, - Baud: 0, - BufferAlgorithm: "", - Ver: version, - NetworkPort: item.NetworkPort, - VendorID: item.IdVendor, - ProductID: item.IdProduct, +func (sp *SerialPortList) getPortByName(portname string) *SpPortItem { + for _, port := range sp.Ports { + if port.Name == portname { + return port } - - // figure out if port is open - //spl.Ports[ctr].IsOpen = false - myport, isFound := findPortByName(item.Name) - - if isFound { - // we found our port - spl.Ports[ctr].IsOpen = true - spl.Ports[ctr].Baud = myport.portConf.Baud - spl.Ports[ctr].BufferAlgorithm = myport.BufferType - spl.Ports[ctr].IsPrimary = myport.IsPrimary - } - //ls += "{ \"name\" : \"" + item.Name + "\", \"friendly\" : \"" + item.FriendlyName + "\" },\n" - ctr++ - } - - if network { - NetworkPorts = spl - } else { - SerialPorts = spl } + return nil } func spErr(err string) { - log.Println("Sending err back: ", err) + //log.Println("Sending err back: ", err) //h.broadcastSys <- []byte(err) h.broadcastSys <- []byte("{\"Error\" : \"" + err + "\"}") } func spClose(portname string) { - // look up the registered port by name - // then call the close method inside serialport - // that should cause an unregister channel call back - // to myself - - myport, isFound := findPortByName(portname) - - if isFound { - // we found our port - spHandlerClose(myport) + if myport, ok := sh.FindPortByName(portname); ok { + h.broadcastSys <- []byte("Closing serial port " + portname) + myport.Close() } else { - // we couldn't find the port, so send err spErr("We could not find the serial port " + portname + " that you were trying to close.") } } -func spWriteJson(arg string) { - - log.Printf("spWriteJson. arg:%v\n", arg) - - // remove sendjson string - arg = sh.reJsonTrim.ReplaceAllString(arg, "") - //log.Printf("string we're going to parse:%v\n", arg) - - // this is a structured command now for sending in serial commands multiple at a time - // with an ID so we can send back the ID when the command is done - var m writeRequestJson - /* - m.P = "COM22" - var data writeRequestJsonData - data.Id = "234" - str := "yeah yeah" - data.D = str //[]byte(str) //[]byte(string("blah blah")) - m.Data = append(m.Data, data) - //m.Data = append(m.Data, data) - bm, err2 := json.Marshal(m) - if err2 == nil { - log.Printf("Test json serialize:%v\n", string(bm)) - } - */ - - err := json.Unmarshal([]byte(arg), &m) - - if err != nil { - log.Printf("Problem decoding json. giving up. json:%v, err:%v\n", arg, err) - spErr(fmt.Sprintf("Problem decoding json. giving up. json:%v, err:%v", arg, err)) - return - } - - // see if we have this port open - portname := m.P - myport, isFound := findPortByName(portname) - - if !isFound { - // we couldn't find the port, so send err - spErr("We could not find the serial port " + portname + " that you were trying to write to.") - return - } - - // we found our port - m.p = myport - - // send it to the writeJson channel - sh.writeJson <- m -} - func spWrite(arg string) { // we will get a string of comXX asdf asdf asdf - log.Println("Inside spWrite arg: " + arg) + //log.Println("Inside spWrite arg: " + arg) arg = strings.TrimPrefix(arg, " ") //log.Println("arg after trim: " + arg) args := strings.SplitN(arg, " ", 3) if len(args) != 3 { errstr := "Could not parse send command: " + arg - log.Println(errstr) + //log.Println(errstr) spErr(errstr) return } + bufferingMode := args[0] portname := strings.Trim(args[1], " ") - //log.Println("The port to write to is:" + portname + "---") - //log.Println("The data is:" + args[2] + "---") + data := args[2] - // see if we have this port open - myport, isFound := findPortByName(portname) + //log.Println("The port to write to is:" + portname + "---") + //log.Println("The data is:" + data + "---") - if !isFound { + // See if we have this port open + port, ok := sh.FindPortByName(portname) + if !ok { // we couldn't find the port, so send err spErr("We could not find the serial port " + portname + " that you were trying to write to.") return } - // we found our port - // create our write request - var wr writeRequest - wr.p = myport - - // see if args[0] is send or sendnobuf - if args[0] != "sendnobuf" { - // we were just given a "send" so buffer it - wr.buffer = true - } else { - log.Println("sendnobuf specified so wr.buffer is false") - wr.buffer = false + // see if bufferingMode is valid + switch bufferingMode { + case "send", "sendnobuf", "sendraw": + // valid buffering mode, go ahead + default: + spErr("Unsupported send command:" + args[0] + ". Please specify a valid one") + return } - // include newline or not in the write? that is the question. - // for now lets skip the newline - //wr.d = []byte(args[2] + "\n") - wr.d = args[2] //[]byte(args[2]) - // send it to the write channel - sh.write <- wr - -} - -func findPortByName(portname string) (*serport, bool) { - portnamel := strings.ToLower(portname) - for port := range sh.ports { - if strings.ToLower(port.portConf.Name) == portnamel { - // we found our port - //spHandlerClose(port) - return port, true - } - } - return nil, false -} - -func findPortByNameRerun(portname string, network bool) (OsSerialPort, bool) { - portnamel := strings.ToLower(portname) - list, _ := GetList(network) - for _, item := range list { - if strings.ToLower(item.Name) == portnamel { - return item, true - } - } - return OsSerialPort{}, false -} - -func spBufferAlgorithms() { - //arr := []string{"default", "tinyg", "dummypause"} - arr := availableBufferAlgorithms - json := "{\"BufferAlgorithm\" : [" - for _, elem := range arr { - json += "\"" + elem + "\", " - } - json = regexp.MustCompile(", $").ReplaceAllString(json, "]}") - h.broadcastSys <- []byte(json) -} - -func spBaudRates() { - arr := []string{"2400", "4800", "9600", "19200", "38400", "57600", "115200", "230400"} - json := "{\"BaudRate\" : [" - for _, elem := range arr { - json += "" + elem + ", " - } - json = regexp.MustCompile(", $").ReplaceAllString(json, "]}") - h.broadcastSys <- []byte(json) + port.Write(data, bufferingMode) } diff --git a/seriallist.go b/seriallist.go deleted file mode 100755 index a0ab17ef9..000000000 --- a/seriallist.go +++ /dev/null @@ -1,62 +0,0 @@ -// Supports Windows, Linux, Mac, and Raspberry Pi - -package main - -import ( - log "github.com/Sirupsen/logrus" - "github.com/facchinm/go-serial" - "regexp" -) - -type OsSerialPort struct { - Name string - SerialNumber string - DeviceClass string - Manufacturer string - Product string - IdProduct string - IdVendor string - NetworkPort bool -} - -func GetList(network bool) ([]OsSerialPort, error) { - - //log.Println("Doing GetList()") - - if network { - netportList, err := GetNetworkList() - return netportList, err - } else { - - // will timeout in 2 seconds - ports, err := serial.GetPortsList() - - arrPorts := []OsSerialPort{} - for _, element := range ports { - arrPorts = append(arrPorts, OsSerialPort{Name: element}) - } - - // see if we should filter the list - if len(*regExpFilter) > 0 { - // yes, user asked for a filter - reFilter := regexp.MustCompile("(?i)" + *regExpFilter) - - newarrPorts := []OsSerialPort{} - for _, element := range arrPorts { - // if matches regex, include - if reFilter.MatchString(element.Name) { - newarrPorts = append(newarrPorts, element) - } else { - log.Debug("serial port did not match. port: %v\n", element) - } - - } - arrPorts = newarrPorts - } - - arrPorts = associateVidPidWithPort(arrPorts) - return arrPorts, err - //log.Printf("Done doing GetList(). arrPorts:%v\n", arrPorts) - } - -} diff --git a/seriallist_darwin.go b/seriallist_darwin.go deleted file mode 100644 index be18cf2c3..000000000 --- a/seriallist_darwin.go +++ /dev/null @@ -1,70 +0,0 @@ -package main - -import ( - "os/exec" - "strings" -) - -// execute system_profiler SPUSBDataType | grep "Vendor ID: 0x2341" -A5 -B2 -// maybe -B2 is not necessary -// trim whitespace and eol -// map everything with : -// get [map][Location ID] first 5 chars -// search all board.txt files for map[Product ID] -// assign it to name - -func associateVidPidWithPort(ports []OsSerialPort) []OsSerialPort { - - // prefilter ports - ports = Filter(ports, func(port OsSerialPort) bool { - return !strings.Contains(port.Name, "Blue") && !strings.Contains(port.Name, "/cu") - }) - - for index, _ := range ports { - port_hash := strings.Trim(ports[index].Name, "/dev/tty.usbmodem") - port_hash = strings.Trim(port_hash, "/dev/tty.usbserial-") - - port_hash = strings.ToLower(port_hash) - - usbcmd := exec.Command("system_profiler", "SPUSBDataType") - grepcmd := exec.Command("grep", "Location ID: 0x"+port_hash[:len(port_hash)-1], "-B6") - cmdOutput, _ := pipe_commands(usbcmd, grepcmd) - - if len(cmdOutput) == 0 { - usbcmd = exec.Command("system_profiler", "SPUSBDataType") - grepcmd = exec.Command("grep" /*"Serial Number: "+*/, strings.Trim(port_hash, "0"), "-B3", "-A3") - cmdOutput, _ = pipe_commands(usbcmd, grepcmd) - } - - if len(cmdOutput) == 0 { - //give up - continue - } - - cmdOutSlice := strings.Split(string(cmdOutput), "\n") - - cmdOutMap := make(map[string]string) - - for _, element := range cmdOutSlice { - if strings.Contains(element, "ID") || strings.Contains(element, "Manufacturer") { - element = strings.TrimSpace(element) - arr := strings.Split(element, ": ") - if len(arr) > 1 { - cmdOutMap[arr[0]] = arr[1] - } else { - cmdOutMap[arr[0]] = "" - } - } - } - ports[index].IdProduct = strings.Split(cmdOutMap["Product ID"], " ")[0] - ports[index].IdVendor = strings.Split(cmdOutMap["Vendor ID"], " ")[0] - ports[index].Manufacturer = cmdOutMap["Manufacturer"] - } - return ports -} - -func hideFile(path string) { -} - -func tellCommandNotToSpawnShell(_ *exec.Cmd) { -} diff --git a/seriallist_linux.go b/seriallist_linux.go deleted file mode 100755 index 925b9fe7d..000000000 --- a/seriallist_linux.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "fmt" - "os/exec" - "path/filepath" - "strconv" - "strings" -) - -func associateVidPidWithPort(ports []OsSerialPort) []OsSerialPort { - - for index, _ := range ports { - ueventcmd := exec.Command("cat", "/sys/class/tty/"+filepath.Base(ports[index].Name)+"/device/uevent") - grep3cmd := exec.Command("grep", "PRODUCT=") - - cmdOutput2, _ := pipe_commands(ueventcmd, grep3cmd) - cmdOutput2S := string(cmdOutput2) - - if len(cmdOutput2S) == 0 { - continue - } - - infos := strings.Split(cmdOutput2S, "=") - - vid_pid := strings.Split(infos[1], "/") - - vid, _ := strconv.ParseInt(vid_pid[0], 16, 32) - pid, _ := strconv.ParseInt(vid_pid[1], 16, 32) - ports[index].IdVendor = fmt.Sprintf("0x%04x", vid) - ports[index].IdProduct = fmt.Sprintf("0x%04x", pid) - } - return ports -} - -func hideFile(path string) { -} - -func tellCommandNotToSpawnShell(_ *exec.Cmd) { -} diff --git a/seriallist_windows.go b/seriallist_windows.go deleted file mode 100644 index 1e7329f0a..000000000 --- a/seriallist_windows.go +++ /dev/null @@ -1,239 +0,0 @@ -package main - -import ( - log "github.com/Sirupsen/logrus" - "github.com/mattn/go-ole" - "github.com/mattn/go-ole/oleutil" - "os" - "os/exec" - "regexp" - "strings" - "sync" - "syscall" -) - -var ( - serialListWindowsWg sync.WaitGroup -) - -func associateVidPidWithPort(ports []OsSerialPort) []OsSerialPort { - ports, _ = getList() - return ports -} - -func getList() ([]OsSerialPort, os.SyscallError) { - // use a queue to do this to avoid conflicts - // we've been getting crashes when this getList is requested - // too many times too fast. i think it's something to do with - // the unsafe syscalls overwriting memory - - // this will only block if waitgroupctr > 0. so first time - // in shouldn't block - serialListWindowsWg.Wait() - - serialListWindowsWg.Add(1) - arr, sysCallErr := getListViaWmiPnpEntity() - serialListWindowsWg.Done() - //arr = make([]OsSerialPort, 0) - - // see if array has any data, if not fallback to the traditional - // com port list model - /* - if len(arr) == 0 { - // assume it failed - arr, sysCallErr = getListViaOpen() - } - */ - - // see if array has any data, if not fallback to looking at - // the registry list - /* - arr = make([]OsSerialPort, 0) - if len(arr) == 0 { - // assume it failed - arr, sysCallErr = getListViaRegistry() - } - */ - - return arr, sysCallErr -} - -func getListSynchronously() { - -} - -func hideFile(path string) { - cpath, cpathErr := syscall.UTF16PtrFromString(path) - if cpathErr != nil { - } - syscall.SetFileAttributes(cpath, syscall.FILE_ATTRIBUTE_HIDDEN) -} - -func getListViaWmiPnpEntity() ([]OsSerialPort, os.SyscallError) { - - //log.Println("Doing getListViaWmiPnpEntity()") - - // this method panics a lot and i'm not sure why, just catch - // the panic and return empty list - defer func() { - if e := recover(); e != nil { - // e is the interface{} typed-value we passed to panic() - log.Println("Got panic: ", e) // Prints "Whoops: boom!" - } - }() - - var err os.SyscallError - - //var friendlyName string - - // init COM, oh yeah - ole.CoInitialize(0) - defer ole.CoUninitialize() - - unknown, _ := oleutil.CreateObject("WbemScripting.SWbemLocator") - defer unknown.Release() - - wmi, _ := unknown.QueryInterface(ole.IID_IDispatch) - defer wmi.Release() - - // service is a SWbemServices - serviceRaw, _ := oleutil.CallMethod(wmi, "ConnectServer") - service := serviceRaw.ToIDispatch() - defer service.Release() - - // result is a SWBemObjectSet - //pname := syscall.StringToUTF16("SELECT * FROM Win32_PnPEntity where Name like '%" + "COM35" + "%'") - pname := "SELECT * FROM Win32_PnPEntity WHERE ConfigManagerErrorCode = 0 and Name like '%(COM%'" - //pname := "SELECT * FROM Win32_PnPEntity WHERE ConfigManagerErrorCode = 0" - resultRaw, err2 := oleutil.CallMethod(service, "ExecQuery", pname) - //log.Println("Got result from oleutil.CallMethod") - if err2 != nil { - // we got back an error or empty list - log.Printf("Got an error back from oleutil.CallMethod. err:%v", err2) - return nil, err - } - - result := resultRaw.ToIDispatch() - defer result.Release() - - countVar, _ := oleutil.GetProperty(result, "Count") - count := int(countVar.Val) - - list := make([]OsSerialPort, count) - - for i := 0; i < count; i++ { - - // items we're looping thru look like below and - // thus we can query for any of these names - /* - __GENUS : 2 - __CLASS : Win32_PnPEntity - __SUPERCLASS : CIM_LogicalDevice - __DYNASTY : CIM_ManagedSystemElement - __RELPATH : Win32_PnPEntity.DeviceID="USB\\VID_1D50&PID_606D&MI_02\\6&2F09EA14&0&0002" - __PROPERTY_COUNT : 24 - __DERIVATION : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement} - __SERVER : JOHN-ATIV - __NAMESPACE : root\cimv2 - __PATH : \\JOHN-ATIV\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_1D50&PID_606D&MI_02\\6&2F09EA14 - &0&0002" - Availability : - Caption : TinyG v2 (Data Channel) (COM12) - ClassGuid : {4d36e978-e325-11ce-bfc1-08002be10318} - CompatibleID : {USB\Class_02&SubClass_02&Prot_01, USB\Class_02&SubClass_02, USB\Class_02} - ConfigManagerErrorCode : 0 - ConfigManagerUserConfig : False - CreationClassName : Win32_PnPEntity - Description : TinyG v2 (Data Channel) - DeviceID : USB\VID_1D50&PID_606D&MI_02\6&2F09EA14&0&0002 - ErrorCleared : - ErrorDescription : - HardwareID : {USB\VID_1D50&PID_606D&REV_0097&MI_02, USB\VID_1D50&PID_606D&MI_02} - InstallDate : - LastErrorCode : - Manufacturer : Synthetos (www.synthetos.com) - Name : TinyG v2 (Data Channel) (COM12) - PNPDeviceID : USB\VID_1D50&PID_606D&MI_02\6&2F09EA14&0&0002 - PowerManagementCapabilities : - PowerManagementSupported : - Service : usbser - Status : OK - StatusInfo : - SystemCreationClassName : Win32_ComputerSystem - SystemName : JOHN-ATIV - PSComputerName : JOHN-ATIV - */ - - // item is a SWbemObject, but really a Win32_Process - itemRaw, _ := oleutil.CallMethod(result, "ItemIndex", i) - item := itemRaw.ToIDispatch() - defer item.Release() - - asString, _ := oleutil.GetProperty(item, "Name") - - //log.Println(asString.ToString()) - - // get the com port - //if false { - s := strings.Split(asString.ToString(), "(COM")[1] - s = "COM" + s - s = strings.Split(s, ")")[0] - list[i].Name = s - //} - - // get the deviceid so we can figure out related ports - // it will look similar to - // USB\VID_1D50&PID_606D&MI_00\6&2F09EA14&0&0000 - deviceIdStr, _ := oleutil.GetProperty(item, "DeviceID") - devIdItems := strings.Split(deviceIdStr.ToString(), "&") - log.Printf("DeviceId elements:%v", devIdItems) - if len(devIdItems) > 3 { - list[i].SerialNumber = devIdItems[3] - list[i].IdProduct = strings.Replace(devIdItems[1], "PID_", "", 1) - list[i].IdVendor = strings.Replace(devIdItems[0], "USB\\VID_", "", 1) - } else { - list[i].SerialNumber = deviceIdStr.ToString() - pidMatch := regexp.MustCompile("PID_(\\d+)").FindAllStringSubmatch(deviceIdStr.ToString(), -1) - if len(pidMatch) > 0 { - if len(pidMatch[0]) > 1 { - list[i].IdProduct = pidMatch[0][1] - } - } - vidMatch := regexp.MustCompile("VID_(\\d+)").FindAllStringSubmatch(deviceIdStr.ToString(), -1) - if len(vidMatch) > 0 { - if len(vidMatch[0]) > 1 { - list[i].IdVendor = vidMatch[0][1] - } - } - } - - list[i].IdVendor = "0x" + list[i].IdVendor - list[i].IdProduct = "0x" + list[i].IdProduct - - manufStr, _ := oleutil.GetProperty(item, "Manufacturer") - list[i].Manufacturer = manufStr.ToString() - descStr, _ := oleutil.GetProperty(item, "Description") - list[i].Product = descStr.ToString() - //classStr, _ := oleutil.GetProperty(item, "CreationClassName") - //list[i].DeviceClass = classStr.ToString() - - } - - return list, err -} - -func convertByteArrayToUint16Array(b []byte, mylen uint32) []uint16 { - - log.Println("converting. len:", mylen) - var i uint32 - ret := make([]uint16, mylen/2) - for i = 0; i < mylen; i += 2 { - //ret[i/2] = binary.LittleEndian.Uint16(b[i : i+1]) - ret[i/2] = uint16(b[i]) | uint16(b[i+1])<<8 - } - return ret -} - -func tellCommandNotToSpawnShell(oscmd *exec.Cmd) { - oscmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} -} diff --git a/serialport.go b/serialport.go index 9aafcfbc9..b3418fe5d 100755 --- a/serialport.go +++ b/serialport.go @@ -1,29 +1,38 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + package main import ( "bytes" - "encoding/json" - log "github.com/Sirupsen/logrus" - "github.com/facchinm/go-serial" + "encoding/base64" "io" "strconv" + "sync" + "sync/atomic" "time" + "unicode/utf8" + + log "github.com/sirupsen/logrus" + serial "go.bug.st/serial" ) +// SerialConfig is the serial port configuration type SerialConfig struct { - Name string - Baud int - - // Size int // 0 get translated to 8 - // Parity SomeNewTypeToGetCorrectDefaultOf_None - // StopBits SomeNewTypeToGetCorrectDefaultOf_1 - - // RTSFlowControl bool - // DTRFlowControl bool - // XONFlowControl bool - - // CRLFTranslate bool - // TimeoutStuff int + Name string + Baud int RtsOn bool DtrOn bool } @@ -32,74 +41,53 @@ type serport struct { // The serial port connection. portConf *SerialConfig portIo io.ReadWriteCloser - - done chan bool // signals the end of this request + portName string // Keep track of whether we're being actively closed // just so we don't show scary error messages - isClosing bool + isClosing atomic.Bool - // counter incremented on queue, decremented on write - itemsInBuffer int + isClosingDueToError bool // buffered channel containing up to 25600 outbound messages. - sendBuffered chan Cmd + sendBuffered chan string // unbuffered channel of outbound messages that bypass internal serial port buffer - sendNoBuf chan Cmd + sendNoBuf chan []byte + + // channel containing raw base64 encoded binary data (outbound messages) + sendRaw chan string // Do we have an extra channel/thread to watch our buffer? BufferType string //bufferwatcher *BufferflowDummypause bufferwatcher Bufferflow - - // Keep track of whether this is the primary serial port, i.e. cnc controller - // or if its secondary, i.e. a backup port or arduino or something tertiary - IsPrimary bool - IsSecondary bool -} - -type Cmd struct { - data string - id string - skippedBuffer bool - willHandleCompleteResponse bool -} - -type CmdComplete struct { - Cmd string - Id string - P string - BufSize int `json:"-"` - D string `json:"-"` -} - -type qwReport struct { - Cmd string - QCnt int - Id string - D string `json:"-"` - Buf string `json:"-"` - P string } +// SpPortMessage is the serial port message type SpPortMessage struct { - // P string // the port, i.e. com22 + P string // the port, i.e. com22 D string // the data, i.e. G0 X0 Y0 } -func (p *serport) reader() { +// SpPortMessageRaw is the raw serial port message +type SpPortMessageRaw struct { + P string // the port, i.e. com22 + D []byte // the data, i.e. G0 X0 Y0 +} + +func (p *serport) reader(buftype string) { - //var buf bytes.Buffer - ch := make([]byte, 1024) timeCheckOpen := time.Now() + var bufferedCh bytes.Buffer + serialBuffer := make([]byte, 1024) for { + n, err := p.portIo.Read(serialBuffer) + bufferPart := serialBuffer[:n] - n, err := p.portIo.Read(ch) - - //if we detect that port is closing, break out o this for{} loop. - if p.isClosing { + //if we detect that port is closing, break out of this for{} loop. + if p.isClosing.Load() { strmsg := "Shutting down reader on " + p.portConf.Name log.Println(strmsg) h.broadcastSys <- []byte(strmsg) @@ -107,46 +95,40 @@ func (p *serport) reader() { } // read can return legitimate bytes as well as an error - // so process the bytes if n > 0 - if n > 0 { - //log.Print("Read " + strconv.Itoa(n) + " bytes ch: " + string(ch)) - data := string(ch[:n]) - //log.Print("The data i will convert to json is:") - //log.Print(data) - - // give the data to our bufferflow so it can do it's work - // to read/translate the data to see if it wants to block - // writes to the serialport. each bufferflow type will decide - // this on its own based on its logic, i.e. tinyg vs grbl vs others - //p.b.bufferwatcher..OnIncomingData(data) - p.bufferwatcher.OnIncomingData(data) - - // see if the OnIncomingData handled the broadcast back - // to the user. this option was added in case the OnIncomingData wanted - // to do something fancier or implementation specific, i.e. TinyG Buffer - // actually sends back data on a perline basis rather than our method - // where we just send the moment we get it. the reason for this is that - // the browser was sometimes getting back packets out of order which - // of course would screw things up when parsing - - if p.bufferwatcher.IsBufferGloballySendingBackIncomingData() == false { - //m := SpPortMessage{"Alice", "Hello"} - m := SpPortMessage{data} - //log.Print("The m obj struct is:") - //log.Print(m) - - //b, err := json.MarshalIndent(m, "", "\t") - b, err := json.Marshal(m) - if err != nil { - log.Println(err) - h.broadcastSys <- []byte("Error creating json on " + p.portConf.Name + " " + - err.Error() + " The data we were trying to convert is: " + string(ch[:n])) - break + // so process the n bytes red, if n > 0 + if n > 0 && err == nil { + + log.Print("Read " + strconv.Itoa(n) + " bytes ch: " + string(bufferPart[:n])) + + data := "" + switch buftype { + case "timedraw", "timed": + data = string(bufferPart[:n]) + // give the data to our bufferflow so it can do it's work + // to read/translate the data to see if it wants to block + // writes to the serialport. each bufferflow type will decide + // this on its own based on its logic + p.bufferwatcher.OnIncomingData(data) + case "default": // the bufferbuftype is actually called default 🤷‍♂️ + // save the left out bytes for the next iteration due to UTF-8 encoding + bufferPart = append(bufferedCh.Bytes(), bufferPart[:n]...) + n += len(bufferedCh.Bytes()) + bufferedCh.Reset() + for i, w := 0, 0; i < n; i += w { + runeValue, width := utf8.DecodeRune(bufferPart[i:n]) // try to decode the first i bytes in the buffer (UTF8 runes do not have a fixed length) + if runeValue == utf8.RuneError { + bufferedCh.Write(bufferPart[i:n]) + break + } + if i == n { + bufferedCh.Reset() + } + data += string(runeValue) + w = width } - //log.Print("Printing out json byte data...") - //log.Print(string(b)) - h.broadcastSys <- b - //h.broadcastSys <- []byte("{ \"p\" : \"" + p.portConf.Name + "\", \"d\": \"" + string(ch[:n]) + "\" }\n") + p.bufferwatcher.OnIncomingData(data) + default: + log.Panicf("unknown buffer type %s", buftype) } } @@ -171,22 +153,37 @@ func (p *serport) reader() { h.broadcastSys <- []byte("Error reading on " + p.portConf.Name + " " + err.Error() + " Closing port.") h.broadcastSys <- []byte("{\"Cmd\":\"OpenFail\",\"Desc\":\"Got error reading on port. " + err.Error() + "\",\"Port\":\"" + p.portConf.Name + "\",\"Baud\":" + strconv.Itoa(p.portConf.Baud) + "}") + p.isClosingDueToError = true break } // Keep track of time difference between two consecutive read with n == 0 and err == nil // we get here if the port has been disconnected while open (cpu usage will jump to 100%) // let's close the port only if the events are extremely fast (<1ms) - if err == nil { - diff := time.Since(timeCheckOpen) - if diff.Nanoseconds() < 1000000 { - p.isClosing = true - } - timeCheckOpen = time.Now() + diff := time.Since(timeCheckOpen) + if diff.Nanoseconds() < 1000000 { + p.isClosingDueToError = true + break } + timeCheckOpen = time.Now() } } - spCloseReal(p) + if p.isClosingDueToError { + p.Close() + } +} + +// Write data to the serial port. +func (p *serport) Write(data string, sendMode string) { + // if user sent in the commands as one text mode line + switch sendMode { + case "send": + p.sendBuffered <- data + case "sendnobuf": + p.sendNoBuf <- []byte(data) + case "sendraw": + p.sendRaw <- data + } } // this method runs as its own thread because it's instantiated @@ -198,8 +195,7 @@ func (p *serport) writerBuffered() { defer func() { if e := recover(); e != nil { - // e is the interface{} typed-value we passed to panic() - log.Println("Got panic: ", e) // Prints "Whoops: boom!" + log.Println("Got panic: ", e) } }() @@ -207,22 +203,10 @@ func (p *serport) writerBuffered() { // sees something come in for data := range p.sendBuffered { - //log.Printf("Got p.sendBuffered. data:%v, id:%v\n", string(data.data), string(data.id)) + // send to the non-buffered serial port writer + //log.Println("About to send to p.sendNoBuf channel") + p.sendNoBuf <- []byte(data) - // we want to block here if we are being asked - // to pause. - goodToGo, willHandleCompleteResponse := p.bufferwatcher.BlockUntilReady(string(data.data), data.id) - - if goodToGo == false { - log.Println("We got back from BlockUntilReady() but apparently we must cancel this cmd") - // since we won't get a buffer decrement in p.sendNoBuf, we must do it here - p.itemsInBuffer-- - } else { - // send to the non-buffered serial port writer - //log.Println("About to send to p.sendNoBuf channel") - data.willHandleCompleteResponse = willHandleCompleteResponse - p.sendNoBuf <- data - } } msgstr := "writerBuffered just got closed. make sure you make a new one. port:" + p.portConf.Name log.Println(msgstr) @@ -236,53 +220,14 @@ func (p *serport) writerNoBuf() { // sees something come in for data := range p.sendNoBuf { - //log.Printf("Got p.sendNoBuf. data:%v, id:%v\n", string(data.data), string(data.id)) - // if we get here, we were able to write successfully // to the serial port because it blocks until it can write - // decrement counter - p.itemsInBuffer-- - log.Printf("itemsInBuffer:%v\n", p.itemsInBuffer) - //h.broadcastSys <- []byte("{\"Cmd\":\"Write\",\"QCnt\":" + strconv.Itoa(p.itemsInBuffer) + ",\"Byte\":" + strconv.Itoa(n2) + ",\"Port\":\"" + p.portConf.Name + "\"}") - - // For reducing load on websocket, stop transmitting write data - buf := "Buf" - if data.skippedBuffer { - buf = "NoBuf" - } - qwr := qwReport{ - Cmd: "Write", - QCnt: p.itemsInBuffer, - Id: string(data.id), - D: string(data.data), - Buf: buf, - P: p.portConf.Name, - } - qwrJson, _ := json.Marshal(qwr) - h.broadcastSys <- qwrJson - // FINALLY, OF ALL THE CODE IN THIS PROJECT // WE TRULY/FINALLY GET TO WRITE TO THE SERIAL PORT! - n2, err := p.portIo.Write([]byte(data.data)) - - // see if we need to send back the completeResponse - if data.willHandleCompleteResponse == false { - // we need to send back complete response - // Send fake cmd:"Complete" back - //strCmd := data.data - m := CmdComplete{"CompleteFake", data.id, p.portConf.Name, -1, data.data} - msgJson, err := json.Marshal(m) - if err == nil { - h.broadcastSys <- msgJson - } - - } + n2, err := p.portIo.Write(data) - log.Print("Just wrote ", n2, " bytes to serial: ", string(data.data)) - //log.Print(n2) - //log.Print(" bytes to serial: ") - //log.Print(data) + log.Print("Just wrote ", n2, " bytes to serial: ", string(data)) if err != nil { errstr := "Error writing to " + p.portConf.Name + " " + err.Error() + " Closing port." log.Print(errstr) @@ -294,9 +239,48 @@ func (p *serport) writerNoBuf() { log.Println(msgstr) h.broadcastSys <- []byte(msgstr) p.portIo.Close() + serialPorts.List() } -func spHandlerOpen(portname string, baud int, buftype string, isSecondary bool) { +// this method runs as its own thread because it's instantiated +// as a "go" method. so if it blocks inside, it is ok +func (p *serport) writerRaw() { + // this method can panic if user closes serial port and something is + // in BlockUntilReady() and then a send occurs on p.sendNoBuf + + defer func() { + if e := recover(); e != nil { + log.Println("Got panic: ", e) + } + }() + + // this for loop blocks on p.sendRaw until that channel + // sees something come in + for data := range p.sendRaw { + + // Decode stuff + sDec, err := base64.StdEncoding.DecodeString(data) + if err != nil { + log.Println("Decoding error:", err) + } + log.Println(string(sDec)) + + // send to the non-buffered serial port writer + p.sendNoBuf <- sDec + + } + msgstr := "writerRaw just got closed. make sure you make a new one. port:" + p.portConf.Name + log.Println(msgstr) + h.broadcastSys <- []byte(msgstr) +} + +// This lock is used to prevent multiple threads from trying to open the same port at the same time. +// It presents issues with the serial port driver on some OS's: https://github.com/arduino/arduino-create-agent/issues/1031 +var spHandlerOpenLock sync.Mutex + +func spHandlerOpen(portname string, baud int, buftype string) { + spHandlerOpenLock.Lock() + defer spHandlerOpenLock.Unlock() log.Print("Inside spHandler") @@ -309,66 +293,77 @@ func spHandlerOpen(portname string, baud int, buftype string, isSecondary bool) out.WriteString(" baud") log.Print(out.String()) - //h.broadcast <- []byte("Opened a serial port ") - //h.broadcastSys <- out.Bytes() - - isPrimary := true - if isSecondary { - isPrimary = false - } - conf := &SerialConfig{Name: portname, Baud: baud, RtsOn: true} mode := &serial.Mode{ BaudRate: baud, - Vmin: 0, - Vtimeout: 1, } - sp, err := serial.OpenPort(portname, mode) + sp, err := serial.Open(portname, mode) log.Print("Just tried to open port") if err != nil { - //log.Fatal(err) - log.Print("Error opening port " + err.Error()) - //h.broadcastSys <- []byte("Error opening port. " + err.Error()) - h.broadcastSys <- []byte("{\"Cmd\":\"OpenFail\",\"Desc\":\"Error opening port. " + err.Error() + "\",\"Port\":\"" + conf.Name + "\",\"Baud\":" + strconv.Itoa(conf.Baud) + "}") - + existingPort, ok := sh.FindPortByName(portname) + if ok && existingPort.portConf.Baud == baud && existingPort.BufferType == buftype { + log.Print("Port already opened") + h.broadcastSys <- []byte("{\"Cmd\":\"Open\",\"Desc\":\"Port already opened.\",\"Port\":\"" + existingPort.portConf.Name + "\",\"Baud\":" + strconv.Itoa(existingPort.portConf.Baud) + ",\"BufferType\":\"" + existingPort.BufferType + "\"}") + } else { + log.Print("Error opening port " + err.Error()) + h.broadcastSys <- []byte("{\"Cmd\":\"OpenFail\",\"Desc\":\"Error opening port. " + err.Error() + "\",\"Port\":\"" + conf.Name + "\",\"Baud\":" + strconv.Itoa(conf.Baud) + "}") + } return } log.Print("Opened port successfully") //p := &serport{send: make(chan []byte, 256), portConf: conf, portIo: sp} // we can go up to 256,000 lines of gcode in the buffer - p := &serport{sendBuffered: make(chan Cmd, 256000), sendNoBuf: make(chan Cmd), portConf: conf, portIo: sp, BufferType: buftype, IsPrimary: isPrimary, IsSecondary: isSecondary} + p := &serport{ + sendBuffered: make(chan string, 256000), + sendNoBuf: make(chan []byte), + sendRaw: make(chan string), + portConf: conf, + portIo: sp, + portName: portname, + BufferType: buftype} var bw Bufferflow - if buftype == "timed" { - bw = &BufferflowTimed{Name: "timed", Port: portname, Output: h.broadcastSys, Input: make(chan string)} - } else { - bw = &BufferflowDefault{Port: portname} + switch buftype { + case "timed": + bw = NewBufferflowTimed(portname, h.broadcastSys) + case "timedraw": + bw = NewBufferflowTimedRaw(portname, h.broadcastSys) + case "default": + bw = NewBufferflowDefault(portname, h.broadcastSys) + default: + log.Panicf("unknown buffer type: %s", buftype) } bw.Init() p.bufferwatcher = bw - sh.register <- p - defer func() { sh.unregister <- p }() + sh.Register(p) + + serialPorts.MarkPortAsOpened(portname) + serialPorts.List() + // this is internally buffered thread to not send to serial port if blocked go p.writerBuffered() // this is thread to send to serial port regardless of block go p.writerNoBuf() - p.reader() - //go p.reader() - //p.done = make(chan bool) - //<-p.done + // this is thread to send to serial port but with base64 decoding + go p.writerRaw() + // this is the thread that reads from the serial port + go func() { + p.reader(buftype) + serialPorts.List() + sh.Unregister(p) + }() } -func spHandlerClose(p *serport) { - p.isClosing = true - h.broadcastSys <- []byte("Closing serial port " + p.portConf.Name) -} +func (p *serport) Close() { + p.isClosing.Store(true) -func spCloseReal(p *serport) { p.bufferwatcher.Close() p.portIo.Close() + serialPorts.MarkPortAsClosed(p.portName) + serialPorts.List() } diff --git a/skel/ArduinoCreateAgent.app.zip b/skel/ArduinoCreateAgent.app.zip deleted file mode 100644 index 65d14073c..000000000 Binary files a/skel/ArduinoCreateAgent.app.zip and /dev/null differ diff --git a/snapshot/README.md b/snapshot/README.md deleted file mode 100644 index ae3ff20f3..000000000 --- a/snapshot/README.md +++ /dev/null @@ -1,181 +0,0 @@ -serial-port-json-server -======================= -Version 1.75 - -A serial port JSON websocket & web server that runs from the command line on Windows, Mac, Linux, Raspberry Pi, or Beagle Bone that lets you communicate with your serial port from a web application. This enables web apps to be written that can communicate with your local serial device such as an Arduino, CNC controller, or any device that communicates over the serial port. - -The app is written in Go. It has an embedded web server and websocket server. The server runs on the standard port of localhost:8989. You can connect to it locally with your browser to interact by visiting http://localhost:8989. The websocket is technically running at ws://localhost/ws. You can of course connect to your websocket from any other computer to bind in remotely. For example, just connect to ws://192.168.1.10/ws if you are on a remote host where 192.168.1.10 is your devices actual IP address. - -The app is one executable with everything you need and is available ready-to-go for every major platform. It is a multi-threaded app that uses all of the cool techniques available in Go including extensive use of channels (threads) to create a super-responsive app. - -If you are a web developer and want to write a web application that connects to somebody's local or remote serial port server, then you simply need to create a websocket connection to the localhost or remote host and you will be directly interacting with that user's serial port. - -For example, if you wanted to create a Gcode Sender web app to enable people to send 3D print or milling commands from your site, this would be a perfect use case. Or if you've created an oscilloscope web app that connects to an Arduino, it would be another great use case. Finally you can write web apps that interact with a user's local hardware. - -Thanks go to gary.burd.info for the websocket example in Go. Thanks also go to tarm/goserial for the serial port base implementation. Thanks go to Jarret Luft at well for building the Grbl buffer and helping on global code changes to make everything better. - -Example Use Case ---------- -Here is a screenshot of the Serial Port JSON Server being used inside the ChiliPeppr Serial Port web console app. -http://chilipeppr.com/serialport - - -This is the Serial Port JSON Server being used inside the TinyG workspace in ChiliPeppr. -http://chilipeppr.com/tinyg - - -There is also a JSFiddle you can fork to create your own interface to the Serial Port JSON Server for your own project. -http://jsfiddle.net/chilipeppr/vetj5fvx/ - - - -Running ---------- -From the command line issue the following command: -- Mac/Linux -`./serial-port-json-server` -- Windows -`serial-port-json-server.exe` - -Verbose logging mode: -- Mac/Linux -`./serial-port-json-server -v` -- Windows -`serial-port-json-server.exe -v` - -Running on alternate port: -- Mac/Linux -`./serial-port-json-server -addr :8000` -- Windows -`serial-port-json-server.exe -addr :8000` - -Here's a screenshot of a successful run on Windows x64. Make sure you allow the firewall to give access to Serial Port JSON Server or you'll wonder why it's not working. - - - -How to Build ---------- -Video tutorial of building SPJS on a Mac: https://www.youtube.com/watch?v=4Hou06bOuHc - -1. Install Go (http://golang.org/doc/install) -2. If you're on a Mac, install Xcode from the Apple Store because you'll need gcc to compile the native code for a Mac. If you're on Windows, Linux, Raspberry Pi, or Beagle Bone you are all set. -3. Get go into your path so you can run "go" from any directory: - On Linux, Mac, Raspberry Pi, Beagle Bone Black - export PATH=$PATH:/usr/local/go/bin - On Windows, use the Environment Variables dialog by right-click My Computer -4. Define your GOPATH variable and create the folder to match. This is your personal working folder for all yourGo code. This is important because you will be retrieving several projects from Github and Go needs to know where to download all the files and where to build the directory structure. On my Windows computer I created a folder called C:\Users\John\go and set GOPATH=C:\Users\John\go - On Mac - export GOPATH=/Users/john/go - On Linux, Raspberry Pi, Beagle Bone Black, Intel Edison - export GOPATH=/home/john/go - On Windows, use the Environment Variables dialog by right-click My Computer to create GOPATH -5. Change directory into your GOPATH -6. Type "go get github.com/johnlauer/serial-port-json-server". This will retrieve this Github project and all dependent projects. It takes some time to run this. -7. Then change direcory into github.com\johnlauer\serial-port-json-server. -8. Type "go build" when you're inside that directory and it will create a binary called serial-port-json-server -9. Run it by typing ./serial-port-json-server or on Windows run serial-port-json-server.exe -10. If you have a firewall on the computer running the serial-port-json-server you must allow port 8989 in the firewall. - -Supported Commands -------- - -Command | Example | Description -------- | ------- | ------- -list | | Lists all available serial ports on your device -open portName baudRate [bufferAlgorithm] | open /dev/ttyACM0 115200 tinyg | Opens a serial port. The comPort should be the Name of the port inside the list response such as COM2 or /dev/ttyACM0. The baudrate should be a rate from the baudrates command or a typical baudrate such as 9600 or 115200. A bufferAlgorithm can be optionally specified such as "tinyg" (or in the future "grbl" if somebody writes it) or write your own. -sendjson {} | {"P":"COM22","Data":[{"D":"!~\n","Id":"234"},{"D":"{\"sr\":\"\"}\n","Id":"235"}]} | See Wiki page at https://github.com/johnlauer/serial-port-json-server/wiki -send portName data | send /dev/ttyACM0 G1 X10.5 Y2 F100\n | Send your data to the serial port. Remember to send a newline in your data if your serial port expects it. -sendnobuf portName data | send COM22 {"qv":0}\n | Send your data and bypass the bufferFlowAlgorithm if you specified one. -close portName | close COM1 | Close out your serial port -bufferalgorithms | | List the available bufferAlgorithms on the server. You will get a list such as "default, tinyg" -baudrates | | List common baudrates such as 2400, 9600, 115200 - -FAQ -------- -- Q: There are several Node.js serial port servers. Why not write this in Node.js instead of Go? - -- A: Because Go is a better solution for several reasons. - - Easier to install on your computer. Just download and run binary. (Node requires big install) - - It is multi-threaded which is key for a serial port websocket server (Node is single-threaded) - - It has a tiny memory footprint using about 3MB of RAM - - It is one clean compiled executable with no dependencies - - It makes very efficient use of RAM with amazing garbage collection - - It is super fast when running - - It launches super quick - - It is essentially C code without the pain of C code. Go has insanely amazing threading support called Channels. Node.js is single-threaded, so you can't take full advantage of the CPU's threading capabilities. Go lets you do this easily. A serial port server needs several threads. 1) Websocket thread for each connection. 2) Serial port thread for each serial device. Serial Port JSON Server allows you to bind as many serial port devices in parallel as you want. 3) A writer and reader thread for each serial port. 4) A buffering thread for each incoming message from the browser into the websocket 5) A buffering thread for messages back out from the server to the websocket to the browser. To achieve this in Node requires lots of callbacks. You also end up talking natively anyway to the serial port on each specific platform you're on, so you have to deal with the native code glued to Node. - -Revisions -------- -Changes in 1.75 -- Tweaked the order of operations for pausing/unpausing the buffer in Grbl and TinyG to account for rare cases where a deadlock could occur. This should guarantee no dead-locking. -- Jarret Luft added an artificial % buffer wipe to Grbl buffer to mimic to some degree the buffer wiping available on TinyG. - -Changes in 1.7 -- sendjson now supported. Will give back onQueue, onWrite, onComplete -- Moved TinyG buffer to serial byte counting. - -Changes in 1.6 -- Logging is now off by default so Raspberry Pi runs cleaner. The immense amount of logging was dragging the Raspi down. Should help on BeagleBone Black as well. Makes SPJS run more efficient on powerful systems too like Windows, Mac, and Linux. You can turn on logging by issuing a -v on the command line. This fix by Jarret Luft. -- Added EOF extra checking for Linux serial ports that seem to return an EOF on a new connect and thus the port was prematurely closing. Thanks to Yiannis Mandravellos for finding the bug and fixing it. -- Added a really nice Grbl bufferAlgorithm which was written by Jarret Luft who is the creator of the Grbl workspace in ChiliPeppr. - - The buffer counts each line of gcode being sent to Grbl up to 127 bytes and then doesn't send anymore data to Grbl until it sees an OK or ERROR response from Grbl indicating the command was processed. For each OK|ERROR the buffer decrements the counter to see how much more room is avaialble. If the next Gcode command can fit it is sent immediately in. - - This new Grbl buffer should mirror the stream.py example code from Sonny Jeon who maintains Grbl. This Serial Port JSON Server should now be able to execute the commands faster than anything out there since it's written in Go (which is C) and is compiled and super-fast. - - Position requests occur inside this buffer where a ? is sent every 250ms to Grbl such that you should see a position just come back on demand non-stop from Grbl. It could be possible in a future version to only queue these position reports up during actual Gcode commands being sent so that when idle there are not a ton of position updates being sent back that aren't necessary. - - Soft resets (Ctrl-x) now wipe the buffer. - - !~? will skip ahead of all other commands now. This is important for jogging or using ! as a quick stop of your controller since you can have 25,000 lines of gcode queued to SPJS now and of course you would want these commands to skip in front of that queue. - - Feedhold pauses the buffer inside SPJS now. - - Cycle resume ~ unpauses the buffer inside SPJS now. - - When using this buffer data is sent back in a per line mode rather than as characters are received so there is more efficiency on the websocket. - - Checks for the grbl init line indicating the arduino is ready to accept commands - -Changes in 1.5 -- For TinyG buffer, moved to slot counter approach. The buffer planner approach was causing G2/G3 commands to overflow the buffer because the round-trip time was too off with reading QR responses. So, moved to a 4 slot buffer approach. Jogging is still a bit rough in this approach, but that can get tweaked. The new slot approach is more like counting serial buffer queue items. SPJS sends up to 4 commands and then waits for a r:{} json response. It has intelligence to know if certain commands won't get a response like !~% or newlines, so it doesn't look for slot responses and just blindly sends. The only danger is if there are 4 really long lines of Gcode that surpass the 254 bytes in the serial buffer then we could overflow. Could add trapping for that. - -Changes in 1.4 -- Added reporting on Queuing so you know what the state of the Serial Port JSON Server Queue is doing. The reason for this is to ensure your serial port commands don't get out of order you will want to make sure you write to the websocket and then wait for the {"Cmd":"Queued"} response. Then write your next command. This is necessary because when sending different frames across a websocket over the Internet, you can get packet retransmissions, and although you'll never lose your data, your serial commands could arrive at the server out of order. By watching that your command is queued, you are safe to send the next command. However, this can also slow things down, so now you can simply gang up multiple commands into one send and the Serial Port JSON Server will split them into separate sub-commands and tell you that it did in the queue and write reports. - - For example, a typical queue report looks like {"Cmd":"Queued","QCnt":61,"Type":["Buf"],"D":["{\"sr\":\"\"}\n"],"Port":"COM22"}. - - If you send something like: send COM22 {"sr":""}\n{"qr":""}\n{"sr":""}\n{"qr":""}\n. You will get back a queue report like {"Cmd":"Queued","QCnt":4,"Type":["Buf","Buf","Buf","Buf"],"D":["{\"sr\":\"\"}\n","{\"qr\":\"\"}\n","{\"sr\":\"\"}\n","{\"qr\":\"\"}\n"],"Port":"COM22"} - - When two queue items are written to the serial port you will get back something like {"Cmd":"Write","QCnt":1,"D":"{\"qr\":\"\"}\n","Port":"COM22"}{"Cmd":"Write","QCnt":0,"D":"{\"sr\":\"\"}\n","Port":"COM22"} -- Fixed analysis of incoming serial data due to some serial ports sending fragmented data. -- Added bufferalgorithms and baudrates commands -- A new command called sendnobuf was added so you can bypass the bufferflow algorithm. This command only is worth using if you specified a bufflerFlowAlgorithm when you opened the serial port. You use it by sending "sendnobuf com4 G0 X0 Y0" and it will jump ahead of the queue and go diretly to the serial port without hesitation. -- TinyG Bufferflow algorithm. - - Looks for qr responses and if they are too low on the planner buffer will trigger a pause on send. - - Looks for qr responses and if they are high enough to send again the bufferflow is unblocked. - - If you pause with ! then the bufferflow also pauses. - - If you resume with ~ then the bufferflow also resumes. - - If you wipe the buffer with % then the bufferflow also wipes. - - When you send !~% it automatically is sent to TinyG without buffering so it essentially skips ahead of all other buffered commands. This mimics what TinyG does internally. - - If you ask qr reports to be turned off with a $qv=0 or {"qv":0} then bypassmode is entered whereby no blocking occurs on sending serial port commands. - - If you ask qr reports to be turned back on with $qv=1 (or 2 or 3) or {"qv":1} (or 2 or 3) then bypassmode is turned off. - - If a qr reponse is seen from TinyG then BypassMode is turned off automatically. - -Changes in 1.3 -- Added ability for buffer flow plugins. There is a new buffer flow plugin - for TinyG that watches the {"qr":NN} response. When it sees the qr value - go below 12 it pauses its own sending and queues up whatever is still coming - in on the Websocket. This is fine because we've got plenty of RAM on the - websocket server. The {"qr":NN} value is still sent back on the websocket as - soon as it was before, so the host application should see no real difference - as to how it worked before. The difference now though is that the serial sending - knows to check if sending is paused to the serial port and queue. This makes - sure no buffer overflows ever occur. The reason this was becoming important is - that the lag time between the qr response and the sending of Gcode was too distant - and this buffer flow needs resolution around 5ms. Normal latency on the Internet - is like 20ms to 200ms, so it just wasn't fast enough. If the Javascript hosting - the websocket was busy processing other events, then this lag time became even - worse. So, now the Serial Port JSON Server simply helps out by lots of extra - buffering. Go ahead and pound it even harder with more serial commands and see - it fly. - -Changes in 1.2 -- Added better error handling -- Removed forcibly adding a newline to the serial data being sent to the port. This - means apps must send in a newline if the serial port expects it. -- Embedded the home.html file inside the binary so there is no longer a dependency - on an external file. -- TODO: Closing a port on Beagle Bone seems to hang. Only solution now is to kill - the process and restart. -- TODO: Mac implementation seems to have trouble on writing data after a while. Mac - gray screen of death can appear. Mac version uses CGO, so it is in unsafe mode. - May have to rework Mac serial port to use pure golang code. diff --git a/snapshot/downloads.md b/snapshot/downloads.md deleted file mode 100644 index 08a20ce5a..000000000 --- a/snapshot/downloads.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: default -title: Downloads ---- - -serial-port-json-server downloads (version snapshot) - -### Linux - - * [serial-port-json-server\_linux\_386.tar.gz](serial-port-json-server_linux_386.tar.gz) - * [serial-port-json-server\_linux\_amd64.tar.gz](serial-port-json-server_linux_amd64.tar.gz) - * [serial-port-json-server\_linux\_arm.tar.gz](serial-port-json-server_linux_arm.tar.gz) - * [serial-port-json-server\_snapshot\_amd64.deb](serial-port-json-server_snapshot_amd64.deb) - * [serial-port-json-server\_snapshot\_armhf.deb](serial-port-json-server_snapshot_armhf.deb) - * [serial-port-json-server\_snapshot\_i386.deb](serial-port-json-server_snapshot_i386.deb) - -### MS Windows - - * [serial-port-json-server\_windows\_386.zip](serial-port-json-server_windows_386.zip) - * [serial-port-json-server\_windows\_amd64.zip](serial-port-json-server_windows_amd64.zip) - -### Other files - - * [README.md](README.md) - - - -Generated by goxc \ No newline at end of file diff --git a/systray/exec_darwin.go b/systray/exec_darwin.go new file mode 100644 index 000000000..912a736e3 --- /dev/null +++ b/systray/exec_darwin.go @@ -0,0 +1,77 @@ +package systray + +/* +#cgo CFLAGS: -x objective-c +#cgo LDFLAGS: -framework Cocoa +#import + +char **makeCharArray(int size) { + return calloc(sizeof(char*), size); +} + +void setCharArray(char **a, int n, char *s) { + a[n] = s; +} + +void freeCharArray(char **a, int size) { + int i; + for (i = 0; i < size; i++) { + free(a[i]); + } + free(a); +} + +void runApplication(const char *path, const char **argv, int argc) { + NSMutableArray *stringArray = [NSMutableArray array]; + for (int i=0; i *arguments = [NSArray arrayWithArray:stringArray]; + + NSWorkspace *ws = [NSWorkspace sharedWorkspace]; + NSURL *url = [NSURL fileURLWithPath:@(path) isDirectory:NO]; + + NSWorkspaceOpenConfiguration* configuration = [NSWorkspaceOpenConfiguration new]; + //[configuration setEnvironment:env]; + [configuration setPromptsUserIfNeeded:YES]; + [configuration setCreatesNewApplicationInstance:YES]; + [configuration setArguments:arguments]; + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + [ws openApplicationAtURL:url configuration:configuration completionHandler:^(NSRunningApplication* app, NSError* error) { + dispatch_semaphore_signal(semaphore); + }]; + dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); +} +*/ +import "C" +import ( + "os/exec" + "path/filepath" + "unsafe" + + "github.com/sirupsen/logrus" +) + +func execApp(path string, args ...string) error { + if filepath.Ext(path) != ".app" { + // If not .app, fallback to standard process execution + logrus.WithField("path", path).WithField("args", args).Info("Running new app with os/exec.Exec") + cmd := exec.Command(path, args...) + return cmd.Start() + } + + logrus.WithField("path", path).WithField("args", args).Info("Running new app with openApplicationAtURL") + argc := C.int(len(args)) + argv := C.makeCharArray(argc) + for i, arg := range args { + C.setCharArray(argv, C.int(i), C.CString(arg)) + } + + cpath := C.CString(path) + defer C.free(unsafe.Pointer(cpath)) + C.runApplication(cpath, argv, argc) + + C.freeCharArray(argv, argc) + return nil +} diff --git a/systray/exec_default.go b/systray/exec_default.go new file mode 100644 index 000000000..ea28618b5 --- /dev/null +++ b/systray/exec_default.go @@ -0,0 +1,26 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +//go:build !darwin + +package systray + +import "os/exec" + +// default execApp from golang +func execApp(path string, args ...string) error { + cmd := exec.Command(path, args...) + return cmd.Start() +} diff --git a/systray/systray.go b/systray/systray.go new file mode 100644 index 000000000..4df4fadbc --- /dev/null +++ b/systray/systray.go @@ -0,0 +1,103 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package systray + +import ( + "fmt" + "os" + "strings" + + "github.com/arduino/go-paths-helper" + log "github.com/sirupsen/logrus" +) + +// Systray manages the systray icon with its menu and actions. It also handles the pause/resume behaviour of the agent +type Systray struct { + // Whether the Agent is in Pause mode + Hibernate bool + // The version of the Agent, displayed in the trayicon menu + Version string + // The url of the debug page. It's a function because it could change port + DebugURL func() string + // The active configuration file + AdditionalConfig string + // The path to the directory containing the configuration files + ConfigDir *paths.Path + // The path of the exe (only used in update) + path string + // The path of the configuration file + currentConfigFilePath *paths.Path +} + +// Restart restarts the program +// it works by finding the executable path and launching it before quitting +func (s *Systray) Restart() { + + if s.path == "" { + log.Println("Update binary path not set") + var err error + s.path, err = os.Executable() + if err != nil { + log.Printf("Error getting exe path using os lib. err: %v\n", err) + } + } else { + log.Println("Starting updated binary: ", s.path) + } + + // Trim newlines (needed on osx) + s.path = strings.Trim(s.path, "\n") + + // Build args + args := []string{"-ls", fmt.Sprintf("--hibernate=%v", s.Hibernate)} + + if s.AdditionalConfig != "" { + args = append(args, fmt.Sprintf("--additional-config=%s", s.AdditionalConfig)) + } + + // Launch executable + err := execApp(s.path, args...) + if err != nil { + log.Printf("Error restarting process: %v\n", err) + return + } + + // If everything was fine, quit + s.Quit() +} + +// Pause restarts the program with the hibernate flag set to true +func (s *Systray) Pause() { + s.Hibernate = true + s.Restart() +} + +// Resume restarts the program with the hibernate flag set to false +func (s *Systray) Resume() { + s.Hibernate = false + s.Restart() +} + +// RestartWith restarts the program with the given path +func (s *Systray) RestartWith(path string) { + s.path = path + s.Restart() +} + +// SetCurrentConfigFile allows to specify the path of the configuration file the agent +// is using. The tray menu with this info can display an "open config file" option. +func (s *Systray) SetCurrentConfigFile(configPath *paths.Path) { + s.currentConfigFilePath = configPath +} diff --git a/systray/systray_fake.go b/systray/systray_fake.go new file mode 100644 index 000000000..8f8e858a3 --- /dev/null +++ b/systray/systray_fake.go @@ -0,0 +1,32 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +//go:build cli + +// Systray_fake gets compiled when the tag 'cli' is present. This is useful to build an agent without trayicon functionalities + +package systray + +import "os" + +// Start is a dummy function +func (s *Systray) Start() { + select {} +} + +// Quit is a dummy function +func (s *Systray) Quit() { + os.Exit(0) +} diff --git a/systray/systray_real.go b/systray/systray_real.go new file mode 100644 index 000000000..b070f22af --- /dev/null +++ b/systray/systray_real.go @@ -0,0 +1,251 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +//go:build !cli + +// Systray_real gets compiled when the tag 'cli' is missing. This is the default case + +package systray + +import ( + "os" + "runtime" + "time" + + "fyne.io/systray" + cert "github.com/arduino/arduino-create-agent/certificates" + "github.com/arduino/arduino-create-agent/config" + "github.com/arduino/arduino-create-agent/icon" + "github.com/arduino/arduino-create-agent/utilities" + "github.com/go-ini/ini" + log "github.com/sirupsen/logrus" + "github.com/skratchdot/open-golang/open" +) + +// Start sets up the systray icon with its menus +func (s *Systray) Start() { + if s.Hibernate { + systray.Run(s.startHibernate, s.end) + } else { + systray.Run(s.start, s.end) + } +} + +// Quit simply exits the program +func (s *Systray) Quit() { + systray.Quit() +} + +// start creates a systray icon with menu options to go to arduino create, open debug, pause/quit the agent +func (s *Systray) start() { + systray.SetTemplateIcon(icon.GetIcon(), icon.GetIcon()) + + // Add version + menuVer := systray.AddMenuItem("Agent version "+s.Version, "") + menuVer.Disable() + + // Add links + mURL := systray.AddMenuItem("Go to Arduino Cloud", "Arduino Cloud") + mDebug := systray.AddMenuItem("Open Debug Console", "Debug console") + mConfig := systray.AddMenuItem("Open Configuration", "Config File") + + // Remove crash-reports + mRmCrashes := systray.AddMenuItem("Remove crash reports", "") + s.updateMenuItem(mRmCrashes, config.LogsIsEmpty()) + + mManageCerts := systray.AddMenuItem("Manage HTTPS certificate", "HTTPS Certs") + // On linux/windows chrome/firefox/edge(chromium) the agent works without problems on plain HTTP, + // so we disable the menuItem to generate/install the certificates + if runtime.GOOS != "darwin" { + s.updateMenuItem(mManageCerts, true) + } + + // Add pause/quit + mPause := systray.AddMenuItem("Pause Agent", "") + systray.AddSeparator() + mQuit := systray.AddMenuItem("Quit Agent", "") + + // Add configs + s.addConfigs() + + // listen for events + go func() { + for { + select { + case <-mURL.ClickedCh: + _ = open.Start("https://app.arduino.cc") + case <-mDebug.ClickedCh: + _ = open.Start(s.DebugURL()) + case <-mConfig.ClickedCh: + _ = open.Start(s.currentConfigFilePath.String()) + case <-mRmCrashes.ClickedCh: + RemoveCrashes() + s.updateMenuItem(mRmCrashes, config.LogsIsEmpty()) + case <-mManageCerts.ClickedCh: + infoMsg := "The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\n\nYour HTTPS certificate status:\n" + buttons := "{\"Install the certificate for Safari\", \"OK\"}" + toPress := "Install the certificate for Safari" + certDir := config.GetCertificatesDir() + if cert.CertInKeychain() || config.CertsExist() { + expDate, err := cert.GetExpirationDate() + if err != nil { + log.Errorf("cannot get certificates expiration date, something went wrong: %s", err) + } + infoMsg = infoMsg + "- Certificate installed:\t\tYes\n- Certificate trusted:\t\tYes\n- Certificate expiration:\t" + expDate.Format(time.DateTime) + buttons = "{\"Uninstall the certificate for Safari\", \"OK\"}" + toPress = "Uninstall the certificate for Safari" + pressedButton := utilities.UserPrompt(infoMsg, buttons, "OK", toPress, "Arduino Agent: Manage HTTPS certificate") + if pressedButton { + err := cert.UninstallCertificates() + if err != nil { + log.Errorf("cannot uninstall certificates something went wrong: %s", err) + } else { + cert.DeleteCertificates(certDir) + err = config.SetInstallCertsIni(s.currentConfigFilePath.String(), "false") + if err != nil { + log.Errorf("cannot set installCerts value in config.ini: %s", err) + } + utilities.UserPrompt("The HTTPS certificate has been uninstalled.", "{\"OK\"}", "OK", "OK", "Arduino Agent: HTTPS certificate installation") + } + s.Restart() + } + } else { + infoMsg = infoMsg + "- Certificate installed:\t\tNo\n- Certificate trusted:\t\tN/A\n- Certificate expiration:\tN/A" + pressedButton := utilities.UserPrompt(infoMsg, buttons, "OK", toPress, "Arduino Agent: Manage HTTPS certificate") + if pressedButton { + cert.GenerateAndInstallCertificates(certDir) + err := config.SetInstallCertsIni(s.currentConfigFilePath.String(), "true") + if err != nil { + log.Errorf("cannot set installCerts value in config.ini: %s", err) + } + s.Restart() + } + } + case <-mPause.ClickedCh: + s.Pause() + case <-mQuit.ClickedCh: + s.Quit() + } + } + }() +} + +// updateMenuItem will enable or disable an item in the tray icon menu id disable is true +func (s *Systray) updateMenuItem(item *systray.MenuItem, disable bool) { + if disable { + item.Disable() + } else { + item.Enable() + } +} + +// RemoveCrashes removes the crash-reports from `logs` folder +func RemoveCrashes() { + logsDir := config.GetLogsDir() + pathErr := logsDir.RemoveAll() + if pathErr != nil { + log.Errorf("Cannot remove crashreports: %s", pathErr) + } else { + log.Infof("Removed crashreports inside: %s", logsDir) + } +} + +// starthibernate creates a systray icon with menu options to resume/quit the agent +func (s *Systray) startHibernate() { + systray.SetTemplateIcon(icon.GetIconHiber(), icon.GetIconHiber()) + + mResume := systray.AddMenuItem("Resume Agent", "") + systray.AddSeparator() + mQuit := systray.AddMenuItem("Quit Agent", "") + + // listen for events + go func() { + for { + select { + case <-mResume.ClickedCh: + s.Resume() + case <-mQuit.ClickedCh: + s.Quit() + } + } + }() +} + +// end simply exits the program +func (s *Systray) end() { + os.Exit(0) +} + +func (s *Systray) addConfigs() { + var mConfigCheckbox []*systray.MenuItem + + configs := s.getConfigs() + if len(configs) > 1 { + for _, config := range configs { + entry := systray.AddMenuItem(config.Name, "") + mConfigCheckbox = append(mConfigCheckbox, entry) + // decorate configs + gliph := " ☐ " + if s.AdditionalConfig == config.Location { + gliph = " 🗹 " + } + entry.SetTitle(gliph + config.Name) + } + } + + // It would be great to use the select channel here, + // but unfortunately there's no clean way to do it with an array of channels, so we start a single goroutine for each of them + for i := range mConfigCheckbox { + go func(v int) { + <-mConfigCheckbox[v].ClickedCh + s.AdditionalConfig = configs[v].Location + s.Restart() + }(i) + } +} + +type configIni struct { + Name string + Location string +} + +// getConfigs parses all config files in the .arduino-create folder +func (s *Systray) getConfigs() []configIni { + var configs []configIni + + files, err := s.ConfigDir.ReadDir() + if err != nil { + log.Errorf("cannot read the content of %s", s.ConfigDir) + return nil + } + files.FilterOutDirs() + files.FilterSuffix(".ini") + for _, file := range files { + cfg, err := ini.LoadSources(ini.LoadOptions{IgnoreInlineComment: true, AllowPythonMultilineValues: true}, file.String()) + if err != nil { + log.Errorf("error walking through executable configuration: %s", err) + } else { + defaultSection, err := cfg.GetSection("") + name := defaultSection.Key("name").String() + if name == "" || err != nil { + name = "Default config" + } + conf := configIni{Name: name, Location: file.String()} + configs = append(configs, conf) + } + } + + return configs +} diff --git a/tests/common.py b/tests/common.py new file mode 100644 index 000000000..34e16b523 --- /dev/null +++ b/tests/common.py @@ -0,0 +1,7 @@ +import os + +def running_on_ci(): + """ + Returns whether the program is running on a CI environment + """ + return 'GITHUB_WORKFLOW' in os.environ diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 000000000..0e81d76f0 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,101 @@ +# Copyright 2022 Arduino SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import os +import platform +import signal +import time +from pathlib import Path + +import pytest +from invoke import Local +from invoke.context import Context +import socketio as io + +@pytest.fixture(scope="function") +def agent(pytestconfig): + if platform.system() == "Windows": + agent = str(Path(pytestconfig.rootdir) / "arduino-cloud-agent_cli.exe") + else: + agent = str(Path(pytestconfig.rootdir) / "arduino-cloud-agent") + env = { + # "ARDUINO_DATA_DIR": data_dir, + # "ARDUINO_DOWNLOADS_DIR": downloads_dir, + # "ARDUINO_SKETCHBOOK_DIR": data_dir, + } + run_context = Context() + + runner = Local(run_context) # execute a command on the local filesystem + + cd_command = "cd" + with run_context.prefix(f'{cd_command} ..'): + runner.run(agent, echo=True, hide=True, warn=True, env=env, asynchronous=True) + + # we give some time to the agent to start and listen to + # incoming requests + time.sleep(1) + + # we block here until the test function using this fixture has returned + yield runner + + # Kill the runner's process as we finished our test (platform dependent) + os_signal = signal.SIGTERM + if platform.system() != "Windows": + os_signal = signal.SIGKILL + os.kill(runner.process.pid, os_signal) + + +@pytest.fixture(scope="session") +def base_url(): + return "http://127.0.0.1:8991" + +@pytest.fixture(scope="function") +def socketio(base_url, agent): + sio = io.Client() + sio.connect(base_url) + yield sio + sio.disconnect() + +@pytest.fixture(scope="session") +def serial_port(): + return "/dev/ttyACM0" # maybe this could be enhanced by calling arduino-cli + +@pytest.fixture(scope="session") +def baudrate(): + return "9600" + +# open_port cannot be coced as a fixture because of the buffertype parameter + +# at the end of the test closes the serial port +@pytest.fixture(scope="function") +def close_port(socketio, serial_port): + yield socketio + socketio.emit('command', 'close ' + serial_port) + time.sleep(.5) + + +@pytest.fixture(scope="function") +def message(socketio): + global message + message = [] + #in message var we will find the "response" + socketio.on('message', message_handler) + return message + +# callback called by socketio when a message is received +def message_handler(msg): + # print('Received message: ', msg) + global message + message.append(msg) \ No newline at end of file diff --git a/tests/test_info.py b/tests/test_info.py new file mode 100644 index 000000000..efda3bce8 --- /dev/null +++ b/tests/test_info.py @@ -0,0 +1,32 @@ +# Copyright 2022 Arduino SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import re +import requests +import pytest +from sys import platform + + +@pytest.mark.skipif( + platform == "darwin", + reason="on macOS the user is prompted to install certificates", +) +def test_version(base_url, agent): + + resp = requests.get(f"{base_url}/info") + assert resp.status_code == 200 + + info = resp.json() + assert re.match("[0-9]+.[0-9]+.[0-9]+", info["version"]) is not None diff --git a/tests/test_v2.py b/tests/test_v2.py new file mode 100644 index 000000000..5fa44034e --- /dev/null +++ b/tests/test_v2.py @@ -0,0 +1,30 @@ +# Copyright 2022 Arduino SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import requests +import pytest +from sys import platform + + +@pytest.mark.skipif( + platform == "darwin", + reason="on macOS the user is prompted to install certificates", +) +def test_get_tools(base_url, agent): + + resp = requests.get(f"{base_url}/v2/pkgs/tools/installed") + assert resp.status_code == 200 + + tools = resp.json() \ No newline at end of file diff --git a/tests/test_ws.py b/tests/test_ws.py new file mode 100644 index 000000000..b8004649d --- /dev/null +++ b/tests/test_ws.py @@ -0,0 +1,210 @@ +# Copyright 2022 Arduino SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import time +import json +import base64 +import pytest +from sys import platform + +from common import running_on_ci +message = [] + + +@pytest.mark.skipif( + platform == "darwin", + reason="on macOS the user is prompted to install certificates", +) +def test_ws_connection(socketio): + print('my sid is', socketio.sid) + assert socketio.sid is not None + + +@pytest.mark.skipif( + platform == "darwin", + reason="on macOS the user is prompted to install certificates", +) +def test_list(socketio, message): + socketio.emit('command', 'list') + time.sleep(.2) + print (message) + assert any("list" in i for i in message) + assert any("Ports" in i for i in message) + + +# NOTE run the following tests with a board connected to the PC +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_open_serial_default(socketio, serial_port, baudrate, message): + general_open_serial(socketio, serial_port, baudrate, message, "default") + + +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_open_serial_timed(socketio, serial_port, baudrate, message): + general_open_serial(socketio, serial_port, baudrate, message, "timed") + + +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_open_serial_timedraw(socketio, serial_port, baudrate, message): + general_open_serial(socketio, serial_port, baudrate, message, "timedraw") + + +# NOTE run the following tests with a board connected to the PC and with the sketch found in tests/testdata/SerialEcho.ino on it be sure to change serial_address in conftest.py +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_send_serial_default(socketio, close_port, serial_port, baudrate, message): + general_send_serial(socketio, close_port, serial_port, baudrate, message, "default") + + +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_send_serial_timed(socketio, close_port, serial_port, baudrate, message): + general_send_serial(socketio, close_port, serial_port, baudrate, message, "timed") + + +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_send_serial_timedraw(socketio, close_port, serial_port, baudrate, message): + general_send_serial(socketio, close_port, serial_port, baudrate, message, "timedraw") + + +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_send_emoji_serial_default(socketio, close_port, serial_port, baudrate, message): + general_send_emoji_serial(socketio, close_port, serial_port, baudrate, message, "default") + + +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_send_emoji_serial_timed(socketio, close_port, serial_port, baudrate, message): + general_send_emoji_serial(socketio, close_port, serial_port, baudrate, message, "timed") + + +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_send_emoji_serial_timedraw(socketio, close_port, serial_port, baudrate, message): + general_send_emoji_serial(socketio, close_port, serial_port, baudrate, message, "timedraw") + + +def general_open_serial(socketio, serial_port, baudrate, message, buffertype): + open_serial_port(socketio, serial_port, baudrate, message, buffertype) + # test the closing of the serial port, we are gonna use close_port for the other tests + socketio.emit('command', 'close ' + serial_port) + time.sleep(.2) + print (message) + #check if port has been closed + assert any("\"IsOpen\": false," in i for i in message) + + +def general_send_serial(socketio, close_port, serial_port, baudrate, message, buffertype): + open_serial_port(socketio, serial_port, baudrate, message, buffertype) + # send the string "ciao" using the serial connection + socketio.emit('command', 'send ' + serial_port + ' ciao') + time.sleep(1) + print(message) + # check if the send command has been registered + assert any("send " + serial_port + " ciao" in i for i in message) + #check if message has been sent back by the connected board + if buffertype == "timedraw": + output = decode_output(extract_serial_data(message)) + elif buffertype in ("default", "timed"): + output = extract_serial_data(message) + assert "ciao" in output + # the serial connection is closed by close_port() fixture: even if in case of test failure + + +def general_send_emoji_serial(socketio, close_port, serial_port, baudrate, message, buffertype): + open_serial_port(socketio, serial_port, baudrate, message, buffertype) + # send a lot of emoji: they can be messed up + socketio.emit('command', 'send ' + serial_port + ' /"🧀🧀🧀🧀🧀🧀🧀🧀🧀🧀/"') + time.sleep(1) + print(message) + # check if the send command has been registered + assert any("send " + serial_port + " /\"🧀🧀🧀🧀🧀🧀🧀🧀🧀🧀/\"" in i for i in message) + if buffertype == "timedraw": + output = decode_output(extract_serial_data(message)) + elif buffertype in ("default", "timed"): + output = extract_serial_data(message) + assert "/\"🧀🧀🧀🧀🧀🧀🧀🧀🧀🧀/\"" in output + # the serial connection is closed by close_port() fixture: even if in case of test failure + + +def open_serial_port(socketio, serial_port, baudrate, message, buffertype): + #open a new serial connection with the specified buffertype + socketio.emit('command', 'open ' + serial_port + ' ' + baudrate + ' ' + buffertype) + # give time to the message var to be filled + time.sleep(.5) + print(message) + # the serial connection should be open now + assert any("\"IsOpen\": true" in i for i in message) + + +@pytest.mark.skipif( + running_on_ci(), + reason="VMs have no serial ports", +) +def test_sendraw_serial(socketio, close_port, serial_port, baudrate, message): + open_serial_port(socketio, serial_port, baudrate, message, "timedraw") + #test with bytes + integers = [1, 2, 3, 4, 5] + bytes_array=bytearray(integers) + encoded_integers = base64.b64encode(bytes_array).decode('ascii') + socketio.emit('command', 'sendraw ' + serial_port + ' ' + encoded_integers) + time.sleep(1) + print(message) + # check if the send command has been registered + assert any(("sendraw " + serial_port + ' ' + encoded_integers) in i for i in message) + #check if message has been sent back by the connected board + output = extract_serial_data(message) # TODO use decode_output() + print (output) + assert encoded_integers in output + + +# helper function used to extract serial data from its JSON representation +# NOTE make sure to pass a clean message (maybe reinitialize the message global var before populating it) +def extract_serial_data(msg): + serial_data = "" + for i in msg: + if "{\"P\"" in i: + print (json.loads(i)["D"]) + serial_data+=json.loads(i)["D"] + print("serialdata:"+serial_data) + return serial_data + +def decode_output(raw_output): + # print(raw_output) + base64_bytes = raw_output.encode('ascii') #encode rawoutput message into a bytes-like object + output_bytes = base64.b64decode(base64_bytes) + return output_bytes.decode('utf-8') diff --git a/tests/testdata/SerialEcho/SerialEcho.ino b/tests/testdata/SerialEcho/SerialEcho.ino new file mode 100644 index 000000000..efb7c59b7 --- /dev/null +++ b/tests/testdata/SerialEcho/SerialEcho.ino @@ -0,0 +1,18 @@ +int incomingByte = 0; // for incoming serial data + +void setup() { + Serial.begin(9600); // opens serial port, sets data rate to 9600 bps +} + +void loop() { + // send data only when you receive data: + if (Serial.available() > 0) { + + // read the incoming byte: + incomingByte = Serial.read(); + + // say what you got: + Serial.print((char)incomingByte); + } + +} diff --git a/tests/testdata/test.ini b/tests/testdata/test.ini new file mode 100644 index 000000000..c9629a110 --- /dev/null +++ b/tests/testdata/test.ini @@ -0,0 +1,9 @@ +signatureKey = -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvc0yZr1yUSen7qmE3cxF + IE12rCksDnqR+Hp7o0nGi9123eCSFcJ7CkIRC8F+8JMhgI3zNqn4cUEn47I3RKD1 + ZChPUCMiJCvbLbloxfdJrUi7gcSgUXrlKQStOKF5Iz7xv1M4XOP3JtjXLGo3EnJ1 + pFgdWTOyoSrA8/w1rck4c/ISXZSinVAggPxmLwVEAAln6Itj6giIZHKvA2fL2o8z + CeK057Lu8X6u2CG8tRWSQzVoKIQw/PKK6CNXCAy8vo4EkXudRutnEYHEJlPkVgPn + 2qP06GI+I+9zKE37iqj0k1/wFaCVXHXIvn06YrmjQw6I0dDj/60Wvi500FuRVpn9 + twIDAQAB + -----END PUBLIC KEY----- diff --git a/tools/download.go b/tools/download.go new file mode 100644 index 000000000..8c4a37a6c --- /dev/null +++ b/tools/download.go @@ -0,0 +1,105 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package tools + +import ( + "context" + "errors" + "os" + "os/exec" + "path/filepath" + "runtime" + + "github.com/arduino/arduino-create-agent/gen/tools" + "github.com/arduino/arduino-create-agent/utilities" +) + +// Download will parse the index at the indexURL for the tool to download. +// It will extract it in a folder in .arduino-create, and it will update the +// Installed map. +// +// pack contains the packager of the tool +// name contains the name of the tool. +// version contains the version of the tool. +// behaviour contains the strategy to use when there is already a tool installed +// +// If version is "latest" it will always download the latest version (regardless +// of the value of behaviour) +// +// If version is not "latest" and behaviour is "replace", it will download the +// version again. If instead behaviour is "keep" it will not download the version +// if it already exists. +func (t *Tools) Download(pack, name, version, behaviour string) error { + + t.tools.SetBehaviour(behaviour) + _, err := t.tools.Install(context.Background(), &tools.ToolPayload{Name: name, Version: version, Packager: pack}) + if err != nil { + return err + } + + path := filepath.Join(pack, name, version) + safePath, err := utilities.SafeJoin(t.directory.String(), path) + if err != nil { + return err + } + + // if the tool contains a post_install script, run it: it means it is a tool that needs to install drivers + // AFAIK this is only the case for the windows-driver tool + err = t.installDrivers(safePath) + if err != nil { + return err + } + + // Ensure that the files are executable + t.logger("Ensure that the files are executable") + + // Update the tool map + t.logger("Updating map with location " + safePath) + + t.setMapValue(name, safePath) + t.setMapValue(name+"-"+version, safePath) + + return nil +} + +func (t *Tools) installDrivers(location string) error { + OkPressed := 6 + extension := ".bat" + // add .\ to force locality + preamble := ".\\" + if runtime.GOOS != "windows" { + extension = ".sh" + // add ./ to force locality + preamble = "./" + } + if _, err := os.Stat(filepath.Join(location, "post_install"+extension)); err == nil { + t.logger("Installing drivers") + ok := MessageBox("Installing drivers", "We are about to install some drivers needed to use Arduino/Genuino boards\nDo you want to continue?") + if ok == OkPressed { + os.Chdir(location) + t.logger(preamble + "post_install" + extension) + oscmd := exec.Command(preamble + "post_install" + extension) + if runtime.GOOS != "linux" { + // spawning a shell could be the only way to let the user type his password + TellCommandNotToSpawnShell(oscmd) + } + err = oscmd.Run() + return err + } + return errors.New("could not install drivers") + } + return nil +} diff --git a/tools/download_test.go b/tools/download_test.go new file mode 100644 index 000000000..96a105fd7 --- /dev/null +++ b/tools/download_test.go @@ -0,0 +1,184 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package tools + +import ( + "encoding/json" + "runtime" + "testing" + "time" + + "github.com/arduino/arduino-create-agent/globals" + "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/utilities" + "github.com/arduino/arduino-create-agent/v2/pkgs" + "github.com/arduino/go-paths-helper" + "github.com/stretchr/testify/require" +) + +func TestDownloadCorrectPlatform(t *testing.T) { + testCases := []struct { + hostOS string + hostArch string + correctOSArch string + }{ + {"linux", "amd64", "x86_64-linux-gnu"}, + {"linux", "386", "i686-linux-gnu"}, + {"darwin", "amd64", "x86_64-apple-darwin"}, + {"darwin", "arm64", "arm64-apple-darwin"}, + {"windows", "386", "i686-mingw32"}, + {"windows", "amd64", "x86_64-mingw32"}, + {"linux", "arm", "arm-linux-gnueabihf"}, + } + defer func() { + pkgs.OS = runtime.GOOS // restore `runtime.OS` + pkgs.Arch = runtime.GOARCH // restore `runtime.ARCH` + }() + testIndex := paths.New("testdata", "test_tool_index.json") + buf, err := testIndex.ReadFile() + require.NoError(t, err) + + var data pkgs.Index + err = json.Unmarshal(buf, &data) + require.NoError(t, err) + for _, tc := range testCases { + t.Run(tc.hostOS+tc.hostArch, func(t *testing.T) { + pkgs.OS = tc.hostOS // override `runtime.OS` for testing purposes + pkgs.Arch = tc.hostArch // override `runtime.ARCH` for testing purposes + // Find the tool by name + correctTool, correctSystem, found := pkgs.FindTool("arduino-test", "arduino-fwuploader", "2.2.2", data) + require.True(t, found) + require.NotNil(t, correctTool) + require.NotNil(t, correctSystem) + require.Equal(t, correctTool.Name, "arduino-fwuploader") + require.Equal(t, correctTool.Version, "2.2.2") + require.Equal(t, correctSystem.Host, tc.correctOSArch) + }) + } +} + +func TestDownloadFallbackPlatform(t *testing.T) { + testCases := []struct { + hostOS string + hostArch string + correctOSArch string + }{ + {"darwin", "amd64", "i386-apple-darwin11"}, + {"darwin", "arm64", "i386-apple-darwin11"}, + {"windows", "amd64", "i686-mingw32"}, + } + defer func() { + pkgs.OS = runtime.GOOS // restore `runtime.OS` + pkgs.Arch = runtime.GOARCH // restore `runtime.ARCH` + }() + testIndex := paths.New("testdata", "test_tool_index.json") + buf, err := testIndex.ReadFile() + require.NoError(t, err) + + var data pkgs.Index + err = json.Unmarshal(buf, &data) + require.NoError(t, err) + for _, tc := range testCases { + t.Run(tc.hostOS+tc.hostArch, func(t *testing.T) { + pkgs.OS = tc.hostOS // override `runtime.OS` for testing purposes + pkgs.Arch = tc.hostArch // override `runtime.ARCH` for testing purposes + // Find the tool by name + correctTool, correctSystem, found := pkgs.FindTool("arduino-test", "arduino-fwuploader", "2.2.0", data) + require.True(t, found) + require.NotNil(t, correctTool) + require.NotNil(t, correctSystem) + require.Equal(t, correctTool.Name, "arduino-fwuploader") + require.Equal(t, correctTool.Version, "2.2.0") + require.Equal(t, correctSystem.Host, tc.correctOSArch) + }) + } +} + +func TestDownload(t *testing.T) { + testCases := []struct { + name string + version string + filesCreated []string + }{ + {"avrdude", "6.3.0-arduino17", []string{"bin", "etc"}}, + {"bossac", "1.6.1-arduino", []string{"bossac"}}, + {"bossac", "1.7.0-arduino3", []string{"bossac"}}, + {"bossac", "1.9.1-arduino2", []string{"bossac"}}, + {"openocd", "0.11.0-arduino2", []string{"bin", "share"}}, + {"dfu-util", "0.10.0-arduino1", []string{"dfu-prefix", "dfu-suffix", "dfu-util"}}, + {"rp2040tools", "1.0.6", []string{"elf2uf2", "picotool", "pioasm", "rp2040load"}}, + {"esptool_py", "4.5.1", []string{"esptool"}}, + {"arduino-fwuploader", "2.2.2", []string{"arduino-fwuploader"}}, + } + // prepare the test environment + tempDir := t.TempDir() + tempDirPath := paths.New(tempDir) + testIndex := index.Resource{ + IndexFile: *paths.New("testdata", "test_tool_index.json"), + LastRefresh: time.Now(), + } + testTools := New(tempDirPath, &testIndex, func(msg string) { t.Log(msg) }, utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) + + for _, tc := range testCases { + t.Run(tc.name+"-"+tc.version, func(t *testing.T) { + // Download the tool + err := testTools.Download("arduino-test", tc.name, tc.version, "replace") + require.NoError(t, err) + + // Check that the tool has been downloaded + toolDir := tempDirPath.Join("arduino-test", tc.name, tc.version) + require.DirExists(t, toolDir.String()) + + // Check that the files have been created + for _, file := range tc.filesCreated { + filePath := toolDir.Join(file) + if filePath.IsDir() { + require.DirExists(t, filePath.String()) + } else { + if runtime.GOOS == "windows" { + require.FileExists(t, filePath.String()+".exe") + } else { + require.FileExists(t, filePath.String()) + } + } + } + + // Check that the tool has been installed + _, ok := testTools.getMapValue(tc.name + "-" + tc.version) + require.True(t, ok) + }) + } +} + +func TestCorruptedInstalled(t *testing.T) { + // prepare the test environment + tempDir := t.TempDir() + tempDirPath := paths.New(tempDir) + testIndex := index.Resource{ + IndexFile: *paths.New("testdata", "test_tool_index.json"), + LastRefresh: time.Now(), + } + corruptedJSON := tempDirPath.Join("installed.json") + fileJSON, err := corruptedJSON.Create() + require.NoError(t, err) + defer fileJSON.Close() + _, err = fileJSON.Write([]byte("Hello")) + require.NoError(t, err) + testTools := New(tempDirPath, &testIndex, func(msg string) { t.Log(msg) }, utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) + // Download the tool + err = testTools.Download("arduino-test", "avrdude", "6.3.0-arduino17", "keep") + require.NoError(t, err) +} diff --git a/tools/shell_default.go b/tools/shell_default.go new file mode 100644 index 000000000..24a607a5d --- /dev/null +++ b/tools/shell_default.go @@ -0,0 +1,31 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +//go:build !windows + +package tools + +import ( + "os/exec" +) + +// TellCommandNotToSpawnShell will now spawn a shell +func TellCommandNotToSpawnShell(_ *exec.Cmd) { +} + +// MessageBox will open a dialog +func MessageBox(title, text string) int { + return 6 +} diff --git a/tools/shell_windows.go b/tools/shell_windows.go new file mode 100644 index 000000000..55f665dea --- /dev/null +++ b/tools/shell_windows.go @@ -0,0 +1,40 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package tools + +import ( + "os/exec" + "syscall" + "unsafe" +) + +// TellCommandNotToSpawnShell will now spawn a shell +func TellCommandNotToSpawnShell(oscmd *exec.Cmd) { + oscmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} +} + +// MessageBox will open a dialog +func MessageBox(title, text string) int { + var mod = syscall.NewLazyDLL("user32.dll") + var proc = mod.NewProc("MessageBoxW") + var MB_YESNO = 0x00000004 + + ret, _, _ := proc.Call(0, + uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(text))), + uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(title))), + uintptr(MB_YESNO)) + return int(ret) +} diff --git a/tools/testdata/test_tool_index.json b/tools/testdata/test_tool_index.json new file mode 100644 index 000000000..b7f8b87d2 --- /dev/null +++ b/tools/testdata/test_tool_index.json @@ -0,0 +1,521 @@ +{ + "packages": [ + { + "name": "arduino-test", + "maintainer": "Arduino", + "websiteURL": "http://www.arduino.cc/", + "email": "packages@arduino.cc", + "help": { + "online": "http://www.arduino.cc/en/Reference/HomePage" + }, + "platforms": [ + { + "name": "Arduino megaAVR Boards - Pre-release", + "architecture": "megaavr", + "version": "1.8.102", + "category": "Arduino", + "url": "http://downloads.arduino.cc/cores/staging/core-megaavr-1.8.102.tar.bz2", + "archiveFileName": "core-megaavr-1.8.102.tar.bz2", + "checksum": "SHA-256:ad5e60b828678d9ccff957032524a4c4d68b218737e7df24b905769a04dc2a6a", + "size": "858620", + "help": { + "online": "https://github.com/arduino/ArduinoCore-megaavr/issues" + }, + "boards": [ + { + "name": "Arduino Uno WiFi Rev2" + }, + { + "name": "Arduino Nano Every" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "avr-gcc", + "version": "7.3.0-atmel3.6.1-arduino5" + }, + { + "packager": "arduino", + "name": "avrdude", + "version": "7.0-arduino.3" + }, + { + "packager": "arduino", + "name": "arduinoOTA", + "version": "1.3.0" + } + ] + } + ], + "tools": [ + { + "name": "avrdude", + "version": "6.3.0-arduino17", + "systems": [ + { + "size": "219631", + "checksum": "SHA-256:2a8e68c5d803aa6f902ef219f177ec3a4c28275d85cbe272962ad2cd374f50d1", + "host": "arm-linux-gnueabihf", + "archiveFileName": "avrdude-6.3.0-arduino17-armhf-pc-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-armhf-pc-linux-gnu.tar.bz2" + }, + { + "size": "229852", + "checksum": "SHA-256:6cf948f751acfe7b96684537f2291c766ec8b54b4f7dc95539864821456fa9fc", + "host": "aarch64-linux-gnu", + "archiveFileName": "avrdude-6.3.0-arduino17-aarch64-pc-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-aarch64-pc-linux-gnu.tar.bz2" + }, + { + "size": "279045", + "checksum": "SHA-256:120cc9edaae699e7e9ac50b1b8eb0e7d51fdfa555bac54233c2511e6ee5418c9", + "host": "x86_64-apple-darwin12", + "archiveFileName": "avrdude-6.3.0-arduino17-x86_64-apple-darwin12.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-x86_64-apple-darwin12.tar.bz2" + }, + { + "size": "254271", + "checksum": "SHA-256:accdfb920af2aabf4f7461d2ac73c0751760f525216dc4e7657427a78c60d13d", + "host": "x86_64-linux-gnu", + "archiveFileName": "avrdude-6.3.0-arduino17-x86_64-pc-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-x86_64-pc-linux-gnu.tar.bz2" + }, + { + "size": "244550", + "checksum": "SHA-256:5c8cc6c17db9300e1451fe41cd7178b0442b4490ee6fdbc0aed9811aef96c05f", + "host": "i686-linux-gnu", + "archiveFileName": "avrdude-6.3.0-arduino17-i686-pc-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-i686-pc-linux-gnu.tar.bz2" + }, + { + "size": "328460", + "checksum": "SHA-256:e99188873c7c5ad8f8f906f068c33600e758b2e36cce3adbd518a21bd266749d", + "host": "i686-mingw32", + "archiveFileName": "avrdude-6.3.0-arduino17-i686-w64-mingw32.zip", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-i686-w64-mingw32.zip" + } + ] + }, + { + "name": "bossac", + "version": "1.6.1-arduino", + "systems": [ + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-arm-linux-gnueabihf.tar.bz2", + "archiveFileName": "bossac-1.6.1-arduino-arm-linux-gnueabihf.tar.bz2", + "checksum": "SHA-256:8c4e63db982178919c824e7a35580dffc95c3426afa7285de3eb583982d4d391", + "size": "201341" + }, + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-mingw32.tar.gz", + "archiveFileName": "bossac-1.6.1-arduino-mingw32.tar.gz", + "checksum": "SHA-256:d59f43e2e83a337d04c4ae88b195a4ee175b8d87fff4c43144d23412a4a9513b", + "size": "222918" + }, + { + "host": "x86_64-apple-darwin", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-i386-apple-darwin14.5.0.tar.gz", + "archiveFileName": "bossac-1.6.1-arduino-i386-apple-darwin14.5.0.tar.gz", + "checksum": "SHA-256:2f80ef569a3fb19da60ab3489e49d8fe7d4699876acf30ff4938c632230a09aa", + "size": "64587" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-x86_64-linux-gnu.tar.gz", + "archiveFileName": "bossac-1.6.1-arduino-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:b78afc66c00ccfdd69a08bd3959c260a0c64ccce78a71d5a1135ae4437ff40db", + "size": "30869" + }, + { + "host": "i686-pc-linux-gnu", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-i486-linux-gnu.tar.gz", + "archiveFileName": "bossac-1.6.1-arduino-i486-linux-gnu.tar.gz", + "checksum": "SHA-256:1e211347569d75193b337296a10dd25b0ce04419e3d7dc644355178b6b514f92", + "size": "30320" + } + ] + }, + { + "name": "bossac", + "version": "1.7.0-arduino3", + "systems": [ + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-windows.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-windows.tar.gz", + "checksum": "SHA-256:62745cc5a98c26949ec9041ef20420643c561ec43e99dae659debf44e6836526", + "size": "3607421" + }, + { + "host": "x86_64-apple-darwin", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-osx.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-osx.tar.gz", + "checksum": "SHA-256:adb3c14debd397d8135e9e970215c6972f0e592c7af7532fa15f9ce5e64b991f", + "size": "75510" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-linux64.tar.gz", + "checksum": "SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100", + "size": "207271" + }, + { + "host": "i686-pc-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux32.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-linux32.tar.gz", + "checksum": "SHA-256:4ac4354746d1a09258f49a43ef4d1baf030d81c022f8434774268b00f55d3ec3", + "size": "193577" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linuxarm.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-linuxarm.tar.gz", + "checksum": "SHA-256:626c6cc548046901143037b782bf019af1663bae0d78cf19181a876fb9abbb90", + "size": "193941" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linuxaarch64.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-linuxaarch64.tar.gz", + "checksum": "SHA-256:a098b2cc23e29f0dc468416210d097c4a808752cd5da1a7b9b8b7b931a04180b", + "size": "268365" + } + ] + }, + { + "name": "bossac", + "version": "1.9.1-arduino2", + "systems": [ + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-windows.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-windows.tar.gz", + "checksum": "SHA-256:5c994d04354f0db8e4bea136f49866d2ba537f0af74b2e78026f2d4fc75e3e39", + "size": "1260628" + }, + { + "host": "x86_64-apple-darwin", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-osx.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-osx.tar.gz", + "checksum": "SHA-256:b7732129364a378676604db6579c9b8dab50dd965fb50d7a3afff1839c97ff80", + "size": "47870" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-linux64.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-linux64.tar.gz", + "checksum": "SHA-256:9eb549874391521999cee13dc823a2cfc8866b8246945339a281808d99c72d2c", + "size": "399532" + }, + { + "host": "i686-pc-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-linux32.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-linux32.tar.gz", + "checksum": "SHA-256:10d69f53f169f25afee2dd583dfd9dc803c10543e6c5260d106725cb0d174900", + "size": "384951" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-linuxarm.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-linuxarm.tar.gz", + "checksum": "SHA-256:c9539d161d23231b5beb1d09a71829744216c7f5bc2857a491999c3e567f5b19", + "size": "361915" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-linuxaarch64.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-linuxaarch64.tar.gz", + "checksum": "SHA-256:c167fa0ea223966f4d21f5592da3888bcbfbae385be6c5c4e41f8abff35f5cb1", + "size": "442853" + } + ] + }, + { + "name": "openocd", + "version": "0.11.0-arduino2", + "systems": [ + { + "size": "1902818", + "checksum": "SHA-256:a1aa7f1435a61eafb72ee90722f2496d6a34a7a0f085d0315c2613e4a548b824", + "host": "aarch64-linux-gnu", + "archiveFileName": "openocd-0.11.0-arduino2-static-aarch64-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-aarch64-linux-gnu.tar.bz2" + }, + { + "size": "1986716", + "checksum": "SHA-256:57041130160be086e69387cceb4616eefc9819a0ef75de1f7c11aea57fb92699", + "host": "arm-linux-gnueabihf", + "archiveFileName": "openocd-0.11.0-arduino2-static-arm-linux-gnueabihf.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-arm-linux-gnueabihf.tar.bz2" + }, + { + "size": "1971364", + "checksum": "SHA-256:6f4a8b77c8076aa18afb8438472526dff8c0d161a3ca68d0326163b59fcab663", + "host": "i686-linux-gnu", + "archiveFileName": "openocd-0.11.0-arduino2-static-i686-ubuntu12.04-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-i686-ubuntu12.04-linux-gnu.tar.bz2" + }, + { + "size": "2460087", + "checksum": "SHA-256:631010980f12b1e750c4c67ce012b31c5953caabf4d30607d806e3d2b717d4b8", + "host": "i686-mingw32", + "archiveFileName": "openocd-0.11.0-arduino2-static-i686-w64-mingw32.zip", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-i686-w64-mingw32.zip" + }, + { + "size": "1893150", + "checksum": "SHA-256:280e7234eba84e830e92d791ebc685286f71d2bc1d3347f93605ef170d54fef4", + "host": "i386-apple-darwin11", + "archiveFileName": "openocd-0.11.0-arduino2-static-x86_64-apple-darwin13.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-x86_64-apple-darwin13.tar.bz2" + }, + { + "size": "2052080", + "checksum": "SHA-256:4d19b6e3906de1434ec86841e0e3138235714c655d45f037c0fabfa5e5c0681b", + "host": "x86_64-linux-gnu", + "archiveFileName": "openocd-0.11.0-arduino2-static-x86_64-ubuntu12.04-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-x86_64-ubuntu12.04-linux-gnu.tar.bz2" + } + ] + }, + { + "name": "dfu-util", + "version": "0.10.0-arduino1", + "systems": [ + { + "host": "i386-apple-darwin11", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-osx.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-osx.tar.bz2", + "size": "73921", + "checksum": "SHA-256:7562d128036759605828d64b8d672d42445a8d95555c4b9ba339f73a1711a640" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-arm.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-arm.tar.bz2", + "size": "272153", + "checksum": "SHA-256:f1e550f40c235356b7fde1c59447bfbab28f768915d3c14bd858fe0576bfc5a9" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-arm64.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-arm64.tar.bz2", + "size": "277886", + "checksum": "SHA-256:ebfbd21d3030c500da1f83b9aae5b8c597bee04c3bde1ce0a51b41abeafc9614" + }, + { + "host": "x86_64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-linux64.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-linux64.tar.bz2", + "size": "77184", + "checksum": "SHA-256:13ef2ec591c1e8b0b7eb0a05da972ecd6695016e7a9607e332c7553899af9b4a" + }, + { + "host": "i686-linux-gnu", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-linux32.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-linux32.tar.bz2", + "size": "81826", + "checksum": "SHA-256:43599ec60c000e9ef016970a496d6ab2cbbe5a8b7df9d06ef3114ecf83f9d123" + }, + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-windows.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-windows.tar.bz2", + "size": "464314", + "checksum": "SHA-256:90816b669273ae796d734a2459c46bb340d4790783fd7aa01eb40c0443f1a9b1" + } + ] + }, + { + "name": "rp2040tools", + "version": "1.0.6", + "systems": [ + { + "host": "i386-apple-darwin11", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-darwin_amd64.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-darwin_amd64.tar.bz2", + "size": "1717967", + "checksum": "SHA-256:4e32aa4b8f36db40a17bfbdfd34d80da91710e30c3887732bf0c0bf0b02840a7" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-linux_arm.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-linux_arm.tar.bz2", + "size": "8702508", + "checksum": "SHA-256:084a29accf0014bc79723fbb40057b95299c7ae63876f74494a077c987014cc3" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-linux_arm64.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-linux_arm64.tar.bz2", + "size": "9037783", + "checksum": "SHA-256:1a2a6cb1abf1f7b8198d494c8d8e838700297d748877be8232e02aaa5ca8d0df" + }, + { + "host": "x86_64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-linux_amd64.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-linux_amd64.tar.bz2", + "size": "6108121", + "checksum": "SHA-256:6e2ea818db1ff57f2d8e1e3010fbc5bdb5f28ff44f5a68900cae41d7d709f738" + }, + { + "host": "i686-linux-gnu", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-linux_386.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-linux_386.tar.bz2", + "size": "6604083", + "checksum": "SHA-256:ef339e2e0f5c7d5464b9911b612c634767daba39a6be977a1ffa41c95b9827a1" + }, + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-windows_386.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-windows_386.tar.bz2", + "size": "3145329", + "checksum": "SHA-256:26a5daebba68c2348dade33716a6e379ded89895ef0e49df1332964a724f6170" + } + ] + }, + { + "name": "esptool_py", + "version": "4.5.1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-macos.tar.gz", + "archiveFileName": "esptool-v4.5.1-macos.tar.gz", + "checksum": "SHA-256:78b52acfd51541ceb97cee893b7d4d49b8ddc284602be8c73ea47e3d849e0956", + "size": "5850888" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + } + ] + }, + { + "name": "arduino-fwuploader", + "version": "2.2.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.0_Windows_32bit.zip", + "archiveFileName": "arduino-fwuploader_2.2.0_Windows_32bit.zip", + "checksum": "SHA-256:c0ff772702460fb5cbd8593f8ce731145d21fbf550342da556e45ef946c7d2f5", + "size": "7442444" + }, + { + "host": "i386-apple-darwin11", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.0_macOS_64bit.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.0_macOS_64bit.tar.gz", + "checksum": "SHA-256:ce4444e92ba88c6b24736adb4b0b2b6c4241e4fb916945acbc7de6391d5bfe8c", + "size": "7301372" + } + ] + }, + { + "name": "arduino-fwuploader", + "version": "2.2.2", + "systems": [ + { + "host": "i686-linux-gnu", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Linux_32bit.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_Linux_32bit.tar.gz", + "checksum": "SHA-256:503b9f8b24c6e396d09eb64f0e1f625c6f9aa5a90b01a50d7dec6477f4a866f0", + "size": "7262873" + }, + { + "host": "x86_64-linux-gnu", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Linux_64bit.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_Linux_64bit.tar.gz", + "checksum": "SHA-256:8d77d0b33c8b0787fe3b80191709b69d638ef2a447d9853536cda35bfafd274b", + "size": "7306763" + }, + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Windows_32bit.zip", + "archiveFileName": "arduino-fwuploader_2.2.2_Windows_32bit.zip", + "checksum": "SHA-256:74ad9a5d369204b51be288c98d74f949ceb7a0c227ee64eb65ae179ec884c84c", + "size": "7450717" + }, + { + "host": "x86_64-mingw32", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Windows_64bit.zip", + "archiveFileName": "arduino-fwuploader_2.2.2_Windows_64bit.zip", + "checksum": "SHA-256:b25ac549cb0645166613c96cf899aebc541e482fe196aada6408bd7cff2c7d02", + "size": "7390999" + }, + { + "host": "x86_64-apple-darwin", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_macOS_64bit.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_macOS_64bit.tar.gz", + "checksum": "SHA-256:2cd6168ff470457b5124ba0faf118f315be2d1b9fb4fef43eb74370cd83620a2", + "size": "7306576" + }, + { + "host": "arm64-apple-darwin", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_macOS_ARM64.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_macOS_ARM64.tar.gz", + "checksum": "SHA-256:10ae5614af4d82096b6ba0e1e07aab667fa140d2bf1d5e3407dd8ad4c6748195", + "size": "6878214" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Linux_ARMv6.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_Linux_ARMv6.tar.gz", + "checksum": "SHA-256:5aadf6e50ffe620635faf941fdf82c0765c8cba4830951bb53267ad125fc5af8", + "size": "6940393" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Linux_ARM64.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_Linux_ARM64.tar.gz", + "checksum": "SHA-256:6d11a4f4aa5a81de865f3d18ca395a2780fdbb1e1597a2b11b2b5329e09f30fd", + "size": "6829396" + } + ] + } + ] + } + ] +} diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 000000000..f371126b5 --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,125 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package tools + +import ( + "crypto/rsa" + "encoding/json" + "path/filepath" + "strings" + "sync" + + "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/v2/pkgs" + "github.com/arduino/go-paths-helper" + "github.com/xrash/smetrics" +) + +// Tools handle the tools necessary for an upload on a board. +// It provides a means to download a tool from the arduino servers. +// +// - *directory* contains the location where the tools are downloaded. +// - *indexURL* contains the url where the tools description is contained. +// - *logger* is a StdLogger used for reporting debug and info messages +// - *installed* contains a map[string]string of the tools installed and their exact location +// +// Usage: +// You have to call the New() function passing it the required parameters: +// +// index = index.Init("https://downloads.arduino.cc/packages/package_index.json", dataDir) +// tools := tools.New(dataDir, index, logger) + +// Tools will represent the installed tools +type Tools struct { + directory *paths.Path + index *index.Resource + logger func(msg string) + installed map[string]string + mutex sync.RWMutex + tools *pkgs.Tools +} + +// New will return a Tool object, allowing the caller to execute operations on it. +// The New functions accept the directory to use to host the tools, +// an index (used to download the tools), +// and a logger to log the operations +func New(directory *paths.Path, index *index.Resource, logger func(msg string), signPubKey *rsa.PublicKey) *Tools { + t := &Tools{ + directory: directory, + index: index, + logger: logger, + installed: map[string]string{}, + mutex: sync.RWMutex{}, + tools: pkgs.New(index, directory.String(), "replace", signPubKey), + } + _ = t.readMap() + return t +} + +func (t *Tools) setMapValue(key, value string) { + t.mutex.Lock() + t.installed[key] = value + t.mutex.Unlock() +} + +func (t *Tools) getMapValue(key string) (string, bool) { + t.mutex.RLock() + defer t.mutex.RUnlock() + value, ok := t.installed[key] + return value, ok +} + +// readMap() reads the installed map from json file "installed.json" +func (t *Tools) readMap() error { + t.mutex.Lock() + defer t.mutex.Unlock() + filePath := t.directory.Join("installed.json") + b, err := filePath.ReadFile() + if err != nil { + return err + } + return json.Unmarshal(b, &t.installed) +} + +// GetLocation extracts the toolname from a command like +func (t *Tools) GetLocation(command string) (string, error) { + command = strings.Replace(command, "{runtime.tools.", "", 1) + command = strings.Replace(command, ".path}", "", 1) + + var location string + var ok bool + + // Load installed + err := t.readMap() + if err != nil { + return "", err + } + + // use string similarity to resolve a runtime var with a "similar" map element + if location, ok = t.getMapValue(command); !ok { + maxSimilarity := 0.0 + t.mutex.RLock() + defer t.mutex.RUnlock() + for i, candidate := range t.installed { + similarity := smetrics.Jaro(command, i) + if similarity > 0.8 && similarity > maxSimilarity { + maxSimilarity = similarity + location = candidate + } + } + } + return filepath.ToSlash(location), nil +} diff --git a/trayicon.go b/trayicon.go deleted file mode 100644 index 4be9c61f7..000000000 --- a/trayicon.go +++ /dev/null @@ -1,127 +0,0 @@ -// -// trayicon.go -// -// Created by Martino Facchin -// Copyright (c) 2015 Arduino LLC -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -// +build !arm - -package main - -import ( - log "github.com/Sirupsen/logrus" - "github.com/facchinm/go-serial" - "github.com/facchinm/systray" - "github.com/facchinm/systray/example/icon" - "github.com/skratchdot/open-golang/open" - "runtime" -) - -func setupSysTray() { - runtime.LockOSThread() - if *hibernate == true { - systray.Run(setupSysTrayHibernate) - } else { - systray.Run(setupSysTrayReal) - } -} - -func addRebootTrayElement() { - reboot_tray := systray.AddMenuItem("Reboot to update", "") - - go func() { - <-reboot_tray.ClickedCh - systray.Quit() - log.Println("Restarting now...") - log.Println("Restart because addReebotTrayElement") - restart("") - }() -} - -func setupSysTrayReal() { - - systray.SetIcon(icon.Data) - mUrl := systray.AddMenuItem("Go to Arduino Create (staging)", "Arduino Create") - mDebug := systray.AddMenuItem("Open debug console", "Debug console") - menuVer := systray.AddMenuItem("Agent version "+version+"-"+git_revision, "") - mPause := systray.AddMenuItem("Pause Plugin", "") - //mQuit := systray.AddMenuItem("Quit Plugin", "") - - menuVer.Disable() - - go func() { - <-mPause.ClickedCh - ports, _ := serial.GetPortsList() - for _, element := range ports { - spClose(element) - } - systray.Quit() - *hibernate = true - log.Println("Restart becayse setup went wrong?") - restart("") - }() - - // go func() { - // <-mQuit.ClickedCh - // systray.Quit() - // exit() - // }() - - go func() { - for { - <-mDebug.ClickedCh - logAction("log on") - open.Start("http://localhost" + port) - } - }() - - // We can manipulate the systray in other goroutines - go func() { - for { - <-mUrl.ClickedCh - open.Start("http://create-staging.arduino.cc") - } - }() -} - -func setupSysTrayHibernate() { - - systray.SetIcon(icon.DataHibernate) - mOpen := systray.AddMenuItem("Open Plugin", "") - mQuit := systray.AddMenuItem("Kill Plugin", "") - - go func() { - <-mOpen.ClickedCh - *hibernate = false - log.Println("Restart for hubernation") - restart("") - }() - - go func() { - <-mQuit.ClickedCh - systray.Quit() - exit() - }() -} diff --git a/trayicon_linux_arm.go b/trayicon_linux_arm.go deleted file mode 100644 index ac0c9fc73..000000000 --- a/trayicon_linux_arm.go +++ /dev/null @@ -1,38 +0,0 @@ -// -// trayicon.go -// -// Created by Martino Facchin -// Copyright (c) 2015 Arduino LLC -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -package main - -func setupSysTray() { - //no systray support for arm yet - select {} -} - -func addRebootTrayElement() { - select {} -} diff --git a/update.go b/update.go index e2ffea7b6..33c028bce 100644 --- a/update.go +++ b/update.go @@ -30,418 +30,20 @@ package main import ( - "archive/zip" - "bytes" - "compress/gzip" - "crypto/sha256" - "encoding/json" - "errors" - "fmt" - log "github.com/Sirupsen/logrus" - "github.com/inconshreveable/go-update" - "github.com/kardianos/osext" - "github.com/kr/binarydist" - "github.com/pivotal-golang/archiver/extractor" - patch "github.com/sanderhahn/gozip/patchzip" - "io" - "io/ioutil" - "math/rand" - "net/http" - "os" - "path" - "path/filepath" - "runtime" - "strings" - "time" + "github.com/arduino/arduino-create-agent/updater" + "github.com/gin-gonic/gin" ) -func UnzipWrapper(src, dest string) error { - e := extractor.NewDetectable() - return e.Extract(src, dest) -} - -func IsZip(path string) bool { - r, err := zip.OpenReader(path) - if err == nil { - r.Close() - return true - } - return false -} - -func Zip(path string, dirs []string) (err error) { - if IsZip(path) { - return errors.New(path + " is already a zip file") - } - - f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644) - if err != nil { - return - } - defer f.Close() - - startoffset, err := f.Seek(0, os.SEEK_END) - if err != nil { - return - } - - w := patch.NewWriterAt(f, startoffset) - - for _, dir := range dirs { - err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - fh, err := patch.FileInfoHeader(info) - if err != nil { - return err - } - fh.Name = path - - p, err := w.CreateHeader(fh) - if err != nil { - return err - } - if !info.IsDir() { - content, err := ioutil.ReadFile(path) - if err != nil { - return err - } - _, err = p.Write(content) - if err != nil { - return err - } - } - return err - }) - } - err = w.Close() - return -} - -func Unzip(zippath string, destination string) (err error) { - r, err := zip.OpenReader(zippath) - if err != nil { - return err - } - for _, f := range r.File { - fullname := path.Join(destination, f.Name) - if f.FileInfo().IsDir() { - os.MkdirAll(fullname, f.FileInfo().Mode().Perm()) - } else { - os.MkdirAll(filepath.Dir(fullname), 0755) - perms := f.FileInfo().Mode().Perm() - out, err := os.OpenFile(fullname, os.O_CREATE|os.O_RDWR, perms) - if err != nil { - return err - } - rc, err := f.Open() - if err != nil { - return err - } - _, err = io.CopyN(out, rc, f.FileInfo().Size()) - if err != nil { - return err - } - rc.Close() - out.Close() - - mtime := f.FileInfo().ModTime() - err = os.Chtimes(fullname, mtime, mtime) - if err != nil { - return err - } - } - } - return -} - -func UnzipList(path string) (list []string, err error) { - r, err := zip.OpenReader(path) +func updateHandler(c *gin.Context) { + restartPath, err := updater.CheckForUpdates(version, *updateURL, *appName) if err != nil { + c.JSON(500, gin.H{"error": err.Error()}) return } - for _, f := range r.File { - list = append(list, f.Name) - } - return -} - -// Update protocol: -// -// GET hk.heroku.com/hk/linux-amd64.json -// -// 200 ok -// { -// "Version": "2", -// "Sha256": "..." // base64 -// } -// -// then -// -// GET hkpatch.s3.amazonaws.com/hk/1/2/linux-amd64 -// -// 200 ok -// [bsdiff data] -// -// or -// -// GET hkdist.s3.amazonaws.com/hk/2/linux-amd64.gz -// -// 200 ok -// [gzipped executable data] -// -// - -const ( - plat = runtime.GOOS + "-" + runtime.GOARCH -) - -const devValidTime = 7 * 24 * time.Hour - -var ErrHashMismatch = errors.New("new file hash mismatch after patch") -var up = update.New() - -// Updater is the configuration and runtime data for doing an update. -// -// Note that ApiURL, BinURL and DiffURL should have the same value if all files are available at the same location. -// -// Example: -// -// updater := &selfupdate.Updater{ -// CurrentVersion: version, -// ApiURL: "http://updates.yourdomain.com/", -// BinURL: "http://updates.yourdownmain.com/", -// DiffURL: "http://updates.yourdomain.com/", -// Dir: "update/", -// CmdName: "myapp", // app name -// } -// if updater != nil { -// go updater.BackgroundRun() -// } -type Updater struct { - CurrentVersion string // Currently running version. - ApiURL string // Base URL for API requests (json files). - CmdName string // Command name is appended to the ApiURL like http://apiurl/CmdName/. This represents one binary. - BinURL string // Base URL for full binary downloads. - DiffURL string // Base URL for diff downloads. - Dir string // Directory to store selfupdate state. - Info struct { - Version string - Sha256 []byte - } -} - -func (u *Updater) getExecRelativeDir(dir string) string { - filename, _ := osext.Executable() - path := filepath.Join(filepath.Dir(filename), dir) - return path -} - -// BackgroundRun starts the update check and apply cycle. -func (u *Updater) BackgroundRun() error { - os.MkdirAll(u.getExecRelativeDir(u.Dir), 0777) - if u.wantUpdate() { - if err := up.CanUpdate(); err != nil { - log.Println(err) - return err - } - //self, err := osext.Executable() - //if err != nil { - // fail update, couldn't figure out path to self - //return - //} - // TODO(bgentry): logger isn't on Windows. Replace w/ proper error reports. - if err := u.update(); err != nil { - return err - } - } - return nil -} - -func (u *Updater) wantUpdate() bool { - if strings.Contains(u.CurrentVersion, "dev") { - return false + c.JSON(200, gin.H{"success": "Please wait a moment while the agent reboots itself"}) + if restartPath == "quit" { + Systray.Quit() } else { - return true - } -} - -func (u *Updater) update() error { - path, err := osext.Executable() - if err != nil { - return err - } - old, err := os.Open(path) - if err != nil { - return err - } - defer old.Close() - - err = u.fetchInfo() - if err != nil { - log.Println(err) - return err - } - if u.Info.Version == u.CurrentVersion { - return nil - } - bin, err := u.fetchAndVerifyPatch(old) - if err != nil { - if err == ErrHashMismatch { - log.Println("update: hash mismatch from patched binary") - } else { - if u.DiffURL != "" { - log.Println("update: patching binary,", err) - } - } - - bin, err = u.fetchAndVerifyFullBin() - if err != nil { - if err == ErrHashMismatch { - log.Println("update: hash mismatch from full binary") - } else { - log.Println("update: fetching full binary,", err) - } - return err - } - } - - // close the old binary before installing because on windows - // it can't be renamed if a handle to the file is still open - old.Close() - - err, errRecover := up.FromStream(bytes.NewBuffer(bin)) - if errRecover != nil { - log.Errorf("update and recovery errors: %q %q", err, errRecover) - return fmt.Errorf("update and recovery errors: %q %q", err, errRecover) - } - if err != nil { - return err - } - - // remove config.ini so at restart the package will extract again - //shutil.CopyFile(*configIni, *configIni+".bak", false) - //os.Remove(*configIni) - - log.Println("Restarting because update!") - - restart(path) - //addRebootTrayElement() - - // update done, we should decide if we need to restart ASAP (maybe a field in update json?) - // BIG issue: the file has been renamed in the meantime - - return nil -} - -func (u *Updater) fetchInfo() error { - r, err := fetch(u.ApiURL + u.CmdName + "/" + plat + ".json") - if err != nil { - return err - } - defer r.Close() - err = json.NewDecoder(r).Decode(&u.Info) - if err != nil { - return err - } - if len(u.Info.Sha256) != sha256.Size { - return errors.New("bad cmd hash in info") - } - return nil -} - -func (u *Updater) fetchAndVerifyPatch(old io.Reader) ([]byte, error) { - bin, err := u.fetchAndApplyPatch(old) - if err != nil { - return nil, err - } - if !verifySha(bin, u.Info.Sha256) { - return nil, ErrHashMismatch - } - return bin, nil -} - -func (u *Updater) fetchAndApplyPatch(old io.Reader) ([]byte, error) { - r, err := fetch(u.DiffURL + u.CmdName + "/" + u.CurrentVersion + "/" + u.Info.Version + "/" + plat) - if err != nil { - return nil, err + Systray.RestartWith(restartPath) } - defer r.Close() - var buf bytes.Buffer - err = binarydist.Patch(old, &buf, r) - return buf.Bytes(), err -} - -func (u *Updater) fetchAndVerifyFullBin() ([]byte, error) { - bin, err := u.fetchBin() - if err != nil { - return nil, err - } - verified := verifySha(bin, u.Info.Sha256) - if !verified { - return nil, ErrHashMismatch - } - return bin, nil -} - -func (u *Updater) fetchBin() ([]byte, error) { - r, err := fetch(u.BinURL + u.CmdName + "/" + u.Info.Version + "/" + plat + ".gz") - if err != nil { - return nil, err - } - defer r.Close() - buf := new(bytes.Buffer) - gz, err := gzip.NewReader(r) - if err != nil { - return nil, err - } - if _, err = io.Copy(buf, gz); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -// returns a random duration in [0,n). -func randDuration(n time.Duration) time.Duration { - return time.Duration(rand.Int63n(int64(n))) -} - -func fetch(url string) (io.ReadCloser, error) { - resp, err := http.Get(url) - if err != nil { - return nil, err - } - if resp.StatusCode != 200 { - log.Errorf("bad http status from %s: %v", url, resp.Status) - return nil, fmt.Errorf("bad http status from %s: %v", url, resp.Status) - } - return resp.Body, nil -} - -func readTime(path string) time.Time { - p, err := ioutil.ReadFile(path) - if os.IsNotExist(err) { - return time.Time{} - } - if err != nil { - return time.Now().Add(1000 * time.Hour) - } - t, err := time.Parse(time.RFC3339, string(p)) - if err != nil { - return time.Now().Add(1000 * time.Hour) - } - return t -} - -func verifySha(bin []byte, sha []byte) bool { - h := sha256.New() - h.Write(bin) - return bytes.Equal(h.Sum(nil), sha) -} - -func writeTime(path string, t time.Time) bool { - return ioutil.WriteFile(path, []byte(t.Format(time.RFC3339)), 0644) == nil } diff --git a/updater/updater.go b/updater/updater.go new file mode 100644 index 000000000..db4e5454f --- /dev/null +++ b/updater/updater.go @@ -0,0 +1,112 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package updater + +import ( + "crypto/sha256" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "os" + "path/filepath" + "runtime" + "strings" + + log "github.com/sirupsen/logrus" +) + +// Start checks if an update has been downloaded and if so returns the path to the +// binary to be executed to perform the update. If no update has been downloaded +// it returns an empty string. +func Start(src string) string { + return start(src) +} + +// CheckForUpdates checks if there is a new version of the binary available and +// if so downloads it. +func CheckForUpdates(currentVersion string, updateURL string, cmdName string) (string, error) { + return checkForUpdates(currentVersion, updateURL, cmdName) +} + +const ( + plat = runtime.GOOS + "-" + runtime.GOARCH +) + +func fetchInfo(updateAPIURL string) (*availableUpdateInfo, error) { + r, err := fetch(updateAPIURL) + if err != nil { + return nil, err + } + defer r.Close() + + var res availableUpdateInfo + if err := json.NewDecoder(r).Decode(&res); err != nil { + return nil, err + } + if len(res.Sha256) != sha256.Size { + return nil, errors.New("bad cmd hash in info") + } + return &res, nil +} + +type availableUpdateInfo struct { + Version string + Sha256 []byte +} + +func fetch(url string) (io.ReadCloser, error) { + resp, err := http.Get(url) + if err != nil { + return nil, err + } + if resp.StatusCode != 200 { + log.Errorf("bad http status from %s: %v", url, resp.Status) + return nil, fmt.Errorf("bad http status from %s: %v", url, resp.Status) + } + return resp.Body, nil +} + +// addTempSuffixToPath adds the "-temp" suffix to the path to an executable file (a ".exe" extension is replaced with "-temp.exe") +func addTempSuffixToPath(path string) string { + if filepath.Ext(path) == "exe" { + path = strings.Replace(path, ".exe", "-temp.exe", -1) + } else { + path = path + "-temp" + } + + return path +} + +// removeTempSuffixFromPath removes "-temp" suffix from the path to an executable file (a "-temp.exe" extension is replaced with ".exe") +func removeTempSuffixFromPath(path string) string { + return strings.Replace(path, "-temp", "", -1) +} + +func copyExe(from, to string) error { + data, err := os.ReadFile(from) + if err != nil { + log.Println("Cannot read file: ", from) + return err + } + err = os.WriteFile(to, data, 0755) + if err != nil { + log.Println("Cannot write file: ", to) + return err + } + return nil +} diff --git a/updater/updater_darwin.go b/updater/updater_darwin.go new file mode 100644 index 000000000..829466352 --- /dev/null +++ b/updater/updater_darwin.go @@ -0,0 +1,164 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package updater + +import ( + "bytes" + "context" + "crypto/sha256" + "fmt" + "io" + "os" + "runtime" + "strings" + + "github.com/arduino/go-paths-helper" + "github.com/codeclysm/extract/v4" + "github.com/sirupsen/logrus" + log "github.com/sirupsen/logrus" +) + +func start(src string) string { + if strings.Contains(src, "-temp") { + // This is required to transition from the previous auto-update system to the new one. + // Updating from version <=1.2.7 will produce the `ArduinoCreateAgent-temp` file and we should + // complete the upgrade by copying the `ArduinoCreateAgent-temp` executable back to the original. + // + // This procedure will be automatically skipped starting from version >1.2.7. + + newPath := removeTempSuffixFromPath(src) + if err := copyExe(src, newPath); err != nil { + log.Println("Copy error: ", err) + panic(err) + } + return newPath + } + + return "" +} + +func checkForUpdates(currentVersion string, updateURL string, cmdName string) (string, error) { + executablePath, err := os.Executable() + if err != nil { + return "", fmt.Errorf("could not app path: %w", err) + } + currentAppPath := paths.New(executablePath).Parent().Parent().Parent() + if currentAppPath.Ext() != ".app" { + return "", fmt.Errorf("could not find app root in %s", executablePath) + } + oldAppPath := currentAppPath.Parent().Join("ArduinoCreateAgent.old.app") + if oldAppPath.Exist() { + return "", fmt.Errorf("temp app already exists: %s, cannot update", oldAppPath) + } + + // Fetch information about updates + + // updateURL: "https://downloads.arduino.cc/" + // cmdName: "CreateAgent/Stable" + // plat: "darwin-amd64" + // info URL: "https://downloads.arduino.cc/CreateAgent/Stable/darwin-amd64-bundle.json" + infoURL := updateURL + cmdName + "/" + plat + "-bundle.json" + info, err := fetchInfo(infoURL) + if err != nil { + return "", err + } + if info.Version == currentVersion { + // No updates available, bye bye + return "", nil + } + + tmp := paths.TempDir().Join("arduino-create-agent") + if err := tmp.MkdirAll(); err != nil { + return "", err + } + tmpZip := tmp.Join("update.zip") + tmpAppPath := tmp.Join("ArduinoCreateAgent-update.app") + defer tmp.RemoveAll() + + // Download the update. + + // updateURL: "https://downloads.arduino.cc/" + // cmdName == "CreateAgent/Stable" + // info.Version == "1.2.8" + // runtime.GOARCH: "amd64" + // downloadURL: "https://downloads.arduino.cc/CreateAgent/Stable/1.2.8/ArduinoCreateAgent.app_arm64_notarized.zip" + downloadURL := updateURL + cmdName + "/" + info.Version + "/ArduinoCreateAgent.app_" + runtime.GOARCH + "_notarized.zip" + logrus.WithField("url", downloadURL).Info("Downloading update") + download, err := fetch(downloadURL) + if err != nil { + return "", err + } + defer download.Close() + + f, err := tmpZip.Create() + if err != nil { + return "", err + } + defer f.Close() + + sha := sha256.New() + if _, err := io.Copy(io.MultiWriter(sha, f), download); err != nil { + return "", err + } + f.Close() + + // Check the hash + if s := sha.Sum(nil); !bytes.Equal(s, info.Sha256) { + return "", fmt.Errorf("bad hash: %s (expected %s)", s, info.Sha256) + } + + // Unzip the update + logrus.WithField("tmpDir", tmpAppPath).Info("Unzipping update") + if err := tmpAppPath.MkdirAll(); err != nil { + return "", fmt.Errorf("could not create tmp dir to unzip update: %w", err) + } + + f, err = tmpZip.Open() + if err != nil { + return "", fmt.Errorf("could not open archive for unzip: %w", err) + } + defer f.Close() + if err := extract.Archive(context.Background(), f, tmpAppPath.String(), nil); err != nil { + return "", fmt.Errorf("extracting archive: %w", err) + } + + // Rename current app as .old + logrus.WithField("from", currentAppPath).WithField("to", oldAppPath).Info("Renaming old app") + if err := currentAppPath.Rename(oldAppPath); err != nil { + return "", fmt.Errorf("could not rename old app as .old: %w", err) + } + + // Install new app + logrus.WithField("from", tmpAppPath).WithField("to", currentAppPath).Info("Copying updated app") + createPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Create_Agent") + cloudPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Cloud_Agent") + if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || (!createPath.Exist() && !cloudPath.Exist()) { + // Try rollback changes + _ = currentAppPath.RemoveAll() + _ = oldAppPath.Rename(currentAppPath) + return "", fmt.Errorf("could not install app: %w", err) + } + + // Remove old app + logrus.WithField("to", oldAppPath).Info("Removing old app") + _ = oldAppPath.RemoveAll() + + // Restart agent + logrus.WithField("path", currentAppPath).Info("Running new app") + + // Close old agent + return currentAppPath.String(), nil +} diff --git a/updater/updater_default.go b/updater/updater_default.go new file mode 100644 index 000000000..2cf01b8ad --- /dev/null +++ b/updater/updater_default.go @@ -0,0 +1,234 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +//go:build !darwin + +package updater + +import ( + "bytes" + "compress/gzip" + "crypto/sha256" + "errors" + "fmt" + "io" + "os" + "path/filepath" + "strings" + + log "github.com/sirupsen/logrus" + "gopkg.in/inconshreveable/go-update.v0" +) + +// Update protocol: +// +// GET hk.heroku.com/hk/linux-amd64.json +// +// 200 ok +// { +// "Version": "2", +// "Sha256": "..." // base64 +// } +// +// then +// +// GET hkpatch.s3.amazonaws.com/hk/1/2/linux-amd64 +// +// 200 ok +// [bsdiff data] +// +// or +// +// GET hkdist.s3.amazonaws.com/hk/2/linux-amd64.gz +// +// 200 ok +// [gzipped executable data] +// +// + +var errHashMismatch = errors.New("new file hash mismatch after patch") +var up = update.New() + +func start(src string) string { + // If the executable is temporary, copy it to the full path, then restart + if strings.Contains(src, "-temp") { + newPath := removeTempSuffixFromPath(src) + if err := copyExe(src, newPath); err != nil { + log.Println("Copy error: ", err) + panic(err) + } + return newPath + } + + // Otherwise copy to a path with -temp suffix + if err := copyExe(src, addTempSuffixToPath(src)); err != nil { + panic(err) + } + return "" +} + +func checkForUpdates(currentVersion string, updateURL string, cmdName string) (string, error) { + path, err := os.Executable() + if err != nil { + return "", err + } + var up = &Updater{ + CurrentVersion: currentVersion, + UpdateURL: updateURL, + Dir: "update/", + CmdName: cmdName, + } + + if err := up.BackgroundRun(); err != nil { + return "", err + } + return addTempSuffixToPath(path), nil +} + +// Updater is the configuration and runtime data for doing an update. +// +// Note that ApiURL, BinURL and DiffURL should have the same value if all files are available at the same location. +// +// Example: +// +// updater := &selfupdate.Updater{ +// CurrentVersion: version, +// UpdateURL: "http://updates.yourdomain.com/", +// Dir: "update/", +// CmdName: "myapp", // app name +// } +// if updater != nil { +// go updater.BackgroundRun() +// } +type Updater struct { + CurrentVersion string // Currently running version. + UpdateURL string // Base URL for API requests (json files). + CmdName string // Command name is appended to the ApiURL like http://apiurl/CmdName/. This represents one binary. + Dir string // Directory to store selfupdate state. + Info *availableUpdateInfo // Information about the available update. +} + +// BackgroundRun starts the update check and apply cycle. +func (u *Updater) BackgroundRun() error { + os.MkdirAll(u.getExecRelativeDir(u.Dir), 0777) + if err := up.CanUpdate(); err != nil { + log.Println(err) + return err + } + //self, err := os.Executable() + //if err != nil { + // fail update, couldn't figure out path to self + //return + //} + // TODO(bgentry): logger isn't on Windows. Replace w/ proper error reports. + if err := u.update(); err != nil { + return err + } + return nil +} + +func verifySha(bin []byte, sha []byte) bool { + h := sha256.New() + h.Write(bin) + return bytes.Equal(h.Sum(nil), sha) +} + +func (u *Updater) fetchAndVerifyFullBin() ([]byte, error) { + bin, err := u.fetchBin() + if err != nil { + return nil, err + } + verified := verifySha(bin, u.Info.Sha256) + if !verified { + return nil, errHashMismatch + } + return bin, nil +} + +func (u *Updater) fetchBin() ([]byte, error) { + r, err := fetch(u.UpdateURL + u.CmdName + "/" + u.Info.Version + "/" + plat + ".gz") + if err != nil { + return nil, err + } + defer r.Close() + buf := new(bytes.Buffer) + gz, err := gzip.NewReader(r) + if err != nil { + return nil, err + } + if _, err = io.Copy(buf, gz); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +func (u *Updater) getExecRelativeDir(dir string) string { + filename, _ := os.Executable() + path := filepath.Join(filepath.Dir(filename), dir) + return path +} + +func (u *Updater) update() error { + path, err := os.Executable() + if err != nil { + return err + } + + path = addTempSuffixToPath(path) + + old, err := os.Open(path) + if err != nil { + return err + } + defer old.Close() + + infoURL := u.UpdateURL + u.CmdName + "/" + plat + ".json" + info, err := fetchInfo(infoURL) + if err != nil { + log.Println(err) + return err + } + u.Info = info + if u.Info.Version == u.CurrentVersion { + return nil + } + + bin, err := u.fetchAndVerifyFullBin() + if err != nil { + if err == errHashMismatch { + log.Println("update: hash mismatch from full binary") + } else { + log.Println("update: fetching full binary,", err) + } + return err + } + + // close the old binary before installing because on windows + // it can't be renamed if a handle to the file is still open + old.Close() + + up.TargetPath = path + err, errRecover := up.FromStream(bytes.NewBuffer(bin)) + if errRecover != nil { + log.Errorf("update and recovery errors: %q %q", err, errRecover) + return fmt.Errorf("update and recovery errors: %q %q", err, errRecover) + } + if err != nil { + return err + } + + return nil +} diff --git a/upload/README.md b/upload/README.md new file mode 100644 index 000000000..57717cdf0 --- /dev/null +++ b/upload/README.md @@ -0,0 +1,105 @@ +Package upload +===================== + + import "github.com/arduino/arduino-create-agent/upload" + +Package upload allows to upload sketches into a board connected to the +computer It can do it via serial port + +**Usage for a serial upload** + +Make sure that you have a compiled sketch somewhere on your disk + +```go +commandline = ``"/usr/bin/avrdude" "-C/usr/bin/avrdude.conf" -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D "-Uflash:w:./sketch.hex:i"`` +err := upload.Serial("/dev/ttyACM0", commandline, upload.Extra{}, nil) +``` + +note that the commandline contains the path of the sketch (sketch.hex) + +**Resolving commandlines** + +If you happen to have an unresolved commandline (full of {} parameters) you can +resolve it + +```go + t := tools.Tools{} + commandline = upload.Resolve("/dev/ttyACM0", "arduino:avr:leonardo", "./sketch.hex", commandline, upload.Extra{}, t) + ``` + +t must implement the locater interface (the Tools package does!) + +**Logging** If you're interested in the output of the commands, you can +implement the logger interface. Here's an example: + +```go + logger := logrus.New() + logger.Level = logrus.DebugLevel + upload.Serial("/dev/ttyACM0", commandline, upload.Extra{}, logger) + ``` + + + +Variables +--------- + + +```go +var Busy = false +``` +Busy tells wether the upload is doing something + +Functions +--------- + + +```go +func Kill() +``` + +Kill stops any upload process as soon as possible + + +```go +func Resolve(port, board, file, commandline string, extra Extra, t Locater) (string, error) +``` + +Resolve replaces some symbols in the commandline with the appropriate values it +can return an error when looking a variable in the Locater + + +```go +func Serial(port, commandline string, extra Extra, l Logger) error +``` + +Serial performs a serial upload + +Types +----- + + +```go +type Extra struct { + Use1200bpsTouch bool `json:"use_1200bps_touch"` + WaitForUploadPort bool `json:"wait_for_upload_port"` + Network bool `json:"network"` +} +``` +Extra contains some options used during the upload + + +```go +type Locater interface { + GetLocation(command string) (string, error) +} +``` +Locater can return the location of a tool in the system + + +```go +type Logger interface { + Debug(args ...interface{}) + Info(args ...interface{}) +} +``` +Logger is an interface implemented by most loggers (like logrus) diff --git a/upload/upload.go b/upload/upload.go new file mode 100644 index 000000000..613d72957 --- /dev/null +++ b/upload/upload.go @@ -0,0 +1,194 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package upload + +import ( + "bufio" + "os/exec" + "path/filepath" + "regexp" + "runtime" + "strings" + + "github.com/arduino/arduino-create-agent/utilities" + serialutils "github.com/arduino/go-serial-utils" + shellwords "github.com/mattn/go-shellwords" + "github.com/pkg/errors" + "go.bug.st/serial/enumerator" +) + +// Extra contains some options used during the upload +type Extra struct { + Use1200bpsTouch bool `json:"use_1200bps_touch"` + WaitForUploadPort bool `json:"wait_for_upload_port"` + Network bool `json:"network"` +} + +// PartiallyResolve replaces some symbols in the commandline with the appropriate values +// it can return an error when looking a variable in the Locater +func PartiallyResolve(board, file, platformPath, commandline string, extra Extra, t Locater) (string, error) { + commandline = strings.Replace(commandline, "{build.path}", filepath.ToSlash(filepath.Dir(file)), -1) + commandline = strings.Replace(commandline, "{build.project_name}", strings.TrimSuffix(filepath.Base(file), filepath.Ext(filepath.Base(file))), -1) + commandline = strings.Replace(commandline, "{runtime.platform.path}", filepath.ToSlash(platformPath), -1) + commandline = strings.Replace(commandline, "{fqbn}", board, -1) + + // search for runtime variables and replace with values from Locater + var runtimeRe = regexp.MustCompile(`\{(.*?)\}`) + runtimeVars := runtimeRe.FindAllString(commandline, -1) + + for _, element := range runtimeVars { + + location, err := t.GetLocation(element) + if err != nil { + return "", errors.Wrapf(err, "get location of %s", element) + } + if location != "" { + commandline = strings.Replace(commandline, element, location, 1) + } + } + + return commandline, nil +} + +func fixupPort(port, commandline string) string { + commandline = strings.Replace(commandline, "{serial.port}", port, -1) + commandline = strings.Replace(commandline, "{serial.port.file}", filepath.Base(port), -1) + ports, err := enumerator.GetDetailedPortsList() + if err == nil { + for _, p := range ports { + if p.Name == port { + commandline = strings.Replace(commandline, "{serial.port.iserial}", p.SerialNumber, -1) + } + } + } + return commandline +} + +// Serial performs a serial upload +func Serial(port, commandline string, extra Extra, l Logger) error { + // some boards needs to be resetted + if extra.Use1200bpsTouch { + var err error + port, err = reset(port, extra.WaitForUploadPort, l) + if err != nil { + return errors.Wrapf(err, "Reset before upload") + } + } + + commandline = fixupPort(port, commandline) + + z, err := shellwords.Parse(commandline) + if err != nil { + return errors.Wrapf(err, "Parse commandline") + } + + return program(z[0], z[1:], l) +} + +var cmds = map[*exec.Cmd]bool{} + +// Kill stops any upload process as soon as possible +func Kill() { + for cmd := range cmds { + if cmd.Process.Pid > 0 { + cmd.Process.Kill() + } + } +} + +// reset wraps arduino-cli's serialutils +// it opens the port at 1200bps. It returns the new port name (which could change +// sometimes) and an error (usually because the port listing failed) +func reset(port string, wait bool, l Logger) (string, error) { + info(l, "Restarting in bootloader mode") + newPort, err := serialutils.Reset(port, wait, false, nil, nil) // TODO use callbacks to print reset progress + if err != nil { + info(l, err) + return "", err + } + if newPort != "" { + port = newPort + } + return port, nil +} + +// program spawns the given binary with the given args, logging the sdtout and stderr +// through the Logger +func program(binary string, args []string, l Logger) error { + // remove quotes form binary command and args + binary = strings.Replace(binary, "\"", "", -1) + + for i := range args { + args[i] = strings.Replace(args[i], "\"", "", -1) + } + + // find extension + extension := "" + if runtime.GOOS == "windows" { + extension = ".exe" + } + + cmd := exec.Command(binary, args...) + + // Add the command to the map of running commands + cmds[cmd] = true + defer func() { + delete(cmds, cmd) + }() + + utilities.TellCommandNotToSpawnShell(cmd) + + stdout, err := cmd.StdoutPipe() + if err != nil { + return errors.Wrapf(err, "Retrieve output") + } + + stderr, err := cmd.StderrPipe() + if err != nil { + return errors.Wrapf(err, "Retrieve output") + } + + info(l, "Flashing with command:"+binary+extension+" "+strings.Join(args, " ")) + + err = cmd.Start() + if err != nil { + return errors.Wrapf(err, "Start command") + } + + stdoutCopy := bufio.NewScanner(stdout) + stderrCopy := bufio.NewScanner(stderr) + + stdoutCopy.Split(bufio.ScanLines) + stderrCopy.Split(bufio.ScanLines) + + go func() { + for stdoutCopy.Scan() { + info(l, stdoutCopy.Text()) + } + }() + + go func() { + for stderrCopy.Scan() { + info(l, stderrCopy.Text()) + } + }() + + err = cmd.Wait() + if err != nil { + return errors.Wrapf(err, "Executing command") + } + return nil +} diff --git a/upload/upload_test.go b/upload/upload_test.go new file mode 100644 index 000000000..1e030b602 --- /dev/null +++ b/upload/upload_test.go @@ -0,0 +1,119 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package upload + +import ( + "log" + "strings" + "testing" + + homedir "github.com/mitchellh/go-homedir" + "github.com/sirupsen/logrus" +) + +type mockTools struct{} + +func (mockTools) GetLocation(el string) (string, error) { + return "$loc" + el, nil +} + +// TestSerialData requires a leonardo connected to the /dev/ttyACM0 port +var TestSerialData = []struct { + Name string + Port string + Commandline string + Extra Extra +}{ + { + "leonardo", "/dev/ttyACM0", + `"$HOME/.arduino-create/avrdude/6.3.0-arduino6/bin/avrdude" "-C$HOME/.arduino-create/avrdude/6.3.0-arduino6/etc/avrdude.conf" -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D "-Uflash:w:./upload_test.hex:i"`, Extra{Use1200bpsTouch: true, WaitForUploadPort: true}}, +} + +func TestSerial(t *testing.T) { + logger := logrus.New() + logger.Level = logrus.DebugLevel + + home, _ := homedir.Dir() + + for _, test := range TestSerialData { + commandline := strings.Replace(test.Commandline, "$HOME", home, -1) + err := Serial(test.Port, commandline, test.Extra, logger) + log.Println(err) + } +} + +var TestResolveData = []struct { + Board string + File string + PlatformPath string + CommandLine string + Extra Extra + Result string +}{ + { + Board: "arduino:avr:leonardo", + File: "./upload_test.hex", + PlatformPath: "", + CommandLine: `{runtime.tools.avrdude.path}/bin/avrdude -C{runtime.tools.avrdude.path}/etc/avrdude.conf -v {upload.verify} -patmega32u4 -cavr109 -P{serial.port} -b57600 -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"`, + Extra: Extra{Use1200bpsTouch: true, WaitForUploadPort: true}, + Result: `$loc$loc{runtime.tools.avrdude.path}/bin/avrdude -C{runtime.tools.avrdude.path}/etc/avrdude.conf -v $loc{upload.verify} -patmega32u4 -cavr109 -P$loc{serial.port} -b57600 -D "-Uflash:w:./upload_test.hex:i"`, + }, + { + Board: "arduino:renesas_uno:unor4wifi", + File: "UpdateFirmware.bin", + PlatformPath: "", + CommandLine: `{runtime.tools.arduino-fwuploader.path}/arduino-fwuploader firmware flash -a {serial.port} -b {fqbn} -v --retries 5"`, + Extra: Extra{Use1200bpsTouch: true, WaitForUploadPort: true}, + Result: `$loc{runtime.tools.arduino-fwuploader.path}/arduino-fwuploader firmware flash -a $loc{serial.port} -b arduino:renesas_uno:unor4wifi -v --retries 5"`, + }, +} + +func TestResolve(t *testing.T) { + for _, test := range TestResolveData { + result, _ := PartiallyResolve(test.Board, test.File, test.PlatformPath, test.CommandLine, test.Extra, mockTools{}) + if result != test.Result { + t.Error("expected " + test.Result + ", got " + result) + continue + } + } +} + +var TestFixupData = []struct { + Port string + CommandLine string + Result string +}{ + { + Port: "/dev/ttyACM0", + CommandLine: `{runtime.tools.avrdude.path}/bin/avrdude -C{runtime.tools.avrdude.path}/etc/avrdude.conf -v {upload.verify} -patmega32u4 -cavr109 -P{serial.port} -b57600 -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"`, + Result: `{runtime.tools.avrdude.path}/bin/avrdude -C{runtime.tools.avrdude.path}/etc/avrdude.conf -v {upload.verify} -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"`, + }, + { + Port: "/dev/cu.usbmodemDC5475C5557C2", + CommandLine: `{runtime.tools.arduino-fwuploader.path}/arduino-fwuploader firmware flash -a {serial.port} -b arduino:renesas_uno:unor4wifi -v --retries 5"`, + Result: `{runtime.tools.arduino-fwuploader.path}/arduino-fwuploader firmware flash -a /dev/cu.usbmodemDC5475C5557C2 -b arduino:renesas_uno:unor4wifi -v --retries 5"`, + }, +} + +func TestFixupPort(t *testing.T) { + for _, test := range TestFixupData { + result := fixupPort(test.Port, test.CommandLine) + if result != test.Result { + t.Error("expected " + test.Result + ", got " + result) + continue + } + } +} diff --git a/upload/upload_test.hex b/upload/upload_test.hex new file mode 100644 index 000000000..48ef41b02 --- /dev/null +++ b/upload/upload_test.hex @@ -0,0 +1,449 @@ +:100000000C94DF000C9407010C9407010C94070179 +:100010000C9407010C9407010C9407010C94070140 +:100020000C9407010C9407010C94520C0C944C098D +:100030000C9407010C9407010C9407010C94070120 +:100040000C9407010C9407010C9407010C94070110 +:100050000C9407010C9407010C9407010C94AE0B4F +:100060000C9407010C9407010C9407010C940701F0 +:100070000C9407010C9407010C9407010C940701E0 +:100080000C9407010C9407010C9407010C940701D0 +:100090000C9407010C9407010C9407010C940701C0 +:1000A0000C9407010C9407010C940701FC01FF015B +:1000B000EE01F201F60120022002200203020702F3 +:1000C0000B021102150220021B0200000000250095 +:1000D00028002B002E00310004040404040304054E +:1000E00002020202040302020202060606060606D5 +:1000F00004040202020404040802011040804010BB +:10010000204080408008020401804020100201103D +:100110008010204040200000000200090F00000372 +:100120000401000C000000000000000000000000BE +:100130000000000000080B00020202010009040098 +:100140000001020200000524001001052401010144 +:10015000042402060524060001070581031000405F +:1001600009040100020A0000000705020240000025 +:1001700007058302400000040309044172647569A5 +:100180006E6F204C4C430041726475696E6F204C59 +:10019000656F6E6172646F00120100020000004022 +:1001A0004123368000010102030112010002EF0227 +:1001B000014041233680000101020301010D112499 +:1001C0001FBECFEFDAE0DEBFCDBF11E0A0E0B1E0AF +:1001D000E2ECFBE102C005900D92A033B107D9F724 +:1001E00023E0A0E3B1E001C01D92A33FB207E1F715 +:1001F00010E0CFEDD0E004C02197FE010E94D40DA5 +:10020000CE3DD107C9F70E94310D0C94DF0D0C943F +:1002100000004091440350914503209142033091E6 +:10022000430342175307B4F49091E8009570E1F34B +:100230009091E80092FD19C08093F10080914403F1 +:100240009091450301968F739927892B19F48EEFAE +:100250008093E80080914403909145030196909328 +:1002600045038093440381E0089580E00895DF9280 +:10027000EF92FF920F931F93CF93DF93D82E8A01B3 +:100280007B01E40EF51EEB01CE15DF0571F0D7FE04 +:1002900003C0FE01849101C088810E94090121965A +:1002A0008111F2CF8FEF9FEF01C0C801DF91CF9195 +:1002B0001F910F91FF90EF90DF900895615030F003 +:1002C0002091F100FC0120830196F8CF289884E664 +:1002D00080934A030895CF92DF92EF92FF920F939B +:1002E0001F93CF93DF936C017A018B01C0E0D0E0C4 +:1002F000CE15DF0589F0D8016D918D01D601ED9104 +:10030000FC910190F081E02DC6010995892B11F433 +:100310007E0102C02196ECCFC701DF91CF911F91E2 +:100320000F91FF90EF90DF90CF900895CF93DF93E0 +:100330001F92CDB7DEB76983DC01ED91FC9102809D +:10034000F381E02D41E050E0BE016F5F7F4F0995E2 +:100350000F90DF91CF91089583E08093E900809121 +:10036000F200882319F08AE38093E8000895FC01E5 +:100370008485958597FD0BC09FB7F89482E08093A4 +:10038000E9008091F2009FBF90E0019608959FB729 +:10039000F89482E08093E9008091F2009FBF90E0A2 +:1003A0000895362F90E0FC01EA5EFE4F4491FC0177 +:1003B000E950FF4F2491FC01E852FF4F84918823BC +:1003C00009F451C04423E1F150E0FA013197EF30D4 +:1003D000F105B0F5EA5AFF4F0C94D40D90918000CE +:1003E0009F7707C0909180009F7D03C0909180000F +:1003F000977F9093800024C094B59F7702C094B5F6 +:100400009F7D94BD1DC0909190009F7707C09091F3 +:1004100090009F7D03C090919000977F90939000F3 +:100420000FC09091C0009F7703C09091C0009F7D46 +:100430009093C00005C09091C200977F9093C20036 +:10044000E82FF0E0EE0FFF1FE653FF4FA591B491A8 +:100450008FB7F894EC91311103C020952E2301C081 +:100460002E2B2C938FBF08952FB7F89460913903EA +:1004700070913A0380913B0390913C032FBF089504 +:1004800061E0FC0184810E94D101809130018111E1 +:100490001092300108958EBD00000DB407FEFDCF0F +:1004A0008EB508958FEF0C944B020F931F93CF934B +:1004B000DF93EB010E9434028B010E9452028F3FB6 +:1004C00049F00E943402601B710B6C177D07A8F382 +:1004D00080E001C081E0DF91CF911F910F910895DD +:1004E000CF93DF93EC018E81882389F08F819885EB +:1004F0009C012F5F3F4F38872F838230924018F442 +:100500000E945202F3CFCE010E9440021E82DF9170 +:10051000CF910895CF92DF92FF920F931F93CF93C5 +:10052000DF9300D000D0CDB7DEB76C01F62E298363 +:100530003A834B835C830E94700280913001298151 +:100540003A814B815C81811109C081E08093300147 +:1005500090914C0380914D039CBD8DBD60E0F601F0 +:10056000848129833A834B835C830E94D1016CE2AE +:1005700071E0C6010E9455028F2D80640E944B02DB +:1005800008E110E05C814B813A812981DA01C901DF +:10059000002E04C0B695A795979587950A94D2F733 +:1005A00029833A834B835C830E944B0208501109D4 +:1005B00029813A814B815C81083FFFEF1F0731F7AA +:1005C000FF2029F088E0F81204C087E803C085E91D +:1005D00001C08FEF0E944B0210E00E945202F60110 +:1005E000828787FF04C01F3F11F01F5FF6CF0F9077 +:1005F0000F900F900F90DF91CF911F910F91FF906F +:10060000DF90CF900895EF92FF920F931F93CF93B7 +:10061000DF93EC017901411551056105710511F474 +:1006200082E13CC08B85833039F089E0440F551F4F +:10063000661F771F8A95D1F79A01AB0168E1CE0159 +:100640000E948A02882311F084E028C08EEF0E9465 +:100650004B0287018EEFF81AF80181918F010E94F9 +:100660004B020E151F05C1F78FEF0E944B028FEF53 +:100670000E944B020E9452028A878F71853031F0AE +:1006800081E18D83CE010E94400209C068E572E0DD +:10069000CE010E945502811107C085E18D83CE01F4 +:1006A0000E94400280E013C020E030E0A9016DE02C +:1006B000CE010E948A02811104C00E945202882346 +:1006C00011F084E1EBCFCE010E94400281E0DF9186 +:1006D000CF911F910F91FF90EF900895CF93DF93EB +:1006E00080913301882399F1C0913101D091320179 +:1006F000409100015091010160910201709103014C +:1007000028E331E0CE010E940303811102C080E0A2 +:100710001FC04091340150913501609136017091B4 +:100720003701411551056105710579F028E331E084 +:10073000CE010E940303882351F3109234011092DA +:10074000350110923601109237011092330181E089 +:10075000DF91CF910895BF92CF92DF92EF92FF92F7 +:100760000F931F93CF93DF936B017C01B42E809185 +:10077000000190910101A0910201B09103018C153B +:100780009D05AE05BF0509F476C00E946E0388235F +:1007900009F478C0C0913101D09132018E81882353 +:1007A00069F088819981AA81BB81C816D906EA06B9 +:1007B000FB0621F48F819885892BB1F1C882D982FB +:1007C000EA82FB828B85A7019601833039F089E0AC +:1007D000220F331F441F551F8A95D1F761E1CE01C7 +:1007E0000E948A02882319F083E08D8337C00E941B +:1007F00034028B010E9452028A878F3F49F40E9483 +:100800003402601B710B6D327140A0F38FE003C0A6 +:100810008E3F31F08DE08D83CE010E9440021EC0DC +:1008200018861F8281E08E8308E311E00E94520245 +:10083000F80181938F01F3E008331F07B9F78F8127 +:1008400098859E5F98878F832985222319F08115CB +:10085000924048F0CE010E94700205C0CE010E9475 +:10086000400280E00FC0C0920001D0920101E092EE +:100870000201F092030180913301482F4B294093EC +:10088000330181E0DF91CF911F910F91FF90EF90A5 +:10089000DF90CF90BF9008954F925F926F927F92BA +:1008A0008F929F92AF92BF92CF92DF92EF92FF9280 +:1008B0000F931F93CF93DF93EC016A017B01280113 +:1008C0003901423051056105710510F480E073C0B3 +:1008D00089859A85AB85BC850196A11DB11D8417BC +:1008E0009507A607B70790F38B889C88AD88BE88CC +:1008F0008F89803129F4BB27AF2D9E2D8D2D09C006 +:10090000DB01CA0147E0B695A795979587954A956B +:10091000D1F7880E991EAA1EBB1E809100019091EE +:100920000101A0910201B091030188169906AA065F +:10093000BB0679F48F898031A1F4DD24EE24FF24F5 +:10094000C601880F991FFC01E85CFE4F518240826E +:1009500019C040E0C501B4010E94AB038111EACF88 +:10096000B5CFE894C7F8DD24EE24FF24C601880F34 +:10097000991F880F991FFC01E85CFE4F408251824D +:1009800062827382809133018160809333018A890E +:10099000823080F08D819E81AF81B885880E991E4E +:1009A000AA1EBB1E8092340190923501A09236019E +:1009B000B092370181E0DF91CF911F910F91FF90AD +:1009C000EF90DF90CF90BF90AF909F908F907F90EF +:1009D0006F905F904F9008958F929F92AF92BF92C9 +:1009E000CF92DF92EF92FF920F931F93CF93DF93FB +:1009F000FC0181859285A385B4850196A11DB11D59 +:100A000084179507A607B70710F480E05CC08389B8 +:100A10009489A589B689C789C03129F4852E962E77 +:100A2000A72EBB2409C04A015B01C7E0B694A79476 +:100A300097948794CA95D1F7E9016A017B018F01E8 +:100A4000BC01CD01680D791D8A1D9B1D80900001A0 +:100A500090900101A0900201B09003016815790502 +:100A60008A059B0599F4F80187898031A9F4B701BB +:100A7000A601552766277727440F551FFA01E85C22 +:100A8000FE4F80819181A0E0B0E018C040E00E945C +:100A9000AB038111E8CFB9CFB701A6014F77552736 +:100AA00066277727440F551F440F551FFA01E85C4E +:100AB000FE4F80819181A281B381BF708883998329 +:100AC000AA83BB8381E0DF91CF911F910F91FF90AB +:100AD000EF90DF90CF90BF90AF909F908F90089550 +:100AE0003F924F925F926F927F928F929F92AF92BE +:100AF000BF92CF92DF92EF92FF920F931F93CF930B +:100B0000DF93CDB7DEB72C970FB6F894DEBF0FBEDC +:100B1000CDBF5C01DC015B968D909C905C97169636 +:100B2000CD90DD90ED90FC901997C114D104E104B3 +:100B3000F10439F0BFEFCB1ADB0AEB0AFB0A312CC8 +:100B400007C0F401C080D180E280F3803324339465 +:100B5000F40181859285A385B4859C01AD012F5F49 +:100B60003F4F4F4F5F4F29873A874B875C8726015E +:100B700037011D821E821F821886F40181859285AD +:100B8000A385B4852D813E814F815885281739076B +:100B90004A075B0708F063C089859A85AB85BC85E9 +:100BA0008C159D05AE05BF0550F482E0C82ED12CF2 +:100BB000E12CF12C92E0492E512C612C712C9E01DC +:100BC0002F5F3F4FB701A601C4010E94EC048823A8 +:100BD00009F445C089819A81AB81BC81892B8A2B1C +:100BE0008B2B41F0260137019FEF491A590A690AF8 +:100BF000790A05C0C414D504E604F70491F02D81E8 +:100C00003E814F8158852F5F3F4F4F4F5F4F2D8360 +:100C10003E834F8358873FEFC31AD30AE30AF30A90 +:100C2000ACCF0FEF1FEF2FEF3FE0B301A201C401E4 +:100C30000E944C04882399F0D50116964D915D9140 +:100C40006D917C911997411551056105710549F028 +:100C500093018201C4010E944C04811102C080E012 +:100C60002AC0D50116964D925D926D927C9219978D +:100C7000332051F0D301C2010196A11DB11DF40131 +:100C800080839183A283B383F5018789908DA18DA1 +:100C9000B28D892B8A2B8B2B69F4D50157964D92F7 +:100CA0005D926D927C925A9714968C9114978068FD +:100CB00014968C9381E02C960FB6F894DEBF0FBE8D +:100CC000CDBFDF91CF911F910F91FF90EF90DF90FB +:100CD000CF90BF90AF909F908F907F906F905F90DC +:100CE0004F903F9008954F925F926F927F928F92B4 +:100CF0009F92AF92BF92EF92FF920F931F93CF9369 +:100D0000DF9300D000D01F92CDB7DEB78C016D838A +:100D1000DC0115968C911597813009F057C0149617 +:100D20008C9181FF53C05AC0038CF48DE02D258532 +:100D300030E0275F3F4F2A013B01B1E04B1A5108D9 +:100D400061087108022E04C0769467945794479402 +:100D50000A94D2F7D501C4010197A109B10904C0D1 +:100D6000B695A795979587952A95D2F784159505F9 +:100D7000A605B70508F070C0F8014789508D618D50 +:100D8000728D46835783608771872C013D017801FE +:100D9000E6E0EE0EF11CD801411451046104710427 +:100DA00009F464C016964D915D916D917C911997EF +:100DB00097015B968D919C915C970E94EC04B1E049 +:100DC0004B1A5108610871088111E5CF81E090E06C +:100DD000F8019383828380E090E04FC182FF0EC0D0 +:100DE000F801428553856485758583889488A58834 +:100DF000B688481559056A057B05F1F4D8011A969D +:100E00004D915D916D917C911D975B968D919C911B +:100E10005C97FC0174807A944A015B0129E0B694E6 +:100E2000A794979487942A95D1F778207A01F1E0D6 +:100E3000FF22772011F164C081149104A104B10450 +:100E400009F072CF1682178210861186F801128679 +:100E5000138614861586D2CF452B462B472B09F4D3 +:100E60008BCF84199509A609B7098FCF1A968D9251 +:100E70009D92AD92BC921D97C1CFE114F10409F08F +:100E80003FC0F80146815781608571854115510544 +:100E90006105710549F48789908DA18DB28D009708 +:100EA000A105B10541F521C09E012F5F3F4F0E9472 +:100EB000EC04882309F48FCF89819A81AB81BC81AE +:100EC000F801238D348DF9012789203129F048EF6D +:100ED0005FEF6FEF7FE004C048EF5FEF60E070E02E +:100EE00084179507A607B70730F0C8010E94700560 +:100EF000811106C06BCFF80186839783A087B187E5 +:100F0000D8015B96ED91FC915C9716968D909D9023 +:100F1000AD90BC901997B2E08B1A9108A108B10866 +:100F2000058404C0880C991CAA1CBB1C0A94D2F727 +:100F300086859785A089B189880E991EAA1EBB1E39 +:100F4000870C911CA11CB11CE114F10409F5F801F6 +:100F5000428553856485758583899489A589B68979 +:100F6000481759076A077B0798F00E946E03882389 +:100F700009F42CCF8092000190920101A09202010D +:100F8000B09203018091330181608093330108C0E6 +:100F900041E0C501B4010E94AB03882309F416CFD8 +:100FA000F701E85CFE4F8D818083F801828593858F +:100FB000A485B5850196A11DB11D82879387A4875D +:100FC000B5874389548965897689481759076A071F +:100FD0007B0738F4838B948BA58BB68B84818068D8 +:100FE0008483D80114968C9183FD03C081E090E046 +:100FF00044C0F8019581992309F4E8CE87FF38C0F1 +:10100000668577858089918941E00E94AB038823BA +:1010100009F4DCCED8015296EC91B0E2EB9F90013E +:101020001124D901A85CBE4F109709F4CFCEF80166 +:101030008581823050F443895489658976895C962C +:101040004D935D936D937C935F97F8018789908DA5 +:10105000A18DB28DF901E85CFE4F938F828FB58B25 +:10106000A48BD80114968C9114978F7714968C9337 +:101070000E946E038111BACFA9CE0F900F900F90EE +:101080000F900F90DF91CF911F910F91FF90EF90F4 +:10109000BF90AF909F908F907F906F905F904F9098 +:1010A00008950F931F93CF93DF931F92CDB7DEB7B1 +:1010B00082E0898342E450E065E371E080E80E94C9 +:1010C00037010E943E0CDC0112960D911C91139782 +:1010D0000115110569F0D801ED91FC910280F381B1 +:1010E000E02DBE016F5F7F4FC801099597FF07C0D4 +:1010F00089810F90DF91CF911F910F910895F80191 +:1011000000851185E5CF8F929F92AF92BF92CF92CB +:10111000DF92EF92FF920F931F93CF93DF935C01C7 +:101120006B018A0180910F01882309F459C08091D5 +:101130004B03882309F454C08091480380FF05C005 +:101140008091E00082608093E000E8018AEFF82E51 +:1011500093E0E92E2FE3822E3AE3932E2097C9F1F4 +:101160008FB7F894E092E9009091E80095FF06C0EF +:101170009091F200282D291B922F01C090E08FBF83 +:10118000911106C0FA94FF2059F10E94FA0BE6CFA4 +:10119000292F30E0C217D3070CF49C2F8FB7F89497 +:1011A000E092E9002091E80025FF11C0292F30E0EE +:1011B000C21BD30BF601915020F041914093F100F6 +:1011C000FACFC20ED31E9091E80095FF13C08FBFD7 +:1011D000C5CF5D9884E6809346031016110644F04F +:1011E00081E090E0F5019383828380E090E005C088 +:1011F000C80103C09092E800EACFDF91CF911F9120 +:101200000F91FF90EF90DF90CF90BF90AF909F90A5 +:101210008F9008950F931F93CF93DF931F92CDB7B5 +:10122000DEB78C01FC018485958597FF0EC0CE0149 +:1012300001960E94140C019719F4298130E002C034 +:101240002FEF3FEFF80135872487F80184859585D6 +:101250000F90DF91CF911F910F910895CF93DF935E +:101260001F92CDB7DEB7FC018485958597FD05C03B +:101270002FEF3FEF358724870BC0CE0101960E94E8 +:10128000140C019719F4898190E002C08FEF9FEF51 +:101290000F90DF91CF9108951F920F920FB60F928A +:1012A0001124CF92DF92EF92FF920F931F932F930F +:1012B0003F934F935F936F937F938F939F93AF93DE +:1012C000BF93EF93FF93CF93DF93CDB7DEB76C97C8 +:1012D000DEBFCDBF1092E9008091E80083FFFAC124 +:1012E00068E0CE0145960E945E0182EF8093E8009F +:1012F0008D8987FF05C09091E80090FFFCCF03C067 +:101300009EEF9093E800982F907609F0C6C09E89D2 +:101310002F89188D91110CC0803829F480914903D0 +:101320008093F10002C01092F1001092F10047C1C9 +:10133000422F50E0512B913051F4811140C1413086 +:10134000510509F03CC1809149038D7F0BC093305A +:1013500061F4811134C14130510509F030C18091EF +:1013600049038260809349032AC1953041F48091FA +:10137000E80080FFFCCF20682093E30020C1963076 +:1013800009F05FC0EB8CFC8C1092E90010924503D1 +:1013900010924403123091F51092430310924203CD +:1013A0000E94510899E0BE016F5F7F4FDB01E92F7A +:1013B0001D92EA95E9F799831A8391E09E8390EA5A +:1013C00098879AEF99872091440330914503275FCE +:1013D0003F4F3C832B838D831092E900109245038D +:1013E00010924403F0924303E092420349E050E03C +:1013F00080E00E9437010E945108E1C0F09243034F +:10140000E09242030E943E0CDC011296ED90FC90AB +:101410001397E114F10409F4C0C0D701ED91FC91D8 +:101420000480F581E02DBE016B5E7F4FC7010995F9 +:10143000009719F00CF0C3C0C6C0F701E084F18436 +:10144000E8CF973009F4BFC0983021F481E0809351 +:10145000F100B5C0993009F0B2C0837009F0B3C093 +:10146000E1E1F1E081E021E036E39081992361F050 +:101470008093E9002093EB0091919093EC003093DE +:10148000ED008F5F873089F78EE78093EA00109236 +:10149000EA008F8980934B0392C08B8D9C8D1092B4 +:1014A000E900109245031092440390934303809304 +:1014B0004203898D811156C08E899D89913A59F4D4 +:1014C000813209F080C047E050E068E071E080E0E0 +:1014D0000E94370174C0913209F075C0833289F4DB +:1014E000888D90E0982F88272F89822BA0E0B0E08C +:1014F0008093040190930501A0930601B093070126 +:101500005EC0803269F48091E80082FFFCCF67E022 +:1015100088E091E00E945E018BEF8093E80006C0B6 +:10152000823209F04CC08F8980930F01809147036C +:10153000882319F0EEEFFAE002C0E0E0F8E08091D5 +:10154000080190910901A0910A01B0910B01803B23 +:101550009440A105B10509F088C080910F0180FF7A +:10156000A0C083C00E943E0CDC0112960D911C911C +:1015700013970115110539F1D801ED91FC910190F6 +:10158000F081E02DBE016B5E7F4FC801099581118E +:1015900016C0F80100851185ECCF1130C1F0133071 +:1015A00091F48F89882309F455C08230E9F440E82A +:1015B00060E187E891E00E94C40C882321F08EEF5F +:1015C0008093E80087C081E28093EB0083C08B8D1D +:1015D0009C8D089711F41093410380914103811170 +:1015E00036C068E971E038C0813029F440E86BE02A +:1015F0008BE791E0E0CF833031F70E943E0CDC01B5 +:101600001296ED90FC9013978E010F5F1F4F6801AB +:10161000E114F10479F0D701ED91FC910680F78196 +:10162000E02DB801C7010995080F111DF701E084ED +:10163000F184EECFD8011C92F60101900020E9F769 +:101640003197BF016C197D0940E0C601B4CF6AEA49 +:1016500071E002C067E771E06115710509F4B3CF6D +:10166000FB01449150E080E833CF0FB6F894A89581 +:1016700080916000886180936000109260000FBECE +:10168000A895EE3F2AE0F20739F08091FE0A90918A +:10169000FF0A9183808393CF1092FF0A1092FE0A73 +:1016A0008ECFEE3F8AE0F80731F0808191819093F0 +:1016B000FF0A8093FE0A87E797E7918380839BE088 +:1016C00088E10FB6F894A895809360000FBE9093C0 +:1016D000600075CF6C960FB6F894DEBF0FBECDBF1D +:1016E000DF91CF91FF91EF91BF91AF919F918F913A +:1016F0007F916F915F914F913F912F911F910F912A +:10170000FF90EF90DF90CF900F900FBE0F901F9043 +:1017100018953FB7F89480913D0390913E03A091B6 +:101720003F03B091400326B5A89B05C02F3F19F099 +:101730000196A11DB11D3FBFBA2FA92F982F882751 +:10174000820F911DA11DB11DBC01CD0142E0660FAC +:10175000771F881F991F4A95D1F708951F920F92FE +:101760000FB60F9211242F933F938F939F93AF93B4 +:10177000BF938091390390913A03A0913B03B091BC +:101780003C033091380323E0230F2D3720F40196DA +:10179000A11DB11D05C026E8230F0296A11DB11D94 +:1017A000209338038093390390933A03A0933B032B +:1017B000B0933C0380913D0390913E03A0913F0381 +:1017C000B09140030196A11DB11D80933D039093FC +:1017D0003E03A0933F03B0934003BF91AF919F910D +:1017E0008F913F912F910F900FBE0F901F901895E2 +:1017F0000E94DA0DCF92DF92EF92FF920E94890B46 +:101800006B017C010E94890BDC01CB018C199D09C5 +:10181000AE09BF09883E9340A105B10598F3FF903A +:10182000EF90DF90CF900895FC0180914B038111E0 +:1018300003C08FEF9FEF08959FB7F89482E08093E5 +:10184000E9002091F20030E01216130614F421E0B2 +:1018500030E02115310559F0289884E680934A0339 +:101860008091F10080838091F200882319F09FBF5E +:10187000C90108958BE68093E800F9CF8091520367 +:1018800081110DC082E080934E0384E080934F036A +:10189000109251031092500381E0809352038EE422 +:1018A00093E008951F920F920FB60F9211248F9319 +:1018B0009F938091E1009091E100937F9093E100EC +:1018C00083FF0FC01092E90091E09093EB0010921B +:1018D000EC0092E39093ED0010924B0398E090930C +:1018E000F00082FF20C093E09093E9009091F20015 +:1018F000992319F09AE39093E80090914603992375 +:1019000039F090914603915090934603992389F1C1 +:1019100090914A03992339F090914A039150909302 +:101920004A03992341F184FF10C08091E2008E7E2A +:1019300081608093E2008091E1008F7E8093E100DE +:10194000809148038E7E806111C080FF16C0809117 +:10195000E2008E7E80618093E2008091E1008E7EC5 +:101960008093E100809148038E7E816080934803DC +:1019700004C05D9ACDCF289AD6CF9F918F910F90BA +:101980000FBE0F901F901895CF92DF92EF92FF92AB +:101990000F931F93CF93DF931F92CDB7DEB7182F0E +:1019A000062FE42E862F880F8E5F99830E940901EF +:1019B00083E00E940901F12EC12E9981D92E8C2D30 +:1019C0008F19801798F4F601E7FE02C0849101C0D8 +:1019D00080810E940901182F80E00E940901812363 +:1019E000FFEFCF1ADF0A8111EACF01C081E00F902B +:1019F000DF91CF911F910F91FF90EF90DF90CF90EB +:101A00000895EAE5F3E01382128288EE93E0A0E005 +:101A1000B0E084839583A683B7838BE191E09183C3 +:101A200080838FEF9FEF95878487ECE4F3E080E578 +:101A300080831182EAEAF3E015821682118613860A +:101A400082E090E0A0E0B0E084879587A687B78722 +:101A500013A215A614A68BE291E093A782A717A65E +:101A60000895789484B5826084BD84B5816084BD16 +:101A700085B5826085BD85B5816085BD80916E002C +:101A8000816080936E00109281008091810082605D +:101A9000809381008091810081608093810080919A +:101AA00080008160809380008091910082608093AB +:101AB00091008091910081608093910080919000CD +:101AC0008160809390008091C10084608093C10008 +:101AD0008091C10082608093C1008091C1008160CB +:101AE0008093C1008091C30081608093C300809186 +:101AF000C00082608093C0008091C20081608093AA +:101B0000C20080917A00846080937A0080917A008C +:101B1000826080937A0080917A00816080937A005D +:101B200080917A00806880937A0010924B03109223 +:101B30004903109248038091D70081608093D700B9 +:101B400080EA8093D80089B5806189BD89B58260BB +:101B500089BD09B400FEFDCF0E94FA0B8091D80028 +:101B60008F7C80618093D8008091E000807F80939B +:101B7000E0008091E1008E7E8093E1008DE0809313 +:101B8000E200559A209AEEEFFFE7859194918B3F02 +:101B90009C4D19F481E080934703C0E0D0E020978A +:101BA000F1F30E940000FBCFEE0FFF1F0590F491B0 +:101BB000E02D099481E090E0F8940C94DF0DF89406 +:021BC000FFCF55 +:101BC200FFFFFFFFFFFFFFFF00E10000000000003A +:101BD20000C180810000000000000096018308B768 +:101BE200012E090A09AC010000000073066B010016 +:00000001FF diff --git a/upload/utils.go b/upload/utils.go new file mode 100644 index 000000000..984a951d8 --- /dev/null +++ b/upload/utils.go @@ -0,0 +1,59 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package upload + +// Logger is an interface implemented by most loggers (like logrus) +type Logger interface { + Debug(args ...interface{}) + Info(args ...interface{}) +} + +func debug(l Logger, args ...interface{}) { + if l != nil { + l.Debug(args...) + } +} + +func info(l Logger, args ...interface{}) { + if l != nil { + l.Info(args...) + } +} + +// Locater can return the location of a tool in the system +type Locater interface { + GetLocation(command string) (string, error) +} + +// differ returns the first item that differ between the two input slices +func differ(slice1 []string, slice2 []string) string { + m := map[string]int{} + + for _, s1Val := range slice1 { + m[s1Val] = 1 + } + for _, s2Val := range slice2 { + m[s2Val] = m[s2Val] + 1 + } + + for mKey, mVal := range m { + if mVal == 1 { + return mKey + } + } + + return "" +} diff --git a/upload/utils_test.go b/upload/utils_test.go new file mode 100644 index 000000000..c92d0a151 --- /dev/null +++ b/upload/utils_test.go @@ -0,0 +1,38 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package upload + +import "testing" + +var TestDifferData = []struct { + Before []string + After []string + Result string +}{ + {[]string{}, []string{}, ""}, + {[]string{"/dev/ttyACM0", "/dev/sys"}, []string{"/dev/sys"}, "/dev/ttyACM0"}, + {[]string{"/dev/sys"}, []string{"/dev/ttyACM0", "/dev/sys"}, "/dev/ttyACM0"}, +} + +func TestDiffer(t *testing.T) { + for _, test := range TestDifferData { + result := differ(test.Before, test.After) + if result != test.Result { + t.Error("expected " + test.Result + ", got " + result) + continue + } + } +} diff --git a/utilities.go b/utilities.go deleted file mode 100644 index e6ef73a85..000000000 --- a/utilities.go +++ /dev/null @@ -1,78 +0,0 @@ -// utilities.go - -package main - -import ( - "bytes" - "crypto/md5" - "io" - "os" - "os/exec" -) - -func computeMd5(filePath string) ([]byte, error) { - var result []byte - file, err := os.Open(filePath) - if err != nil { - return result, err - } - defer file.Close() - - hash := md5.New() - if _, err := io.Copy(hash, file); err != nil { - return result, err - } - - return hash.Sum(result), nil -} - -func call(stack []*exec.Cmd, pipes []*io.PipeWriter) (err error) { - if stack[0].Process == nil { - if err = stack[0].Start(); err != nil { - return err - } - } - if len(stack) > 1 { - if err = stack[1].Start(); err != nil { - return err - } - defer func() { - pipes[0].Close() - err = call(stack[1:], pipes[1:]) - }() - } - return stack[0].Wait() -} - -// code inspired by https://gist.github.com/tyndyll/89fbb2c2273f83a074dc -func pipe_commands(commands ...*exec.Cmd) ([]byte, error) { - var errorBuffer, outputBuffer bytes.Buffer - pipeStack := make([]*io.PipeWriter, len(commands)-1) - i := 0 - for ; i < len(commands)-1; i++ { - stdinPipe, stdoutPipe := io.Pipe() - commands[i].Stdout = stdoutPipe - commands[i].Stderr = &errorBuffer - commands[i+1].Stdin = stdinPipe - pipeStack[i] = stdoutPipe - } - commands[i].Stdout = &outputBuffer - commands[i].Stderr = &errorBuffer - - if err := call(commands, pipeStack); err != nil { - return nil, err - } - - return outputBuffer.Bytes(), nil -} - -// Filter returns a new slice containing all OsSerialPort in the slice that satisfy the predicate f. -func Filter(vs []OsSerialPort, f func(OsSerialPort) bool) []OsSerialPort { - var vsf []OsSerialPort - for _, v := range vs { - if f(v) { - vsf = append(vsf, v) - } - } - return vsf -} diff --git a/utilities/utilities.go b/utilities/utilities.go new file mode 100644 index 000000000..662672da7 --- /dev/null +++ b/utilities/utilities.go @@ -0,0 +1,177 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package utilities + +import ( + "bytes" + "crypto" + "crypto/rsa" + "crypto/sha256" + "crypto/x509" + "encoding/hex" + "encoding/pem" + "errors" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "strings" +) + +// SaveFileonTempDir creates a temp directory and saves the file data as the +// filename in that directory. +// Returns an error if the agent doesn't have permission to create the folder. +// Returns an error if the filename doesn't form a valid path. +// +// Note that path could be defined and still there could be an error. +func SaveFileonTempDir(filename string, data io.Reader) (string, error) { + tmpdir, err := os.MkdirTemp("", "arduino-create-agent") + if err != nil { + return "", errors.New("Could not create temp directory to store downloaded file. Do you have permissions?") + } + return saveFileonTempDir(tmpdir, filename, data) +} + +func saveFileonTempDir(tmpDir, filename string, data io.Reader) (string, error) { + path, err := SafeJoin(tmpDir, filename) + if err != nil { + return "", err + } + // Determine filename + filename, err = filepath.Abs(path) + if err != nil { + return "", err + } + + // Touch file + output, err := os.Create(filename) + if err != nil { + return filename, err + } + defer output.Close() + + // Write file + _, err = io.Copy(output, data) + if err != nil { + return filename, err + } + return filename, nil +} + +// PipeCommands executes the commands received as input by feeding the output of +// one to the input of the other, exactly like Unix Pipe (|). +// Returns the output of the final command and the eventual error. +// +// code inspired by https://gist.github.com/tyndyll/89fbb2c2273f83a074dc +func PipeCommands(commands ...*exec.Cmd) ([]byte, error) { + var errorBuffer, outputBuffer bytes.Buffer + pipeStack := make([]*io.PipeWriter, len(commands)-1) + i := 0 + for ; i < len(commands)-1; i++ { + stdinPipe, stdoutPipe := io.Pipe() + commands[i].Stdout = stdoutPipe + commands[i].Stderr = &errorBuffer + commands[i+1].Stdin = stdinPipe + pipeStack[i] = stdoutPipe + } + commands[i].Stdout = &outputBuffer + commands[i].Stderr = &errorBuffer + + if err := call(commands, pipeStack); err != nil { + return nil, err + } + + return outputBuffer.Bytes(), nil +} + +func call(stack []*exec.Cmd, pipes []*io.PipeWriter) (err error) { + if stack[0].Process == nil { + if err = stack[0].Start(); err != nil { + return err + } + } + if len(stack) > 1 { + if err = stack[1].Start(); err != nil { + return err + } + defer func() { + pipes[0].Close() + err = call(stack[1:], pipes[1:]) + }() + } + return stack[0].Wait() +} + +// SafeJoin performs a filepath.Join of 'parent' and 'subdir' but returns an error +// if the resulting path points outside of 'parent'. +func SafeJoin(parent, subdir string) (string, error) { + res := filepath.Join(parent, subdir) + if !strings.HasSuffix(parent, string(os.PathSeparator)) { + parent += string(os.PathSeparator) + } + if !strings.HasPrefix(res, parent) { + return res, fmt.Errorf("unsafe path join: '%s' with '%s'", parent, subdir) + } + return res, nil +} + +// VerifyInput will verify an input against a signature using the public key. +// A valid signature is indicated by returning a nil error. +func VerifyInput(input string, signature string, pubKey *rsa.PublicKey) error { + sign, _ := hex.DecodeString(signature) + h := sha256.New() + h.Write([]byte(input)) + d := h.Sum(nil) + return rsa.VerifyPKCS1v15(pubKey, crypto.SHA256, d, sign) +} + +// ParseRsaPublicKey parses a public key in PEM format and returns the rsa.PublicKey object. +// Returns an error if the key is invalid. +func ParseRsaPublicKey(key []byte) (*rsa.PublicKey, error) { + block, _ := pem.Decode(key) + if block == nil { + return nil, errors.New("invalid key") + } + + parsedKey, err := x509.ParsePKIXPublicKey(block.Bytes) + if err != nil { + return nil, err + } + + publicKey, ok := parsedKey.(*rsa.PublicKey) + if !ok { + return nil, fmt.Errorf("not an rsa key") + } + return publicKey, nil +} + +// MustParseRsaPublicKey parses a public key in PEM format and returns the rsa.PublicKey object. +// Panics if the key is invalid. +func MustParseRsaPublicKey(key []byte) *rsa.PublicKey { + parsedKey, err := ParseRsaPublicKey(key) + if err != nil { + panic(err) + } + return parsedKey +} + +// UserPrompt executes an osascript and returns the pressed button +func UserPrompt(dialog string, buttons string, defaultButton string, toPress string, title string) bool { + oscmd := exec.Command("osascript", "-e", "display dialog \""+dialog+"\" buttons "+buttons+" default button\""+defaultButton+"\" with title \""+title+"\"") + pressedButton, _ := oscmd.Output() + return strings.Contains(string(pressedButton), "button returned:"+toPress) +} diff --git a/utilities/utilities_darwin.go b/utilities/utilities_darwin.go new file mode 100644 index 000000000..ab567497a --- /dev/null +++ b/utilities/utilities_darwin.go @@ -0,0 +1,22 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package utilities + +import "os/exec" + +// TellCommandNotToSpawnShell will now spawn a shell +func TellCommandNotToSpawnShell(_ *exec.Cmd) { +} diff --git a/utilities/utilities_linux.go b/utilities/utilities_linux.go new file mode 100644 index 000000000..ab567497a --- /dev/null +++ b/utilities/utilities_linux.go @@ -0,0 +1,22 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package utilities + +import "os/exec" + +// TellCommandNotToSpawnShell will now spawn a shell +func TellCommandNotToSpawnShell(_ *exec.Cmd) { +} diff --git a/utilities/utilities_test.go b/utilities/utilities_test.go new file mode 100644 index 000000000..6511a1719 --- /dev/null +++ b/utilities/utilities_test.go @@ -0,0 +1,48 @@ +package utilities + +import ( + "bytes" + "fmt" + "path/filepath" + "runtime" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestSaveFileonTemp(t *testing.T) { + filename := "file" + tmpDir := t.TempDir() + + path, err := saveFileonTempDir(tmpDir, filename, bytes.NewBufferString("TEST")) + require.NoError(t, err) + require.Equal(t, filepath.Join(tmpDir, filename), path) +} + +func TestSaveFileonTempDirWithEvilName(t *testing.T) { + evilFileNames := []string{ + "/", + "..", + "../", + "../evil.txt", + "../../../../../../../../../../../../../../../../../../../../tmp/evil.txt", + "some/path/../../../../../../../../../../../../../../../../../../../../tmp/evil.txt", + "/../../../../../../../../../../../../../../../../../../../../tmp/evil.txt", + "/some/path/../../../../../../../../../../../../../../../../../../../../tmp/evil.txt", + } + if runtime.GOOS == "windows" { + evilFileNames = []string{ + "..\\", + "..\\evil.txt", + "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\tmp\\evil.txt", + "some\\path\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\tmp\\evil.txt", + "\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\tmp\\evil.txt", + "\\some\\path\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\tmp\\evil.txt", + } + } + for _, evilFileName := range evilFileNames { + _, err := saveFileonTempDir(t.TempDir(), evilFileName, bytes.NewBufferString("TEST")) + require.Error(t, err, fmt.Sprintf("with filename: '%s'", evilFileName)) + require.ErrorContains(t, err, "unsafe path join") + } +} diff --git a/utilities/utilities_windows.go b/utilities/utilities_windows.go new file mode 100644 index 000000000..658aaec8c --- /dev/null +++ b/utilities/utilities_windows.go @@ -0,0 +1,26 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package utilities + +import ( + "os/exec" + "syscall" +) + +// TellCommandNotToSpawnShell will now spawn a shell +func TellCommandNotToSpawnShell(oscmd *exec.Cmd) { + oscmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} +} diff --git a/v2/http.go b/v2/http.go new file mode 100644 index 000000000..2b47b93a8 --- /dev/null +++ b/v2/http.go @@ -0,0 +1,76 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package v2 + +import ( + "context" + "crypto/rsa" + "encoding/json" + "net/http" + + toolssvr "github.com/arduino/arduino-create-agent/gen/http/tools/server" + toolssvc "github.com/arduino/arduino-create-agent/gen/tools" + "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/v2/pkgs" + "github.com/sirupsen/logrus" + goahttp "goa.design/goa/v3/http" + "goa.design/goa/v3/http/middleware" + goamiddleware "goa.design/goa/v3/middleware" +) + +// Server is the actual server +func Server(directory string, index *index.Resource, pubKey *rsa.PublicKey) http.Handler { + mux := goahttp.NewMuxer() + + // Instantiate logger + logger := logrus.New() + logger.SetLevel(logrus.DebugLevel) + logAdapter := LogAdapter{Logger: logger} + + // Mount tools + toolsSvc := pkgs.New(index, directory, "replace", pubKey) + toolsEndpoints := toolssvc.NewEndpoints(toolsSvc) + toolsServer := toolssvr.New(toolsEndpoints, mux, CustomRequestDecoder, goahttp.ResponseEncoder, errorHandler(logger), nil) + toolssvr.Mount(mux, toolsServer) + + // Mount middlewares + handler := middleware.Log(logAdapter)(mux) + handler = middleware.RequestID()(handler) + + return handler +} + +// errorHandler returns a function that writes and logs the given error. +// The function also writes and logs the error unique ID so that it's possible +// to correlate. +func errorHandler(logger *logrus.Logger) func(context.Context, http.ResponseWriter, error) { + return func(ctx context.Context, w http.ResponseWriter, err error) { + id := ctx.Value(goamiddleware.RequestIDKey).(string) + w.Write([]byte("[" + id + "] encoding: " + err.Error())) + logger.Printf("[%s] ERROR: %s", id, err.Error()) + } +} + +// CustomRequestDecoder overrides the RequestDecoder provided by goahttp package +// It returns always a json.NewDecoder for legacy reasons: +// The web editor sends always request to the agent setting "Content-Type: text/plain" +// even when it should set "Content-Type: application/json". This breaks the parsing with: +// "can't decode text/plain to *server.InstallRequestBody" error message. +// This was working before the bump to goa v3 only because a "text/plain" decoder was not implemented +// and it was fallbacking to the json decoder. (https://github.com/goadesign/goa/pull/2310) +func CustomRequestDecoder(r *http.Request) goahttp.Decoder { + return json.NewDecoder(r.Body) +} diff --git a/v2/log.go b/v2/log.go new file mode 100644 index 000000000..8d683ad18 --- /dev/null +++ b/v2/log.go @@ -0,0 +1,46 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package v2 + +import ( + "bytes" + "fmt" + + "github.com/sirupsen/logrus" +) + +// LogAdapter is the adapter for the logger +type LogAdapter struct { + *logrus.Logger +} + +// Log is the log function +func (a LogAdapter) Log(keyvals ...interface{}) error { + n := (len(keyvals) + 1) / 2 + if len(keyvals)%2 != 0 { + keyvals = append(keyvals, "MISSING") + } + var fm bytes.Buffer + vals := make([]interface{}, n) + for i := 0; i < len(keyvals); i += 2 { + k := keyvals[i] + v := keyvals[i+1] + vals[i/2] = v + fm.WriteString(fmt.Sprintf(" %s=%%+v", k)) + } + a.Logger.Printf(fm.String(), vals...) + return nil +} diff --git a/v2/pkgs/pkgs.go b/v2/pkgs/pkgs.go new file mode 100644 index 000000000..07e392b2f --- /dev/null +++ b/v2/pkgs/pkgs.go @@ -0,0 +1,141 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Package pkgs implements the functions from +// github.com/arduino-create-agent/gen/indexes +// and github.com/arduino-create-agent/gen/tools. +// +// It allows to manage package indexes from arduino +// cores, and to download tools used for upload. +package pkgs + +import "regexp" + +// Index is the go representation of a typical +// package-index file, stripped from every non-used field. +type Index struct { + Packages []struct { + Name string `json:"name"` + Tools []Tool `json:"tools"` + } `json:"packages"` +} + +// Tool is the go representation of the info about a +// tool contained in a package-index file, stripped from +// every non-used field. +type Tool struct { + Name string `json:"name"` + Version string `json:"version"` + Systems []System `json:"systems"` +} + +// System is the go representation of the info needed to +// download a tool for a specific OS/Arch +type System struct { + Host string `json:"host"` + URL string `json:"url"` + Name string `json:"archiveFileName"` + Checksum string `json:"checksum"` +} + +// Source: https://github.com/arduino/arduino-cli/blob/master/internal/arduino/cores/tools.go#L129-L142 +var ( + regexpLinuxArm = regexp.MustCompile("arm.*-linux-gnueabihf") + regexpLinuxArm64 = regexp.MustCompile("(aarch64|arm64)-linux-gnu") + regexpLinux64 = regexp.MustCompile("x86_64-.*linux-gnu") + regexpLinux32 = regexp.MustCompile("i[3456]86-.*linux-gnu") + regexpWindows32 = regexp.MustCompile("i[3456]86-.*(mingw32|cygwin)") + regexpWindows64 = regexp.MustCompile("(amd64|x86_64)-.*(mingw32|cygwin)") + regexpMac64 = regexp.MustCompile("x86_64-apple-darwin.*") + regexpMac32 = regexp.MustCompile("i[3456]86-apple-darwin.*") + regexpMacArm64 = regexp.MustCompile("arm64-apple-darwin.*") + regexpFreeBSDArm = regexp.MustCompile("arm.*-freebsd[0-9]*") + regexpFreeBSD32 = regexp.MustCompile("i?[3456]86-freebsd[0-9]*") + regexpFreeBSD64 = regexp.MustCompile("amd64-freebsd[0-9]*") +) + +// Source: https://github.com/arduino/arduino-cli/blob/master/internal/arduino/cores/tools.go#L144-L176 +func (s *System) isExactMatchWith(osName, osArch string) bool { + if s.Host == "all" { + return true + } + + switch osName + "," + osArch { + case "linux,arm", "linux,armbe": + return regexpLinuxArm.MatchString(s.Host) + case "linux,arm64": + return regexpLinuxArm64.MatchString(s.Host) + case "linux,amd64": + return regexpLinux64.MatchString(s.Host) + case "linux,386": + return regexpLinux32.MatchString(s.Host) + case "windows,386": + return regexpWindows32.MatchString(s.Host) + case "windows,amd64": + return regexpWindows64.MatchString(s.Host) + case "darwin,arm64": + return regexpMacArm64.MatchString(s.Host) + case "darwin,amd64": + return regexpMac64.MatchString(s.Host) + case "darwin,386": + return regexpMac32.MatchString(s.Host) + case "freebsd,arm": + return regexpFreeBSDArm.MatchString(s.Host) + case "freebsd,386": + return regexpFreeBSD32.MatchString(s.Host) + case "freebsd,amd64": + return regexpFreeBSD64.MatchString(s.Host) + } + return false +} + +// Source: https://github.com/arduino/arduino-cli/blob/master/internal/arduino/cores/tools.go#L178-L198 +func (s *System) isCompatibleWith(osName, osArch string) (bool, int) { + if s.isExactMatchWith(osName, osArch) { + return true, 1000 + } + + switch osName + "," + osArch { + case "windows,amd64": + return regexpWindows32.MatchString(s.Host), 10 + case "darwin,amd64": + return regexpMac32.MatchString(s.Host), 10 + case "darwin,arm64": + // Compatibility guaranteed through Rosetta emulation + if regexpMac64.MatchString(s.Host) { + // Prefer amd64 version if available + return true, 20 + } + return regexpMac32.MatchString(s.Host), 10 + } + + return false, 0 +} + +// GetFlavourCompatibleWith returns the downloadable resource (System) compatible with the specified OS/Arch +// Source: https://github.com/arduino/arduino-cli/blob/master/internal/arduino/cores/tools.go#L206-L216 +func (t *Tool) GetFlavourCompatibleWith(osName, osArch string) System { + var correctSystem System + maxSimilarity := -1 + + for _, s := range t.Systems { + if comp, similarity := s.isCompatibleWith(osName, osArch); comp && similarity > maxSimilarity { + correctSystem = s + maxSimilarity = similarity + } + } + + return correctSystem +} diff --git a/v2/pkgs/testdata/test_tool_index.json b/v2/pkgs/testdata/test_tool_index.json new file mode 100644 index 000000000..b7f8b87d2 --- /dev/null +++ b/v2/pkgs/testdata/test_tool_index.json @@ -0,0 +1,521 @@ +{ + "packages": [ + { + "name": "arduino-test", + "maintainer": "Arduino", + "websiteURL": "http://www.arduino.cc/", + "email": "packages@arduino.cc", + "help": { + "online": "http://www.arduino.cc/en/Reference/HomePage" + }, + "platforms": [ + { + "name": "Arduino megaAVR Boards - Pre-release", + "architecture": "megaavr", + "version": "1.8.102", + "category": "Arduino", + "url": "http://downloads.arduino.cc/cores/staging/core-megaavr-1.8.102.tar.bz2", + "archiveFileName": "core-megaavr-1.8.102.tar.bz2", + "checksum": "SHA-256:ad5e60b828678d9ccff957032524a4c4d68b218737e7df24b905769a04dc2a6a", + "size": "858620", + "help": { + "online": "https://github.com/arduino/ArduinoCore-megaavr/issues" + }, + "boards": [ + { + "name": "Arduino Uno WiFi Rev2" + }, + { + "name": "Arduino Nano Every" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "avr-gcc", + "version": "7.3.0-atmel3.6.1-arduino5" + }, + { + "packager": "arduino", + "name": "avrdude", + "version": "7.0-arduino.3" + }, + { + "packager": "arduino", + "name": "arduinoOTA", + "version": "1.3.0" + } + ] + } + ], + "tools": [ + { + "name": "avrdude", + "version": "6.3.0-arduino17", + "systems": [ + { + "size": "219631", + "checksum": "SHA-256:2a8e68c5d803aa6f902ef219f177ec3a4c28275d85cbe272962ad2cd374f50d1", + "host": "arm-linux-gnueabihf", + "archiveFileName": "avrdude-6.3.0-arduino17-armhf-pc-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-armhf-pc-linux-gnu.tar.bz2" + }, + { + "size": "229852", + "checksum": "SHA-256:6cf948f751acfe7b96684537f2291c766ec8b54b4f7dc95539864821456fa9fc", + "host": "aarch64-linux-gnu", + "archiveFileName": "avrdude-6.3.0-arduino17-aarch64-pc-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-aarch64-pc-linux-gnu.tar.bz2" + }, + { + "size": "279045", + "checksum": "SHA-256:120cc9edaae699e7e9ac50b1b8eb0e7d51fdfa555bac54233c2511e6ee5418c9", + "host": "x86_64-apple-darwin12", + "archiveFileName": "avrdude-6.3.0-arduino17-x86_64-apple-darwin12.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-x86_64-apple-darwin12.tar.bz2" + }, + { + "size": "254271", + "checksum": "SHA-256:accdfb920af2aabf4f7461d2ac73c0751760f525216dc4e7657427a78c60d13d", + "host": "x86_64-linux-gnu", + "archiveFileName": "avrdude-6.3.0-arduino17-x86_64-pc-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-x86_64-pc-linux-gnu.tar.bz2" + }, + { + "size": "244550", + "checksum": "SHA-256:5c8cc6c17db9300e1451fe41cd7178b0442b4490ee6fdbc0aed9811aef96c05f", + "host": "i686-linux-gnu", + "archiveFileName": "avrdude-6.3.0-arduino17-i686-pc-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-i686-pc-linux-gnu.tar.bz2" + }, + { + "size": "328460", + "checksum": "SHA-256:e99188873c7c5ad8f8f906f068c33600e758b2e36cce3adbd518a21bd266749d", + "host": "i686-mingw32", + "archiveFileName": "avrdude-6.3.0-arduino17-i686-w64-mingw32.zip", + "url": "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino17-i686-w64-mingw32.zip" + } + ] + }, + { + "name": "bossac", + "version": "1.6.1-arduino", + "systems": [ + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-arm-linux-gnueabihf.tar.bz2", + "archiveFileName": "bossac-1.6.1-arduino-arm-linux-gnueabihf.tar.bz2", + "checksum": "SHA-256:8c4e63db982178919c824e7a35580dffc95c3426afa7285de3eb583982d4d391", + "size": "201341" + }, + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-mingw32.tar.gz", + "archiveFileName": "bossac-1.6.1-arduino-mingw32.tar.gz", + "checksum": "SHA-256:d59f43e2e83a337d04c4ae88b195a4ee175b8d87fff4c43144d23412a4a9513b", + "size": "222918" + }, + { + "host": "x86_64-apple-darwin", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-i386-apple-darwin14.5.0.tar.gz", + "archiveFileName": "bossac-1.6.1-arduino-i386-apple-darwin14.5.0.tar.gz", + "checksum": "SHA-256:2f80ef569a3fb19da60ab3489e49d8fe7d4699876acf30ff4938c632230a09aa", + "size": "64587" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-x86_64-linux-gnu.tar.gz", + "archiveFileName": "bossac-1.6.1-arduino-x86_64-linux-gnu.tar.gz", + "checksum": "SHA-256:b78afc66c00ccfdd69a08bd3959c260a0c64ccce78a71d5a1135ae4437ff40db", + "size": "30869" + }, + { + "host": "i686-pc-linux-gnu", + "url": "http://downloads.arduino.cc/bossac-1.6.1-arduino-i486-linux-gnu.tar.gz", + "archiveFileName": "bossac-1.6.1-arduino-i486-linux-gnu.tar.gz", + "checksum": "SHA-256:1e211347569d75193b337296a10dd25b0ce04419e3d7dc644355178b6b514f92", + "size": "30320" + } + ] + }, + { + "name": "bossac", + "version": "1.7.0-arduino3", + "systems": [ + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-windows.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-windows.tar.gz", + "checksum": "SHA-256:62745cc5a98c26949ec9041ef20420643c561ec43e99dae659debf44e6836526", + "size": "3607421" + }, + { + "host": "x86_64-apple-darwin", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-osx.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-osx.tar.gz", + "checksum": "SHA-256:adb3c14debd397d8135e9e970215c6972f0e592c7af7532fa15f9ce5e64b991f", + "size": "75510" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-linux64.tar.gz", + "checksum": "SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100", + "size": "207271" + }, + { + "host": "i686-pc-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux32.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-linux32.tar.gz", + "checksum": "SHA-256:4ac4354746d1a09258f49a43ef4d1baf030d81c022f8434774268b00f55d3ec3", + "size": "193577" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linuxarm.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-linuxarm.tar.gz", + "checksum": "SHA-256:626c6cc548046901143037b782bf019af1663bae0d78cf19181a876fb9abbb90", + "size": "193941" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linuxaarch64.tar.gz", + "archiveFileName": "bossac-1.7.0-arduino3-linuxaarch64.tar.gz", + "checksum": "SHA-256:a098b2cc23e29f0dc468416210d097c4a808752cd5da1a7b9b8b7b931a04180b", + "size": "268365" + } + ] + }, + { + "name": "bossac", + "version": "1.9.1-arduino2", + "systems": [ + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-windows.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-windows.tar.gz", + "checksum": "SHA-256:5c994d04354f0db8e4bea136f49866d2ba537f0af74b2e78026f2d4fc75e3e39", + "size": "1260628" + }, + { + "host": "x86_64-apple-darwin", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-osx.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-osx.tar.gz", + "checksum": "SHA-256:b7732129364a378676604db6579c9b8dab50dd965fb50d7a3afff1839c97ff80", + "size": "47870" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-linux64.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-linux64.tar.gz", + "checksum": "SHA-256:9eb549874391521999cee13dc823a2cfc8866b8246945339a281808d99c72d2c", + "size": "399532" + }, + { + "host": "i686-pc-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-linux32.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-linux32.tar.gz", + "checksum": "SHA-256:10d69f53f169f25afee2dd583dfd9dc803c10543e6c5260d106725cb0d174900", + "size": "384951" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-linuxarm.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-linuxarm.tar.gz", + "checksum": "SHA-256:c9539d161d23231b5beb1d09a71829744216c7f5bc2857a491999c3e567f5b19", + "size": "361915" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/bossac-1.9.1-arduino2-linuxaarch64.tar.gz", + "archiveFileName": "bossac-1.9.1-arduino2-linuxaarch64.tar.gz", + "checksum": "SHA-256:c167fa0ea223966f4d21f5592da3888bcbfbae385be6c5c4e41f8abff35f5cb1", + "size": "442853" + } + ] + }, + { + "name": "openocd", + "version": "0.11.0-arduino2", + "systems": [ + { + "size": "1902818", + "checksum": "SHA-256:a1aa7f1435a61eafb72ee90722f2496d6a34a7a0f085d0315c2613e4a548b824", + "host": "aarch64-linux-gnu", + "archiveFileName": "openocd-0.11.0-arduino2-static-aarch64-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-aarch64-linux-gnu.tar.bz2" + }, + { + "size": "1986716", + "checksum": "SHA-256:57041130160be086e69387cceb4616eefc9819a0ef75de1f7c11aea57fb92699", + "host": "arm-linux-gnueabihf", + "archiveFileName": "openocd-0.11.0-arduino2-static-arm-linux-gnueabihf.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-arm-linux-gnueabihf.tar.bz2" + }, + { + "size": "1971364", + "checksum": "SHA-256:6f4a8b77c8076aa18afb8438472526dff8c0d161a3ca68d0326163b59fcab663", + "host": "i686-linux-gnu", + "archiveFileName": "openocd-0.11.0-arduino2-static-i686-ubuntu12.04-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-i686-ubuntu12.04-linux-gnu.tar.bz2" + }, + { + "size": "2460087", + "checksum": "SHA-256:631010980f12b1e750c4c67ce012b31c5953caabf4d30607d806e3d2b717d4b8", + "host": "i686-mingw32", + "archiveFileName": "openocd-0.11.0-arduino2-static-i686-w64-mingw32.zip", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-i686-w64-mingw32.zip" + }, + { + "size": "1893150", + "checksum": "SHA-256:280e7234eba84e830e92d791ebc685286f71d2bc1d3347f93605ef170d54fef4", + "host": "i386-apple-darwin11", + "archiveFileName": "openocd-0.11.0-arduino2-static-x86_64-apple-darwin13.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-x86_64-apple-darwin13.tar.bz2" + }, + { + "size": "2052080", + "checksum": "SHA-256:4d19b6e3906de1434ec86841e0e3138235714c655d45f037c0fabfa5e5c0681b", + "host": "x86_64-linux-gnu", + "archiveFileName": "openocd-0.11.0-arduino2-static-x86_64-ubuntu12.04-linux-gnu.tar.bz2", + "url": "http://downloads.arduino.cc/tools/openocd-0.11.0-arduino2-static-x86_64-ubuntu12.04-linux-gnu.tar.bz2" + } + ] + }, + { + "name": "dfu-util", + "version": "0.10.0-arduino1", + "systems": [ + { + "host": "i386-apple-darwin11", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-osx.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-osx.tar.bz2", + "size": "73921", + "checksum": "SHA-256:7562d128036759605828d64b8d672d42445a8d95555c4b9ba339f73a1711a640" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-arm.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-arm.tar.bz2", + "size": "272153", + "checksum": "SHA-256:f1e550f40c235356b7fde1c59447bfbab28f768915d3c14bd858fe0576bfc5a9" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-arm64.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-arm64.tar.bz2", + "size": "277886", + "checksum": "SHA-256:ebfbd21d3030c500da1f83b9aae5b8c597bee04c3bde1ce0a51b41abeafc9614" + }, + { + "host": "x86_64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-linux64.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-linux64.tar.bz2", + "size": "77184", + "checksum": "SHA-256:13ef2ec591c1e8b0b7eb0a05da972ecd6695016e7a9607e332c7553899af9b4a" + }, + { + "host": "i686-linux-gnu", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-linux32.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-linux32.tar.bz2", + "size": "81826", + "checksum": "SHA-256:43599ec60c000e9ef016970a496d6ab2cbbe5a8b7df9d06ef3114ecf83f9d123" + }, + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/tools/dfu-util-0.10.0-arduino1-windows.tar.bz2", + "archiveFileName": "dfu-util-0.10.0-arduino1-windows.tar.bz2", + "size": "464314", + "checksum": "SHA-256:90816b669273ae796d734a2459c46bb340d4790783fd7aa01eb40c0443f1a9b1" + } + ] + }, + { + "name": "rp2040tools", + "version": "1.0.6", + "systems": [ + { + "host": "i386-apple-darwin11", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-darwin_amd64.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-darwin_amd64.tar.bz2", + "size": "1717967", + "checksum": "SHA-256:4e32aa4b8f36db40a17bfbdfd34d80da91710e30c3887732bf0c0bf0b02840a7" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-linux_arm.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-linux_arm.tar.bz2", + "size": "8702508", + "checksum": "SHA-256:084a29accf0014bc79723fbb40057b95299c7ae63876f74494a077c987014cc3" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-linux_arm64.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-linux_arm64.tar.bz2", + "size": "9037783", + "checksum": "SHA-256:1a2a6cb1abf1f7b8198d494c8d8e838700297d748877be8232e02aaa5ca8d0df" + }, + { + "host": "x86_64-linux-gnu", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-linux_amd64.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-linux_amd64.tar.bz2", + "size": "6108121", + "checksum": "SHA-256:6e2ea818db1ff57f2d8e1e3010fbc5bdb5f28ff44f5a68900cae41d7d709f738" + }, + { + "host": "i686-linux-gnu", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-linux_386.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-linux_386.tar.bz2", + "size": "6604083", + "checksum": "SHA-256:ef339e2e0f5c7d5464b9911b612c634767daba39a6be977a1ffa41c95b9827a1" + }, + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/tools/rp2040tools-1.0.6-windows_386.tar.bz2", + "archiveFileName": "rp2040tools-1.0.6-windows_386.tar.bz2", + "size": "3145329", + "checksum": "SHA-256:26a5daebba68c2348dade33716a6e379ded89895ef0e49df1332964a724f6170" + } + ] + }, + { + "name": "esptool_py", + "version": "4.5.1", + "systems": [ + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-src.tar.gz", + "archiveFileName": "esptool-v4.5.1-src.tar.gz", + "checksum": "SHA-256:aa06831a7d88d8ccde4ea21241e983a08dbdae967290e181658b0d18bffc8f86", + "size": "96922" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-macos.tar.gz", + "archiveFileName": "esptool-v4.5.1-macos.tar.gz", + "checksum": "SHA-256:78b52acfd51541ceb97cee893b7d4d49b8ddc284602be8c73ea47e3d849e0956", + "size": "5850888" + }, + { + "host": "x86_64-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.7/esptool-v4.5.1-win64.zip", + "archiveFileName": "esptool-v4.5.1-win64.zip", + "checksum": "SHA-256:64d0c24499d46b80d6bd7a05c98bdacc3455ab6d503cc2a99e35711310216045", + "size": "6638448" + } + ] + }, + { + "name": "arduino-fwuploader", + "version": "2.2.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.0_Windows_32bit.zip", + "archiveFileName": "arduino-fwuploader_2.2.0_Windows_32bit.zip", + "checksum": "SHA-256:c0ff772702460fb5cbd8593f8ce731145d21fbf550342da556e45ef946c7d2f5", + "size": "7442444" + }, + { + "host": "i386-apple-darwin11", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.0_macOS_64bit.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.0_macOS_64bit.tar.gz", + "checksum": "SHA-256:ce4444e92ba88c6b24736adb4b0b2b6c4241e4fb916945acbc7de6391d5bfe8c", + "size": "7301372" + } + ] + }, + { + "name": "arduino-fwuploader", + "version": "2.2.2", + "systems": [ + { + "host": "i686-linux-gnu", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Linux_32bit.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_Linux_32bit.tar.gz", + "checksum": "SHA-256:503b9f8b24c6e396d09eb64f0e1f625c6f9aa5a90b01a50d7dec6477f4a866f0", + "size": "7262873" + }, + { + "host": "x86_64-linux-gnu", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Linux_64bit.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_Linux_64bit.tar.gz", + "checksum": "SHA-256:8d77d0b33c8b0787fe3b80191709b69d638ef2a447d9853536cda35bfafd274b", + "size": "7306763" + }, + { + "host": "i686-mingw32", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Windows_32bit.zip", + "archiveFileName": "arduino-fwuploader_2.2.2_Windows_32bit.zip", + "checksum": "SHA-256:74ad9a5d369204b51be288c98d74f949ceb7a0c227ee64eb65ae179ec884c84c", + "size": "7450717" + }, + { + "host": "x86_64-mingw32", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Windows_64bit.zip", + "archiveFileName": "arduino-fwuploader_2.2.2_Windows_64bit.zip", + "checksum": "SHA-256:b25ac549cb0645166613c96cf899aebc541e482fe196aada6408bd7cff2c7d02", + "size": "7390999" + }, + { + "host": "x86_64-apple-darwin", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_macOS_64bit.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_macOS_64bit.tar.gz", + "checksum": "SHA-256:2cd6168ff470457b5124ba0faf118f315be2d1b9fb4fef43eb74370cd83620a2", + "size": "7306576" + }, + { + "host": "arm64-apple-darwin", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_macOS_ARM64.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_macOS_ARM64.tar.gz", + "checksum": "SHA-256:10ae5614af4d82096b6ba0e1e07aab667fa140d2bf1d5e3407dd8ad4c6748195", + "size": "6878214" + }, + { + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Linux_ARMv6.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_Linux_ARMv6.tar.gz", + "checksum": "SHA-256:5aadf6e50ffe620635faf941fdf82c0765c8cba4830951bb53267ad125fc5af8", + "size": "6940393" + }, + { + "host": "aarch64-linux-gnu", + "url": "http://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.2_Linux_ARM64.tar.gz", + "archiveFileName": "arduino-fwuploader_2.2.2_Linux_ARM64.tar.gz", + "checksum": "SHA-256:6d11a4f4aa5a81de865f3d18ca395a2780fdbb1e1597a2b11b2b5329e09f30fd", + "size": "6829396" + } + ] + } + ] + } + ] +} diff --git a/v2/pkgs/tools.go b/v2/pkgs/tools.go new file mode 100644 index 000000000..7f34e3d08 --- /dev/null +++ b/v2/pkgs/tools.go @@ -0,0 +1,392 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package pkgs + +import ( + "bytes" + "context" + "crypto/rsa" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "os" + "path/filepath" + "runtime" + "strings" + "sync" + + "github.com/arduino/arduino-create-agent/gen/tools" + "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/utilities" + "github.com/blang/semver" + "github.com/codeclysm/extract/v4" +) + +// public vars to allow override in the tests +var ( + OS = runtime.GOOS + Arch = runtime.GOARCH +) + +// Tools is a client that implements github.com/arduino/arduino-create-agent/gen/tools.Service interface. +// It saves tools in a specified folder with this structure: packager/name/version +// For example: +// +// folder +// └── arduino +// └── bossac +// ├── 1.6.1-arduino +// │   └── bossac +// └── 1.7.0 +// └── bossac +// +// It requires an Index Resource to search for tools +type Tools struct { + index *index.Resource + folder string + behaviour string + installed map[string]string + mutex sync.RWMutex + verifySignaturePubKey *rsa.PublicKey // public key used to verify the signature of a command sent to the boards +} + +// New will return a Tool object, allowing the caller to execute operations on it. +// The New function will accept an index as parameter (used to download the indexes) +// and a folder used to download the indexes +func New(index *index.Resource, folder, behaviour string, verifySignaturePubKey *rsa.PublicKey) *Tools { + t := &Tools{ + index: index, + folder: folder, + behaviour: behaviour, + installed: map[string]string{}, + mutex: sync.RWMutex{}, + verifySignaturePubKey: verifySignaturePubKey, + } + t.readInstalled() + return t +} + +// Installedhead is here only because it was required by the front-end. +// Probably when we bumped GOA something changed: +// Before that the frontend was able to perform the HEAD request to `v2/pkgs/tools/installed`. +// After the bump we have to implement it explicitly. Currently I do not know a better way in achieving the same result. +func (t *Tools) Installedhead(ctx context.Context) (err error) { + return nil +} + +// Available crawles the downloaded package index files and returns a list of tools that can be installed. +func (t *Tools) Available(ctx context.Context) (res tools.ToolCollection, err error) { + body, err := t.index.Read() + if err != nil { + return nil, err + } + + var index Index + json.Unmarshal(body, &index) + + for _, packager := range index.Packages { + for _, tool := range packager.Tools { + res = append(res, &tools.Tool{ + Packager: packager.Name, + Name: tool.Name, + Version: tool.Version, + }) + } + } + + return res, nil +} + +// Installed crawles the Tools Folder and finds the installed tools. +func (t *Tools) Installed(ctx context.Context) (tools.ToolCollection, error) { + res := tools.ToolCollection{} + + // Find packagers + packagers, err := os.ReadDir(t.folder) + if err != nil { + if !strings.Contains(err.Error(), "no such file") { + return nil, err + } + err = os.MkdirAll(t.folder, 0755) + if err != nil { + return nil, err + } + } + + for _, packager := range packagers { + if !packager.IsDir() { + continue + } + + // Find tools + toolss, err := os.ReadDir(filepath.Join(t.folder, packager.Name())) + if err != nil { + return nil, err + } + + for _, tool := range toolss { + // Find versions + path := filepath.Join(t.folder, packager.Name(), tool.Name()) + versions, err := os.ReadDir(path) + if err != nil { + continue // we ignore errors because the folders could be dirty + } + + for _, version := range versions { + res = append(res, &tools.Tool{ + Packager: packager.Name(), + Name: tool.Name(), + Version: version.Name(), + }) + } + } + } + + return res, nil +} + +// Install crawles the Index folder, downloads the specified tool, extracts the archive in the Tools Folder. +// It checks for the Signature specified in the package index. +func (t *Tools) Install(ctx context.Context, payload *tools.ToolPayload) (*tools.Operation, error) { + path := filepath.Join(payload.Packager, payload.Name, payload.Version) + + //if URL is defined and is signed we verify the signature and override the name, payload, version parameters + if payload.URL != nil && payload.Signature != nil && payload.Checksum != nil { + err := utilities.VerifyInput(*payload.URL, *payload.Signature, t.verifySignaturePubKey) + if err != nil { + return nil, err + } + return t.install(ctx, path, *payload.URL, *payload.Checksum) + } + + // otherwise we install from the default index + body, err := t.index.Read() + if err != nil { + return nil, err + } + + var index Index + json.Unmarshal(body, &index) + + correctTool, correctSystem, found := FindTool(payload.Packager, payload.Name, payload.Version, index) + path = filepath.Join(payload.Packager, correctTool.Name, correctTool.Version) + + key := correctTool.Name + "-" + correctTool.Version + // Check if it already exists + if t.behaviour == "keep" && pathExists(t.folder) { + location, ok := t.getInstalledValue(key) + if ok && pathExists(location) { + // overwrite the default tool with this one + err := t.writeInstalled(path) + if err != nil { + return nil, err + } + return &tools.Operation{Status: "ok"}, nil + } + } + if found { + return t.install(ctx, path, correctSystem.URL, correctSystem.Checksum) + } + + return nil, tools.MakeNotFound( + fmt.Errorf("tool not found with packager '%s', name '%s', version '%s'", + payload.Packager, payload.Name, payload.Version)) +} + +func (t *Tools) install(ctx context.Context, path, url, checksum string) (*tools.Operation, error) { + // Download the archive + res, err := http.Get(url) + if err != nil { + return nil, err + } + defer res.Body.Close() + + var buffer bytes.Buffer + + // We copy the body of the response to a buffer to calculate the checksum + _, err = io.Copy(&buffer, res.Body) + if err != nil { + return nil, err + } + + // Check the checksum + sum := sha256.Sum256(buffer.Bytes()) + sumString := "SHA-256:" + hex.EncodeToString(sum[:sha256.Size]) + + if sumString != checksum { + return nil, errors.New("checksum of downloaded file doesn't match, expected: " + checksum + " got: " + sumString) + } + + safePath, err := utilities.SafeJoin(t.folder, path) + if err != nil { + return nil, err + } + + // Cleanup + err = os.RemoveAll(safePath) + if err != nil { + return nil, err + } + + err = extract.Archive(ctx, &buffer, t.folder, rename(path)) + if err != nil { + os.RemoveAll(safePath) + return nil, err + } + + // Write installed.json for retrocompatibility with v1 + err = t.writeInstalled(path) + if err != nil { + return nil, err + } + + return &tools.Operation{Status: "ok"}, nil +} + +// Remove deletes the tool folder from Tools Folder +func (t *Tools) Remove(ctx context.Context, payload *tools.ToolPayload) (*tools.Operation, error) { + path := filepath.Join(payload.Packager, payload.Name, payload.Version) + pathToRemove, err := utilities.SafeJoin(t.folder, path) + if err != nil { + return nil, err + } + + err = os.RemoveAll(pathToRemove) + if err != nil { + return nil, err + } + + return &tools.Operation{Status: "ok"}, nil +} + +// rename function is used to rename the path of the extracted files +func rename(base string) extract.Renamer { + // "Rename" the given path adding the "base" and removing the root folder in "path" (if present). + return func(path string) string { + parts := strings.Split(filepath.ToSlash(path), "/") + if len(parts) <= 1 { + // The path does not contain a root folder. This might happen for tool packages (zip files) + // that have an invalid structure. Do not try to remove the root folder in these cases. + return filepath.Join(base, path) + } + // Removes the first part of the path (the root folder). + path = strings.Join(parts[1:], "/") + return filepath.Join(base, path) + } +} + +func (t *Tools) readInstalled() error { + t.mutex.RLock() + defer t.mutex.RUnlock() + // read installed.json + installedFile, err := utilities.SafeJoin(t.folder, "installed.json") + if err != nil { + return err + } + data, err := os.ReadFile(installedFile) + if err != nil { + return err + } + return json.Unmarshal(data, &t.installed) +} + +func (t *Tools) writeInstalled(path string) error { + t.mutex.Lock() + defer t.mutex.Unlock() + + parts := strings.Split(path, string(filepath.Separator)) + tool := parts[len(parts)-2] + toolWithVersion := fmt.Sprint(tool, "-", parts[len(parts)-1]) + toolFile, err := utilities.SafeJoin(t.folder, path) + if err != nil { + return err + } + t.installed[tool] = toolFile + t.installed[toolWithVersion] = toolFile + + data, err := json.Marshal(t.installed) + if err != nil { + return err + } + + installedFile, err := utilities.SafeJoin(t.folder, "installed.json") + if err != nil { + return err + } + + return os.WriteFile(installedFile, data, 0644) +} + +// SetBehaviour sets the download behaviour to either keep or replace +func (t *Tools) SetBehaviour(behaviour string) { + t.behaviour = behaviour +} + +func (t *Tools) getInstalledValue(key string) (string, bool) { + t.mutex.RLock() + defer t.mutex.RUnlock() + location, ok := t.installed[key] + return location, ok +} + +func pathExists(path string) bool { + _, err := os.Stat(path) + if err == nil { + return true + } + if os.IsNotExist(err) { + return false + } + return true +} + +// FindTool searches the index for the correct tool and system that match the specified tool name and version +func FindTool(pack, name, version string, data Index) (Tool, System, bool) { + var correctTool Tool + correctTool.Version = "0.0" + found := false + + for _, p := range data.Packages { + if p.Name != pack { + continue + } + for _, t := range p.Tools { + if version != "latest" { + if t.Name == name && t.Version == version { + correctTool = t + found = true + } + } else { + // Find latest + v1, _ := semver.Make(t.Version) + v2, _ := semver.Make(correctTool.Version) + if t.Name == name && v1.Compare(v2) > 0 { + correctTool = t + found = true + } + } + } + } + + // Find the url based on system + correctSystem := correctTool.GetFlavourCompatibleWith(OS, Arch) + + return correctTool, correctSystem, found +} diff --git a/v2/pkgs/tools_test.go b/v2/pkgs/tools_test.go new file mode 100644 index 000000000..7bf0ff0e3 --- /dev/null +++ b/v2/pkgs/tools_test.go @@ -0,0 +1,278 @@ +// Copyright 2022 Arduino SA +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package pkgs_test + +import ( + "context" + "os" + "runtime" + "strings" + "testing" + "time" + + "github.com/arduino/arduino-create-agent/config" + "github.com/arduino/arduino-create-agent/gen/tools" + "github.com/arduino/arduino-create-agent/globals" + "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/utilities" + "github.com/arduino/arduino-create-agent/v2/pkgs" + "github.com/arduino/go-paths-helper" + "github.com/stretchr/testify/require" +) + +// TestTools performs a series of operations about tools, ensuring it behaves as expected. +// This test depends on the internet so it could fail unexpectedly +func TestTools(t *testing.T) { + // Initialize indexes with a temp folder + tmp, err := os.MkdirTemp("", "") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmp) + + indexURL := "https://downloads.arduino.cc/packages/package_index.json" + // Instantiate Index + Index := index.Init(indexURL, config.GetDataDir()) + + service := pkgs.New(Index, tmp, "replace", utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) + + ctx := context.Background() + + // List available tools + available, err := service.Available(ctx) + if err != nil { + t.Fatal(err) + } + require.NotEmpty(t, available) + + // Try to install a non-existent tool + _, err = service.Install(ctx, &tools.ToolPayload{}) + if err == nil || !strings.Contains(err.Error(), "tool not found with packager '', name '', version ''") { + t.Fatalf("expected '%v' == '%v' (%s)", err, "tool not found with packager '', name '', version ''", "err") + } + + // Install a tool + installed, err := service.Installed(ctx) + if err != nil { + t.Fatal(err) + } + if len(installed) != 0 { + t.Fatalf("expected %d == %d (%s)", len(installed), 0, "len(installed)") + } + + _, err = service.Install(ctx, &tools.ToolPayload{ + Packager: "arduino", + Name: "avrdude", + Version: "6.0.1-arduino2", + }) + if err != nil { + t.Fatal(err) + } + // List installed tools + installed, err = service.Installed(ctx) + if err != nil { + t.Fatal(err) + } + if len(installed) != 1 { + t.Fatalf("expected %d == %d (%s)", len(installed), 1, "len(installed)") + } + + // Install the tool again + _, err = service.Install(ctx, &tools.ToolPayload{ + Packager: "arduino", + Name: "avrdude", + Version: "6.0.1-arduino2", + }) + if err != nil { + t.Fatal(err) + } + + // Remove tool + _, err = service.Remove(ctx, &tools.ToolPayload{ + Packager: "arduino", + Name: "avrdude", + Version: "6.0.1-arduino2", + }) + if err != nil { + t.Fatal(err) + } + + installed, err = service.Installed(ctx) + if err != nil { + t.Fatal(err) + } + if len(installed) != 0 { + t.Fatalf("expected %d == %d (%s)", len(installed), 0, "len(installed)") + } +} + +func TestEvilFilename(t *testing.T) { + + // Initialize indexes with a temp folder + tmp := t.TempDir() + + indexURL := "https://downloads.arduino.cc/packages/package_index.json" + // Instantiate Index + Index := index.Init(indexURL, config.GetDataDir()) + + service := pkgs.New(Index, tmp, "replace", utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) + + ctx := context.Background() + + type test struct { + fileName string + errBody string + } + + evilFileNames := []string{ + "/", + "..", + "../", + "../evil.txt", + "../../../../../../../../../../../../../../../../../../../../tmp/evil.txt", + "some/path/../../../../../../../../../../../../../../../../../../../../tmp/evil.txt", + } + if runtime.GOOS == "windows" { + evilFileNames = []string{ + "..\\", + "..\\evil.txt", + "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\tmp\\evil.txt", + "some\\path\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\tmp\\evil.txt", + } + } + tests := []test{} + for _, evilFileName := range evilFileNames { + tests = append(tests, test{fileName: evilFileName, + errBody: "unsafe path join"}) + } + + toolsTemplate := tools.ToolPayload{ + // We'll replace the name directly in the test + Checksum: strpoint("SHA-256:1ae54999c1f97234a5c603eb99ad39313b11746a4ca517269a9285afa05f9100"), + Signature: strpoint("382898a97b5a86edd74208f10107d2fecbf7059ffe9cc856e045266fb4db4e98802728a0859cfdcda1c0b9075ec01e42dbea1f430b813530d5a6ae1766dfbba64c3e689b59758062dc2ab2e32b2a3491dc2b9a80b9cda4ae514fbe0ec5af210111b6896976053ab76bac55bcecfcececa68adfa3299e3cde6b7f117b3552a7d80ca419374bb497e3c3f12b640cf5b20875416b45e662fc6150b99b178f8e41d6982b4c0a255925ea39773683f9aa9201dc5768b6fc857c87ff602b6a93452a541b8ec10ca07f166e61a9e9d91f0a6090bd2038ed4427af6251039fb9fe8eb62ec30d7b0f3df38bc9de7204dec478fb86f8eb3f71543710790ee169dce039d3e0"), + URL: strpoint("http://downloads.arduino.cc/tools/bossac-1.7.0-arduino3-linux64.tar.gz"), + } + + for _, test := range tests { + t.Run("REMOVE payload containing evil names: "+test.fileName, func(t *testing.T) { + // Here we could inject malicious name also in the Packager and Version field. + // Since the path is made by joining all of these 3 fields, we're using only the Name, + // as it won't change the result and let us keep the test small and readable. + _, err := service.Remove(ctx, &tools.ToolPayload{Name: test.fileName}) + require.Error(t, err, test) + require.ErrorContains(t, err, test.errBody) + }) + } + for _, test := range tests { + toolsTemplate.Name = test.fileName + t.Run("INSTALL payload containing evil names: "+toolsTemplate.Name, func(t *testing.T) { + // Here we could inject malicious name also in the Packager and Version field. + // Since the path is made by joining all of these 3 fields, we're using only the Name, + // as it won't change the result and let us keep the test small and readable. + _, err := service.Install(ctx, &toolsTemplate) + require.Error(t, err, test) + require.ErrorContains(t, err, test.errBody) + }) + } +} + +func TestInstalledHead(t *testing.T) { + // Initialize indexes with a temp folder + tmp := t.TempDir() + + indexURL := "https://downloads.arduino.cc/packages/package_index.json" + // Instantiate Index + Index := index.Init(indexURL, config.GetDataDir()) + + service := pkgs.New(Index, tmp, "replace", utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) + + ctx := context.Background() + + err := service.Installedhead(ctx) + require.NoError(t, err) +} + +func strpoint(s string) *string { + return &s +} + +func TestInstall(t *testing.T) { + // Initialize indexes with a temp folder + tmp := t.TempDir() + + testIndex := &index.Resource{ + IndexFile: *paths.New("testdata", "test_tool_index.json"), + LastRefresh: time.Now(), + } + + tool := pkgs.New(testIndex, tmp, "replace", utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) + + ctx := context.Background() + + testCases := []tools.ToolPayload{ + // https://github.com/arduino/arduino-create-agent/issues/920 + {Name: "avrdude", Version: "6.3.0-arduino17", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + {Name: "bossac", Version: "1.6.1-arduino", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + {Name: "bossac", Version: "1.7.0-arduino3", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + {Name: "bossac", Version: "1.9.1-arduino2", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + {Name: "openocd", Version: "0.11.0-arduino2", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + {Name: "dfu-util", Version: "0.10.0-arduino1", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + {Name: "rp2040tools", Version: "1.0.6", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + {Name: "esptool_py", Version: "4.5.1", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + {Name: "arduino-fwuploader", Version: "2.2.2", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + // test download of a tool not present in index. the same archive is downloaded on linux/win/mac See https://github.com/arduino/arduino-create-agent/issues/980 + {Name: "esptool", Version: "2.5.0-3-20ed2b9", Packager: "esp8266", URL: strpoint("https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-linux-gnu.esptool-f80ae31.tar.gz"), Checksum: strpoint("SHA-256:bded1dca953377838b6086a9bcd40a1dc5286ba5f69f2372c22a1d1819baad24"), Signature: strpoint("852b58871419ce5e5633ecfaa72c0f0fa890ceb51164b362b8133bc0e3e003a21cec48935b8cdc078f4031219cbf17fb7edd9d7c9ca8ed85492911c9ca6353c9aa4691eb91fda99563a6bd49aeca0d9981fb05ec76e45c6024f8a6822862ad1e34ddc652fbbf4fa909887a255d4f087398ec386577efcec523c21203be3d10fc9e9b0f990a7536875a77dc2bc5cbffea7734b62238e31719111b718bacccebffc9be689545540e81d23b81caa66214376f58a0d6a45cf7efc5d3af62ab932b371628162fffe403906f41d5534921e5be081c5ac2ecc9db5caec03a105cc44b00ce19a95ad079843501eb8182e0717ce327867380c0e39d2b48698547fc1d0d66")}, + } + + expectedFiles := map[string][]string{ + "avrdude-6.3.0-arduino17": {"bin", "etc"}, + "bossac-1.6.1-arduino": {"bossac"}, + "bossac-1.7.0-arduino3": {"bossac"}, + "bossac-1.9.1-arduino2": {"bossac"}, + "openocd-0.11.0-arduino2": {"bin", "share"}, + "dfu-util-0.10.0-arduino1": {"dfu-prefix", "dfu-suffix", "dfu-util"}, + "rp2040tools-1.0.6": {"elf2uf2", "picotool", "pioasm", "rp2040load"}, + "esptool_py-4.5.1": {"esptool"}, + "arduino-fwuploader-2.2.2": {"arduino-fwuploader"}, + // "esptool-2.5.0-3-20ed2b9": {"esptool"}, // we don't check if there is esptool in the archive because it's the same archive even on windows (no extension) + } + for _, tc := range testCases { + t.Run(tc.Name+"-"+tc.Version, func(t *testing.T) { + // Install the Tool + _, err := tool.Install(ctx, &tc) + require.NoError(t, err) + + // Check that the tool has been downloaded + toolDir := paths.New(tmp).Join(tc.Packager, tc.Name, tc.Version) + require.DirExists(t, toolDir.String()) + + // Check that the files have been created + for _, file := range expectedFiles[tc.Name+"-"+tc.Version] { + filePath := toolDir.Join(file) + if filePath.IsDir() { + require.DirExists(t, filePath.String()) + } else { + if runtime.GOOS == "windows" { + require.FileExists(t, filePath.String()+".exe") + } else { + require.FileExists(t, filePath.String()) + } + } + } + }) + } + +}