diff --git a/.env.development.local.example b/.env.development.local.example index 75e02c500..a818e9f67 100644 --- a/.env.development.local.example +++ b/.env.development.local.example @@ -7,8 +7,8 @@ VUE_APP_PORT=7125 # reconnect interval in ms VUE_APP_RECONNECT_INTERVAL=5000 -# remote mode -VUE_APP_REMOTE_MODE=false +# where should mainsail read the instances from (moonraker, browser or json) +VUE_APP_INSTANCES_DB="moonraker" # defaults for multi language tests VUE_APP_I18N_LOCALE=en diff --git a/.github/DEVELOPER_CERTIFICATE_OF_ORIGIN.md b/.github/DEVELOPER_CERTIFICATE_OF_ORIGIN.md new file mode 100644 index 000000000..7f32c076e --- /dev/null +++ b/.github/DEVELOPER_CERTIFICATE_OF_ORIGIN.md @@ -0,0 +1,36 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +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: + +(a) The contribution was created in whole or in part by me and I +have the right to submit it under the open source license +indicated in the file; or + +(b) The contribution is based upon previous work that, to the best +of my knowledge, is covered under an appropriate open source +license and I have the right under that license to submit that +work with modifications, whether created in whole or in part +by me, under the same open source license (unless I am +permitted to submit under a different license), as indicated +in the file; or + +(c) The contribution was provided directly to me by some other +person who certified (a), (b) or (c) and I have not modified +it. + +(d) I understand and agree that this project and the contribution +are public and that a record of the contribution (including all +personal information I submit with it, including my sign-off) is +maintained indefinitely and may be redistributed consistent with +this project or the open source license(s) involved. diff --git a/.github/label-actions.yml b/.github/label-actions.yml new file mode 100644 index 000000000..20f85fd45 --- /dev/null +++ b/.github/label-actions.yml @@ -0,0 +1,23 @@ +# Configuration for Label Actions - https://github.com/dessant/label-actions + +not on Github: + issues: + comment: | + Ahoi! + + It looks like this ticket is a request for help (or similar). + Many helpful people will not see your message here and you are + unlikely to get a useful response. + + We use github to handle bugreports, feature requests and + planning new releases. + + Please use our Discord-Server for help: [discord.gg/mainsail](https://discord.gg/mainsail) + + This ticket will be automatically closed. + + Fair wind and a following sea! + ~ Your friendly MainsailGithubBot + + *PS: I'm just an automated script, not a real sailor.* + close: true diff --git a/.github/workflows/auto-analyze.yml b/.github/workflows/auto-analyze.yml new file mode 100644 index 000000000..a4dd0ef10 --- /dev/null +++ b/.github/workflows/auto-analyze.yml @@ -0,0 +1,38 @@ +name: 'Auto analyze if package.json was edited' + +on: + pull_request: + branches: + - develop + +permissions: + pull-requests: write + +jobs: + auto-analyze: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Check package.json was changed + id: changed-file-package-json + uses: tj-actions/changed-files@v23 + with: + sha: ${{ github.event.pull_request.head.sha }} + + - name: Install node + uses: actions/setup-node@v3 + if: contains(steps.changed-file-package-json.outputs.modified_files, 'package.json') + with: + node-version: '16' + cache: 'npm' + + - uses: preactjs/compressed-size-action@v2 + if: contains(steps.changed-file-package-json.outputs.modified_files, 'package.json') + with: + strip-hash: "\\b\\w{8}\\." + pattern: './dist/**/*.{js,css,html,json,woff2,svg,png}' + exclude: '{./dist/manifest.json,./dist/build.zip,**/*.map,**/node_modules/**}' diff --git a/.github/workflows/issues-no-response.yml b/.github/workflows/issues-no-response.yml deleted file mode 100644 index 92b7559ca..000000000 --- a/.github/workflows/issues-no-response.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: No Response - -# Both `issue_comment` and `scheduled` event types are required for this Action -# to work properly. -on: - issue_comment: - types: [created] - schedule: - - cron: '5 * * * *' - -jobs: - noResponse: - runs-on: ubuntu-latest - steps: - - uses: lee-dohm/no-response@v0.5.0 - with: - token: ${{ github.token }} - daysUntilClose: 7 - responseRequiredLabel: ❔ User Input diff --git a/.github/workflows/label-actions.yml b/.github/workflows/label-actions.yml new file mode 100644 index 000000000..afdcd5acc --- /dev/null +++ b/.github/workflows/label-actions.yml @@ -0,0 +1,19 @@ +name: 'Label Actions' + +on: + issues: + types: [labeled, unlabeled] + pull_request: + types: [labeled, unlabeled] + +permissions: + contents: read + issues: write + pull-requests: write + discussions: write + +jobs: + action: + runs-on: ubuntu-latest + steps: + - uses: dessant/label-actions@v2 diff --git a/.github/workflows/lgtm.yml b/.github/workflows/lgtm.yml new file mode 100644 index 000000000..61c91e5cc --- /dev/null +++ b/.github/workflows/lgtm.yml @@ -0,0 +1,18 @@ +name: Send LGTM reaction +on: + issue_comment: + types: [created] + pull_request_review: + types: [submitted] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@1.0.0 + - uses: micnncim/action-lgtm-reaction@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIPHY_API_KEY: ${{ secrets.GIPHY_API_KEY }} + with: + trigger: '["^(?i)lgtm!*$"]' + source: 'giphy' diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 16f089d52..8e3fce9c5 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -5,6 +5,9 @@ on: branches: ['master', 'develop'] tags: - '*' + pull_request: + branches: + - '*' env: REGISTRY: ghcr.io @@ -37,7 +40,6 @@ jobs: type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }} type=edge,branch=develop type=ref,event=tag - - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -47,7 +49,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v2 with: - platforms: linux/amd64,linux/arm64 - push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..bdff823c8 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,56 @@ +name: 'Close stale issues and PRs' + +# Both `issue_comment` and `scheduled` event types are required for this Action +# to work properly. +on: + issue_comment: + types: [created] + schedule: + - cron: '30 1 * * *' + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v5 + with: + days-before-stale: 14 + days-before-close: 7 + exempt-all-milestones: true + close-issue-reason: not_planned + only-labels: '❔ User Input' + labels-to-remove-when-unstale: '❔ User Input,💤 Stale' + stale-issue-label: '💤 Stale' + stale-pr-label: '💤 Stale' + stale-issue-message: | + Ahoi! + + It looks like there hasn't been any recent updates on + this issue. If you created this issue and no longer + consider it to get merged, then please login to github + and close it. Otherwise, if there is no further activity + on this issue, it will be automatically closedwithin the + next 7 days. + + Fair wind and a following sea! + ~ Your friendly MainsailGithubBot + + *PS: I'm just an automated script, not a real sailor.* + stale-pr-message: | + Ahoi! + + It looks like there hasn't been any recent updates on + this pull request. If you created this pull request and + no longer consider it to get merged, then please login + to github and close it. Otherwise, if there is no further + activity on this pull request, it will be automatically + closed within the next 7 days. + + Fair wind and a following sea! + ~ Your friendly MainsailGithubBot + + *PS: I'm just an automated script, not a real sailor.* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c8e212d15..2619a184c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,43 +1,87 @@ -# Mainsail Contributing Guide +# Contributing to Mainsail -Hi! I'm really excited that you are interested in contributing to Mainsail. Before submitting your contribution, please make sure to take a moment and read through the following guidelines: +If you are reading this document right now, you are probably considering contributing to Mainsail and making it better +than it is today. Thank you for taking that initiative! Before submitting your contribution, please take a moment and +make sure to read through our contribution guidelines: -- [Code of Conduct](https://github.com/meteyou/mainsail/.github/CODE_OF_CONDUCT.md) -- [Issue Reporting Guidelines](#issue-reporting-guidelines) -- [Pull Request Guidelines](#pull-request-guidelines) +- [Code of Conduct](https://github.com/mainsail-crew/mainsail/blob/develop/.github/CODE_OF_CONDUCT.md) +- [Question or Problem?](#question) +- [Issues and Bugs](#issue) +- [Feature Requests](#feature) +- [Submission Guidelines](#submit) + - [Submit an Issue](#submit-issue) + - [Submit a Pull Request](#submit-pr) +- [Financial Contributions](#financial) +- [Credits](https://docs.mainsail.xyz/credits) -## Issue Reporting Guidelines +## Got a Question or Problem? -- Use [https://github.com/meteyou/mainsail/issues](https://github.com/meteyou/mainsail/issues) to create new issues. +Please do not open issues for general support questions. We want to keep GitHub issues for bug reports and feature +requests. Instead, please visit us on [Discord](https://discord.gg/mainsail) to ask support-related questions. -## Pull Request Guidelines +Our Discord server is a much better place to ask general support questions. We take a right to close issues that are +requests for generic support and redirect people to Discord. -- The `master` branch is just a snapshot of the latest stable release. All development should be done in dedicated branches. **Do not submit PRs against the `master` branch.** +## Found a Bug? -- Checkout a topic branch from the relevant branch, e.g. `develop`, and merge back against that branch. +If you find a bug in the source code or think that Mainsail is behaving odd in specific situations, you can help us fix +that issue by [submitting an issue](https://github.com/mainsail-crew/mainsail/issues/new?assignees=&labels=%E2%9A%A1+Type%3A+Bug&template=bug_report.yml). +If you have already fixed that issue, you can [submit a Pull Request](#submit-pr) with that fix. -- It's OK to have multiple small commits as you work on the PR - GitHub will automatically squash it before merging. +## Missing a Feature? -- If adding a new feature: +You can request a new feature by [submitting a feature request](https://github.com/mainsail-crew/mainsail/issues/new?assignees=&labels=%F0%9F%92%A1+Type%3A+FR&template=feature_request.yml). +If you would like to implement a new feature, please consider the scope of the change. For changes requiring a lot of +work, it's best to outline a proposal first so it can be discussed. This allows us to prevent wasted time and effort and +discuss how to bring your proposed feature into the project. - - Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it. +## Submission Guidelines -- If fixing bug: - - If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`. - - Provide a detailed description of the bug in the PR. Live demo preferred. - - Add appropriate test coverage if applicable. +### Submitting an Issue -## Committing Changes +Before you submit an issue, please search the issue tracker if your problem may already exist. If a ticket already +covers your case, please refrain from opening a new ticket and instead contribute to the existing ticket. If you submit +an issue, please provide the required information and reproduction steps. We need those to be able to try and reproduce +the bug ourselves. Without proper instructions on how to reproduce the issue you are encountering, we might be unable to +fix a possible bug. -Commit messages should follow the [commit message convention](https://www.conventionalcommits.org/en/v1.0.0/) so that changelogs can be automatically generated. +### Submitting a Pull Request (PR) -## Financial Contribution +Before you work on a PR and submit it, please pay attention to the following guidelines: -As a pure community-driven project without major corporate backing, we also welcome financial contributions via Patreon and OpenCollective. +1. Search the [pull requests](https://github.com/mainsail-crew/mainsail/pulls) for an open or closed PR related to your submission. + - You don't want to duplicate existing efforts or work on something unlikely to be merged into the project. +2. Do not submit PRs against the `master` branch. PRs need to be submitted against the `develop` branch. +3. Follow our [Code Standards](https://docs.mainsail.xyz/development/code-standards) +4. If there is an issue describing the problem you're fixing or a discussion of a feature you are implementing, make sure to link it in the PRs body. -- [Become a supporter on Patreon](https://patreon.com/meteyou) -- [One-time donation via Ko-Fi](https://ko-fi.com/mainsail) + - You can also add `fix #` or `fixes #` in the PR body where `` is the issue id. + - Example PR title, body and sign-off: -## Credits + ``` + fix: incorrect handling of click event -Thank you to all the people who have already contributed to Mainsail! + This PR will fix #123. + Fixes correct handling of click event when button [X] is clicked. + + Signed-off-by: James Smith + ``` + +5. If there is no issue describing the problem, create an issue first or provide a sufficient description of the bug/feature. + - Screenshots of your changes are welcome if you worked on UI-related code. +6. The title of the PR should follow the [commit message convention](https://www.conventionalcommits.org/en/v1.0.0/). + - If the PR consists of multiple commits, it's good practice to follow the convention, although that is not necessarily required. + - Upon merging, we will squash all commits of the PR into a single commit for a clean history and release changelogs. +7. Please sign off each commit and your PR. It must contain your real name and a current email address (see example in item 4). + - The sign-off should follow this pattern: `Signed-off-by: My Name ` + - The sign-off certifies that you agree with the [developer certificate of origin](https://github.com/mainsail-crew/mainsail/.github/DEVELOPER_CERTIFICATE_OF_ORIGIN.md). + - If you provide a translation, a sign-off is not necessarily required. +8. When opening a pull request, keep `Allow edits and access to secrets by maintainers` **enabled**. + +## Financial Contribution + +As a community-driven project without primary corporate backing, we always welcome financial contributions. A list of +options we offer to support us financially can be seen below. + +- [Become a supporter on Patreon](https://patreon.com/meteyou) (monthly recurring) +- [Donation via Ko-Fi](https://ko-fi.com/mainsail) (one time / monthly recurring) diff --git a/Dockerfile b/Dockerfile index 2d044667b..7ea862212 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # # Builder stage, builds the application in node # -FROM node:16-alpine as builder +FROM --platform=$BUILDPLATFORM node:16-alpine as builder RUN apk add zip diff --git a/index.html b/index.html index 4b6152d42..440cf950e 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ - +