Skip to content

Commit 499371c

Browse files
committed
build: update dependencies
1 parent c9b98a4 commit 499371c

File tree

5 files changed

+33
-39
lines changed

5 files changed

+33
-39
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ coverage
3535
.envrc
3636
.env
3737
.vercel
38+
scripts

fly.toml

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
11
app = "unavatar"
2-
kill_signal = "SIGINT"
2+
kill_signal = "SIGTERM"
33
kill_timeout = 5
4-
processes = []
54

6-
[experimental]
7-
allowed_public_ports = []
8-
auto_rollback = true
9-
10-
[[services]]
11-
http_checks = []
5+
[http_service]
126
internal_port = 3000
13-
processes = ["app"]
14-
protocol = "tcp"
15-
script_checks = []
16-
17-
# [services.concurrency]
18-
# hard_limit = 8
19-
# soft_limit = 4
20-
# type = "requests"
7+
force_https = false
8+
auto_stop_machines = true
9+
auto_start_machines = true
10+
min_machines_running = 0
2111

22-
[[services.ports]]
23-
force_https = false
24-
handlers = ["http"]
25-
port = 80
12+
[http_service.concurrency]
13+
type = "requests"
14+
soft_limit = 5
15+
hard_limit = 10
2616

27-
[[services.tcp_checks]]
28-
grace_period = "1s"
29-
interval = "15s"
30-
restart_limit = 0
31-
timeout = "2s"
17+
[[http_service.checks]]
18+
grace_period = "3s"
19+
interval = "30s"
20+
method = "GET"
21+
timeout = "1s"
22+
path = "/ping"

package.json

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,29 +91,29 @@
9191
"@keyvhq/core": "~2.1.0",
9292
"@keyvhq/multi": "~2.1.0",
9393
"@keyvhq/redis": "~2.1.0",
94-
"@kikobeats/time-span": "~1.0.3",
94+
"@kikobeats/time-span": "~1.0.4",
9595
"@microlink/mql": "~0.12.2",
96-
"@microlink/ping-url": "~1.4.11",
97-
"@microlink/ua": "~1.2.0",
98-
"async-memoize-one": "~1.1.6",
99-
"browserless": "~10.2.4",
96+
"@microlink/ping-url": "~1.4.12",
97+
"@microlink/ua": "~1.2.3",
98+
"async-memoize-one": "~1.1.7",
99+
"browserless": "~10.2.6",
100100
"cacheable-lookup": "~6.1.0",
101-
"cacheable-response": "~2.8.10",
101+
"cacheable-response": "~2.8.12",
102102
"cheerio": "~1.0.0-rc.12",
103103
"cors": "~2.8.5",
104104
"data-uri-regex": "~0.1.4",
105105
"data-uri-to-buffer": "~5.0.1",
106-
"debug-logfmt": "~1.2.0",
106+
"debug-logfmt": "~1.2.2",
107107
"frequency-counter": "~1.0.1",
108108
"got": "~11.8.6",
109109
"helmet": "~7.1.0",
110-
"html-get": "~2.15.0",
111-
"http-compression": "~1.0.17",
110+
"html-get": "~2.15.1",
111+
"http-compression": "~1.0.19",
112112
"https-tls": "~1.0.16",
113113
"ioredis": "~5.3.2",
114114
"is-absolute-url": "~3.0.3",
115115
"is-email-like": "~1.0.0",
116-
"is-url-http": "~2.3.7",
116+
"is-url-http": "~2.3.8",
117117
"lodash": "~4.17.21",
118118
"ms": "~2.1.3",
119119
"on-finished": "~2.4.1",
@@ -124,13 +124,13 @@
124124
"puppeteer": "~21.10.0",
125125
"qsm": "~2.1.2",
126126
"rate-limiter-flexible": "~5.0.0",
127-
"router-http": "~1.0.5",
127+
"router-http": "~1.0.7",
128128
"send-http": "~1.0.6",
129129
"serve-static": "~1.15.0",
130130
"srcset": "~4.0.0",
131131
"tangerine": "~1.5.4",
132-
"top-crawler-agents": "~1.0.23",
133-
"top-user-agents": "~2.1.0",
132+
"top-crawler-agents": "~1.0.26",
133+
"top-user-agents": "~2.1.10",
134134
"unique-random-array": "~2.0.0",
135135
"url-regex": "~5.0.0"
136136
},
@@ -172,7 +172,6 @@
172172
"build": "gulp build && untracked > .vercelignore",
173173
"clean": "rm -rf node_modules",
174174
"contributors": "(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
175-
"deploy": "now -e NODE_ENV=production --public && now alias && now rm unavatar --safe --yes",
176175
"dev": "TZ=UTC watchexec --clear=clear --on-busy-update=restart 'fkill \"Google Chrome for Testing\" --silent && node src/server.js'",
177176
"dev:docker": "docker build --platform linux/amd64 -t unavatar . && docker run --platform linux/amd64 --name unavatar -e NODE_ENV=staging -p 3000:3000 --rm unavatar",
178177
"dev:docs": "concurrently \"npm run dev:docs:server\" \"npm run dev:docs:src\"",

src/authentication.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const debug = require('debug-logfmt')('unavatar:authentication')
55
const { RateLimiterMemory } = require('rate-limiter-flexible')
66
const FrequencyCounter = require('frequency-counter')
77
const onFinished = require('on-finished')
8+
const os = require('os')
89

910
const duration = timeSpan()
1011
const reqsMin = new FrequencyCounter(60)
@@ -62,6 +63,7 @@ module.exports = async (req, res, next) => {
6263

6364
debug(req.ipAddress, {
6465
uptime: duration(),
66+
load: os.loadavg().map(n => n.toFixed(2)),
6567
reqs,
6668
'req/m': perMinute,
6769
'req/s': perSecond,

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ router
7878
next()
7979
}
8080
)
81+
.get('ping', (_, res) => send(res, 200, 'pong'))
8182
.get('/:key', (req, res) =>
8283
ssrCache({
8384
req,

0 commit comments

Comments
 (0)