This commit is contained in:
Elio Bischof
2023-05-19 19:46:10 +02:00
parent c98201f3cf
commit 07e1975698
2 changed files with 15 additions and 34 deletions

View File

@@ -40,48 +40,29 @@ or have limited resources on your local machine.
### Developing Against Your Local ZITADEL Instance
```sh
docker compose --file ./acceptance/docker-compose.yaml run setup
```
### Developing Against Your ZITADEL Cloud Instance
Create the file ./apps/login/.env.local with the following content:
```sh
ZITADEL_API_URL=<your cloud instance URL here>
ZITADEL_ORG_ID=<your service accounts organization id here>
ZITADEL_SERVICE_USER_TOKEN=<your service account personal access token here>
```
### Setting up local environment
This guide assumes you develop against a local ZITADEL instance using docker compose.
If you want to develop against
A quick guide on how to setup your ZITADEL typescript app locally to work on it and test out any changes:
1. Clone the repo:
```sh
git clone https://github.com/zitadel/typescript.git
cd typescript
```
3. Install packages. Developing requires Node.js v16:
```sh
# Install dependencies. Developing requires Node.js v16
pnpm install
```
4. Populate `.env.local`:
Copy `/apps/login/.env` to `/apps/login/.env.local`, and add your instance env variables for each entry.
```sh
cp apps/login/.env apps/login/.env.local
```
5. Generate GRPC stub for the application:
```sh
# Generate gRPC stubs
pnpm generate
```
6. Start the developer application/server:
```sh
# Start a local development server
pnpm dev
```

View File

@@ -1,6 +1,6 @@
#!/bin/sh
set -ex
set -e
KEY=${KEY:-./machinekey/zitadel-admin-sa.json}
echo "Using key path ${KEY} to the instance admin service account."
@@ -20,7 +20,7 @@ echo "Deferred the Host header ${AUDIENCE_HOST} which will be sent in requests t
JWT=$(zitadel-tools key2jwt --key ${KEY} --audience ${AUDIENCE})
echo "Created JWT from Admin service account key ${JWT}"
TOKEN_RESPONSE=$(curl --request POST \
TOKEN_RESPONSE=$(curl -s --request POST \
--url ${SERVICE}/oauth/v2/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header "Host: ${AUDIENCE_HOST}" \
@@ -33,7 +33,7 @@ echo "${TOKEN_RESPONSE}" | jq
TOKEN=$(echo -n ${TOKEN_RESPONSE} | jq -r '.access_token')
echo "Extracted access token ${TOKEN}"
ORG_RESPONSE=$(curl --request GET \
ORG_RESPONSE=$(curl -s --request GET \
--url ${SERVICE}/admin/v1/orgs/default \
--header 'Accept: application/json' \
--header "Authorization: Bearer ${TOKEN}" \