Make github auth optional and better name the env vars
This commit is contained in:
@@ -15,8 +15,6 @@ APP_ORIGIN=http://localhost:3000
|
||||
|
||||
NODE_ENV=development
|
||||
|
||||
PULSAR_ENABLED=1
|
||||
|
||||
SESSION_SECRET=
|
||||
|
||||
|
||||
@@ -25,9 +23,9 @@ SESSION_SECRET=
|
||||
# ************************************* LOGIN *******************************************
|
||||
#########################################################################################
|
||||
|
||||
GITHUB_CLIENT_ID=
|
||||
AUTH_GITHUB_CLIENT_ID=
|
||||
|
||||
GITHUB_SECRET=
|
||||
AUTH_GITHUB_CLIENT_SECRET=
|
||||
|
||||
LOGIN_ORIGIN=http://localhost:3000
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ function LoginForm() {
|
||||
Continue with Email
|
||||
</Button>
|
||||
<Paragraph variant="small" className="mt-2 text-center">
|
||||
By connecting your GitHub account you agree to our{" "}
|
||||
By creating an account you agree to our{" "}
|
||||
<TextLink href="#">terms</TextLink> and{" "}
|
||||
<TextLink href="#">privacy</TextLink> policies.
|
||||
</Paragraph>
|
||||
|
||||
@@ -29,8 +29,8 @@ const EnvironmentSchema = z.object({
|
||||
SECRET_STORE: SecretStoreOptionsSchema.default("DATABASE"),
|
||||
POSTHOG_PROJECT_KEY: z.string().optional(),
|
||||
MAGIC_LINK_SECRET: z.string(),
|
||||
GITHUB_CLIENT_ID: z.string(),
|
||||
GITHUB_SECRET: z.string(),
|
||||
AUTH_GITHUB_CLIENT_ID: z.string().optional(),
|
||||
AUTH_GITHUB_CLIENT_SECRET: z.string().optional(),
|
||||
FROM_EMAIL: z.string(),
|
||||
REPLY_TO_EMAIL: z.string(),
|
||||
RESEND_API_KEY: z.string(),
|
||||
|
||||
@@ -11,6 +11,7 @@ import { Fieldset } from "~/components/primitives/Fieldset";
|
||||
import { FormTitle } from "~/components/primitives/FormTitle";
|
||||
import { NamedIcon } from "~/components/primitives/NamedIcon";
|
||||
import { Paragraph, TextLink } from "~/components/primitives/Paragraph";
|
||||
import { isGithubAuthSupported } from "~/services/auth.server";
|
||||
|
||||
import { commitSession, setRedirectTo } from "~/services/redirectTo.server";
|
||||
import { getUserId } from "~/services/session.server";
|
||||
@@ -26,7 +27,7 @@ export async function loader({ request }: LoaderArgs) {
|
||||
const session = await setRedirectTo(request, redirectTo);
|
||||
|
||||
return typedjson(
|
||||
{ redirectTo },
|
||||
{ redirectTo, isGithubAuthSupported },
|
||||
{
|
||||
headers: {
|
||||
"Set-Cookie": await commitSession(session),
|
||||
@@ -34,7 +35,7 @@ export async function loader({ request }: LoaderArgs) {
|
||||
}
|
||||
);
|
||||
} else {
|
||||
return typedjson({ redirectTo: null });
|
||||
return typedjson({ redirectTo: null, isGithubAuthSupported });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,10 +64,12 @@ export default function LoginPage() {
|
||||
<FormTitle divide={false} title="Create your Trigger.dev account" />
|
||||
<Fieldset>
|
||||
<div className="flex flex-col gap-y-2">
|
||||
<Button type="submit" variant="primary/large" fullWidth>
|
||||
<NamedIcon name={"github"} className={"mr-1.5 h-4 w-4"} />
|
||||
Continue with GitHub
|
||||
</Button>
|
||||
{isGithubAuthSupported && (
|
||||
<Button type="submit" variant="primary/large" fullWidth>
|
||||
<NamedIcon name={"github"} className={"mr-1.5 h-4 w-4"} />
|
||||
Continue with GitHub
|
||||
</Button>
|
||||
)}
|
||||
<LinkButton
|
||||
to="/login/magic"
|
||||
variant="secondary/large"
|
||||
@@ -82,7 +85,7 @@ export default function LoginPage() {
|
||||
</LinkButton>
|
||||
</div>
|
||||
<Paragraph variant="extra-small" className="mt-2 text-center">
|
||||
By connecting your GitHub account you agree to our{" "}
|
||||
By signing up you agree to our{" "}
|
||||
<TextLink
|
||||
href="https://trigger.dev/legal/terms"
|
||||
target="_blank"
|
||||
|
||||
@@ -3,12 +3,24 @@ import type { AuthUser } from "./authUser";
|
||||
import { addEmailLinkStrategy } from "./emailAuth.server";
|
||||
import { addGitHubStrategy } from "./gitHubAuth.server";
|
||||
import { sessionStorage } from "./sessionStorage.server";
|
||||
import { env } from "~/env.server";
|
||||
|
||||
// Create an instance of the authenticator, pass a generic with what
|
||||
// strategies will return and will store in the session
|
||||
const authenticator = new Authenticator<AuthUser>(sessionStorage);
|
||||
|
||||
addGitHubStrategy(authenticator);
|
||||
const isGithubAuthSupported =
|
||||
typeof env.AUTH_GITHUB_CLIENT_ID === "string" &&
|
||||
typeof env.AUTH_GITHUB_CLIENT_SECRET === "string";
|
||||
|
||||
if (env.AUTH_GITHUB_CLIENT_ID && env.AUTH_GITHUB_CLIENT_SECRET) {
|
||||
addGitHubStrategy(
|
||||
authenticator,
|
||||
env.AUTH_GITHUB_CLIENT_ID,
|
||||
env.AUTH_GITHUB_CLIENT_SECRET
|
||||
);
|
||||
}
|
||||
|
||||
addEmailLinkStrategy(authenticator);
|
||||
|
||||
export { authenticator };
|
||||
export { authenticator, isGithubAuthSupported };
|
||||
|
||||
@@ -5,40 +5,44 @@ import { findOrCreateUser } from "~/models/user.server";
|
||||
import type { AuthUser } from "./authUser";
|
||||
import { postAuthentication } from "./postAuth.server";
|
||||
|
||||
const gitHubStrategy = new GitHubStrategy(
|
||||
{
|
||||
clientID: env.GITHUB_CLIENT_ID ?? "",
|
||||
clientSecret: env.GITHUB_SECRET ?? "",
|
||||
callbackURL: `${env.LOGIN_ORIGIN}/auth/github/callback`,
|
||||
},
|
||||
async ({ accessToken, extraParams, profile }) => {
|
||||
const emails = profile.emails;
|
||||
export function addGitHubStrategy(
|
||||
authenticator: Authenticator<AuthUser>,
|
||||
clientID: string,
|
||||
clientSecret: string
|
||||
) {
|
||||
const gitHubStrategy = new GitHubStrategy(
|
||||
{
|
||||
clientID,
|
||||
clientSecret,
|
||||
callbackURL: `${env.LOGIN_ORIGIN}/auth/github/callback`,
|
||||
},
|
||||
async ({ accessToken, extraParams, profile }) => {
|
||||
const emails = profile.emails;
|
||||
|
||||
if (!emails) {
|
||||
throw new Error("GitHub login requires an email address");
|
||||
if (!emails) {
|
||||
throw new Error("GitHub login requires an email address");
|
||||
}
|
||||
|
||||
try {
|
||||
const { user, isNewUser } = await findOrCreateUser({
|
||||
email: emails[0].value,
|
||||
authenticationMethod: "GITHUB",
|
||||
accessToken,
|
||||
authenticationProfile: profile,
|
||||
authenticationExtraParams: extraParams,
|
||||
});
|
||||
|
||||
await postAuthentication({ user, isNewUser, loginMethod: "GITHUB" });
|
||||
|
||||
return {
|
||||
userId: user.id,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
try {
|
||||
const { user, isNewUser } = await findOrCreateUser({
|
||||
email: emails[0].value,
|
||||
authenticationMethod: "GITHUB",
|
||||
accessToken,
|
||||
authenticationProfile: profile,
|
||||
authenticationExtraParams: extraParams,
|
||||
});
|
||||
|
||||
await postAuthentication({ user, isNewUser, loginMethod: "GITHUB" });
|
||||
|
||||
return {
|
||||
userId: user.id,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
export function addGitHubStrategy(authenticator: Authenticator<AuthUser>) {
|
||||
authenticator.use(gitHubStrategy);
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
# fly.toml app configuration file generated for trigger-v2-fly-demo on 2023-06-22T16:23:19+01:00
|
||||
#
|
||||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
|
||||
#
|
||||
|
||||
app = "trigger-v2-fly-demo"
|
||||
primary_region = "lhr"
|
||||
|
||||
[build]
|
||||
image = "ghcr.io/triggerdotdev/trigger.dev:latest"
|
||||
|
||||
[env]
|
||||
PRIMARY_REGION = "lhr"
|
||||
|
||||
[http_service]
|
||||
internal_port = 3000
|
||||
force_https = true
|
||||
auto_stop_machines = true
|
||||
auto_start_machines = true
|
||||
min_machines_running = 0
|
||||
+2
-2
@@ -13,8 +13,8 @@ DATABASE_HOST=database:5432
|
||||
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
|
||||
|
||||
# Github sign in OAUTH client id and secret
|
||||
GITHUB_CLIENT_ID=
|
||||
GITHUB_SECRET=
|
||||
AUTH_GITHUB_CLIENT_ID=
|
||||
AUTH_GITHUB_CLIENT_SECRET=
|
||||
|
||||
# E-mail settings
|
||||
FROM_EMAIL=
|
||||
|
||||
@@ -1,481 +0,0 @@
|
||||
{
|
||||
"$schema": "https://app.flightcontrol.dev/schema.json",
|
||||
"environments": [
|
||||
{
|
||||
"id": "prod",
|
||||
"name": "Prod",
|
||||
"region": "us-east-1",
|
||||
"source": {
|
||||
"branch": "main",
|
||||
"trigger": "push"
|
||||
},
|
||||
"envVariables": {
|
||||
"PULSAR_ISSUER_URL": "https://auth.streamnative.cloud/",
|
||||
"PULSAR_AUDIENCE": {
|
||||
"fromParameterStore": "/Prod/Pulsar/Audience"
|
||||
},
|
||||
"PULSAR_TENANT": "triggerdotdev",
|
||||
"PULSAR_WORKFLOWS_NAMESPACE": "workflows",
|
||||
"PULSAR_QUEUES_NAMESPACE": "queues",
|
||||
"PULSAR_SERVICE_URL": {
|
||||
"fromParameterStore": "/Prod/Pulsar/ServiceURL"
|
||||
},
|
||||
"DOCKER_USERNAME": "maverickdotdev",
|
||||
"DOCKER_PASSWORD": {
|
||||
"fromParameterStore": "/Docker/Password"
|
||||
}
|
||||
},
|
||||
"services": [
|
||||
{
|
||||
"id": "p-webapp",
|
||||
"name": "Prod Webapp",
|
||||
"type": "fargate",
|
||||
"buildType": "docker",
|
||||
"dockerfilePath": "./apps/webapp/Dockerfile",
|
||||
"dockerContext": ".",
|
||||
"cpu": 4,
|
||||
"memory": 8,
|
||||
"minInstances": 1,
|
||||
"maxInstances": 10,
|
||||
"domain": "app.trigger.dev",
|
||||
"port": 3000,
|
||||
"healthCheckPath": "/healthcheck",
|
||||
"watchPaths": [
|
||||
"apps/webapp/app/**",
|
||||
"apps/webapp/public/**",
|
||||
"apps/webapp/Dockerfile",
|
||||
"apps/webapp/package.json",
|
||||
"apps/webapp/server.ts",
|
||||
"apps/webapp/remix.config.js",
|
||||
"apps/webapp/tailwind.config.js",
|
||||
"apps/webapp/tsconfig.json",
|
||||
"apps/webapp/postcss.config.js",
|
||||
"apps/webapp/styles/**",
|
||||
"apps/webapp/prisma/**",
|
||||
"apps/webapp/types/**",
|
||||
"packages/internal-platform/src/**",
|
||||
"packages/common-schemas/src/**",
|
||||
"integrations/*/src/**",
|
||||
"packages/integration-catalog/src/**",
|
||||
"packages/emails/src/**",
|
||||
"packages/emails/emails/**",
|
||||
"packages/internal-pulsar/src/**",
|
||||
"./pnpm-lock.yaml"
|
||||
],
|
||||
"dependsOn": [
|
||||
"p-db"
|
||||
],
|
||||
"envVariables": {
|
||||
"FROM_EMAIL": "Trigger.dev <hello@email.trigger.dev>",
|
||||
"REPLY_TO_EMAIL": "hello@trigger.dev",
|
||||
"RESEND_API_KEY": {
|
||||
"fromParameterStore": "/Prod/webapp/RESEND_API_KEY"
|
||||
},
|
||||
"SENTRY_DSN": {
|
||||
"fromParameterStore": "SENTRY_DSN"
|
||||
},
|
||||
"SENTRY_PROJECT": "triggerdev-web",
|
||||
"SENTRY_ORG": "triggerdev",
|
||||
"SENTRY_AUTH_TOKEN": {
|
||||
"fromParameterStore": "SENTRY_AUTH_TOKEN"
|
||||
},
|
||||
"SESSION_SECRET": {
|
||||
"fromParameterStore": "/Prod/webapp/SESSION_SECRET"
|
||||
},
|
||||
"MAGIC_LINK_SECRET": {
|
||||
"fromParameterStore": "/Prod/webapp/MAGIC_LINK_SECRET"
|
||||
},
|
||||
"GITHUB_CLIENT_ID": "724e56fcebe940eb5b22",
|
||||
"GITHUB_SECRET": {
|
||||
"fromParameterStore": "/Prod/webapp/GITHUB_SECRET"
|
||||
},
|
||||
"DATABASE_URL": {
|
||||
"fromService": {
|
||||
"id": "p-db",
|
||||
"value": "dbConnectionString"
|
||||
}
|
||||
},
|
||||
"PULSAR_CLIENT_ID": {
|
||||
"fromParameterStore": "/Prod/Pulsar/webapp/ClientId"
|
||||
},
|
||||
"PULSAR_CLIENT_SECRET": {
|
||||
"fromParameterStore": "/Prod/Pulsar/webapp/ClientSecret"
|
||||
},
|
||||
"PULSAR_ROLE": {
|
||||
"fromParameterStore": "/Prod/Pulsar/webapp/Role"
|
||||
},
|
||||
"PIZZLY_HOST": "https://auth.trigger.dev",
|
||||
"PIZZLY_SECRET_KEY": {
|
||||
"fromParameterStore": "/Prod/webapp/PIZZLY_SECRET_KEY"
|
||||
},
|
||||
"POSTHOG_PROJECT_KEY": {
|
||||
"fromParameterStore": "/Prod/webapp/POSTHOG_PROJECT_KEY"
|
||||
},
|
||||
"TRIGGER_LOG_LEVEL": "debug",
|
||||
"INTERNAL_TRIGGER_API_KEY": {
|
||||
"fromParameterStore": "/Prod/webapp/INTERNAL_TRIGGER_API_KEY"
|
||||
},
|
||||
"PULSAR_ENABLED": "1",
|
||||
"PULSAR_DEBUG": true,
|
||||
"GITHUB_APP_NAME": "trigger-dev-app",
|
||||
"GITHUB_APP_ID": "294349",
|
||||
"GITHUB_APP_CLIENT_ID": {
|
||||
"fromParameterStore": "/Prod/webapp/GITHUB_APP_CLIENT_ID"
|
||||
},
|
||||
"GITHUB_APP_CLIENT_SECRET": {
|
||||
"fromParameterStore": "/Prod/webapp/GITHUB_APP_CLIENT_SECRET"
|
||||
},
|
||||
"GITHUB_APP_PRIVATE_KEY": {
|
||||
"fromParameterStore": "/Prod/webapp/GITHUB_APP_PRIVATE_KEY"
|
||||
},
|
||||
"GITHUB_APP_WEBHOOK_SECRET": {
|
||||
"fromParameterStore": "/Prod/webapp/GITHUB_APP_WEBHOOK_SECRET"
|
||||
},
|
||||
"INTEGRATIONS_API_KEY": {
|
||||
"fromParameterStore": "/Prod/integrations/API_TOKEN"
|
||||
},
|
||||
"INTEGRATIONS_API_ORIGIN": "https://integrations.trigger.dev",
|
||||
"CAKEWORK_API_KEY": {
|
||||
"fromParameterStore": "/Prod/webapp/CAKEWORK_API_KEY"
|
||||
},
|
||||
"TRIGGER_WSS_URL": "wss://wss.trigger.dev/ws"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "p-wss",
|
||||
"name": "Prod WSS",
|
||||
"type": "fargate",
|
||||
"buildType": "docker",
|
||||
"dockerfilePath": "./apps/wss/Dockerfile",
|
||||
"dockerContext": ".",
|
||||
"cpu": 2,
|
||||
"memory": 4,
|
||||
"minInstances": 2,
|
||||
"maxInstances": 10,
|
||||
"domain": "wss.trigger.dev",
|
||||
"port": 8889,
|
||||
"healthCheckPath": "/healthcheck",
|
||||
"watchPaths": [
|
||||
"apps/wss/src/**",
|
||||
"apps/wss/tsconfig.json",
|
||||
"apps/wss/tsup.config.ts",
|
||||
"apps/wss/package.json",
|
||||
"packages/internal-platform/src/**",
|
||||
"packages/internal-bridge/src/**",
|
||||
"packages/common-schemas/src/**",
|
||||
"packages/internal-pulsar/src/**",
|
||||
"./pnpm-lock.yaml"
|
||||
],
|
||||
"envVariables": {
|
||||
"PULSAR_CLIENT_ID": {
|
||||
"fromParameterStore": "/Prod/Pulsar/wss/ClientId"
|
||||
},
|
||||
"PULSAR_CLIENT_SECRET": {
|
||||
"fromParameterStore": "/Prod/Pulsar/wss/ClientSecret"
|
||||
},
|
||||
"PULSAR_ROLE": {
|
||||
"fromParameterStore": "/Prod/Pulsar/wss/Role"
|
||||
},
|
||||
"PLATFORM_API_URL": "https://app.trigger.dev",
|
||||
"TRIGGER_LOG_LEVEL": "debug",
|
||||
"SENTRY_DSN": {
|
||||
"fromParameterStore": "/wss/SENTRY_DSN"
|
||||
},
|
||||
"APP_ENV": "production"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "p-integrations",
|
||||
"name": "Prod integrations",
|
||||
"type": "fargate",
|
||||
"buildType": "docker",
|
||||
"dockerfilePath": "./apps/integrations/Dockerfile",
|
||||
"dockerContext": ".",
|
||||
"cpu": 2,
|
||||
"memory": 4,
|
||||
"minInstances": 2,
|
||||
"maxInstances": 10,
|
||||
"domain": "integrations.trigger.dev",
|
||||
"port": 3006,
|
||||
"healthCheckPath": "/healthcheck",
|
||||
"watchPaths": [
|
||||
"apps/integrations/src/**",
|
||||
"apps/integrations/tsconfig.json",
|
||||
"apps/integrations/tsup.config.ts",
|
||||
"apps/integrations/package.json",
|
||||
"./pnpm-lock.yaml"
|
||||
],
|
||||
"envVariables": {
|
||||
"DATABASE_URL": {
|
||||
"fromParameterStore": "/Prod/integrations/DATABASE_URL"
|
||||
},
|
||||
"API_TOKEN": {
|
||||
"fromParameterStore": "/Prod/integrations/API_TOKEN"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "p-db",
|
||||
"name": "Prod Database",
|
||||
"type": "rds",
|
||||
"engine": "postgres",
|
||||
"applyChangesImmediately": true,
|
||||
"engineVersion": "14",
|
||||
"autoUpgradeMinorVersions": true,
|
||||
"instanceSize": "db.m5.2xlarge",
|
||||
"storage": 4000,
|
||||
"maxStorage": 4000,
|
||||
"private": false,
|
||||
"deletionProtection": true,
|
||||
"port": 5432
|
||||
},
|
||||
{
|
||||
"id": "p-redis",
|
||||
"name": "Prod Redis",
|
||||
"type": "elasticache",
|
||||
"engine": "redis",
|
||||
"engineVersion": "7.0",
|
||||
"instanceSize": "cache.m5.large",
|
||||
"connectionStringEnvVarName": "REDIS_URL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "staging",
|
||||
"name": "Staging",
|
||||
"region": "us-east-1",
|
||||
"source": {
|
||||
"branch": "dev",
|
||||
"trigger": "push"
|
||||
},
|
||||
"envVariables": {
|
||||
"PULSAR_ISSUER_URL": "https://auth.streamnative.cloud/",
|
||||
"PULSAR_AUDIENCE": {
|
||||
"fromParameterStore": "/Prod/Pulsar/Audience"
|
||||
},
|
||||
"PULSAR_TENANT": "triggerdotdev-staging",
|
||||
"PULSAR_WORKFLOWS_NAMESPACE": "workflows",
|
||||
"PULSAR_QUEUES_NAMESPACE": "queues",
|
||||
"PULSAR_SERVICE_URL": {
|
||||
"fromParameterStore": "/Prod/Pulsar/ServiceURL"
|
||||
},
|
||||
"DOCKER_USERNAME": "maverickdotdev",
|
||||
"DOCKER_PASSWORD": {
|
||||
"fromParameterStore": "/Docker/Password"
|
||||
}
|
||||
},
|
||||
"services": [
|
||||
{
|
||||
"id": "s-webapp",
|
||||
"name": "Staging Webapp",
|
||||
"type": "fargate",
|
||||
"buildType": "docker",
|
||||
"dockerfilePath": "./apps/webapp/Dockerfile",
|
||||
"dockerContext": ".",
|
||||
"cpu": 1,
|
||||
"memory": 2,
|
||||
"minInstances": 2,
|
||||
"maxInstances": 2,
|
||||
"domain": "app-staging.trigger.dev",
|
||||
"port": 3000,
|
||||
"healthCheckPath": "/healthcheck",
|
||||
"watchPaths": [
|
||||
"apps/webapp/app/**",
|
||||
"apps/webapp/public/**",
|
||||
"apps/webapp/Dockerfile",
|
||||
"apps/webapp/package.json",
|
||||
"apps/webapp/server.ts",
|
||||
"apps/webapp/remix.config.js",
|
||||
"apps/webapp/tailwind.config.js",
|
||||
"apps/webapp/tsconfig.json",
|
||||
"apps/webapp/postcss.config.js",
|
||||
"apps/webapp/styles/**",
|
||||
"apps/webapp/prisma/**",
|
||||
"apps/webapp/types/**",
|
||||
"packages/internal-platform/src/**",
|
||||
"packages/common-schemas/src/**",
|
||||
"integrations/*/src/**",
|
||||
"packages/integration-catalog/src/**",
|
||||
"packages/emails/src/**",
|
||||
"packages/emails/emails/**",
|
||||
"packages/internal-pulsar/src/**",
|
||||
"./pnpm-lock.yaml"
|
||||
],
|
||||
"dependsOn": [
|
||||
"s-db"
|
||||
],
|
||||
"envVariables": {
|
||||
"APP_ENV": "staging",
|
||||
"FROM_EMAIL": "Trigger.dev <hello@email.trigger.dev>",
|
||||
"REPLY_TO_EMAIL": "hello@trigger.dev",
|
||||
"RESEND_API_KEY": {
|
||||
"fromParameterStore": "/Staging/webapp/RESEND_API_KEY"
|
||||
},
|
||||
"SENTRY_DSN": {
|
||||
"fromParameterStore": "SENTRY_DSN"
|
||||
},
|
||||
"SENTRY_PROJECT": "triggerdev-web",
|
||||
"SENTRY_ORG": "triggerdev",
|
||||
"SENTRY_AUTH_TOKEN": {
|
||||
"fromParameterStore": "SENTRY_AUTH_TOKEN"
|
||||
},
|
||||
"SESSION_SECRET": {
|
||||
"fromParameterStore": "/Staging/webapp/SESSION_SECRET"
|
||||
},
|
||||
"MAGIC_LINK_SECRET": {
|
||||
"fromParameterStore": "/Staging/webapp/MAGIC_LINK_SECRET"
|
||||
},
|
||||
"GITHUB_CLIENT_ID": "2da3c8e5c6e4e0a7964f",
|
||||
"GITHUB_SECRET": {
|
||||
"fromParameterStore": "/Staging/webapp/GITHUB_SECRET"
|
||||
},
|
||||
"DATABASE_URL": {
|
||||
"fromService": {
|
||||
"id": "s-db",
|
||||
"value": "dbConnectionString"
|
||||
}
|
||||
},
|
||||
"PULSAR_CLIENT_ID": {
|
||||
"fromParameterStore": "/Staging/Pulsar/webapp/ClientId"
|
||||
},
|
||||
"PULSAR_CLIENT_SECRET": {
|
||||
"fromParameterStore": "/Staging/Pulsar/webapp/ClientSecret"
|
||||
},
|
||||
"PULSAR_ROLE": {
|
||||
"fromParameterStore": "/Staging/Pulsar/webapp/Role"
|
||||
},
|
||||
"PIZZLY_HOST": "https://auth-staging.trigger.dev",
|
||||
"PIZZLY_SECRET_KEY": {
|
||||
"fromParameterStore": "/Staging/webapp/PIZZLY_SECRET_KEY"
|
||||
},
|
||||
"POSTHOG_PROJECT_KEY": {
|
||||
"fromParameterStore": "/Staging/webapp/POSTHOG_PROJECT_KEY"
|
||||
},
|
||||
"TRIGGER_LOG_LEVEL": "debug",
|
||||
"PULSAR_ENABLED": "1",
|
||||
"PULSAR_DEBUG": true,
|
||||
"GITHUB_APP_NAME": "trigger-dev-staging",
|
||||
"GITHUB_APP_ID": "294080",
|
||||
"GITHUB_APP_CLIENT_ID": {
|
||||
"fromParameterStore": "/Staging/webapp/GITHUB_APP_CLIENT_ID"
|
||||
},
|
||||
"GITHUB_APP_CLIENT_SECRET": {
|
||||
"fromParameterStore": "/Staging/webapp/GITHUB_APP_CLIENT_SECRET"
|
||||
},
|
||||
"GITHUB_APP_PRIVATE_KEY": {
|
||||
"fromParameterStore": "/Staging/webapp/GITHUB_APP_PRIVATE_KEY"
|
||||
},
|
||||
"GITHUB_APP_WEBHOOK_SECRET": {
|
||||
"fromParameterStore": "/Staging/webapp/GITHUB_APP_WEBHOOK_SECRET"
|
||||
},
|
||||
"INTEGRATIONS_API_KEY": {
|
||||
"fromParameterStore": "/Staging/integrations/API_TOKEN"
|
||||
},
|
||||
"INTEGRATIONS_API_ORIGIN": "https://integrations-staging.trigger.dev",
|
||||
"CAKEWORK_API_KEY": {
|
||||
"fromParameterStore": "/Staging/webapp/CAKEWORK_API_KEY"
|
||||
},
|
||||
"TRIGGER_WSS_URL": "wss://wss-staging.trigger.dev/ws"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "s-wss",
|
||||
"name": "Staging WSS",
|
||||
"type": "fargate",
|
||||
"buildType": "docker",
|
||||
"dockerfilePath": "./apps/wss/Dockerfile",
|
||||
"dockerContext": ".",
|
||||
"cpu": 0.5,
|
||||
"memory": 1,
|
||||
"minInstances": 2,
|
||||
"maxInstances": 2,
|
||||
"domain": "wss-staging.trigger.dev",
|
||||
"port": 8889,
|
||||
"healthCheckPath": "/healthcheck",
|
||||
"watchPaths": [
|
||||
"apps/wss/src/**",
|
||||
"apps/wss/tsconfig.json",
|
||||
"apps/wss/tsup.config.ts",
|
||||
"apps/wss/package.json",
|
||||
"packages/internal-platform/src/**",
|
||||
"packages/internal-bridge/src/**",
|
||||
"packages/common-schemas/src/**",
|
||||
"packages/internal-pulsar/src/**",
|
||||
"./pnpm-lock.yaml"
|
||||
],
|
||||
"envVariables": {
|
||||
"PULSAR_CLIENT_ID": {
|
||||
"fromParameterStore": "/Staging/Pulsar/wss/ClientId"
|
||||
},
|
||||
"PULSAR_CLIENT_SECRET": {
|
||||
"fromParameterStore": "/Staging/Pulsar/wss/ClientSecret"
|
||||
},
|
||||
"PULSAR_ROLE": {
|
||||
"fromParameterStore": "/Staging/Pulsar/wss/Role"
|
||||
},
|
||||
"PLATFORM_API_URL": "https://app-staging.trigger.dev",
|
||||
"TRIGGER_LOG_LEVEL": "debug",
|
||||
"SENTRY_DSN": {
|
||||
"fromParameterStore": "/wss/SENTRY_DSN"
|
||||
},
|
||||
"APP_ENV": "staging"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "s-integrations",
|
||||
"name": "Staging integrations",
|
||||
"type": "fargate",
|
||||
"buildType": "docker",
|
||||
"dockerfilePath": "./apps/integrations/Dockerfile",
|
||||
"dockerContext": ".",
|
||||
"cpu": 1,
|
||||
"memory": 2,
|
||||
"minInstances": 1,
|
||||
"maxInstances": 2,
|
||||
"domain": "integrations-staging.trigger.dev",
|
||||
"port": 3006,
|
||||
"healthCheckPath": "/healthcheck",
|
||||
"watchPaths": [
|
||||
"apps/integrations/src/**",
|
||||
"apps/integrations/tsconfig.json",
|
||||
"apps/integrations/tsup.config.ts",
|
||||
"apps/integrations/package.json",
|
||||
"./pnpm-lock.yaml"
|
||||
],
|
||||
"envVariables": {
|
||||
"DATABASE_URL": {
|
||||
"fromParameterStore": "/Staging/integrations/DATABASE_URL"
|
||||
},
|
||||
"API_TOKEN": {
|
||||
"fromParameterStore": "/Staging/integrations/API_TOKEN"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "s-db",
|
||||
"name": "Staging Database",
|
||||
"type": "rds",
|
||||
"engine": "postgres",
|
||||
"applyChangesImmediately": true,
|
||||
"engineVersion": "14",
|
||||
"autoUpgradeMinorVersions": true,
|
||||
"instanceSize": "db.t3.large",
|
||||
"storage": 100,
|
||||
"maxStorage": 400,
|
||||
"private": false,
|
||||
"deletionProtection": true,
|
||||
"port": 5432
|
||||
},
|
||||
{
|
||||
"id": "s-redis",
|
||||
"name": "Staging Redis",
|
||||
"type": "elasticache",
|
||||
"engine": "redis",
|
||||
"engineVersion": "7.0",
|
||||
"instanceSize": "cache.t3.small",
|
||||
"connectionStringEnvVarName": "REDIS_URL"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+2
-2
@@ -17,8 +17,8 @@
|
||||
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
||||
"generate": "turbo run generate",
|
||||
"lint": "turbo run lint",
|
||||
"docker:services": "docker-compose -f docker/compose-without-app.yml up -d",
|
||||
"docker:services:stop": "docker-compose -f docker/compose-without-app.yml stop",
|
||||
"docker:services": "docker-compose -p v2services -f docker/compose-without-app.yml up -d",
|
||||
"docker:services:stop": "docker-compose -p v2services -f docker/compose-without-app.yml stop",
|
||||
"docker:app": "docker-compose -p triggerv2 -f docker/compose.yml up -d",
|
||||
"docker:app:build": "docker-compose -p triggerv2 -f docker/compose.yml build webapp",
|
||||
"docker:app:stop": "docker-compose -p triggerv2 -f docker/compose.yml stop",
|
||||
|
||||
+33
-13
@@ -2,7 +2,9 @@
|
||||
"$schema": "https://turborepo.org/schema.json",
|
||||
"pipeline": {
|
||||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"outputs": [
|
||||
"dist/**",
|
||||
"public/build/**",
|
||||
@@ -12,12 +14,20 @@
|
||||
]
|
||||
},
|
||||
"webapp#start": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["public/build/**"]
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"outputs": [
|
||||
"public/build/**"
|
||||
]
|
||||
},
|
||||
"start": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": ["public/build/**"]
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"outputs": [
|
||||
"public/build/**"
|
||||
]
|
||||
},
|
||||
"db:generate": {
|
||||
"cache": false
|
||||
@@ -35,7 +45,9 @@
|
||||
"cache": false
|
||||
},
|
||||
"generate": {
|
||||
"dependsOn": ["^generate"]
|
||||
"dependsOn": [
|
||||
"^generate"
|
||||
]
|
||||
},
|
||||
"lint": {
|
||||
"outputs": []
|
||||
@@ -52,16 +64,22 @@
|
||||
"cache": false
|
||||
},
|
||||
"test:e2e:dev": {
|
||||
"dependsOn": ["^build"],
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"outputs": [],
|
||||
"cache": false
|
||||
},
|
||||
"test:e2e:ci": {
|
||||
"dependsOn": ["^build"],
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
"typecheck": {
|
||||
"dependsOn": ["^build"],
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
"clean": {
|
||||
@@ -77,7 +95,9 @@
|
||||
"cache": false
|
||||
}
|
||||
},
|
||||
"globalDependencies": [".env"],
|
||||
"globalDependencies": [
|
||||
".env"
|
||||
],
|
||||
"globalEnv": [
|
||||
"NODE_ENV",
|
||||
"REMIX_APP_PORT",
|
||||
@@ -88,8 +108,8 @@
|
||||
"LOGIN_ORIGIN",
|
||||
"POSTHOG_PROJECT_KEY",
|
||||
"MAGIC_LINK_SECRET",
|
||||
"GITHUB_CLIENT_ID",
|
||||
"GITHUB_SECRET",
|
||||
"AUTH_GITHUB_CLIENT_ID",
|
||||
"AUTH_GITHUB_CLIENT_SECRET",
|
||||
"SENTRY_DSN",
|
||||
"FROM_EMAIL",
|
||||
"REPLY_TO_EMAIL",
|
||||
@@ -101,4 +121,4 @@
|
||||
"APP_ENV",
|
||||
"APP_LOG_LEVEL"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user