Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow running the local scripts outside of the main FTL directory. #3017

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

jvmakine
Copy link
Contributor

@jvmakine jvmakine commented Oct 7, 2024

Previously, trying to run ~/Development/ftl/scripts/ftl dev from a separate project failed with

error:controller0: error: No justfile found

After this, scripts/ftl dev builds the console correctly, though the console UI still does not load correctly, due to

http: proxy error: dial tcp [::1]:5173: connect: connection refused

Previously, trying to run `~/Development/ftl/scripts/ftl dev` from a separate project failed with
```
error:controller0: error: No justfile found
```

After this, it builds the frontend correctly.
@jvmakine jvmakine requested review from a team and alecthomas as code owners October 7, 2024 03:51
@jvmakine jvmakine requested review from deniseli and removed request for a team October 7, 2024 03:51
@ftl-robot ftl-robot mentioned this pull request Oct 7, 2024
@@ -24,7 +25,7 @@ var proxyURL, _ = url.Parse("http://localhost:5173") //nolint:errcheck
var proxy = httputil.NewSingleHostReverseProxy(proxyURL)

func Server(ctx context.Context, timestamp time.Time, publicURL *url.URL, allowOrigin *url.URL) (http.Handler, error) {
gitRoot, ok := internal.GitRoot("").Get()
gitRoot, ok := internal.GitRoot(os.Getenv("FTL_DIR")).Get()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to use an envar, plumb it through from a Kong config rather than using getenv directly

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, this is local.go...disregard!

@@ -24,7 +25,7 @@ var proxyURL, _ = url.Parse("http://localhost:5173") //nolint:errcheck
var proxy = httputil.NewSingleHostReverseProxy(proxyURL)

func Server(ctx context.Context, timestamp time.Time, publicURL *url.URL, allowOrigin *url.URL) (http.Handler, error) {
gitRoot, ok := internal.GitRoot("").Get()
gitRoot, ok := internal.GitRoot(os.Getenv("FTL_DIR")).Get()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, this is local.go...disregard!

@jvmakine jvmakine merged commit 3f355e4 into main Oct 7, 2024
98 checks passed
@jvmakine jvmakine deleted the juho/local-console branch October 7, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants