Skip to content

Commit

Permalink
refactor: Remove TRACECAT__RUNNER_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
daryllimyt committed Jun 9, 2024
1 parent d6d4314 commit 3d3b757
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 17 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ TRACECAT__API_URL=http://localhost:8000
# Runner Service URL
# We recommend using ngrok here, but feel free to use any other service
# Run `ngrok http --domain=INSERT_STATIC_NGROK_DOMAIN_HERE 8001` to start ngrok and get the forwarding URL
TRACECAT__RUNNER_URL=http://localhost:8001
TRACECAT__PUBLIC_RUNNER_URL=https://your-ngrok-runner-url

# --- RabbitMQ ---
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ services:
TRACECAT__SERVICE_KEY: ${TRACECAT__SERVICE_KEY}
TRACECAT__SIGNING_SECRET: ${TRACECAT__SIGNING_SECRET}
TRACECAT__API_URL: ${TRACECAT__API_URL}
TRACECAT__RUNNER_URL: ${TRACECAT__RUNNER_URL}
TRACECAT__PUBLIC_RUNNER_URL: ${TRACECAT__PUBLIC_RUNNER_URL}
CLERK_FRONTEND_API_URL: ${CLERK_FRONTEND_API_URL}
TRACECAT__DISABLE_AUTH: ${TRACECAT__DISABLE_AUTH}
Expand Down Expand Up @@ -90,7 +89,6 @@ services:
TRACECAT__SERVICE_KEY: ${TRACECAT__SERVICE_KEY}
TRACECAT__SIGNING_SECRET: ${TRACECAT__SIGNING_SECRET}
TRACECAT__API_URL: ${TRACECAT__API_URL}
TRACECAT__RUNNER_URL: ${TRACECAT__RUNNER_URL}
TRACECAT__PUBLIC_RUNNER_URL: ${TRACECAT__PUBLIC_RUNNER_URL}
# Auth
TRACECAT__DISABLE_AUTH: ${TRACECAT__DISABLE_AUTH}
Expand Down
8 changes: 4 additions & 4 deletions docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ The domain should be in the format `<some-random-phrase>.ngrok-free.app`.
For example, if your ngrok domain is `your-grnok-domain.ngrok-free.app`, start `ngrok` by running the following command:

```bash
ngrok http --domain=your-ngrok-domain.ngrok-free.app 8001
ngrok http --domain=your-ngrok-domain.ngrok-free.app 8000
```

If you don't have a static domain, you can use a free ephermeral domain by running:

```bash
ngrok http http://localhost:8001
ngrok http http://localhost:8000
```

<Note>
Expand All @@ -126,7 +126,7 @@ ngrok http http://localhost:8001
If correctly set up, your .env should contain:

```bash
TRACECAT__RUNNER_URL=https://your-ngrok-domain.ngrok-free.app
TRACECAT__PUBLIC_RUNNER_URL=https://your-ngrok-domain.ngrok-free.app
```

### Linux users
Expand Down Expand Up @@ -158,7 +158,7 @@ services:
TRACECAT__SERVICE_KEY: ${TRACECAT__SERVICE_KEY}
TRACECAT__SIGNING_SECRET: ${TRACECAT__SIGNING_SECRET}
TRACECAT__API_URL: ${TRACECAT__API_URL}
TRACECAT__RUNNER_URL: ${TRACECAT__RUNNER_URL}
TRACECAT__PUBLIC_RUNNER_URL: ${TRACECAT__PUBLIC_RUNNER_URL}
# Auth
CLERK_FRONTEND_API_URL: ${CLERK_FRONTEND_API_URL}
TRACECAT__DISABLE_AUTH: ${TRACECAT__DISABLE_AUTH}
Expand Down
2 changes: 1 addition & 1 deletion env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ dotenv_replace "RESEND_API_KEY" "$resend_api_key" "$env_file"

# Check if the existing value matches the default value
if [ "$runner_url" == "https://your-ngrok-runner-url" ]; then
echo -e "${RED}The TRACECAT__RUNNER_URL value is missing. Please update it in the .env file.${NC}"
echo -e "${RED}The TRACECAT__PUBLIC_RUNNER_URL value is missing. Please update it in the .env file.${NC}"
exit 1
fi
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def env_sandbox(monkeysession, request: pytest.FixtureRequest):
)
monkeysession.setenv("TRACECAT__DB_ENCRYPTION_KEY", Fernet.generate_key().decode())
monkeysession.setenv("TRACECAT__API_URL", "http://api:8000")
monkeysession.setenv("TRACECAT__RUNNER_URL", "http://runner:8000")
monkeysession.setenv("TRACECAT__PUBLIC_RUNNER_URL", "http://localhost:8001")
monkeysession.setenv("TRACECAT__SERVICE_KEY", "test-service-key")
monkeysession.setenv("TEMPORAL__DOCKER_COMPOSE_PATH", temporal_compose_file)
Expand Down
8 changes: 1 addition & 7 deletions tracecat/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,9 @@ def create_app(**kwargs) -> FastAPI:
if config.TRACECAT__APP_ENV == "production":
# NOTE: If you are using Tracecat self-hosted
# please replace with your own domain
cors_origins_kwargs = {
"allow_origins": [
"https://platform.tracecat.com",
config.TRACECAT__RUNNER_URL,
]
}
cors_origins_kwargs = {"allow_origins": ["https://platform.tracecat.com"]}
elif config.TRACECAT__APP_ENV == "staging":
cors_origins_kwargs = {
# "allow_origins": [config.TRACECAT__RUNNER_URL],
# "allow_origin_regex": r"https://tracecat-.*-tracecat\.vercel\.app",
"allow_origins": "*"
}
Expand Down
1 change: 0 additions & 1 deletion tracecat/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
TRACECAT__SCHEDULE_MAX_CONNECTIONS = 6
TRACECAT__APP_ENV = os.environ.get("TRACECAT__APP_ENV", "dev")
TRACECAT__API_URL = os.environ.get("TRACECAT__API_URL", "http://localhost:8000")
TRACECAT__RUNNER_URL = os.environ.get("TRACECAT__RUNNER_URL", "http://runner:8000")
TRACECAT__PUBLIC_RUNNER_URL = os.environ.get(
"TRACECAT__PUBLIC_RUNNER_URL", "http://localhost:8001"
)
Expand Down

0 comments on commit 3d3b757

Please sign in to comment.