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

Change AWS S3 env var names #55

Merged
merged 2 commits into from
Oct 9, 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
5 changes: 5 additions & 0 deletions .changeset/sharp-toes-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lookit/data": patch
---

Update AWS environment variable names to avoid naming conflicts with RecordRTC AWS variables.
8 changes: 4 additions & 4 deletions packages/data/src/environment.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
S3_REGION: string;
S3_ACCESS_KEY_ID: string;
S3_SECRET_ACCESS_KEY: string;
S3_BUCKET: string;
JSPSYCH_S3_REGION: string;
JSPSYCH_S3_ACCESS_KEY_ID: string;
JSPSYCH_S3_SECRET_ACCESS_KEY: string;
JSPSYCH_S3_BUCKET: string;
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/data/src/lookitS3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LookitS3 {
private s3: S3Client;
private uploadId: string = "";
private key: string;
private bucket: string = process.env.S3_BUCKET;
private bucket: string = process.env.JSPSYCH_S3_BUCKET;
private complete: boolean = false;

public static readonly minUploadSize: number = 5 * 1024 * 1024;
Expand All @@ -30,10 +30,10 @@ class LookitS3 {
this.key = key;
try {
this.s3 = new S3Client({
region: process.env.S3_REGION,
region: process.env.JSPSYCH_S3_REGION,
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
accessKeyId: process.env.JSPSYCH_S3_ACCESS_KEY_ID,
secretAccessKey: process.env.JSPSYCH_S3_SECRET_ACCESS_KEY,
},
});
} catch (e) {
Expand Down