diff --git a/.gitignore b/.gitignore index 1a11f6419..65ceecaf1 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,10 @@ next-env.d.ts apps/web/scripts-dist # File uploads in development +apps/web/uploads +apps/web/public/uploads + +# Temporal tmp # Misc diff --git a/apps/infra/src/app/production/shared.ts b/apps/infra/src/app/production/shared.ts index 6854e4b9e..c6e7bb725 100644 --- a/apps/infra/src/app/production/shared.ts +++ b/apps/infra/src/app/production/shared.ts @@ -150,6 +150,10 @@ export const environment = pulumi { name: 'DRIVE_DISK', value: 's3' }, { name: 'ASW_REGION', value: 'eu-central-1' }, { name: 'S3_BUCKET', value: 'latitude-llm-bucket-production' }, + { + name: 'PUBLIC_S3_BUCKET', + value: 'latitude-llm-public-bucket-production', + }, { name: 'AWS_ACCESS_KEY', value: awsAccessKey }, { name: 'AWS_ACCESS_SECRET', value: awsAccessSecret }, { name: 'DEFAULT_PROJECT_ID', value: defaultProjectId }, diff --git a/docker-compose.yml b/docker-compose.yml index fd9a38d41..c77b187a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,6 +62,7 @@ services: - DRIVE_DISK=local - FILE_PUBLIC_PATH='uploads' - FILES_STORAGE_PATH='/app' + - PUBLIC_FILES_STORAGE_PATH='/app/public' - DEFAULT_PROJECT_ID=1 - DEFAULT_PROVIDER_API_KEY=d32da7c2-94fd-49c3-8dca-b57a5c3bbe27 - NEXT_PUBLIC_POSTHOG_KEY='' @@ -100,6 +101,7 @@ services: - DRIVE_DISK=local - FILE_PUBLIC_PATH='uploads' - FILES_STORAGE_PATH='/app' + - PUBLIC_FILES_STORAGE_PATH='/app/public' - DEFAULT_PROJECT_ID=1 - DEFAULT_PROVIDER_API_KEY=d32da7c2-94fd-49c3-8dca-b57a5c3bbe27 - NEXT_PUBLIC_POSTHOG_KEY='' diff --git a/packages/env/src/index.ts b/packages/env/src/index.ts index d4305d004..882744a58 100644 --- a/packages/env/src/index.ts +++ b/packages/env/src/index.ts @@ -12,9 +12,10 @@ const FILE_PUBLIC_PATH = 'uploads' if (environment === 'development' || environment === 'test') { const pathToEnv = resolve(cwd(), `../../.env.${environment}`) - const FILES_STORAGE_PATH = join( + const FILES_STORAGE_PATH = join(__dirname, `../../../../${FILE_PUBLIC_PATH}`) + const PUBLIC_FILES_STORAGE_PATH = join( __dirname, - `../../../../tmp/${FILE_PUBLIC_PATH}`, + `../../../../public/${FILE_PUBLIC_PATH}`, ) dotenv.populate( @@ -40,6 +41,7 @@ if (environment === 'development' || environment === 'test') { DRIVE_DISK: 'local', FILE_PUBLIC_PATH, FILES_STORAGE_PATH, + PUBLIC_FILES_STORAGE_PATH, DEFAULT_PROJECT_ID: '1', NEXT_PUBLIC_POSTHOG_KEY: '', NEXT_PUBLIC_POSTHOG_HOST: '', @@ -86,12 +88,14 @@ export const env = createEnv({ CACHE_PORT: z.coerce.number().optional().default(6379), DRIVE_DISK: z.union([z.literal('local'), z.literal('s3')]).optional(), FILES_STORAGE_PATH: z.string().optional(), + PUBLIC_FILES_STORAGE_PATH: z.string().optional(), FILE_PUBLIC_PATH: z.string().optional(), MAILER_API_KEY: z.string().optional(), MAILGUN_MAILER_API_KEY: z.string().optional(), QUEUE_PASSWORD: z.string().optional(), QUEUE_PORT: z.coerce.number().optional().default(6379), S3_BUCKET: z.string().optional(), + PUBLIC_S3_BUCKET: z.string().optional(), SENTRY_DSN: z.string().optional(), SENTRY_ORG: z.string().optional(), SENTRY_PROJECT: z.string().optional(), diff --git a/turbo.json b/turbo.json index 66e57e7e7..fb3244fdc 100644 --- a/turbo.json +++ b/turbo.json @@ -16,9 +16,11 @@ "GATEWAY_SSL", "DRIVE_DISK", "FILES_STORAGE_PATH", + "PUBLIC_FILES_STORAGE_PATH", "FILE_PUBLIC_PATH", "AWS_REGION", "S3_BUCKET", + "PUBLIC_S3_BUCKET", "AWS_ACCESS_KEY", "AWS_ACCESS_SECRET", "WORKERS_PORT",