You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've had numerous reports of argon2 causing issues on Raspberry Pi and Linux (see here). We need to investigate argon2 (repo here) to see if it's possible to build from source on those devices.
I have a Pixel 2 with Termux so I can test there. Or we can spin up a dev environment on Coder that mimics Termux (Alpine Linux I think) or Raspberry Pi and test there.
If we can get argon2 working, then we'll be able to unblock both Termux and Pi users of code-server.
Special thanks to @im-coder-lg for all their help debugging this!
I kinda feel like Termux is a combination of FreeBSD and Debian since it includes apt and pkg package managers. But the Argon2 error is affecting the entire NPM package.
Yesterday, I was exploring my Raspberry Pi that has MATE, and an idea flashed in my mind. In one of the discussions, @Slodziak190q told to install code-server's 3.10.0 version and that worked successfully, providing that it took some time. It works now, and it included a hashed password there.
Wait a minute, let's go a minute back. What if Argon2's 0.28.0 release has the error?
I just had a fantastic idea! @jsjoeio can you tell me when did Argon2 get implemented, before 3.10.0 or after 3.10.0? If it's after that, then why can't we use the older hashing module? Because, I observed, the password was hashed in my Pi, and I changed it, but it was hashed. If Argon2 was implemented before 3.10.0, we need to use an older version of Argon2, that might work, right?
I just had a fantastic idea! @jsjoeio can you tell me when did Argon2 get implemented, before 3.10.0 or after 3.10.0? If it's after that, then why can't we use the older hashing module? Because, I observed, the password was hashed in my Pi, and I changed it, but it was hashed. If Argon2 was implemented before 3.10.0, we need to use an older version of Argon2, that might work, right?
Hmm...possibly! For hashing, we used sha256 which I think came from crypto which is built-in/native to Node. I added argon2 in this PR which came out in 3.11.0. That explains why 3.10.0 works.
It's supposed to be more secure because it requires more computational effort for the password hashing. I still think we need to look more into argon2 to fix this.
I appear to have picked the worst time to try code-server out on Termux, but I may have a lead on the argon issue. I unzipped the pre-built package in my Termux install, then changed the launch script to use the system node, and got this error:
~/.../code-server-3.12.0-linux-arm64/bin $ ./code-server
node:internal/modules/cjs/loader:1183
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: dlopen failed: library "libstdc++.so.6" not found: needed by /data/data/com.termux/files/home/code/code-server-3.12.0-linux-arm64/node_modules/argon2/lib/binding/napi-v3/argon2.node in namespace (default)
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/data/data/com.termux/files/home/code/code-server-3.12.0-linux-arm64/node_modules/argon2/argon2.js:9:56)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'ERR_DLOPEN_FAILED'
}
I can confirm there's no libstdc++.so of any flavor in the libs folder, build-essentials omitted it, and gcc isn't on pkg to install it.
Edit: I just extracted 3.10 with the script edited in the same way, and was able to launch it ok.
I just hopped onto the Argon2 repo and discovered something. Issue 317, ranisalt/node-argon2(don't want to mention it here because it might cause problems, idk but @jsjoeio what do you say? Linking our related Argon2 problems here?
Title: node-argon2 version 0.28.2 uses a vulnerable strip-ANSI package
We use 0.28.2, right? Might be related.
Issue 278, 276 and 305 on node-argon2 seems kinda related.
278's title: Installing fails on Windows(is this related?)
276's title: Broken argon2.node on RHEL7(Red Hat Enterprise Linux, I think it's similar to Fedora, I think it uses dnf)
305: Build fails on Node 16.4 ARM M1(this seems too related except the Node version, what processor does your Mac run on @jsjoeio?)
If you want to link them, feel free, but also I think we must open a ticket at Argon2 and get help from the maintainers there.
@im-coder-lg I don't have any updates yet but once we get 4.0.0 out, we can prioritize this!
Thanks for linking those node-argon2 issues. We may have to switch away from node-argon2 but I don't want to make any decisions until we can investigate this further.
@jsjoeio can we test this on a separate branch? You can try building it(also can you tell hardware requirements for building code-server?) and sending a build to me over here(aarch64 please) and I'll test on Raspberry Pi with Ubuntu 21.10, what do you think? Also @yisibl can you tell us how to implement this over here?
Also(unrelated topic coming up!), I went to see the README, it has an extra comma beside the Coder link, it seems wrong to me, can you please inspect it? Also, since the Coder GitHub org changed the name from cdr to coder, you need to change this line in docs/MAINTAINING.md.
Activity
lg-nineoneninethreenine commentedon Nov 2, 2021
I kinda feel like Termux is a combination of FreeBSD and Debian since it includes apt and pkg package managers. But the Argon2 error is affecting the entire NPM package.
Yesterday, I was exploring my Raspberry Pi that has MATE, and an idea flashed in my mind. In one of the discussions, @Slodziak190q told to install code-server's 3.10.0 version and that worked successfully, providing that it took some time. It works now, and it included a hashed password there.
Wait a minute, let's go a minute back. What if Argon2's 0.28.0 release has the error?
I just had a fantastic idea! @jsjoeio can you tell me when did Argon2 get implemented, before 3.10.0 or after 3.10.0? If it's after that, then why can't we use the older hashing module? Because, I observed, the password was hashed in my Pi, and I changed it, but it was hashed. If Argon2 was implemented before 3.10.0, we need to use an older version of Argon2, that might work, right?
lg-nineoneninethreenine commentedon Nov 2, 2021
Can we create an x86 installer for code-server?
jsjoeio commentedon Nov 2, 2021
Hmm...possibly! For hashing, we used sha256 which I think came from
cryptowhich is built-in/native to Node. I addedargon2in this PR which came out in 3.11.0. That explains why 3.10.0 works.It's supposed to be more secure because it requires more computational effort for the password hashing. I still think we need to look more into argon2 to fix this.
jwannebo commentedon Nov 3, 2021
I appear to have picked the worst time to try code-server out on Termux, but I may have a lead on the argon issue. I unzipped the pre-built package in my Termux install, then changed the launch script to use the system node, and got this error:
I can confirm there's no libstdc++.so of any flavor in the libs folder, build-essentials omitted it, and gcc isn't on pkg to install it.
Edit: I just extracted 3.10 with the script edited in the same way, and was able to launch it ok.
jsjoeio commentedon Nov 3, 2021
Thanks for the notes @jwannebo! Right now we're recommending people install on Termux via
yarn/npmbut I know there are also Node version errors.3.10 doesn't have issues because argon2 was adding in
3.11.0I believe. Thanks for confirming though!Replace nodejs with nodejs-lts in Termux docs (#4336)
lg-nineoneninethreenine commentedon Nov 25, 2021
Any updates? Should we open a ticket at Argon2 and mention this issue there?
lg-nineoneninethreenine commentedon Nov 25, 2021
I just hopped onto the Argon2 repo and discovered something. Issue 317, ranisalt/node-argon2(don't want to mention it here because it might cause problems, idk but @jsjoeio what do you say? Linking our related Argon2 problems here?
Title: node-argon2 version 0.28.2 uses a vulnerable strip-ANSI package
We use 0.28.2, right? Might be related.
Issue 278, 276 and 305 on node-argon2 seems kinda related.
278's title: Installing fails on Windows(is this related?)
276's title: Broken argon2.node on RHEL7(Red Hat Enterprise Linux, I think it's similar to Fedora, I think it uses
dnf)305: Build fails on Node 16.4 ARM M1(this seems too related except the Node version, what processor does your Mac run on @jsjoeio?)
If you want to link them, feel free, but also I think we must open a ticket at Argon2 and get help from the maintainers there.
jsjoeio commentedon Nov 29, 2021
@im-coder-lg I don't have any updates yet but once we get 4.0.0 out, we can prioritize this!
Thanks for linking those node-argon2 issues. We may have to switch away from node-argon2 but I don't want to make any decisions until we can investigate this further.
jsjoeio commentedon Jan 3, 2022
node-rs now publishes an argon2 package. Might help here: https://github.com/napi-rs/node-rs/tree/main/packages/argon2
yisibl commentedon Jan 4, 2022
Yes,
@node-rs/argon2https://github.com/napi-rs/node-rs/tree/main/packages/argon2 relies on the power of napi-rs to solve cross-platform compatibility issues.Feel free to try and give feedback!
lg-nineoneninethreenine commentedon Jan 4, 2022
@jsjoeio can we test this on a separate branch? You can try building it(also can you tell hardware requirements for building code-server?) and sending a build to me over here(aarch64 please) and I'll test on Raspberry Pi with Ubuntu 21.10, what do you think? Also @yisibl can you tell us how to implement this over here?
20 remaining items
jsjoeio commentedon Jan 10, 2022
I'll see if I can get to this tomorrow or Wednesday which should give you enough time to help. Thank you for helping on your holidays!
lg-nineoneninethreenine commentedon Jan 11, 2022
👍
No worries! I like something to keep me occupied during my free time. What'd the branch name be?
lg-nineoneninethreenine commentedon Jan 11, 2022
Also(unrelated topic coming up!), I went to see the README, it has an extra comma beside the Coder link, it seems wrong to me, can you please inspect it? Also, since the Coder GitHub org changed the name from
cdrtocoder, you need to change this line indocs/MAINTAINING.md.lg-nineoneninethreenine commentedon Jan 11, 2022
Also, we need to update all the
cdrlinks tocoder. Do you mind if I do this?jsjoeio commentedon Jan 12, 2022
@im-coder-lg that would be fantastic!
jsjoeio commentedon Jan 12, 2022
Let me see if I can work on this this afternoon and get back to you!
jsjoeio commentedon Jan 12, 2022
Alright I have a PR up. Once CI finishes, there will be a
release-packagesartifact that you can download and test: https://github.com/coder/code-server/actions/runs/1690093340I'll add steps to the PR description for how to test.
lg-nineoneninethreenine commentedon Jan 13, 2022
alr is the artifact ready?
lg-nineoneninethreenine commentedon Jan 13, 2022
It's the new argon2's error.
jsjoeio commentedon Jan 13, 2022
@im-coder-lg not yet. We'll have to check that PR again. I had to rerun the end-to-end tests
lg-nineoneninethreenine commentedon Aug 8, 2022
I think this is happening again, any ideas on a fix?
jsjoeio commentedon Aug 8, 2022
@im-coder-lg can you open a new issue? 🙏🏼
lg-nineoneninethreenine commentedon Aug 9, 2022
Yeah, will do so. But I want to get more info, so I'll post it by tonight(take IST, perhaps 8 pm here).