This commit is contained in:
parent
07d722cc2a
commit
8792d03f18
|
@ -1,3 +1,3 @@
|
||||||
/node_modules/
|
/node_modules/
|
||||||
/lib/
|
/lib/
|
||||||
/kill-the-newsletter.db
|
/data/
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
module.exports = (require) => {
|
module.exports = (require) => {
|
||||||
|
const path = require("path");
|
||||||
const killTheNewsletter = require(".").default;
|
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, () => {
|
webApplication.listen(new URL(webApplication.get("url")).port, () => {
|
||||||
console.log(`Web server started at ${webApplication.get("url")}`);
|
console.log(`Web server started at ${webApplication.get("url")}`);
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
module.exports = async (require) => {
|
module.exports = async (require) => {
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const cookieSession = require("cookie-session");
|
|
||||||
const { sql } = require("@leafac/sqlite");
|
|
||||||
const AutoEncrypt = require("@small-tech/auto-encrypt");
|
const AutoEncrypt = require("@small-tech/auto-encrypt");
|
||||||
const courselore = require(".").default;
|
const killTheNewsletter = require(".").default;
|
||||||
const customization = require(path.join(__dirname, "customization"))(require);
|
|
||||||
|
|
||||||
const app = await courselore(__dirname);
|
const { webApplication, emailApplication } = killTheNewsletter(
|
||||||
|
path.join(__dirname, "data")
|
||||||
|
);
|
||||||
|
|
||||||
app.set("url", "https://courselore.org");
|
webApplication.set("url", "https://kill-the-newsletter.com");
|
||||||
app.set("administrator", "mailto:administrator@courselore.org");
|
webApplication.set("email", "smtp://kill-the-newsletter.com:25");
|
||||||
|
webApplication.set("administrator", "mailto:kill-the-newsletter@leafac.com");
|
||||||
|
|
||||||
const reverseProxy = express();
|
const reverseProxy = express();
|
||||||
|
|
||||||
|
@ -19,19 +19,11 @@ module.exports = async (require) => {
|
||||||
return res.redirect(`${app.get("url")}${req.originalUrl}`);
|
return res.redirect(`${app.get("url")}${req.originalUrl}`);
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
reverseProxy.use(cookieSession({ secret: app.get("cookie secret") }));
|
|
||||||
reverseProxy.use(customization(app));
|
|
||||||
reverseProxy.use(app);
|
|
||||||
|
|
||||||
AutoEncrypt.https
|
AutoEncrypt.https
|
||||||
.createServer(
|
.createServer(
|
||||||
{
|
{
|
||||||
domains: [
|
domains: ["kill-the-newsletter.com", "www.kill-the-newsletter.com"],
|
||||||
"courselore.org",
|
|
||||||
"www.courselore.org",
|
|
||||||
"courselore.com",
|
|
||||||
"www.courselore.com",
|
|
||||||
],
|
|
||||||
settingsPath: path.join(__dirname, "data/keys/tls"),
|
settingsPath: path.join(__dirname, "data/keys/tls"),
|
||||||
},
|
},
|
||||||
reverseProxy
|
reverseProxy
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Courselore
|
Description=Kill the Newsletter!
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[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
|
Environment=NODE_ENV=production
|
||||||
User=root
|
User=root
|
||||||
Restart=always
|
Restart=always
|
Loading…
Reference in New Issue