diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 765e758f..eee14064 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,6 +18,11 @@ jobs: run: "yarn install" - name: Build run: "yarn run build" + env: + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} + SENTRY_URL: ${{ secrets.SENTRY_URL }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: Upload Artifact uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/netlify-main.yaml b/.github/workflows/netlify-main.yaml index ad1f3cd5..5ba15a6a 100644 --- a/.github/workflows/netlify-main.yaml +++ b/.github/workflows/netlify-main.yaml @@ -12,7 +12,11 @@ jobs: runs-on: ubuntu-latest permissions: deployments: write - if: github.event.workflow_run.conclusion == 'success' + # Important: the 'branches' filter above will match the 'main' branch on forks, + # so we need to check the head repo too in order to not run on PRs from forks + # We check the branch name again too just for completeness + # (Is there a nicer way to see if a PR is from a fork?) + if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_repository.full_name == 'vector-im/element-call' && github.event.workflow_run.head_branch == 'main' steps: - name: Create Deployment uses: bobheadxi/deployments@v1 diff --git a/.github/workflows/netlify-pr.yaml b/.github/workflows/netlify-pr.yaml index e1ba2efc..f1d4dced 100644 --- a/.github/workflows/netlify-pr.yaml +++ b/.github/workflows/netlify-pr.yaml @@ -46,7 +46,9 @@ jobs: run: curl -s https://raw.githubusercontent.com/vector-im/element-call/main/config/netlify_redirects > webapp/_redirects - name: Add config file - run: curl -s https://raw.githubusercontent.com/vector-im/element-call/${{ github.event.workflow_run.head_branch }}/config/element_io_preview.json > webapp/config.json + env: + HEADBRACH: ${{ github.event.workflow_run.head_branch }} + run: curl -s "https://raw.githubusercontent.com/vector-im/element-call/${HEADBRACH}/config/element_io_preview.json" > webapp/config.json - name: ☁️ Deploy to Netlify id: netlify diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 86557ef3..f49980d2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -13,7 +13,7 @@ jobs: name: Build & publish runs-on: ubuntu-latest permissions: - contents: read + contents: write # required to upload release asset packages: write steps: - name: Check it out @@ -26,6 +26,33 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Yarn cache + uses: actions/setup-node@v3 + with: + cache: "yarn" + - name: Install dependencies + run: "yarn install" + - name: Build + run: "yarn run build" + env: + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} + SENTRY_URL: ${{ secrets.SENTRY_URL }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + VITE_APP_VERSION: ${{ github.event.release.tag_name }} + + - name: Create Tarball + env: + GITHUB_TAG_NAME: ${{ github.event.release.tag_name }} + run: | + tar --numeric-owner --transform "s/dist/element-call-${GITHUB_TAG_NAME}/" -cvzf element-call-${GITHUB_TAG_NAME}.tar.gz dist + - name: Upload + uses: alexellis/upload-assets@0.4.0 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + asset_paths: '["element-call-${{ github.event.release.tag_name }}.tar.gz"]' + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 diff --git a/Dockerfile b/Dockerfile index 3d7363af..05354e3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,7 @@ -FROM --platform=$BUILDPLATFORM node:16-buster as builder - -WORKDIR /src - -COPY . /src -RUN scripts/dockerbuild.sh - -# App FROM nginxinc/nginx-unprivileged:alpine -COPY --from=builder /src/dist /app -COPY config/nginx.conf /etc/nginx/conf.d/ +COPY ./dist /app +COPY config/nginx.conf /etc/nginx/conf.d/default.conf USER root diff --git a/config/element_io_develop.json b/config/element_io_develop.json index caeddc63..3e7b409c 100644 --- a/config/element_io_develop.json +++ b/config/element_io_develop.json @@ -6,8 +6,8 @@ } }, "posthog": { - "api_key": "phc_MhClVy9DiV20vazSYIiedFkM5Xi3z1LPBwrdn9PYZQQ", - "api_host": "https://app.posthog.com" + "api_key": "phc_rXGHx9vDmyEvyRxPziYtdVIv0ahEv8A9uLWFcCi1WcU", + "api_host": "https://posthog-element-call.element.io" }, "sentry": { "environment": "main-branch-cd", diff --git a/config/element_io_preview.json b/config/element_io_preview.json index c65f252a..39213046 100644 --- a/config/element_io_preview.json +++ b/config/element_io_preview.json @@ -8,5 +8,8 @@ "temp_sfu": { "user_id": "@sfu:call.ems.host", "device_id": "YNZDLSEQMP" + }, + "rageshake": { + "submit_url": "https://element.io/bugreports/submit" } } diff --git a/package.json b/package.json index a7ded872..024b8349 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ }, "devDependencies": { "@babel/core": "^7.16.5", + "@sentry/vite-plugin": "^0.3.0", "@storybook/react": "^6.5.0-alpha.5", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", diff --git a/public/locales/en-GB/app.json b/public/locales/en-GB/app.json index 938e4ff7..b2bfc56d 100644 --- a/public/locales/en-GB/app.json +++ b/public/locales/en-GB/app.json @@ -11,7 +11,8 @@ "<0>Already have an account?<1><0>Log in Or <2>Access as a guest": "<0>Already have an account?<1><0>Log in Or <2>Access as a guest", "<0>Create an account Or <2>Access as a guest": "<0>Create an account Or <2>Access as a guest", "<0>Join call now<1>Or<2>Copy call link and join later": "<0>Join call now<1>Or<2>Copy call link and join later", - "<0>Oops, something's gone wrong.<1>Submitting debug logs will help us track down the problem.": "<0>Oops, something's gone wrong.<1>Submitting debug logs will help us track down the problem.", + "<0>Oops, something's gone wrong.": "<0>Oops, something's gone wrong.", + "<0>Submitting debug logs will help us track down the problem.": "<0>Submitting debug logs will help us track down the problem.", "<0>Why not finish by setting up a password to keep your account?<1>You'll be able to keep your name and set an avatar for use on future calls": "<0>Why not finish by setting up a password to keep your account?<1>You'll be able to keep your name and set an avatar for use on future calls", "Accept camera/microphone permissions to join the call.": "Accept camera/microphone permissions to join the call.", "Accept microphone permissions to join the call.": "Accept microphone permissions to join the call.", diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index 97c5effa..22041abe 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -1,5 +1,5 @@ /* -Copyright 2022 Matrix.org Foundation C.I.C. +Copyright 2022 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,6 +17,12 @@ limitations under the License. import "matrix-js-sdk/src/@types/global"; declare global { + interface Document { + // Safari only supports this prefixed, so tell the type system about it + webkitExitFullscreen: () => void; + webkitFullscreenElement: HTMLElement | null; + } + interface Window { // TODO: https://gitlab.matrix.org/matrix-org/olm/-/issues/10 OLM_OPTIONS: Record; @@ -27,4 +33,9 @@ declare global { interface MediaElement extends HTMLVideoElement { setSinkId: (id: string) => void; } + + interface HTMLElement { + // Safari only supports this prefixed, so tell the type system about it + webkitRequestFullscreen: () => void; + } } diff --git a/src/@types/modules.d.ts b/src/@types/modules.d.ts index b1f45c78..071d0369 100644 --- a/src/@types/modules.d.ts +++ b/src/@types/modules.d.ts @@ -1,2 +1,18 @@ +/* +Copyright 2022 New Vector 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/src/Avatar.module.css b/src/Avatar.module.css index 70ccd9b1..46fc214e 100644 --- a/src/Avatar.module.css +++ b/src/Avatar.module.css @@ -1,3 +1,19 @@ +/* +Copyright 2022 New Vector 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. +*/ + .avatar { position: relative; color: var(--primary-content); diff --git a/src/Avatar.tsx b/src/Avatar.tsx index a4aa826d..a6d151f6 100644 --- a/src/Avatar.tsx +++ b/src/Avatar.tsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 New Vector 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. +*/ + import React, { useMemo, CSSProperties } from "react"; import classNames from "classnames"; import { MatrixClient } from "matrix-js-sdk/src/client"; diff --git a/src/Facepile.module.css b/src/Facepile.module.css index c716988e..3b9befe1 100644 --- a/src/Facepile.module.css +++ b/src/Facepile.module.css @@ -1,3 +1,19 @@ +/* +Copyright 2022 New Vector 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. +*/ + .facepile { width: 100%; position: relative; diff --git a/src/FullScreenView.module.css b/src/FullScreenView.module.css index 9d8fc665..18774c37 100644 --- a/src/FullScreenView.module.css +++ b/src/FullScreenView.module.css @@ -1,3 +1,19 @@ +/* +Copyright 2022 New Vector 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. +*/ + .page { position: relative; display: flex; diff --git a/src/FullScreenView.tsx b/src/FullScreenView.tsx index 4d4739c4..774e55a9 100644 --- a/src/FullScreenView.tsx +++ b/src/FullScreenView.tsx @@ -1,3 +1,19 @@ +/* +Copyright 2022 New Vector 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. +*/ + import React, { ReactNode, useCallback, useEffect } from "react"; import { useLocation } from "react-router-dom"; import classNames from "classnames"; @@ -9,6 +25,7 @@ import { useSubmitRageshake } from "./settings/submit-rageshake"; import { ErrorMessage } from "./input/Input"; import styles from "./FullScreenView.module.css"; import { translatedError, TranslatedError } from "./TranslatedError"; +import { Config } from "./config/Config"; interface FullScreenViewProps { className?: string; @@ -98,7 +115,7 @@ export function CrashView() { logsComponent =
{t("Thanks! We'll get right on it.")}
; } else if (sending) { logsComponent =
{t("Sending…")}
; - } else { + } else if (Config.get().rageshake?.submit_url) { logsComponent = (