Merge pull request #141 from natecarlson/flexible-s3-url

Make S3 URL protocol explicit
This commit is contained in:
Luke Berndt
2023-04-08 13:00:48 -04:00
committed by GitHub
4 changed files with 8 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ var fs = require('fs');
const s3 = require('aws-sdk');
const { events } = require('../models/event');
var s3_endpoint = process.env['S3_ENDPOINT'] != null ? process.env['S3_ENDPOINT'] : 's3.us-west-1.wasabisys.com';
var s3_endpoint = process.env['S3_ENDPOINT'] != null ? process.env['S3_ENDPOINT'] : 'https://s3.us-west-1.wasabisys.com';
var s3_bucket = process.env['S3_BUCKET'] != null ? process.env['S3_BUCKET'] : 'openmhz-west';
var s3_profile = process.env['S3_PROFILE'] != null ? process.env['S3_PROFILE'] : 'wasabi-account';
@@ -279,8 +279,8 @@ const packageEvent = (eventId) => {
createEventZip(tmpEventFolder, zipFile, eventFolder);
await uploadFile(zipFile, s3ZipFile);
const downloadUrl = 'https://' + s3_endpoint + "/" + s3_bucket + "/" + s3ZipFile;
const podcastUrl = 'https://' + s3_endpoint + "/" + s3_bucket + "/" + s3PodcastFile;
const downloadUrl = s3_endpoint + "/" + s3_bucket + "/" + s3ZipFile;
const podcastUrl = s3_endpoint + "/" + s3_bucket + "/" + s3PodcastFile;
event.downloadUrl = downloadUrl;
event.podcastUrl = podcastUrl;
await event.save();

View File

@@ -13,7 +13,7 @@ var secrets = require("../config/secrets");
var util = require("util")
var config = require('../config/config.json');
var s3_endpoint = process.env['S3_ENDPOINT'] != null ? process.env['S3_ENDPOINT'] : 's3.us-west-1.wasabisys.com';
var s3_endpoint = process.env['S3_ENDPOINT'] != null ? process.env['S3_ENDPOINT'] : 'https://s3.us-west-1.wasabisys.com';
var s3_bucket = process.env['S3_BUCKET'] != null ? process.env['S3_BUCKET'] : 'openmhz-west';
var s3_profile = process.env['S3_PROFILE'] != null ? process.env['S3_PROFILE'] : 'wasabi-account';
@@ -157,7 +157,7 @@ exports.upload = function (req, res, next) {
// If not a pro plan, use S3 storage
var url = 'https://' + s3_endpoint + "/" + s3_bucket + "/" + object_key;
var url = s3_endpoint + "/" + s3_bucket + "/" + object_key;
var objectStore = true;

View File

@@ -5,7 +5,7 @@ export REACT_APP_ADMIN_EMAIL="admin@email.com"
export DOMAIN_NAME="openmhz.com"
export S3_PROFILE='default'
export S3_ENDPOINT='s3.us-west-1.wasabisys.com'
export S3_ENDPOINT='https://s3.us-west-1.wasabisys.com'
export S3_BUCKET='openmhz-test'
export TAG=2.0

View File

@@ -5,7 +5,7 @@ export REACT_APP_ADMIN_EMAIL="admin@email.com"
export DOMAIN_NAME="openmhz.test"
export S3_PROFILE='default'
export S3_ENDPOINT='s3.us-west-1.wasabisys.com'
export S3_ENDPOINT='https://s3.us-west-1.wasabisys.com'
export S3_BUCKET='openmhz-test'
export TAG=2.0
@@ -25,4 +25,4 @@ export REACT_APP_COOKIE_DOMAIN=".${DOMAIN_NAME}"
export TWITTER_CONSUMER_KEY=""
export TWITTER_CONSUMER_SECRET=""
export TWITTER_ACCESS_TOKEN_KEY=""
export TWITTER_ACCESS_TOKEN_SECRET=""
export TWITTER_ACCESS_TOKEN_SECRET=""