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

New public bucket envars #717

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions apps/infra/src/app/production/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=''
Expand Down Expand Up @@ -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=''
Expand Down
8 changes: 6 additions & 2 deletions packages/env/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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: '',
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 2 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading