Skip to content

Commit

Permalink
build: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Feb 17, 2024
1 parent c9b98a4 commit 49b7156
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 39 deletions.
41 changes: 16 additions & 25 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@
app = "unavatar"
kill_signal = "SIGINT"
kill_signal = "SIGTERM"
kill_timeout = 5
processes = []

[experimental]
allowed_public_ports = []
auto_rollback = true

[[services]]
http_checks = []
[http_service]
internal_port = 3000
processes = ["app"]
protocol = "tcp"
script_checks = []

# [services.concurrency]
# hard_limit = 8
# soft_limit = 4
# type = "requests"
force_https = false
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0

[[services.ports]]
force_https = false
handlers = ["http"]
port = 80
[http_service.concurrency]
type = "requests"
soft_limit = 5
hard_limit = 10

[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
[[http_service.checks]]
grace_period = "3s"
interval = "30s"
method = "GET"
timeout = "1s"
path = "/ping"
27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,29 +91,29 @@
"@keyvhq/core": "~2.1.0",
"@keyvhq/multi": "~2.1.0",
"@keyvhq/redis": "~2.1.0",
"@kikobeats/time-span": "~1.0.3",
"@kikobeats/time-span": "~1.0.4",
"@microlink/mql": "~0.12.2",
"@microlink/ping-url": "~1.4.11",
"@microlink/ua": "~1.2.0",
"async-memoize-one": "~1.1.6",
"browserless": "~10.2.4",
"@microlink/ping-url": "~1.4.12",
"@microlink/ua": "~1.2.3",
"async-memoize-one": "~1.1.7",
"browserless": "~10.2.6",
"cacheable-lookup": "~6.1.0",
"cacheable-response": "~2.8.10",
"cacheable-response": "~2.8.12",
"cheerio": "~1.0.0-rc.12",
"cors": "~2.8.5",
"data-uri-regex": "~0.1.4",
"data-uri-to-buffer": "~5.0.1",
"debug-logfmt": "~1.2.0",
"debug-logfmt": "~1.2.2",
"frequency-counter": "~1.0.1",
"got": "~11.8.6",
"helmet": "~7.1.0",
"html-get": "~2.15.0",
"http-compression": "~1.0.17",
"html-get": "~2.15.1",
"http-compression": "~1.0.19",
"https-tls": "~1.0.16",
"ioredis": "~5.3.2",
"is-absolute-url": "~3.0.3",
"is-email-like": "~1.0.0",
"is-url-http": "~2.3.7",
"is-url-http": "~2.3.8",
"lodash": "~4.17.21",
"ms": "~2.1.3",
"on-finished": "~2.4.1",
Expand All @@ -124,13 +124,13 @@
"puppeteer": "~21.10.0",
"qsm": "~2.1.2",
"rate-limiter-flexible": "~5.0.0",
"router-http": "~1.0.5",
"router-http": "~1.0.7",
"send-http": "~1.0.6",
"serve-static": "~1.15.0",
"srcset": "~4.0.0",
"tangerine": "~1.5.4",
"top-crawler-agents": "~1.0.23",
"top-user-agents": "~2.1.0",
"top-crawler-agents": "~1.0.26",
"top-user-agents": "~2.1.10",
"unique-random-array": "~2.0.0",
"url-regex": "~5.0.0"
},
Expand Down Expand Up @@ -172,7 +172,6 @@
"build": "gulp build && untracked > .vercelignore",
"clean": "rm -rf node_modules",
"contributors": "(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
"deploy": "now -e NODE_ENV=production --public && now alias && now rm unavatar --safe --yes",
"dev": "TZ=UTC watchexec --clear=clear --on-busy-update=restart 'fkill \"Google Chrome for Testing\" --silent && node src/server.js'",
"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",
"dev:docs": "concurrently \"npm run dev:docs:server\" \"npm run dev:docs:src\"",
Expand Down
2 changes: 2 additions & 0 deletions src/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const debug = require('debug-logfmt')('unavatar:authentication')
const { RateLimiterMemory } = require('rate-limiter-flexible')
const FrequencyCounter = require('frequency-counter')
const onFinished = require('on-finished')
const os = require('os')

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

debug(req.ipAddress, {
uptime: duration(),
load: os.loadavg().map(n => n.toFixed(2)),
reqs,
'req/m': perMinute,
'req/s': perSecond,
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ router
next()
}
)
.get('ping', (_, res) => send(res, 200, 'pong'))
.get('/:key', (req, res) =>
ssrCache({
req,
Expand Down

0 comments on commit 49b7156

Please sign in to comment.