Skip to content
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

upgrade argon2 to 0.29.1 to fix FreeBSD #4669

Assignees
Labels
chore Related to maintenance or clean up dependencies Pull requests that update a dependency file
Milestone

Comments

@GogoFC
Copy link

GogoFC commented Dec 30, 2021

Documentation explains how to start and restart the server via System D

Any FreeBSD users? How do you use it, how do you manually start it and restart it, and any other useful info.

I managed to install it, but I don't know how to start it.

@GogoFC GogoFC added the docs Documentation related label Dec 30, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Jan 3, 2022

The docs explain how to install and run it here.

  1. install
  2. run code-server to start

Let me know if that works

@GogoFC
Copy link
Author

GogoFC commented Jan 5, 2022

Tried again this is the error below. I googled it but didn't help

yarn global add code-server
yarn global v1.22.11
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "code-server > @coder/logger@1.1.16" has unmet peer dependency "@google-cloud/logging@^4.5.2".
[4/4] Building fresh packages...
[1/3] ⡀ argon2
[-/3] ⢀ waiting...
error /home/gogofc/.config/yarn/global/node_modules/argon2: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: /home/gogofc/.config/yarn/global/node_modules/argon2
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@1.0.8
node-pre-gyp info using node@14.18.1 | freebsd | x64
node-pre-gyp info check checked for "/usr/home/gogofc/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3/argon2.node" (not found)
node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/v0.28.3/argon2-v0.28.3-napi-v3-freebsd-x64-unknown.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.28.3/argon2-v0.28.3-napi-v3-freebsd-x64-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for argon2@0.28.3 and node@14.18.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.28.3/argon2-v0.28.3-napi-v3-freebsd-x64-unknown.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.18.1 | freebsd | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.18.1 | freebsd | x64
gyp info find Python using Python version 3.8.12 found at "/usr/local/bin/python3.8"
gyp http GET https://nodejs.org/download/release/v14.18.1/node-v14.18.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v14.18.1/node-v14.18.1-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v14.18.1/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v14.18.1/SHASUMS256.txt
gyp info spawn /usr/local/bin/python3.8
gyp info spawn args [
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/home/gogofc/.config/yarn/global/node_modules/argon2/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/gogofc/.cache/node-gyp/14.18.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/gogofc/.cache/node-gyp/14.18.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/gogofc/.cache/node-gyp/14.18.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/usr/home/gogofc/.config/yarn/global/node_modules/argon2',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.18.1 | freebsd | x64
gypgmake: Entering directory '/usr/home/gogofc/.config/yarn/global/node_modules/argon2/build'
 info spawn gmake
gyp  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
 info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  AR(target) Release/obj.target/argon2.a
  COPY Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
../src/argon2_node.cpp:52:21: error: assigning to 'uint8_t *' (aka 'unsigned char *') from 'const std::__1::basic_string<unsigned char, std::__1::char_traits<unsigned char>, std::__1::allocator<unsigned char>>::value_type *' (aka 'const unsigned char *') discards qualifiers
    ctx.pwd = plain.data();
              ~~~~~~^~~~~~
../src/argon2_node.cpp:54:21: error: assigning to 'uint8_t *' (aka 'unsigned char *') from 'const std::__1::basic_string<unsigned char, std::__1::char_traits<unsigned char>, std::__1::allocator<unsigned char>>::value_type *' (aka 'const unsigned char *') discards qualifiers
    ctx.salt = salt.data();
               ~~~~~^~~~~~
../src/argon2_node.cpp:56:18: error: assigning to 'uint8_t *' (aka 'unsigned char *') from 'const std::__1::basic_string<unsigned char, std::__1::char_traits<unsigned char>, std::__1::allocator<unsigned char>>::value_type *' (aka 'const unsigned char *') discards qualifiers
    ctx.secret = opts.secret.empty() ? nullptr : opts.secret.data();
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/argon2_node.cpp:58:14: error: assigning to 'uint8_t *' (aka 'unsigned char *') from 'const std::__1::basic_string<unsigned char, std::__1::char_traits<unsigned char>, std::__1::allocator<unsigned char>>::value_type *' (aka 'const unsigned char *') discards qualifiers
    ctx.ad = opts.ad.empty() ? nullptr : opts.ad.data();
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/argon2_node.cpp:159:29: warning: implicit conversion from 'unsigned long' to 'uint32_t' (aka 'unsigned int') changes value from 4294967296 to 0 [-Wconstant-conversion]
    setMaxMin("memoryCost", ARGON2_MAX_MEMORY, max(ARGON2_MIN_MEMORY, 1024));
    ~~~~~~~~~               ^~~~~~~~~~~~~~~~~
../src/../argon2/include/argon2.h:68:50: note: expanded from macro 'ARGON2_MAX_MEMORY'
    ARGON2_MIN(UINT32_C(0xFFFFFFFF), UINT64_C(1) << ARGON2_MAX_MEMORY_BITS)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/../argon2/include/argon2.h:63:46: note: expanded from macro 'ARGON2_MIN'
#define ARGON2_MIN(a, b) ((a) < (b) ? (a) : (b))
                                             ^
1 warning and 4 errors generated.
gmake: *** [argon2.target.mk:117: Release/obj.target/argon2/src/argon2_node.o] Error 1
gmake: Leaving directory '/usr/home/gogofc/.config/yarn/global/node_modules/argon2/build'
gyp ERR! build error
gyp ERR! stack Error: `gmake` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System FreeBSD 13.0-RELEASE
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/home/gogofc/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3/argon2.node" "--module_name=argon2" "--module_path=/usr/home/gogofc/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /usr/home/gogofc/.config/yarn/global/node_modules/argon2
gyp ERR! node -v v14.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/home/gogofc/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/usr/home/gogofc/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/home/gogofc/.config/yarn/global/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1058:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
node-pre-gyp ERR! System FreeBSD 13.0-RELEASE
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/gogofc/.config/yarn/global/node_modules/argon2/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/home/gogofc/.config/yarn/global/node_modules/argon2
node-pre-gyp ERR! node -v v14.18.1
node-pre-gyp ERR! node-pre-gyp -v v1.0.8
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/home/gogofc/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/usr/home/gogofc/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3 --napi_version=

gogofc@freebsd:~ $

@jsjoeio
Copy link
Contributor

jsjoeio commented Jan 5, 2022

https://github.com/ranisalt/node-argon2/releases/download/v0.28.3/argon2-v0.28.3-napi-v3-freebsd-x64-unknown.tar.gz

This returns Not Found for me as well.

I think we need to look into argon2 more. I shared this in another issue, but I think we'd have to switch to it within code-server itself: https://github.com/napi-rs/node-rs/tree/main/packages/argon2

In the meantime, you could deploy code-server to Railway or another service to get started today.

@jsjoeio jsjoeio added this to the On Deck milestone Jan 5, 2022
@GogoFC
Copy link
Author

GogoFC commented Jan 5, 2022

thanks, it's needed on this particular server which happens to be FreeBSD :)

@katrinabryce
Copy link

If you want to have it start automatically at boot, you probably want to so:

Create a service file /usr/local/etc/rc.d/code

#!/bin/sh
#
# PROVIDE: code-server
# REQUIRE: nginx-server
# KEYWORD:

. /etc/rc.subr

name="code"
rcvar="code_enable"
code_user="katrina"
code_command="/usr/local/bin/code-server --config /home/katrina/.config/code-server/config.yaml --user-data-dir /home/katrina/"
pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-P ${pidfile} -r -f ${code_command}"

load_rc_config $name
: ${code_enable:=no}

run_rc_command "$1"

Replace "katrina" in the three different places with your own username

In /etc/rc.conf, add the line

code_enable="YES"

Then service code start to start

@ranisalt
Copy link

Try updating to argon2@0.29.1 which packages prebuilt binaries for FreeBSD.

@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 23, 2022

@ranisalt I can do that. Thanks for the suggestion!

@jsjoeio jsjoeio changed the title FreeBSD regular usage pointers upgrade argon2 to 0.29.1 to fix FreeBSD Aug 23, 2022
@jsjoeio jsjoeio self-assigned this Aug 23, 2022
@jsjoeio jsjoeio added dependencies Pull requests that update a dependency file chore Related to maintenance or clean up and removed docs Documentation related labels Aug 23, 2022
@jsjoeio jsjoeio modified the milestones: On Deck, August 2022 Aug 23, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 23, 2022

Closing via #5492

@jsjoeio jsjoeio closed this as completed Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Related to maintenance or clean up dependencies Pull requests that update a dependency file
Projects
None yet
4 participants