From 96a65ab5f9c7d6e6e4c54d00f9f8200c9ff378a3 Mon Sep 17 00:00:00 2001
From: Gavin Mogan
Date: Tue, 22 Apr 2025 17:46:04 -0700
Subject: fix #197 by running through npm so version env is set
---
Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Dockerfile b/Dockerfile
index 61947a8..0db75ce 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,4 +16,4 @@ FROM node:20-alpine
ENV NODE_ENV=production
WORKDIR /app
COPY --from=BUILD_IMAGE /app ./
-CMD ["node", "dist/start.js"]
+CMD ["npm", "run", "start"]
--
cgit v1.2.3
From 2520ba69933e17f6ef7f8cc11f803de3e66b179f Mon Sep 17 00:00:00 2001
From: Gavin Mogan
Date: Tue, 22 Apr 2025 18:11:27 -0700
Subject: Allow url with config information for nodemailer
---
src/lib/config.ts | 1 +
src/lib/email.ts | 80 ++++++++++++++++++++++++++++++-------------------------
src/routes.js | 44 +++---------------------------
3 files changed, 49 insertions(+), 76 deletions(-)
diff --git a/src/lib/config.ts b/src/lib/config.ts
index e8b774a..003a714 100644
--- a/src/lib/config.ts
+++ b/src/lib/config.ts
@@ -28,6 +28,7 @@ export interface GathioConfig {
mongodb_url: string;
};
nodemailer?: {
+ smtp_url?: string;
smtp_server: string;
smtp_port: string;
smtp_username: string;
diff --git a/src/lib/email.ts b/src/lib/email.ts
index 82dd48e..7b7a7a1 100644
--- a/src/lib/email.ts
+++ b/src/lib/email.ts
@@ -1,6 +1,6 @@
import { Request } from "express";
import sgMail from "@sendgrid/mail";
-import nodemailer from "nodemailer";
+import nodemailer, { Transporter } from "nodemailer";
import { getConfig } from "./config.js";
import SMTPTransport from "nodemailer/lib/smtp-transport/index.js";
import { exitWithError } from "./process.js";
@@ -37,32 +37,36 @@ export const initEmailService = async (): Promise => {
console.log("Sendgrid is ready to send emails.");
return true;
case "nodemailer":
- if (
- !config.nodemailer?.smtp_server ||
- !config.nodemailer?.smtp_port
- ) {
- return exitWithError(
- "Nodemailer is configured as the email service, but not all required fields are provided. Please provide all required fields in the config file.",
- );
- }
- const nodemailerConfig = {
- host: config.nodemailer?.smtp_server,
- port: Number(config.nodemailer?.smtp_port) || 587,
- tls: {
- // do not fail on invalid certs
- rejectUnauthorized: false,
- },
- } as SMTPTransport.Options;
+ let nodemailerTransporter:Transporter|undefined = undefined;
+ if (config.nodemailer?.smtp_url) {
+ nodemailerTransporter = nodemailer.createTransport(config.nodemailer?.smtp_url);
+ } else {
+ if (
+ !config.nodemailer?.smtp_server ||
+ !config.nodemailer?.smtp_port
+ ) {
+ return exitWithError(
+ "Nodemailer is configured as the email service, but not all required fields are provided. Please provide all required fields in the config file.",
+ );
+ }
+ const nodemailerConfig = {
+ host: config.nodemailer?.smtp_server,
+ port: Number(config.nodemailer?.smtp_port) || 587,
+ tls: {
+ // do not fail on invalid certs
+ rejectUnauthorized: false,
+ },
+ } as SMTPTransport.Options;
- if (config.nodemailer?.smtp_username) {
- nodemailerConfig.auth = {
- user: config.nodemailer?.smtp_username,
- pass: config.nodemailer?.smtp_password
- };
+ if (config.nodemailer?.smtp_username) {
+ nodemailerConfig.auth = {
+ user: config.nodemailer?.smtp_username,
+ pass: config.nodemailer?.smtp_password
+ };
+ }
+ nodemailerTransporter = nodemailer.createTransport(nodemailerConfig);
}
- const nodemailerTransporter =
- nodemailer.createTransport(nodemailerConfig);
const nodemailerVerified = await nodemailerTransporter.verify();
if (nodemailerVerified) {
console.log("Nodemailer is ready to send emails.");
@@ -110,20 +114,24 @@ export const sendEmail = async (
}
case "nodemailer":
try {
- const nodemailerConfig = {
- host: config.nodemailer?.smtp_server,
- port: Number(config.nodemailer?.smtp_port) || 587,
- } as SMTPTransport.Options;
+ let nodemailerTransporter:Transporter|undefined = undefined;
+ if (config.nodemailer?.smtp_url) {
+ nodemailerTransporter = nodemailer.createTransport(config.nodemailer?.smtp_url);
+ } else {
+ const nodemailerConfig = {
+ host: config.nodemailer?.smtp_server,
+ port: Number(config.nodemailer?.smtp_port) || 587,
+ } as SMTPTransport.Options;
- if (config.nodemailer?.smtp_username) {
- nodemailerConfig.auth = {
- user: config.nodemailer?.smtp_username,
- pass: config.nodemailer?.smtp_password
- };
- }
+ if (config.nodemailer?.smtp_username) {
+ nodemailerConfig.auth = {
+ user: config.nodemailer?.smtp_username,
+ pass: config.nodemailer?.smtp_password
+ };
+ }
- const nodemailerTransporter =
- nodemailer.createTransport(nodemailerConfig);
+ nodemailerTransporter = nodemailer.createTransport(nodemailerConfig);
+ }
await nodemailerTransporter.sendMail({
envelope: {
from: config.general.email,
diff --git a/src/routes.js b/src/routes.js
index 1c132ca..e758e6b 100755
--- a/src/routes.js
+++ b/src/routes.js
@@ -24,6 +24,7 @@ import EventGroup from "./models/EventGroup.js";
import path from "path";
import { activityPubContentType } from "./lib/activitypub.js";
import { hashString } from "./util/generator.js";
+import { initEmailService } from "./lib/email.js";
const config = getConfig();
const domain = config.general.domain;
@@ -43,46 +44,9 @@ const nanoid = customAlphabet(
const router = express.Router();
let sendEmails = false;
-let nodemailerTransporter;
-if (config.general.mail_service) {
- switch (config.general.mail_service) {
- case "sendgrid":
- sgMail.setApiKey(config.sendgrid?.api_key);
- console.log("Sendgrid is ready to send emails.");
- sendEmails = true;
- break;
- case "nodemailer":
- const nodemailerConfig = {
- host: config.nodemailer?.smtp_server,
- port: Number(config.nodemailer?.smtp_port) || 587,
- };
-
- if (config.nodemailer?.smtp_username) {
- nodemailerConfig.auth = {
- user: config.nodemailer?.smtp_username,
- pass: config.nodemailer?.smtp_password
- };
- }
-
- nodemailerTransporter = nodemailer.createTransport(nodemailerConfig);
-
- nodemailerTransporter.verify((error, success) => {
- if (error) {
- console.log(error);
- } else {
- console.log(
- "Nodemailer SMTP server is ready to send emails.",
- );
- sendEmails = true;
- }
- });
- break;
- default:
- console.error(
- "You have not configured this Gathio instance to send emails! This means that event creators will not receive emails when their events are created, which means they may end up locked out of editing events. Consider setting up an email service.",
- );
- }
-}
+initEmailService().then((emailService) => {
+ sendEmails = emailService
+});
router.use(fileUpload());
--
cgit v1.2.3
From 536caa0142fb75d13afe4ebf8a1018e10fd70499 Mon Sep 17 00:00:00 2001
From: Raphael Kabo
Date: Wed, 23 Apr 2025 11:11:19 +0100
Subject: Switch donations card to GitHub Sponsors
---
views/home.handlebars | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/views/home.handlebars b/views/home.handlebars
index 700d875..d5fdb81 100755
--- a/views/home.handlebars
+++ b/views/home.handlebars
@@ -59,13 +59,11 @@
href="https://github.com/lowercasename/gathio/issues">tracker if you encounter any issues.
{{#if showKofi}}
-
-
-
If you find yourself using and enjoying Gathio, consider buying Raphael a coffee. It'll help keep the project
- and main site running!
-
-
+
{{/if}}
--
cgit v1.2.3
From 97807be0cdd2cb0381a478517abedfd3dd0a73b8 Mon Sep 17 00:00:00 2001
From: Raphael Kabo
Date: Wed, 23 Apr 2025 11:22:52 +0100
Subject: Remove deploy workflow
---
.github/workflows/deploy.yaml | 23 -----------------------
1 file changed, 23 deletions(-)
delete mode 100644 .github/workflows/deploy.yaml
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml
deleted file mode 100644
index 1d0330a..0000000
--- a/.github/workflows/deploy.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-name: CI / Deploy
-on:
- workflow_dispatch:
- push:
- branches:
- - main
-
-jobs:
- deploy:
- runs-on: ubuntu-latest
- steps:
- - name: Set up known_hosts file
- run: |
- mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts
- ssh-keyscan ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
-
- - uses: webfactory/ssh-agent@v0.9.1
- with:
- ssh-private-key: ${{ secrets.SSH_KEY }}
-
- - name: Run deploy script
- run: |
- ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd ${{ secrets.DEPLOY_PATH }} && ./deploy.sh'
--
cgit v1.2.3
From 31abcf01165147b9ace7eb6a4dec66d737599218 Mon Sep 17 00:00:00 2001
From: Raphael Kabo
Date: Wed, 23 Apr 2025 13:12:37 +0100
Subject: Bump version to 1.5.2
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 26d1d00..15f5f48 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gathio",
- "version": "1.5.0",
+ "version": "1.5.2",
"description": "A simple, federated, privacy-first event hosting platform",
"main": "index.js",
"type": "module",
@@ -62,4 +62,4 @@
"nodemon": "^2.0.22",
"prettier": "^3.2.5"
}
-}
\ No newline at end of file
+}
--
cgit v1.2.3
From 75d292cbb557f7e327fba5d6e9413f7acf8a3851 Mon Sep 17 00:00:00 2001
From: Raphael
Date: Mon, 28 Apr 2025 10:50:17 +0100
Subject: Create FUNDING.yml
---
.github/FUNDING.yml | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 .github/FUNDING.yml
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000..c0d6816
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,3 @@
+# These are supported funding model platforms
+
+github: [lowercasename]
--
cgit v1.2.3
From 2734ca37953409a3e18969ba37e67f30ed5fb685 Mon Sep 17 00:00:00 2001
From: Raphael
Date: Mon, 28 Apr 2025 10:53:29 +0100
Subject: Add contributors section to README
---
README.md | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/README.md b/README.md
index f30355a..12d63a0 100644
--- a/README.md
+++ b/README.md
@@ -10,3 +10,13 @@ You can use the flagship publicly hosted version [here](https://gath.io).
# Documentation
To learn more about how to use Gathio, or how to set up your own instance, vist our [documentation site](https://docs.gath.io). If the site isn't working, the source documentation files are in the [`docs/` directory](https://github.com/lowercasename/gathio/tree/main/docs).
+
+# Contributors
+
+These amazing people have helped build and support Gathio!
+
+
+
+
+
+Made with [contrib.rocks](https://contrib.rocks).
--
cgit v1.2.3
From e6ac945fb1cf44fd42617bb241f31623e956a066 Mon Sep 17 00:00:00 2001
From: Raphael
Date: Mon, 28 Apr 2025 10:54:14 +0100
Subject: Remove deploy CI badge from README
---
README.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 12d63a0..91647d5 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,6 @@
# gathio
-| [](https://github.com/lowercasename/gathio/actions/workflows/ci.yaml) | [](https://github.com/lowercasename/gathio/actions/workflows/deploy.yaml) |
-| ---- | ---- |
+[](https://github.com/lowercasename/gathio/actions/workflows/ci.yaml)
A simple, federated, privacy-first event hosting platform.
--
cgit v1.2.3