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

config.yml listen: 0.0.0.0:80 is ignored - server still starts listening to default port 4873 #4495

Open
1 task
ascheucher-shopify-partner opened this issue Feb 8, 2024 · 1 comment

Comments

@ascheucher-shopify-partner
Copy link

Port configuration is ignored

Your Environment

Latest Docker image:

  • verdaccio version: 5.29.0
  • node version v20.10.0
  • package manager: not relevant
  • os: linux
  • platform: docker

Bug description

Given the description shown below, starting the verdaccio server, I expect to start listening to port 80, but it listens to the default port 4873.

Server startup log:

info --- config file  - /verdaccio/conf/config.yaml
info --- the "crypt" algorithm is deprecated consider switch to "bcrypt" in the configuration file. Read the documentation for additional details
info --- using htpasswd file: /verdaccio/conf/htpasswd
info --- plugin successfully loaded: verdaccio-htpasswd
warn --- http address - http://0.0.0.0:4873/ - verdaccio/5.29.0

How to Reproduce

How I have setup the docker container:

CONFIG_FILE=$( cat <<-EOF
storage: /verdaccio/storage
listen: 
  - 0.0.0.0:80
auth:
  htpasswd:
    file: ./htpasswd
uplinks:
  npmjs:
    url: https://registry.npmjs.org/
packages:
  '@*/*':
    access: $all
    publish: $authenticated
    proxy: npmjs
  '**':
    proxy: npmjs
log: { type: stdout, format: pretty, level: http }
web:
  enable: true
  title: Verdaccio @ verdaccio.sub.example.com
EOF
)

# write the config into the docker volume
docker run --rm \
  --name create_verdaccio_config \
  -v verdaccio_config:/verdaccio/conf \
  alpine:latest \
  /bin/sh -c "mkdir /verdaccio/conf; echo \"${CONFIG_FILE}\" >> /verdaccio/conf/config.yaml"

# check the config file:
docker run --rm \
  --name create_verdaccio_config \
  -v verdaccio_config:/verdaccio/conf \
  alpine:latest \
  /bin/sh -c 'echo "current /verdaccio/conf/config.yaml:\n"; cat /verdaccio/conf/config.yaml'

# and start
docker run --name verdaccio \
  --expose 80 \
  --env VERDACCIO_PUBLIC_URL="https://verdaccio.sub.example.com/" \
  --env NODE_DEBUG="request verdaccio" \
  --env DEBUG="verdaccio* verdaccio" \
  --detach \
  --restart=unless-stopped \
  -v verdaccio_config:/verdaccio/conf \
  -v verdaccio_storage:/verdaccio/storage \
  -v verdaccio_plugins:/verdaccio/plugins \
  --network='internal-docker-net' \
  verdaccio/verdaccio

Expected behavior

Verdaccio starts listening to port http://0.0.0.0:80

But Verdaccio starts listening to port http://0.0.0.0:8473

Screenshots, server logs, package manager log

