wiki-server 0.26.0-rc.9 → 0.26.1

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/lib/random_id.js CHANGED
@@ -11,4 +11,3 @@
11
11
  // chars that defaults to 16 and returns a random id.
12
12
 
13
13
  export default (chars = 16) => [...Array(chars)].map(() => Math.floor(Math.random() * 16).toString(16)).join('')
14
-
package/lib/server.js CHANGED
@@ -135,6 +135,8 @@ export default async argv => {
135
135
 
136
136
  app.startOpts = argv
137
137
 
138
+ const wikiName = new URL(argv.url).hostname
139
+
138
140
  const log = (...stuff) => {
139
141
  if (argv.debug) console.log(stuff)
140
142
  }
@@ -254,10 +256,22 @@ export default async argv => {
254
256
 
255
257
  // use logger, at least in development, probably needs a param to configure (or turn off).
256
258
  // use stream to direct to somewhere other than stdout.
257
- logger.token('vhost', (req, res) => {
258
- return colorString(req.hostname)
259
- })
260
- app.use(logger(':vhost :method :url :status :res[content-length] - :response-time ms'))
259
+ const vhost = colorString(wikiName)
260
+ app.use(
261
+ logger((tokens, req, res) => {
262
+ return [
263
+ vhost,
264
+ tokens.method(req, res),
265
+ tokens.url(req, res),
266
+ tokens.status(req, res),
267
+ tokens.res(req, res, 'content-length'),
268
+ '-',
269
+ tokens['response-time'](req, res),
270
+ 'ms',
271
+ ].join(' ')
272
+ }),
273
+ )
274
+
261
275
  app.use(cookieParser())
262
276
  app.use(bodyParser.json({ limit: argv.uploadLimit }))
263
277
  app.use(bodyParser.urlencoded({ extended: true, limit: argv.uploadLimit }))
@@ -495,7 +509,7 @@ export default async argv => {
495
509
  if (!err) {
496
510
  res.sendFile(favLoc, { dotfiles: 'allow' })
497
511
  } else {
498
- res.sendFile(defaultFavLoc)
512
+ res.sendFile(defaultFavLoc, { dotfiles: 'allow' })
499
513
  }
500
514
  })
501
515
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wiki-server",
3
3
  "description": "A Federated Wiki Server",
4
- "version": "0.26.0-rc.9",
4
+ "version": "0.26.1",
5
5
  "type": "module",
6
6
  "author": {
7
7
  "name": "Ward Cunningham",
@@ -58,7 +58,7 @@
58
58
  "devDependencies": {
59
59
  "@eslint/js": "^9.39.1",
60
60
  "eslint": "^9.39.1",
61
- "globals": "^16.5.0",
61
+ "globals": "^17.2.0",
62
62
  "grunt-git-authors": "^3.2.0",
63
63
  "prettier": "^3.7.3",
64
64
  "supertest": "^7.1.4",