Skip to content

Commit

Permalink
Update paths to simplify mail templates (not fully secured yet).
Browse files Browse the repository at this point in the history
  • Loading branch information
digisomni committed Sep 13, 2024
1 parent 222a80d commit 738329a
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 26 deletions.
97 changes: 97 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# DB variables -------------------
DB_HOST=mongodb_container
DB_PORT=27017
DB_NAME=tester
DB_USER=metaverse
DB_PASSWORD=nooneknowsit
DB_AUTHDB=admin
DATABASE_URL=

# REDIS variables -------------------
REDIS_URL=redis://redis_container:6379

# Authentication variables -------------------
AUTH_SECRET=M7iszvStilkptn22GT4/NbFGY=

# Server variables ---------------
SERVER_HOST=
SERVER_PORT=3030
SERVER_VERSION=1.1.1-20200101-abcdefg

# General ------------------------
LOCAL=true

# Mode development and production -----------
APP_ENV=development
PUBLIC_PATH=./public

# Metaverse ------------------------
METAVERSE_NAME=Vircadia noobie
METAVERSE_NICK_NAME=Noobie
METAVERSE_SERVER_URL=https://api.vircadia.com:3030
DEFAULT_ICE_SERVER_URL=
DASHBOARD_URL=https://dashboard.vircadia.com
LISTEN_HOST=0.0.0.0

LISTEN_PORT=3030
ENABLE_ACCOUNT_VERIFICATION=false
ENABLE_ACCOUNT_VERIFICATION=true
START_LEVEL=1

# Client variables ---------------
APP_TITLE=Vircadia Metaverse
APP_LOGO=https://vircadia.com/img/logo-1.png
APP_URL=https://dashboard.vircadia.com
APP_HOST=localhost
APP_PORT=80

# - Route 53 ------------
ROUTE53_HOSTED_ZONE_ID=
ROUTE53_ACCESS_KEY_ID=
ROUTE53_ACCESS_KEY_SECRET=

# - keys
STORAGE_AWS_ACCESS_KEY_ID=
STORAGE_AWS_ACCESS_KEY_SECRET=
# --------------------------------

# - S3 ----------
STORAGE_S3_REGION=
STORAGE_S3_STATIC_RESOURCE_BUCKET=
STORAGE_S3_AVATAR_DIRECTORY=avatars
AWS_STORAGE_PROVIDER=
# Possible values:
# local - for local development,
# dev - for live development environment,
# <empty or not defined> - for production environment,
STORAGE_S3_DEV_MODE=local


# - Storage provider aws or local ------------
STORAGE_PROVIDER=local
LOCAL_STORAGE_PROVIDER=localhost:8642
LOCAL_STORAGE_PROVIDER_PORT=8642

# - Email ----------
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_SECURE=true
SMTP_USER=
SMTP_PASS=
SMTP_EMAIL_FROM=

# - Google Authentication Service -----------
GOOGLE_CALLBACK_URL=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# - Faceebook Authentication Service ----------
FACEBOOK_CALLBACK_URL=
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=

# - Blockchain ----------------
#Hardhat test account private key - replace with a real one
MINTER_PRIVATE_KEY=
#Replace with real Infura node URL
ETH_RPC_URL=
File renamed without changes.
38 changes: 19 additions & 19 deletions public/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
const fs = require('fs');
const path = require('path');
var globby = require('globby');
var async = require('async');
// const fs = require('fs');
// const path = require('path');
// var globby = require('globby');
// var async = require('async');

const mailtemplatesPath = process.env.NODE_ENV
? '../mailtemplates'
: '../../mailtemplates';
// const mailtemplatesPath = process.env.NODE_ENV
// ? '../mailtemplates'
// : '../../mailtemplates';

const files = fs
.readdirSync(path.join(__dirname, mailtemplatesPath))
.filter((file: any) => file.indexOf('.html') > -1);
// const files = fs
// .readdirSync(path.join(__dirname, mailtemplatesPath))
// .filter((file: any) => file.indexOf('.html') > -1);

async.each(files, function (file: any) {
fs.writeFile(
path.join(__dirname, `${file}`),
fs.readFileSync(path.join(__dirname, `${mailtemplatesPath}/${file}`)),
(err: any) => {
if (err) throw err;
}
);
});
// async.each(files, function (file: any) {
// fs.writeFile(
// path.join(__dirname, `${file}`),
// fs.readFileSync(path.join(__dirname, `${mailtemplatesPath}/${file}`)),
// (err: any) => {
// if (err) throw err;
// }
// );
// });
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import channels from './channels';
import { HookContext as FeathersHookContext } from '@feathersjs/feathers';
import authentication from './authentication';
import mongodb from './mongodb';
import importDir from 'directory-import';
import socketio from '@feathersjs/socketio';
import { initMonitoring } from './common/Monitoring/Monitoring';
import { initDomains } from './common/DomainFields';
Expand Down Expand Up @@ -96,8 +95,4 @@ app.use(express.errorHandler({ logger } as any));

app.hooks(appHooks);

const importedModules = importDir({
directoryPath: '../mailtemplates',
});

export default app;
4 changes: 2 additions & 2 deletions src/appconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ const metaverseServer = {
email_verification_timeout_minutes: 1440,
enable_account_email_verification:
process.env.ENABLE_ACCOUNT_VERIFICATION ?? 'true',
email_verification_email_body: '../mailtemplates/verificationEmail.html',
email_reset_password_otp_body: '../mailtemplates/resetPasswordOtp.html',
email_verification_email_body: './verificationEmail.html',
email_reset_password_otp_body: './resetPasswordOtp.html',
email_verification_success_redirect:
'METAVERSE_SERVER_URL/verificationEmailSuccess.html',
email_verification_failure_redirect:
Expand Down

0 comments on commit 738329a

Please sign in to comment.