~$ docker logs -f verdaccio
2024-02-08T13:09:45.949Z verdaccio:config:parse parse config file /verdaccio/conf/config.yaml
2024-02-08T13:09:45.952Z verdaccio:config:parse parsing config file: '/verdaccio/conf/config.yaml'
2024-02-08T13:09:45.957Z verdaccio:logger logging stdout enabled
2024-02-08T13:09:45.958Z verdaccio:logger setup logger
2024-02-08T13:09:45.958Z verdaccio:logger has prettifier? true
2024-02-08T13:09:45.967Z verdaccio:config config path: /verdaccio/conf/config.yaml
2024-02-08T13:09:45.967Z verdaccio:config set default user agent
2024-02-08T13:09:45.976Z verdaccio:plugin:local-storage sync database started
2024-02-08T13:09:45.977Z verdaccio:plugin:local-storage sync folder '/verdaccio/storage' created succeed
2024-02-08T13:09:45.980Z verdaccio:plugin:local-storage sync write succeed
2024-02-08T13:09:45.985Z verdaccio:config check secret key
2024-02-08T13:09:45.985Z verdaccio:config reusing previous key
2024-02-08T13:09:45.985Z verdaccio:plugin:local-storage sync database started
2024-02-08T13:09:45.986Z verdaccio:plugin:local-storage sync folder '/verdaccio/storage' created succeed
2024-02-08T13:09:45.986Z verdaccio:plugin:local-storage sync write succeed
2024-02-08T13:09:45.988Z verdaccio:plugin:loader isScoped false
2024-02-08T13:09:45.988Z verdaccio:plugin:loader loading plugin /usr/local/lib/node_modules/verdaccio/build/plugins/htpasswd
2024-02-08T13:09:45.989Z verdaccio:plugin:loader plugin /usr/local/lib/node_modules/verdaccio/build/plugins/htpasswd not found
2024-02-08T13:09:45.989Z verdaccio:plugin:loader loading plugin verdaccio-htpasswd
2024-02-08T13:09:46.006Z verdaccio:plugin:loader plugin htpasswd is an npm package
2024-02-08T13:09:46.006Z verdaccio:plugin:loader plugin is ES6
2024-02-08T13:09:46.007Z verdaccio:plugin:htpasswd password hash algorithm: crypt
2024-02-08T13:09:46.007Z verdaccio:plugin:htpasswd file: ./htpasswd
2024-02-08T13:09:46.007Z verdaccio:plugin:htpasswd config path: /verdaccio/conf/config.yaml
2024-02-08T13:09:46.007Z verdaccio:plugin:htpasswd htpasswd path: /verdaccio/conf/htpasswd
2024-02-08T13:09:46.013Z verdaccio:search:indexer reindexing search indexer
2024-02-08T13:09:46.014Z verdaccio:search:indexer no packages to index
2024-02-08T13:09:46.014Z verdaccio:search:indexer reindexed search indexer
2024-02-08T13:09:46.014Z verdaccio:plugin:local-storage get full list of packages (0) has been fetched
2024-02-08T13:09:46.030Z verdaccio:web:render static path '/usr/local/lib/node_modules/verdaccio/node_modules/@verdaccio/ui-theme/static'
info --- config file  - /verdaccio/conf/config.yaml
info --- the "crypt" algorithm is deprecated consider switch to "bcrypt" in the configuration file. Read the documentation for additional details
info --- using htpasswd file: /verdaccio/conf/htpasswd
info --- plugin successfully loaded: verdaccio-htpasswd
warn --- http address - http://0.0.0.0:4873/ - verdaccio/5.29.0

Configuration File (cat ~/.config/verdaccio/config.yaml)

docker exec -it verdaccio /bin/sh
~ $ cat /verdaccio/conf/config.yaml
storage: ./storage
listen:
  - 0.0.0.0:80
auth:
  htpasswd:
    file: ./htpasswd
uplinks:
  npmjs:
    url: https://registry.npmjs.org/
packages:
  '@*/*':
    access:
    publish:
    proxy: npmjs
  '**':
    proxy: npmjs
log: { type: stdout, format: pretty, level: http }
web:
  enable: true
  title: Verdaccio @ verdaccio.sub.example.com
~ $

Environment information

Please paste the results of running verdaccio --info:

~ $ verdaccio --info

Environment Info:
  System:
    OS: Linux 6.1 Alpine Linux
    CPU: (4) x64 Common KVM processor
  Binaries:
    npm: 10.2.3 - /usr/local/bin/npm
  npmGlobalPackages:
    verdaccio: 5.29.0
~ $

Debugging output

  • $ NODE_DEBUG=request verdaccio display request calls (verdaccio <--> uplinks)
  • $ DEBUG=verdaccio* verdaccio enable extreme verdaccio debug mode (verdaccio api)
  • $ npm -ddd prints:
  • $ npm config get registry prints:

Contribute to Verdaccio

  • I'm willing to fix this bug 🥇

Sorry, not my strong side ;)

@NabilNaou
Copy link

Also having issues with this unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants