Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ Empty means it is safe to fast-forward and something else is wrong (branch
protection, most likely). Not empty means there is work on `release` to merge
back into `main` first.

Amplify builds the branch. Its build settings live in the Amplify console, not
in this repo, so there is no `amplify.yml` here to change.
Amplify builds the branch from `amplify.yml` in this repo. A branch that
contains it ignores the build settings in the Amplify console.

## Windows installer payloads

Expand Down
18 changes: 18 additions & 0 deletions amplify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 1
frontend:
phases:
preBuild:
commands:
- npm config set "@fortawesome:registry" https://npm.fontawesome.com/
- npm config set "//npm.fontawesome.com/:_authToken" $FONT_AWESOME_AUTH_TOKEN
- npm install
build:
commands:
- if [ "$AMPLIFY_PREVIEW" = true ]; then . ./scripts/amplify-preview-env.sh; fi; npm run build-frontend
artifacts:
baseDirectory: frontend/build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ Leave `VITE_OAUTH_CLIENT_ID` as `remoteit_desktop` locally. Redirect URIs are re
branch config makes authorize fail with a 400. `remoteit_desktop` carries both
`http://localhost:3003/authCallback` and `remoteit://authCallback` (the Electron deep link).

Branch previews build on the dev stage as `remoteit_portal`. Amplify autodetects `feat/**` and
`fix/**` branches pushed to this repo, deploys each to its own `*.d20k671nqqv4kl.amplifyapp.com`
address and drops it when the branch is deleted. Its auto-created branch config sets
`AMPLIFY_PREVIEW=true`, which makes `amplify.yml` source `scripts/amplify-preview-env.sh`. Sign-in
needs `https://*.d20k671nqqv4kl.amplifyapp.com/authCallback` and `/signoutCallback` registered on
dev's `remoteit_portal`. That wildcard is safe only while nothing from outside this repo can deploy
under the app's domain, so keep Amplify's **pull request previews off**: they build PRs from forks.

Browse to `http://localhost:3003` exactly. `npm start` binds `0.0.0.0`, but reaching the app
over a LAN IP is a non-secure origin, where `crypto.subtle` is unavailable and the DPoP
proofs every token call carries silently degrade.
Expand Down
9 changes: 9 additions & 0 deletions scripts/amplify-preview-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Sourced by amplify.yml for branch previews: the branches Amplify autodetects, whose auto-created
# branch config sets AMPLIFY_PREVIEW=true. A preview also gets the app-level environment, and the app
# level pins the legacy production API, so a preview would otherwise sign in as remoteit_desktop on
# login.remote.it. Pinning the dev issuer selects STAGES.dev for the rest.
unset VITE_GRAPHQL_API VITE_WEBSOCKET_URL VITE_OAUTH_GRAPHQL_RESOURCE VITE_OAUTH_AGENT_RESOURCE VITE_OAUTH_MCP_RESOURCE VITE_OAUTH_MCP_DETAIL
export VITE_OAUTH_ISSUER=https://login.dev.remote.it
export VITE_OAUTH_CLIENT_ID=remoteit_portal
# A pinned build otherwise calls the agent at /agent, which only the vite dev server proxies.
export VITE_AGENT_URL=https://agent.dev.remote.it
Loading