Skip to content

Commit 10eef10

Browse files
committed
feat: add HTTP_INTERNAL env variable
1 parent 89b94bc commit 10eef10

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

scripts/preinstall.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const env = {
2020
ENCRYPTION_KEY: randomBytes(24).toString('hex'),
2121
HTTP_EXTERNAL: 'http://127.0.0.1:8169',
2222
HTTP_HOST: '0.0.0.0',
23+
HTTP_INTERNAL: '',
2324
HTTP_PORT: 8169,
2425
HTTP_TRUST_PROXY: false,
2526
NODE_ENV: 'production', // not bot-specific
@@ -37,4 +38,4 @@ if (!process.env.ENCRYPTION_KEY && !fs.existsSync('./.env')) {
3738
log(short('&r&0&!e WARNING &r &e&lkeep your environment variables safe, don\'t lose your encryption key or you will lose data'));
3839
} else {
3940
log('nothing to do');
40-
}
41+
}

src/http.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { join } = require('path');
66
const { files } = require('node-dir');
77
const { PermissionsBitField } = require('discord.js');
88

9-
process.env.ORIGIN = process.env.HTTP_EXTERNAL;
9+
process.env.ORIGIN = process.env.HTTP_INTERNAL || process.env.HTTP_EXTERNAL;
1010

1111
module.exports = async client => {
1212
// oauth2 plugin

0 commit comments

Comments
 (0)