diff --git a/.gitignore b/.gitignore index 3c6dcdd..3dace07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /node_modules/ /lib/ -/kill-the-newsletter.db +/data/ diff --git a/configuration.development.js b/configuration.development.js index 1efcd1f..fcb42ef 100644 --- a/configuration.development.js +++ b/configuration.development.js @@ -1,6 +1,9 @@ module.exports = (require) => { + const path = require("path"); const killTheNewsletter = require(".").default; - const { webApplication, emailApplication } = killTheNewsletter(__dirname); + const { webApplication, emailApplication } = killTheNewsletter( + path.join(__dirname, "data") + ); webApplication.listen(new URL(webApplication.get("url")).port, () => { console.log(`Web server started at ${webApplication.get("url")}`); diff --git a/deployment-example/configuration.js b/deployment-example/configuration.js index 6ccf975..def724c 100644 --- a/deployment-example/configuration.js +++ b/deployment-example/configuration.js @@ -1,16 +1,16 @@ module.exports = async (require) => { const path = require("path"); const express = require("express"); - const cookieSession = require("cookie-session"); - const { sql } = require("@leafac/sqlite"); const AutoEncrypt = require("@small-tech/auto-encrypt"); - const courselore = require(".").default; - const customization = require(path.join(__dirname, "customization"))(require); + const killTheNewsletter = require(".").default; - const app = await courselore(__dirname); + const { webApplication, emailApplication } = killTheNewsletter( + path.join(__dirname, "data") + ); - app.set("url", "https://courselore.org"); - app.set("administrator", "mailto:administrator@courselore.org"); + webApplication.set("url", "https://kill-the-newsletter.com"); + webApplication.set("email", "smtp://kill-the-newsletter.com:25"); + webApplication.set("administrator", "mailto:kill-the-newsletter@leafac.com"); const reverseProxy = express(); @@ -19,19 +19,11 @@ module.exports = async (require) => { return res.redirect(`${app.get("url")}${req.originalUrl}`); next(); }); - reverseProxy.use(cookieSession({ secret: app.get("cookie secret") })); - reverseProxy.use(customization(app)); - reverseProxy.use(app); AutoEncrypt.https .createServer( { - domains: [ - "courselore.org", - "www.courselore.org", - "courselore.com", - "www.courselore.com", - ], + domains: ["kill-the-newsletter.com", "www.kill-the-newsletter.com"], settingsPath: path.join(__dirname, "data/keys/tls"), }, reverseProxy diff --git a/deployment-example/courselore.service b/deployment-example/kill-the-newsletter.service similarity index 50% rename from deployment-example/courselore.service rename to deployment-example/kill-the-newsletter.service index 4c5553e..d067258 100644 --- a/deployment-example/courselore.service +++ b/deployment-example/kill-the-newsletter.service @@ -1,9 +1,9 @@ [Unit] -Description=Courselore +Description=Kill the Newsletter! After=network.target [Service] -ExecStart=/root/courselore/courselore /root/courselore/configuration.js +ExecStart=/root/kill-the-newsletter/kill-the-newsletter /root/kill-the-newsletter/configuration.js Environment=NODE_ENV=production User=root Restart=always