Commit Graph

111 Commits

Author SHA1 Message Date
39eca7b8ce Style tweak 2017-08-31 15:42:48 -07:00
98cbffa590 Use explicit status codes 2017-08-31 09:00:25 -07:00
b6f9176c71 Redirect modules 2017-08-31 09:00:17 -07:00
1da995666b Redirect ?json => ?meta
Fixes #60
2017-08-29 14:38:39 -07:00
dd8df34574 Revert to custom file sending logic 2017-08-26 20:38:31 -07:00
5331120a84 Allow serving dotfiles 2017-08-26 19:50:47 -07:00
30de36aa40 Use req.filename directly 2017-08-26 19:50:45 -07:00
e33d49a8cb Log sendFile errors 2017-08-26 19:50:09 -07:00
7d34cc9b88 Add $DEBUG_REDIS env var 2017-08-26 17:44:50 -07:00
50979bfca5 Fix ?module bug with empty filenames 2017-08-26 17:44:29 -07:00
e95dcf0028 Do not needlessly redirect 2017-08-24 01:12:26 -06:00
02b0dc91e2 More improvements for ?module 2017-08-24 00:33:58 -06:00
28543a39b6 Add ?module support to server
In "module" mode, the server looks for the "module"/"esnext:main" fields
in package.json for an ES module. Also, it redirects to the real file
path so that relative imports work.
2017-08-23 14:14:21 -07:00
6329a83f67 Use / instead of "index" 2017-08-22 20:16:21 -07:00
f64bb6bfd5 Treat URLs with no trailing slashes like files
This is to be consistent with the rest of the API, but also to allow
packages to omit the trailing slash and file name when publishing
multiple builds in the same package.
2017-08-22 18:51:37 -07:00
ab3e21b8f8 Be explicit with status codes 2017-08-22 18:44:26 -07:00
7ed062342e Rename logs worker 2017-08-22 17:22:19 -07:00
c1c2d1445f Add "module" Cache-Tag to js modules served with ?module 2017-08-22 09:59:19 -07:00
37640b2c8b Cache stats for 1 minute 2017-08-22 09:45:41 -07:00
52367d97a3 Add more spam to the blacklist 2017-08-22 09:22:31 -07:00
47d42addd2 Filter blacklisted packages from stats
Also added better descriptions to stats page.
2017-08-22 09:12:57 -07:00
2a0d32f214 Add /_stats endpoint
Also, remove ingest_stats worker and use the cache instead.
2017-08-22 08:52:30 -07:00
c4f3d5bbbc Store error/unique counts per hour/minute 2017-08-21 10:18:10 -07:00
be14167718 Use dependencies for unpkg URLs in module mode 2017-08-21 10:17:40 -07:00
066729f17c Re-organize package URL parsing 2017-08-19 11:44:01 -07:00
22c5c550be Move some utils into middleware/utils 2017-08-18 23:09:29 -07:00
bc9731abf1 Add experimental ?expand flag
See #24
2017-08-18 17:55:13 -07:00
19d060f753 Add some server tests 2017-08-18 17:33:27 -07:00
f87f0962f4 Use text/plain for PATENTS file 2017-08-18 16:47:52 -07:00
6b482f1099 Redirect ?json and /_meta to ?meta 2017-08-18 15:49:12 -07:00
e86421240d Redirect requests with invalid query params to cache 2017-08-18 14:50:42 -07:00
7408b24adf Move utilities into middleware/utils 2017-08-18 12:58:48 -07:00
2d03ed9be6 Remove min-download checking 2017-08-18 12:35:45 -07:00
6c6f8814a3 Temporarily disable daily downloads check 2017-08-17 12:23:56 -07:00
504c55a636 Lower minimum daily downloads to 50 2017-08-17 11:55:09 -07:00
8fb2c7810e Improve stats workers
- More accurate expiration times for stats
- Reduce duplication between stats and logs worker
- Expire hostname stats after one week
2017-08-17 11:24:40 -07:00
b9c6c0fc61 Add back checkBlacklist middleware 2017-08-16 23:04:59 -07:00
1173f91091 Require packages to be downloaded >= 100x/day
This should make it more difficult for people who are publishing
malicious packages to npm to get them on the CDN.
2017-08-16 23:04:59 -07:00
666d8afc95 Add /_meta endpoint for metadata
Also, add integrity values to metadata.
2017-08-16 17:30:12 -07:00
bc609ca825 Combine fetchPackage and findFile into same middleware 2017-08-16 15:58:14 -07:00
b6b477e096 Combine parse + blacklist middleware 2017-08-16 15:58:14 -07:00
65c2aa7357 Use function instead of => 2017-08-16 11:58:01 -07:00
f542cdafcd Consolidate db connection logic 2017-08-16 10:47:29 -07:00
16cef63d2b Remove query validation
This is now done at the CDN level.
2017-08-16 10:21:05 -07:00
297db18c02 Remove support for v query param 2017-08-15 15:17:48 -07:00
08292b7c87 Cache redirects for 1 minute 2017-08-15 15:17:34 -07:00
f5be48f2f4 Add v query param
Fixes #52
2017-08-15 12:37:33 -07:00
9d15462006 Validate NPM package names in URLs 2017-08-15 11:56:08 -07:00
db53a296aa Serve .flow files as text/plain 2017-08-12 20:37:29 -07:00
e4f5bfe4c0 Ignore symlinks when decompressing packages 2017-08-12 20:31:24 -07:00