-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New fork resolving vulnerabilities and incorporating most current PRs #224
Comments
sad that this stays unmerged. |
not sure what @cloudhead s view on it is. (i have done stuff on this code, but am not a maintainer) maybe he should officialise the lack of maintainership on this project? if not hand over the repo here - I guess making clear this repo is not maintained anymore - so that other people who want to continue based on the work of this fork for example can gather crowd around them with a clear direction? i guess anyone can just use the published fork dist packages, but some clear direction where this is going and who to follow or who not is the point @bacloud14 ? |
Agreed. I cannot contribute on this in anyway. I just notified maintainer's because frankly, the guy made what seemed to me a big fork. |
Hey, what would be everyone's preference here? The problem is I don't have the capacity to review such a big change. I'd be happy to pass on maintainership to someone. Does this fork have any breaking API changes? (besides the "engines" change) |
Thanks for your reply, @cloudhead .
For anyone wishing to review, most of the changes were a series of merges for PRs already here and some non-API-changing refactoring. But I understand there were a number of merges, and I created however inevitable diff noise with the refactoring.
If no one else is interested, I can accept, but knowing that:
No. It uses ES6+ features, so for someone ignoring the stated Of course with all the changes, e.g., the CLI parsing engine switch, it's always possible there could be some subtle differences, but it's been working for me in my projects, and if there really was any breakage accidentally introduced, my intent would be to fix it. |
Ok, this sounds good. I would then propose that I give you write access to merge this fork into master, and make any fixes that may be needed in the future, given you have the time/capacity. We can then release this as version 0.8. |
Thanks for that, @cloudhead I've made the tweaks I think I'm ready to make at this point, so if you want to add the 0.8.0 release, I think we'd be ready with these steps (which I mention given that they involve files which weren't there before):
Note that there still is an advisory per https://www.npmjs.com/advisories/1206/versions which I wasn't able to replicate (on the contrary, it seemed already fixed), so barring any test case, I'm not sure what we can do there, but the release should at least address the other reported vulnerabilities. |
If you want, we could also bump |
Ok nice @cloudhead @brettz9 :) I don't want to be the devils advocate here, but
made me remind that story 2-3 years ago (how fast we forget these things as well right ...?) where some guy took over maintainership of a package from an overworked open-source dev and eventually used it to inject a Trojan if I remember well, into some crypto-currency platforms backend I am still not sure what the FLOSS & NPM communitys take on this is tbh. |
There are no guarantees that even the regular owner of a project won't suddenly turn into a malicious person. One either has to:
|
I'm well aware of supply chain attacks.. but basically a big part of that responsibility is on users auditing their dependencies. I did my duty of making sure @brettz9 is a legitimate contributor to the open source community (which he clearly is), and so I think he will do a great job. I wouldn't have given write access to someone with no credentials or github history! |
Indeed @cloudhead you are right about all that, and @brettz9 is probably very good maintainer for this project! Happy you guys found each other :) My remark was actually unspecific to you guys as a person or this situation, and I felt similarly it being my duty in such a case to remind all participants about needed trust concerns of such a handover. Which is done, and I agree everything seems all fine here 👍 |
@cloudhead : I bumped to Node 12. Anything else you want for a release? |
@brettz9 Let me know if you need any additional hands on doing some quick codework. |
Thanks, @tchakabam . Feel free to take up any issue, or in some ways, better yet, bring our tests up to 100% coverage so we can be more confident that with any new features/fixes come no new problems. Due to my own limitations, I can't do very much, but hope I can at least review well-explained PRs. |
Hi @cloudhead , Since the work is already done, I'm a bit eager to move on with this and get this out there for the community if that is at all possible. If you have the time to do whatever setup or final reviewing you might want to do, I think it'd be nice to get these vulnerabilities fixed up for the community. Do you think setting up |
that would be a nice summertime 2-day code sprint or so :) need to see if i can shove it in. |
@brettz9 thanks! I'll push a new release now
I looked through the commit history, and wonder why some of the commits have a dash ("-") in front of them? We should fix that before using something like semantic-release especially to make sure the changelog is rendered properly. |
Hadn't thought about building up the past history with such tooling, but makes sense. (In my non-semantic-release projects, I've liked to use them to set off my sometimes adding multiple items to a single commit.) I can rebase the history to remove this (as well as convert the multi-entry commits to perhaps list the most important item, with the lesser items in the footer), though such rebasing would break master for anyone who's forked it. |
Yeah, I think that's a small price to pay for the history to be consistent, also happy to do the formatting if you don't have time. |
I went ahead and amended/rebased until before the last merge. If you want to go back further, it would be great if you could handle that. Thanks! |
@cloudhead the last release on NPM appears to be 0.7.11 from 3 years ago. I was wondering if you could push a new release now? It would be really nice to have a version without the DoS vulnerability. |
Let's get ESM and the cli changes in before publishing |
Ok, with ESM and CLI changes added, I think it should be ready AFAIC. I'm not feeling inclined to add all kinds of tests for the binary files now, but:
(I probably should have checked for other such testing utilities, but haven't come across one, and I think the API is pretty clean.) |
I've also added a GitHub Action file, if you wanted to enable workflows in the repo Settings, @cloudhead . |
Ah, ok, apologies, I'm used to using my own format a lot of times. I think maybe |
I'm ok if we don't follow semantic-release to the letter, but at least the commits should be formatted according to the way git works, ie. it shouldn't break |
I barely use the command line for Git, but will try to remember to adhere to it. Alternatively, it should be doable as per https://github.com/semantic-release/semantic-release#commit-message-format , to add commitizen or commitlint to enforce valid commit messages before they are committed (including possibly via husky). |
I've tried to clean up the history but unfortunately because of all the merges it's very very difficult to rebase (even with the help of some pretty advanced git commands). So I'm left with two choices:
Neither is ideal for me, but (1) would at least mark a clear separation between the old and the new node-static and it would be easy to follow the change. We would of course lose the history, but since it's the history that is not particularly usable as-is, I don't see that as a major downside. |
@cloudhead I should be able to do it for you! Please just hold on a moment. |
@cloudhead I did it! I converted all history since 2018 (i.e. everything @brettz9 pushed) into a linear tree. You can take my cleaned history with:
You can then go ahead and do an interactive rebase with |
@cloudhead : Hi... At this point, I'm looking to update my earlier fork (@brettz9/node-static) and give up on |
#### Context: Was using https://github.com/excaliburjs/template-ts-vite and noticed that `npm run test` was failing in my environment. This led me down a bit of a rabbit hole to look into the `@excaliburjs/testing` code, which ultimately had me creating this PR. --- ### changes - added `devcontainer.json` to aid with development in GitHub Codespaces - fix up observed bug in `clickPlayButton` - update dependencies in `package.json` - _note:_ due to cloudhead/node-static#224 switched out use of `node-static` to `@brettz9/node-static` - _note: if the changes to use a different package than `node-static` is not what we want here, can look into a different approach._ --- _another note:_ after syncing with @eonarheim [on discord](https://discord.com/channels/1195771303215513671/1271936253012475914/1275460580932718643), seems like using `playwright` similar to [how the `electron template`](https://github.com/excaliburjs/template-electron/blob/main/package.json#L20-L22) is doing testing might be the approach to take for the vite template instead. --- _note: since the last release was almost 3 years ago, I'm not sure what the future of this package is._ that being said, I think it can benefit from some of these changes. _Also wondering if a different approach to this change is to update https://github.com/excaliburjs/template-ts-vite/blob/main/package.json#L11 / https://github.com/excaliburjs/template-ts-vite/blob/main/package.json#L35 to use https://github.com/excaliburjs/excalibur-jasmine instead since it was more recently updated._
Hi,
As issues had not received feedback here and the latest commit 3 years ago, I went ahead to make a fork and publish it as @brettz9/node-static.
Besides making a few of my own changes:
engines
to 10.11.0+ (allowing native URL to fix an issue and better flexibility in language features)URL
constructor over deprecatedurl.parse
;should fix Open Redirect issue https://www.npmjs.com/advisories/1207
colors
CHANGES.md
)...the fork also incorporates the following, indicating also the PR numbers here that they close:
User-facing
optimist
toneodoc
(@fidian); Fix vulnerabilities found with npm audit #222mime
andcolors
(@fidian); Fix vulnerabilities found with npm audit #222fs.stat
calls from bad path arguments; fixesDenial of Service issue https://www.npmjs.com/advisories/1208
(@brpvieira); Protect fs.stat calls from invalid path arguments #223; also avoids need for Prevent DoS attack #213
bytes=0-0
Range header (@prajwalkman); Properly handle "bytes=0-0" range header #167spa
, allow dots after path (@gjuchault); fix(spa): parse URL before matching files for 404 #204serverInfo
to benull
(@martindale); Allow Removal ofServer
Header #150--cache 0
(@matthew-andrews); Respect static --cache 0 #138defaultExtension
(@fmalk); New option: defaultExtension #173Dev-facing
I also made some updates/improvements to the PRs:
fs.stat
checking, adding one beyond that covered in the originalfs.stat
PR (Protect fs.stat calls from invalid path arguments #223), and covering the newly-added one in thedefaultExtension
PR (New option: defaultExtension #173).minimatch
(Added glob matching feature for setting cache headers. #183)These remaining prexisting PRs were not fully incorporated:
f
andfalse
aliases, feel free to file an issuestatic
tonodeStatic
#172 - There is no longer a need for avoiding the reservedstatic
keyword, as I renamed the examples (to usestatik
).writeHead
, but what's to prevent someone from rewritingsetHeader
? If it's a common enough use case to overwritewriteHead
, I could add the preventative measure, esp. with a test.Remaining steps:
nyc
for coverage, but I'm not sure that withvows
, we can do binary file testing. I'm thinking whether we should switch tomocha
for this (I prefer that to jest for the ecosystem). Ideally we'd get to full coverage, including the binary.The text was updated successfully, but these errors were encountered: