Browse Source

rename variables with S3_ (from AWS_)

pull/1/head
Trent Larson 8 months ago
parent
commit
eccc6a1835
  1. 24
      .env.sample
  2. 10
      server.js

24
.env.sample

@ -1,16 +1,18 @@
#AWS_ACCESS_KEY=??? # These settings work for American Cloud.
#AWS_BUCKET_NAME=giftsimagetest #S3_ACCESS_KEY=???
#AWS_ENDPOINT_SERVER=a2-west.americancloud.com #S3_BUCKET_NAME=giftsimagetest
#AWS_REGION=US #S3_ENDPOINT_SERVER=a2-west.americancloud.com
#AWS_SECRET_KEY=??? #S3_REGION=US
#S3_SECRET_KEY=???
#S3_SET_ACL=true #S3_SET_ACL=true
AWS_ACCESS_KEY=??? # These settings work for AWS.
AWS_BUCKET_NAME=gifts-image-test S3_ACCESS_KEY=???
AWS_ENDPOINT_SERVER=gifts-image-test.s3.amazonaws.com S3_BUCKET_NAME=gifts-image-test
AWS_REGION=us-west-1 S3_ENDPOINT_SERVER=gifts-image-test.s3.amazonaws.com
AWS_SECRET_KEY=??? S3_REGION=us-west-1
#S3_SET_ACL=false S3_SECRET_KEY=???
S3_SET_ACL=false
# needed to check limits # needed to check limits
#ENDORSER_API_URL=http://localhost:3000 #ENDORSER_API_URL=http://localhost:3000

10
server.js

@ -19,7 +19,7 @@ app.use(cors());
const port = process.env.PORT || 3001; const port = process.env.PORT || 3001;
// file name also referenced in flyway.conf and potentially in .env files or in environment variables // file name also referenced in flyway.conf and potentially in .env files or in environment variables
const dbFile = process.env.SQLITE_FILE || './image-db.sqlite'; const dbFile = process.env.SQLITE_FILE || './image-db.sqlite';
const bucketName = process.env.AWS_BUCKET_NAME || 'gifts-image-test'; const bucketName = process.env.S3_BUCKET_NAME || 'gifts-image-test';
const imageServer = process.env.DOWNLOAD_IMAGE_SERVER || 'test-image.timesafari.app'; const imageServer = process.env.DOWNLOAD_IMAGE_SERVER || 'test-image.timesafari.app';
const ethrDidResolver = getResolver; const ethrDidResolver = getResolver;
@ -41,12 +41,12 @@ const endorserApiUrl = process.env.ENDORSER_API_URL || 'https://test-api.endorse
// Configure AWS // Configure AWS
const s3Client = new S3Client({ const s3Client = new S3Client({
endpoint: 'https://' + process.env.AWS_ENDPOINT_SERVER, endpoint: 'https://' + process.env.S3_ENDPOINT_SERVER,
region: process.env.AWS_REGION, region: process.env.S3_REGION,
forcePathStyle: true, forcePathStyle: true,
credentials: { credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY, accessKeyId: process.env.S3_ACCESS_KEY,
secretAccessKey: process.env.AWS_SECRET_KEY secretAccessKey: process.env.S3_SECRET_KEY
} }
}); });

Loading…
Cancel
Save