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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +4 -4
package/package.json CHANGED
@@ -31,7 +31,7 @@
31
31
  }
32
32
  },
33
33
  "name": "sillytavern",
34
- "version": "1.4.4",
34
+ "version": "1.4.6",
35
35
  "scripts": {
36
36
  "start": "node server.js"
37
37
  },
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(process.cwd(), './config.conf'));
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(process.cwd(), "./whitelist.txt");
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(process.cwd(), 'public/backgrounds', req.url.replace(/%20/g, ' ')));
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(process.cwd(), charactersPath, req.url.replace(/%20/g, ' ')));
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');