Skip to content

Commit 43ed6ec

Browse files
authored
feat: clarify use of tunnel/proxy (#389)
1 parent e018fb1 commit 43ed6ec

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

cmd/cloudx/proxy/proxy.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ Per default, CORS is enabled for all origins.
6868
6969
### Connecting in automated environments
7070
71-
To connect the Ory Tunnel in automated environments, create a Project API Key for your project and set it as an environment variable:
71+
To connect the Ory Tunnel in automated environments, create a Project API Key for your project, set it as an environment variable, and use the ` + "`--quiet`" + ` flag:
7272
73-
$ %[2]s=<project-api-key> {{.CommandPath}} tunnel ...
73+
$ %[2]s=<project-api-key> {{.CommandPath}} -q ...
7474
7575
This will prevent the browser window from opening.
7676
@@ -79,8 +79,8 @@ This will prevent the browser window from opening.
7979
If you are using the Ory Proxy behind a gateway during development, you must set the ` + "`publish-url`" + ` argument:
8080
8181
$ {{.CommandPath}} --project <project-id-or-slug> \
82-
http://localhost:3000 \
83-
https://gateway.local:5000
82+
http://localhost:3000 \
83+
https://gateway.local:5000
8484
8585
Note: You cannot set a path in the ` + "`publish-url`" + `.
8686
@@ -95,18 +95,18 @@ By default, the proxy listens on port 4000. To change this, use the ` + "`--port
9595
If the proxy runs on a subdomain and you want Ory’s cookies (e.g., session cookies) to be accessible across all your domains, use the ` + "`--cookie-domain`" + ` flag to customize the cookie domain. Additionally, allow your subdomains in the CORS headers:
9696
9797
$ {{.CommandPath}} --project <project-id-or-slug> \
98-
--cookie-domain gateway.local \
99-
http://127.0.0.1:3000 \
100-
https://ory.gateway.local
98+
--cookie-domain gateway.local \
99+
http://127.0.0.1:3000 \
100+
https://ory.gateway.local
101101
102102
### Redirects
103103
104104
By default, all redirects will point to ` + "`publish-url`" + `. You can customize this behavior using the ` + "`--default-redirect-url`" + ` flag:
105105
106106
$ {{.CommandPath}} --project <project-id-or-slug> \
107-
--default-redirect-url /welcome \
108-
http://127.0.0.1:3000 \
109-
https://ory.example.org
107+
--default-redirect-url /welcome \
108+
http://127.0.0.1:3000 \
109+
https://ory.example.org
110110
111111
This ensures that all redirects (e.g., after login) go to ` + "`/welcome`" + ` instead of ` + "`/`" + `, unless you’ve specified custom redirects in your Ory configuration or via the flow’s ` + "`?return_to=`" + ` query parameter.
112112

cmd/cloudx/proxy/tunnel.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ Before using the Ory Tunnel, ensure that you have a running Ory Network project.
4646
Once your project is ready, pass the project's slug to the tunnel command:
4747
4848
$ {{.CommandPath}} --project <project-id-or-slug> ...
49-
$ %[1]s=<project-id-or-slug> {{.CommandPath}} tunnel ...
49+
$ %[1]s=<project-id-or-slug> {{.CommandPath}} ...
5050
5151
### Connecting in automated environments
5252
53-
To connect the Ory Tunnel in automated environments, create a Project API Key for your project and set it as an environment variable:
53+
To connect the Ory Tunnel in automated environments, create a Project API Key for your project, set it as an environment variable, and use the `+"`--quiet`"+` flag:
5454
55-
$ %[2]s=<project-api-key> {{.CommandPath}} tunnel ...
55+
$ %[2]s=<project-api-key> {{.CommandPath}} -q ...
5656
5757
This will prevent the browser window from opening.
5858
@@ -82,9 +82,9 @@ If you need to run the tunnel behind a gateway during development, you can speci
8282
Example:
8383
8484
$ {{.CommandPath}} --project <project-id-or-slug> \
85-
https://www.example.org \
86-
https://auth.example.org \
87-
--cookie-domain example.org
85+
https://www.example.org \
86+
https://auth.example.org \
87+
--cookie-domain example.org
8888
8989
Note: You cannot set a path in the `+"`tunnel-url`"+`.
9090
@@ -103,17 +103,17 @@ If your application runs on a non-standard HTTP or HTTPS port, include the port
103103
For cookie support, set the `+"`--cookie-domain`"+` flag to your top-level domain:
104104
105105
$ {{.CommandPath}} --project <project-id-or-slug> \
106-
--cookie-domain example.org \
107-
https://www.example.org \
108-
https://auth.example.org
106+
--cookie-domain example.org \
107+
https://www.example.org \
108+
https://auth.example.org
109109
110110
### Redirects
111111
112112
To specify a custom redirect URL, use the `+"`--default-redirect-url`"+` flag:
113113
114-
$ {{.CommandPath}} tunnel --project <project-id-or-slug> \
115-
--default-redirect-url /welcome \
116-
https://www.example.org`, client.ProjectKey, client.ProjectAPIKey),
114+
$ {{.CommandPath}} --project <project-id-or-slug> \
115+
--default-redirect-url /welcome \
116+
https://www.example.org`, client.ProjectKey, client.ProjectAPIKey),
117117

118118
RunE: func(cmd *cobra.Command, args []string) error {
119119
h, err := client.NewCobraCommandHelper(cmd)

0 commit comments

Comments
 (0)