This commit is contained in:
parent
a63c2a5d6a
commit
bf28279d50
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
@ -1,35 +0,0 @@
|
|||
module.exports = async (require) => {
|
||||
const path = require("path");
|
||||
const express = require("express");
|
||||
const AutoEncrypt = require("@small-tech/auto-encrypt");
|
||||
const killTheNewsletter = require(".").default;
|
||||
|
||||
const { webApplication, emailApplication } = killTheNewsletter(
|
||||
path.join(__dirname, "data")
|
||||
);
|
||||
|
||||
webApplication.set("url", "https://kill-the-newsletter.com");
|
||||
webApplication.set("email", "smtp://kill-the-newsletter.com");
|
||||
webApplication.set("administrator", "mailto:kill-the-newsletter@leafac.com");
|
||||
|
||||
const reverseProxy = express();
|
||||
reverseProxy.use((req, res, next) => {
|
||||
if (req.hostname !== new URL(webApplication.get("url")).hostname)
|
||||
return res.redirect(`${webApplication.get("url")}${req.originalUrl}`);
|
||||
next();
|
||||
});
|
||||
reverseProxy.use(webApplication);
|
||||
|
||||
AutoEncrypt.https
|
||||
.createServer(
|
||||
{
|
||||
domains: ["kill-the-newsletter.com", "www.kill-the-newsletter.com"],
|
||||
settingsPath: path.join(__dirname, "data/keys/tls"),
|
||||
},
|
||||
reverseProxy
|
||||
)
|
||||
.listen(443);
|
||||
emailApplication.listen(25, () => {
|
||||
console.log("Email server started");
|
||||
});
|
||||
};
|
|
@ -1,12 +0,0 @@
|
|||
[Unit]
|
||||
Description=Kill the Newsletter!
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/root/kill-the-newsletter/kill-the-newsletter /root/kill-the-newsletter/configuration.js
|
||||
Environment=NODE_ENV=production
|
||||
User=root
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
|
@ -22,9 +22,16 @@
|
|||
"license": "MIT",
|
||||
"bin": "./build/index.mjs",
|
||||
"scripts": {
|
||||
"start": "node-dev source/index.ts",
|
||||
"test": "prettier --check \"source/**/*\" --end-of-line auto && jest",
|
||||
"prepare": "tsc"
|
||||
"postinstall": "(cd ./server/ && npm install && cd ..) && (cd ./static/ && npm install && cd ..)",
|
||||
"prepare": "(cd ./server/ && npm run prepare && cd ..) && (cd ./static/ && npm run prepare && cd ..)",
|
||||
"start": "nodemon --watch \"./server/**/*.mts\" --watch \"./static/{{prepare,leafac--javascript}.mjs,**/*.{png,jpeg,ico}}\" --watch \"./configuration/**/*.mjs\" --ext \"*\" --exec \"npm run prepare && node ./build/server/index.mjs ./configuration/development.mjs\"",
|
||||
"start:clean:data": "npm run clean:data && npm run start",
|
||||
"test": "prettier --check \"./server/**/*.mts\" --check \"./static/prepare.mjs\" --check \"./configuration/**/*.mjs\" --end-of-line auto",
|
||||
"clean:all": "npm run clean:build && npm run clean:data && npm run clean:node_modules",
|
||||
"clean:build": "shx rm -rf ./build/",
|
||||
"clean:data": "shx rm -rf ./data/",
|
||||
"clean:node_modules": "shx rm -rf ./node_modules/ ./server/node_modules/ ./static/node_modules/",
|
||||
"update": "npm-check-updates --upgrade && (cd ./server/ && npm-check-updates --upgrade && cd ..) && (cd ./static/ && npm-check-updates --upgrade && cd ..) && npm install"
|
||||
},
|
||||
"dependencies": {
|
||||
"@leafac/caddy": "^1.0.5",
|
||||
|
@ -39,17 +46,10 @@
|
|||
"smtp-server": "^3.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/mailparser": "^3.4.0",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/nodemailer": "^6.4.6",
|
||||
"@types/smtp-server": "^3.5.7",
|
||||
"caxa": "^3.0.1",
|
||||
"esbuild": "^0.15.12",
|
||||
"got": "^12.5.2",
|
||||
"nodemailer": "^6.8.0",
|
||||
"nodemon": "^2.0.20",
|
||||
"prettier": "^2.7.1",
|
||||
"typescript": "^4.8.4"
|
||||
"prettier": "^2.7.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
/node_modules/
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/mailparser": "^3.4.0",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/nodemailer": "^6.4.6",
|
||||
"@types/smtp-server": "^3.5.7",
|
||||
"typescript": "^4.8.4"
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"rootDir": "./source/",
|
||||
"outDir": "./build/",
|
||||
"rootDir": "./",
|
||||
"outDir": "../build/server/",
|
||||
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "NodeNext",
|
|
@ -0,0 +1 @@
|
|||
/node_modules/
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"scripts": {
|
||||
"prepare": "node ./prepare.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource/jetbrains-mono": "^4.5.11",
|
||||
"tippy.js": "^6.3.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.15.12"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
console.log("BUILD STATIC BUNDLE");
|
Loading…
Reference in New Issue