Skip to content

Commit

Permalink
feat: add HTTP_INTERNAL env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Jan 20, 2024
1 parent 89b94bc commit 10eef10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/preinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const env = {
ENCRYPTION_KEY: randomBytes(24).toString('hex'),
HTTP_EXTERNAL: 'http://127.0.0.1:8169',
HTTP_HOST: '0.0.0.0',
HTTP_INTERNAL: '',
HTTP_PORT: 8169,
HTTP_TRUST_PROXY: false,
NODE_ENV: 'production', // not bot-specific
Expand All @@ -37,4 +38,4 @@ if (!process.env.ENCRYPTION_KEY && !fs.existsSync('./.env')) {
log(short('&r&0&!e WARNING &r &e&lkeep your environment variables safe, don\'t lose your encryption key or you will lose data'));
} else {
log('nothing to do');
}
}
2 changes: 1 addition & 1 deletion src/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { join } = require('path');
const { files } = require('node-dir');
const { PermissionsBitField } = require('discord.js');

process.env.ORIGIN = process.env.HTTP_EXTERNAL;
process.env.ORIGIN = process.env.HTTP_INTERNAL || process.env.HTTP_EXTERNAL;

module.exports = async client => {
// oauth2 plugin
Expand Down

0 comments on commit 10eef10

Please sign in to comment.