Skip to content

Commit 6b94c4b

Browse files
authored
Merge branch 'HarkerRobo:main' into patch-1
2 parents 0d54d96 + 4d8a880 commit 6b94c4b

24 files changed

Lines changed: 249 additions & 4372 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ The config file should be stored as `config.json`. You can copy from the example
107107
| database.databaseName | "robotics-website" | The name of the database used for this program. |
108108
| automail.singleMentorMail | true | Whether to send the email for purchase requests to a mentor once per day or after every purchase request (set to `true` if only once per day) |
109109
| automail.cronPattern | "0 17 \* \* \*" | The cron pattern for scheduling emails if `automail.singleMentorMail` is true (use the example value to send at 5 P.M. every day). |
110-
| automail.auth.user | "22arjund@students.harker.org" | The email address to send from |
111-
| automail.auth.pass | "password" | The password of the nodemail user
110+
| automail.auth.user | "22arjund@students.harker.org" | The email address to send from |
111+
| automail.auth.pass | "password" | The password of the nodemail user |
112112
| photos.host | "https://photos.harker.org" | The website hosting the photos of students |
113113
| photos.auth | "key" | The API key used to access the photos |
114114
| users.admins | ["22angiej@students.harker.org", "22ethanc@students.harker.org", "22gloriaz@students.harker.org"] | The array of google email addresses of the admins. |

helpers/email.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ var transporter = nodemailer.createTransport({
66
port: config.automail.auth.port,
77
secure: config.automail.auth.secure,
88
auth: {
9-
user: config.automail.auth.username,
10-
pass: config.automail.auth.password
9+
user: config.automail.auth.username,
10+
pass: config.automail.auth.password,
1111
},
12-
tls: { rejectUnauthorized: false }
12+
tls: { rejectUnauthorized: false },
1313
});
1414

1515
const sendMail = (from, to, subject, text, html) => {
@@ -28,6 +28,6 @@ const sendMail = (from, to, subject, text, html) => {
2828
console.log("Email sent: " + info.response);
2929
}
3030
});
31-
}
31+
};
3232

3333
exports.sendMail = sendMail;

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function getTimeFormatted() {
3636

3737
app.set("view engine", "ejs");
3838
app.set("views", __dirname + "/views");
39-
app.set("env", "production");
39+
app.set("env", config.server.runInternal ? "production" : "development");
4040
app.set("case sensitive routing", true);
4141
if (config.server.production) app.set("trust proxy", 1);
4242

@@ -55,14 +55,17 @@ app.use(clientErrorHandler);
5555
//TODO: Route mobile
5656

5757
// use routers
58-
if (config.server.runInternal) app.use("/member", memberRouter);
58+
// if (config.server.runInternal)
59+
app.use("/member", memberRouter);
60+
5961
if (config.server.runInternal)
6062
app.use("/scoutdata", require("./routers/scoutdata"));
6163
app.use("/battery", batteryRouter);
6264
app.use("/blog", blogsRouter);
6365

6466
app.locals.GoogleClientID = config.google.clientIDs[config.google.displayID];
6567
app.locals.config = config;
68+
app.locals.isProduction = config.server.runInternal;
6669
app.locals.ranks = require("./helpers/ranks.json");
6770

6871
app.use("/hackathon", hackathonRouter);

0 commit comments

Comments
 (0)