e7795a06ad
* remove pgadmin * remove V3_ENABLED * v3 is always enabled * enfore docker machine presets by default * rename autoremove env var * prefix more k8s-specific env vars * same prefix for all docker settings * improve profile switcher copy * supervisor can load token from file * optional webapp worker group bootstrap * fix error message * fix app origin fallback for otlp endpoint * use pnpm cache for webapp docker builds * increase default org and env concurrency limit to 100 * optional machine preset overrides * improve s3 pre-signing errors * fix DOCKER_ENFORCE_MACHINE_PRESETS bool coercion * shard unit tests * fix for s3-compatible services * optional object store region * Update apps/supervisor/src/workerToken.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix DEPLOY_REGISTRY_HOST example * fix platform mock * remove remaining v3Enabled refs * fix error type.. bad bot --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
30 lines
705 B
TypeScript
30 lines
705 B
TypeScript
import { requestUrl } from "./utils/requestUrl.server";
|
|
|
|
export type TriggerFeatures = {
|
|
isManagedCloud: boolean;
|
|
};
|
|
|
|
function isManagedCloud(host: string): boolean {
|
|
return (
|
|
host === "cloud.trigger.dev" ||
|
|
host === "test-cloud.trigger.dev" ||
|
|
host === "internal.trigger.dev" ||
|
|
process.env.CLOUD_ENV === "development"
|
|
);
|
|
}
|
|
|
|
function featuresForHost(host: string): TriggerFeatures {
|
|
return {
|
|
isManagedCloud: isManagedCloud(host),
|
|
};
|
|
}
|
|
|
|
export function featuresForRequest(request: Request): TriggerFeatures {
|
|
const url = requestUrl(request);
|
|
return featuresForUrl(url);
|
|
}
|
|
|
|
export function featuresForUrl(url: URL): TriggerFeatures {
|
|
return featuresForHost(url.host);
|
|
}
|