diff --git a/package-lock.json b/package-lock.json index 70543b1..9fc81fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "@redis/client": "5.1.0", "body-parser": "2.3.0", "discord.js": "14.27.0", - "dotenv": "16.5.0", "express": "5.1.0", "express-session": "1.19.0", "markdown-it": "15.0.0", @@ -1894,17 +1893,6 @@ "url": "https://github.com/discordjs/discord.js?sponsor" } }, - "node_modules/dotenv": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", - "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", diff --git a/package.json b/package.json index e19d30a..667d088 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "@redis/client": "5.1.0", "body-parser": "2.3.0", "discord.js": "14.27.0", - "dotenv": "16.5.0", "express": "5.1.0", "express-session": "1.19.0", "markdown-it": "15.0.0", @@ -27,14 +26,14 @@ "sqlite3": "6.0.1" }, "scripts": { - "dev": "tsx watch --enable-source-maps src/index.ts", - "start": "node dist/index.js", + "dev": "tsx watch --enable-source-maps --env-file=.env src/index.ts", + "start": "node --env-file=.env dist/index.js", "lint": "npx eslint .", "typecheck": "npx tsc --noEmit", "build": "npm run clean && node scripts/build.js && npm run copyfiles", "clean": "rimraf dist", "copyfiles": "copyfiles -u 1 \"./src/**/*.html\" ./dist", - "encrypt": "node ./scripts/encrypt-data.js", - "add-author-hash": "node ./scripts/add-author-id-hash.js" + "encrypt": "node --env-file=.env ./scripts/encrypt-data.js", + "add-author-hash": "node --env-file=.env ./scripts/add-author-id-hash.js" } } diff --git a/scripts/add-author-id-hash.js b/scripts/add-author-id-hash.js index 1fb619e..aafee8f 100644 --- a/scripts/add-author-id-hash.js +++ b/scripts/add-author-id-hash.js @@ -1,10 +1,7 @@ import crypto from 'crypto'; -import dotenv from 'dotenv'; import { open } from 'sqlite'; import sqlite3 from 'sqlite3'; -dotenv.config(); - async function main() { Encrypter.initialize(process.env.DATABASE_SECRET); diff --git a/scripts/encrypt-data.js b/scripts/encrypt-data.js index 91ae802..8f13725 100644 --- a/scripts/encrypt-data.js +++ b/scripts/encrypt-data.js @@ -1,10 +1,7 @@ import crypto from 'crypto'; -import dotenv from 'dotenv'; import { open } from 'sqlite'; import sqlite3 from 'sqlite3'; -dotenv.config(); - async function main() { Encrypter.initialize(process.env.DATABASE_SECRET); diff --git a/src/config.ts b/src/config.ts index 670b7b9..1cc22ec 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,7 +1,3 @@ -import dotenv from 'dotenv'; - -dotenv.config(); - const { DISCORD_TOKEN, DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET, DISCORD_GUILD_ID, RELEASE_SECRET, DATABASE_SECRET, LINK_SECRET, E621_BASE_URL, E926_BASE_URL, PRIVACY_POLICY_URL, GIT_REPO_BASE_URL, REDIS_URL, PORT, DEBUG } = process.env; export const config = {