Skip to content

Commit 8ba8759

Browse files
switch from localtunnel to CF tunnel (#23)
* switch from localtunnel to CF tunnel * addressed comments for remaining localtunnel references
1 parent 9845c26 commit 8ba8759

File tree

6 files changed

+18
-22
lines changed

6 files changed

+18
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The `examples/` directory contains Benchling App samples written by Benchling.
77
Demonstrates creating a custom UI in Benchling allowing users to search for
88
molecules from [PubChem](https://pubchem.ncbi.nlm.nih.gov/) and sync them into Benchling.
99

10-
Uses [localtunnel](https://localtunnel.me/) and [Docker](https://www.docker.com/) to receive webhooks
10+
Uses [Cloudflare-tunnel](https://www.cloudflare.com/products/tunnel/) and [Docker](https://www.docker.com/) to receive webhooks
1111
in a local development environment running [Flask](https://flask.palletsprojects.com/) with the
1212
[Benchling SDK](https://docs.benchling.com/docs/getting-started-with-the-sdk).
1313

examples/chem-sync-local-flask/Dockerfile.localtunnel

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/chem-sync-local-flask/README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This app is optimized as a minimal local development experience using [Docker](h
1616
> ⚠️ **Development Only**: This example is not meant to be copied into production as-is. There are additional deployment, scale, and security concerns that should be addressed before deploying an app based on this example to production.
1717
1818
It relies on a few other tools that will be installed for you within Docker containers:
19-
* [Localtunnel](https://localtunnel.me/) - expose a public webhook URL and forward the results locally. ⚠️ *Not for production or real data!*
19+
* [Cloudflare-tunnel](https://www.cloudflare.com/products/tunnel/) - expose a public webhook URL and forward the results locally. ⚠️ *Not for production or real data!*
2020
* [Flask](https://flask.palletsprojects.com/) - A simple Python web application framework
2121

2222
## Getting Started
@@ -54,25 +54,28 @@ curl localhost:8000/health
5454

5555
If Flask is running, you should see `OK` printed.
5656

57-
Be sure to note the URL created for you by `localtunnel`. The log line should look something like this:
57+
Be sure to note the URL created for you by `cloudflare-tunnel`. The log line should look something like this:
5858

5959
```
60-
app-workshop-local-tunnel-1 | your url is: https://brave-wombats-poke.loca.lt
60+
cloudflare-tunnel-1 | 2025-03-11T18:45:24Z INF +--------------------------------------------------------------------------------------------+
61+
cloudflare-tunnel-1 | 2025-03-11T18:45:24Z INF | Your quick Tunnel has been created! Visit it at (it may take some time to be reachable): |
62+
cloudflare-tunnel-1 | 2025-03-11T18:45:24Z INF | https://pioneer-rights-hardly-disorder.trycloudflare.com |
63+
cloudflare-tunnel-1 | 2025-03-11T18:45:24Z INF +--------------------------------------------------------------------------------------------+
6164
```
6265

6366
On *nix systems, you can easily obtain _just_ the URL via:
6467

6568
```
66-
docker compose logs local-tunnel | grep -o https://.* | tail -n 1
69+
docker compose logs cloudflare-tunnel | grep -o 'https://[^ ]*trycloudflare.com[^ ]*' | tail -n 1
6770
```
6871

6972
Example Output:
7073

7174
```
72-
https://brave-wombats-poke.loca.lt
75+
https://pioneer-rights-hardly-disorder.trycloudflare.com
7376
```
7477

75-
> 💡 Don't forget to append `/1/webhooks`, making the full URL given to Benchling `https://brave-wombats-poke.loca.lt/1/webhooks`
78+
> 💡 Don't forget to append `/1/webhooks`, making the full URL given to Benchling `https://pioneer-rights-hardly-disorder.trycloudflare.com/1/webhooks`
7679
7780
## Setting Up Your App in Benchling
7881

@@ -95,17 +98,17 @@ When prompted to upload a file, select `manifest.yaml` and click "Create."
9598

9699
### Update the Webhook URL
97100

98-
Every time we restart the `local-tunnel` Docker container, it will provision
101+
Every time we restart the `cloudflare-tunnel` Docker container, it will provision
99102
a new public webhook URL.
100103

101104
Update the Benchling App's Webhook URL in the UI with the new server and
102105
append the path our Flask route expects (see `local_app/app.py`).
103106

104-
For example, if our `localtunnel` generated URL is `https://hot-ideas-doubt.loca.lt`,
107+
For example, if our `cloudflare-tunnel` generated URL is `https://pioneer-rights-hardly-disorder.trycloudflare.com`,
105108
the webhook URL in Benchling should be:
106109

107110
```
108-
https://hot-ideas-doubt.loca.lt/1/webhooks
111+
https://https://pioneer-rights-hardly-disorder.trycloudflare.com/1/webhooks
109112
```
110113

111114
![image info](./docs/update-webhook-url.gif)
@@ -136,7 +139,7 @@ You'll then need to restart _just_ the `benchling-app` Docker service to pick up
136139
docker-compose up -d
137140
```
138141

139-
If you restart both containers, be sure to update your App in Benchling with the new webhook URL from localtunnel.
142+
If you restart both containers, be sure to update your App in Benchling with the new webhook URL from cloudflare-tunnel.
140143

141144
### Setting Client ID
142145

examples/chem-sync-local-flask/docker-compose.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.8"
2-
31
services:
42
benchling-app:
53
build: .
@@ -29,10 +27,10 @@ services:
2927
# Do not do this in production or use with any sensitive data.
3028
# Benchling has not vetted this tool for use in production or in sensitive systems.
3129
# Conduct your own due diligence before choosing a tool for production use.
32-
local-tunnel:
33-
build:
34-
context: .
35-
dockerfile: Dockerfile.localtunnel
30+
cloudflare-tunnel:
31+
image: cloudflare/cloudflared
32+
restart: unless-stopped
33+
command: tunnel --url http://benchling-app:5000
3634

3735
secrets:
3836
app_client_secret:
64.8 KB
Loading
278 KB
Loading

0 commit comments

Comments
 (0)