added isProxied

pull/12/head
tycrek 3 years ago
parent dff7600c91
commit 0255ccef3f
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -7,7 +7,7 @@ try {
}
// Load the config
const { host, port, domain, useSsl, resourceIdSize, resourceIdType, discordMode } = require('./config.json');
const { host, port, domain, useSsl, resourceIdSize, resourceIdType, discordMode, isProxied } = require('./config.json');
//#region Imports
const fs = require('fs-extra');
@ -15,7 +15,6 @@ const uuid = require('uuid').v4;
const express = require('express');
const useragent = require('express-useragent');
const multer = require('multer');
const zws = require('./idgen/zws');
const { path, saveData, log, verify, generateId } = require('./utils');
//#endregion
@ -65,7 +64,7 @@ function startup() {
saveData(data);
let http = ('http').concat(useSsl ? 's' : '').concat('://');
let trueDomain = domain.concat((port != 80 || port != 443) ? `:${port}` : '');
let trueDomain = domain.concat((port == 80 || port == 443 || isProxied) ? '' : `:${port}`);
let discordCompat = (discordMode && req.file.mimetype == 'video/mp4') ? '.mp4' : '';
res.type('json').send({
resource: `${http}${trueDomain}/${resourceId}${discordCompat}`,

@ -13,6 +13,7 @@ const config = {
port: 40115,
domain: 'upload.example.com',
useSsl: true,
isProxied: true,
resourceIdSize: 12,
resourceIdType: 'zws',
discordMode: false
@ -45,6 +46,12 @@ const setupSchema = {
default: config.useSsl,
required: false
},
isProxied: {
description: 'Will you be running through a reverse proxy',
type: 'boolean',
default: config.isProxied,
required: false
},
resourceIdSize: {
description: 'Resource ID size (by using a higher value, you will be able to upload more files)',
type: 'integer',

Loading…
Cancel
Save