add eslint, fix bugs found
This commit is contained in:
parent
fc2c3a7114
commit
12558d3384
28 changed files with 1774 additions and 745 deletions
|
@ -1,6 +1,6 @@
|
|||
require('dotenv').config();
|
||||
require('dotenv').config()
|
||||
|
||||
const yesNo = require('yes-no');
|
||||
const yesNo = require('yes-no')
|
||||
|
||||
module.exports = {
|
||||
dbPrefix: process.env.DB_PREFIX || 'dbs/',
|
||||
|
@ -16,4 +16,4 @@ module.exports = {
|
|||
wishlist: require('./wishlist'),
|
||||
base: (process.env.ROOT_PATH || '/').endsWith('/') ? (process.env.ROOT_PATH || '/') : `${process.env.ROOT_PATH}/`,
|
||||
trustProxy: process.env.TRUST_PROXY === 'true' ? true : process.env.TRUST_PROXY || 'loopback'
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
const { nanoid } = require('nanoid')
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
const secretFilePath = path.join((process.env.SECRET_DIRNAME ? process.env.SECRET_DIRNAME : __dirname), 'secret.txt');
|
||||
const secretFilePath = path.join((process.env.SECRET_DIRNAME ? process.env.SECRET_DIRNAME : __dirname), 'secret.txt')
|
||||
|
||||
try {
|
||||
module.exports = fs.readFileSync(secretFilePath).toString();
|
||||
module.exports = fs.readFileSync(secretFilePath).toString()
|
||||
} catch (_) {
|
||||
const secret = nanoid(128);
|
||||
fs.writeFileSync(secretFilePath, secret);
|
||||
module.exports = secret;
|
||||
}
|
||||
const secret = nanoid(128)
|
||||
fs.writeFileSync(secretFilePath, secret)
|
||||
module.exports = secret
|
||||
}
|
||||
|
|
|
@ -2,4 +2,4 @@ module.exports = {
|
|||
note: {
|
||||
rows: Number(process.env.WISHLIST_NOTE_ROWS) || 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue