Skip to content

Commit

Permalink
docs: add info about using FMTM and ODK tunnels during dev
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed May 23, 2024
1 parent ca6e5a2 commit dd2eb71
Showing 1 changed file with 48 additions and 38 deletions.
86 changes: 48 additions & 38 deletions docs/dev/Backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,61 +270,71 @@ You can now call the JOSM API from FMTM and changes will be reflected in the GUI
solution for this (an alternative is Ngrok).
- To run the tunnel to the FMTM API:

```bash
docker compose \
-f docker-compose.yml \
-f contrib/tunnel/fmtm/docker-compose.yml \
up -d
```

View the website to access FMTM remotely (e.g. via mobile):

```bash
docker compose \
-f docker-compose.yml \
-f contrib/tunnel/fmtm/docker-compose.yml \
logs api-tunnel
```
```bash
docker compose \
-f docker-compose.yml \
-f contrib/tunnel/fmtm/docker-compose.yml \
up -d
```

- View the website to access FMTM remotely (e.g. via mobile):

```bash
docker compose \
-f docker-compose.yml \
-f contrib/tunnel/fmtm/docker-compose.yml \
logs api-tunnel
```

- Now the final step is to add the provided tunnel URL to the allowed CORS origins.
- Add to your `.env` file:

```dotenv
EXTRA_CORS_ORIGINS=https://the-url-you-were-given.trycloudflare.com
```
```dotenv
EXTRA_CORS_ORIGINS=https://the-url-you-were-given.trycloudflare.com
```

- Then restart your API service:

```bash
docker compose restart api
```
```bash
docker compose restart api
```

### Using local ODK Central on mobile

- Sometimes you wish to use a project in your local ODK Central, via ODK Collect
on your mobile.
- To run the tunnel to the ODK Central API:

```bash
docker compose \
-f docker-compose.yml \
-f contrib/tunnel/odk/docker-compose.yml \
up -d
```
```bash
docker compose \
-f docker-compose.yml \
-f contrib/tunnel/odk/docker-compose.yml \
up -d
```

- During project creation, set the ODK Central server URL to the provided tunnel
address for the ODK Central API:
- View the website to access ODK Central remotely (e.g. via mobile):

```bash
docker compose \
-f docker-compose.yml \
-f contrib/tunnel/odk/docker-compose.yml \
logs central-tunnel
```
```bash
docker compose \
-f docker-compose.yml \
-f contrib/tunnel/odk/docker-compose.yml \
logs central-tunnel
```

1. Requirement: Restart ODK Central using the domain override
(required for form download URLs):

```bash
CENTRAL_DOMAIN_OVERRIDE=tramadol-handbags-protecting-date.trycloudflare.com \
docker compose up -d central
```

2. Requirement: During project creation, set the ODK Central server URL to the
provided tunnel URL for the ODK Central API.

> The credentials for the local ODK Central instance are:
> Username: <[email protected]>
> Password: Password1234
> The credentials for the local ODK Central instance are:
> Username: <[email protected]>
> Password: Password1234

- Now when you access the project via a QRCode on mobile, the connection to ODK
Central should work.

0 comments on commit dd2eb71

Please sign in to comment.