microsoft/code-push-server

I can't log in with headless accessKey on a PC other than the codepush server.

Opened this issue · 0 comments

hello

I created a docker-compose.yml file as follows:

version: "3.9"

services:
  azurite:
    image: mcr.microsoft.com/azure-storage/azurite
    container_name: azurite
    ports:
      - "10000:10000"
      - "10001:10001"
      - "10002:10002"
    networks:
      - my_network
  code-push-server:
    build:
      context: api/
    image: code-push-server:latest
    container_name: code-push-server
    ports:
      - "3000:3000"
    environment:
      - EMULATED=true
      - LOGGING=true
      - SERVER_URL=http://MY_SERVER_IP:3000
      - AZURITE_CONNECTION_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;
      - GITHUB_CLIENT_ID=
      - GITHUB_CLIENT_SECRET=
    depends_on:
      - azurite
    networks:
      - my_network

networks:
  my_network:

I wrote api/Dockerfile as follows:

FROM node:23.2.0-alpine3.19

WORKDIR /app

COPY . .

RUN npm install

RUN npm run build

CMD ["npm", "run", "start:env"]

Next, I built the image and ran the container.
docker-compose up --build

Then, I built the cli (code-push-standalone) as follows.

cd code-push-server/cli

npm i

npm run build

npm install -g

On the same machine as the code-push-server, I can log in through OAuth authentication using cli
code-push-standalone register http://MY_SERVER_IP:3000

I can also issue a headless key
code-push-standalone access-key add "My Key" --ttl 10y

After logging out, I can log in using the headless accessKey.
code-push-standalone login --accessKey {}

However, when I went to another PC, built the cli, installed it globally, and repeated the above process, GitHub OAuth authentication and login worked, and the headless key was issued, but the login with the issued accessKey did not work.
The error is as follows. It is an IPv6-related error.
[Error] connect ECONNREFUSED ::1:3000

Therefore, I tried to log in with the accessKey along with the option to use ipv4 first, as follows. (another pc is windows)
set NODE_OPTIONS=--dns-result-order=ipv4first && code-push-standalone login --accessKey {}

However, the error message changed, but it still does not work. IPv4-related error
[Error] connect ECONNREFUSED 127.0.0.1:3000

Where exactly should I fix the source code?

Thanks