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

Default config not loaded due to excessive validation #654

Open
coopernetes opened this issue Jul 19, 2024 · 1 comment
Open

Default config not loaded due to excessive validation #654

coopernetes opened this issue Jul 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@coopernetes
Copy link
Contributor

coopernetes commented Jul 19, 2024

Describe the bug
When installing Git Proxy as a package to execute & run, a configuration may be optionally provided for customization. When the --config option is omitted, it is expected that the default (bundled) proxy.config.json should be loaded in its place.

Related #526 f9c456d

Currently, the app fails to start due to the call to config.validate() which expects a file to exist in the current working directory:

$ git-proxy
node:fs:573
  return binding.open(
                 ^

Error: ENOENT: no such file or directory, open 'proxy.config.json'
    at Object.openSync (node:fs:573:18)
    at Object.readFileSync (node:fs:452:35)
    at Object.validate (/home/docker/.npm-global/lib/node_modules/@finos/git-proxy/src/config/file.js:16:32)
    at Object.<anonymous> (/home/docker/.npm-global/lib/node_modules/@finos/git-proxy/index.js:39:8)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'proxy.config.json'
}

Node.js v20.15.1

To Reproduce
Steps to reproduce the behavior:

  1. Run npm install -g @finos/[email protected] or run npm pack && npm install -g ./finos-git-proxy-1.3.2.tar.gz to install from source.
  2. Execute git-proxy with no arguments.

Expected behavior
Git Proxy starts with all the default loaded values from proxy.config.json that we ship with the package itself.

@coopernetes coopernetes added bug Something isn't working good first issue Good for newcomers labels Jul 19, 2024
@JamieSlome
Copy link
Member

@msagi - any opine here?

@coopernetes coopernetes self-assigned this Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants