sillytavern 1.4.4 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server.js +4 -4
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -30,10 +30,10 @@ const ExifReader = require('exifreader');
|
|
|
30
30
|
const exif = require('piexifjs');
|
|
31
31
|
const webp = require('webp-converter');
|
|
32
32
|
|
|
33
|
-
const config = require(path.join(
|
|
33
|
+
const config = require(path.join(__dirname, './config.conf'));
|
|
34
34
|
const server_port = process.env.SILLY_TAVERN_PORT || config.port;
|
|
35
35
|
|
|
36
|
-
const whitelistPath = path.join(
|
|
36
|
+
const whitelistPath = path.join(__dirname, "./whitelist.txt");
|
|
37
37
|
let whitelist = config.whitelist;
|
|
38
38
|
|
|
39
39
|
if (fs.existsSync(whitelistPath)) {
|
|
@@ -212,7 +212,7 @@ app.use((req, res, next) => {
|
|
|
212
212
|
app.use(express.static(__dirname + "/public", { refresh: true }));
|
|
213
213
|
|
|
214
214
|
app.use('/backgrounds', (req, res) => {
|
|
215
|
-
const filePath = decodeURIComponent(path.join(
|
|
215
|
+
const filePath = decodeURIComponent(path.join(__dirname, 'public/backgrounds', req.url.replace(/%20/g, ' ')));
|
|
216
216
|
fs.readFile(filePath, (err, data) => {
|
|
217
217
|
if (err) {
|
|
218
218
|
res.status(404).send('File not found');
|
|
@@ -224,7 +224,7 @@ app.use('/backgrounds', (req, res) => {
|
|
|
224
224
|
});
|
|
225
225
|
|
|
226
226
|
app.use('/characters', (req, res) => {
|
|
227
|
-
const filePath = decodeURIComponent(path.join(
|
|
227
|
+
const filePath = decodeURIComponent(path.join(__dirname, charactersPath, req.url.replace(/%20/g, ' ')));
|
|
228
228
|
fs.readFile(filePath, (err, data) => {
|
|
229
229
|
if (err) {
|
|
230
230
|
res.status(404).send('File not found');
|