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

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

Open
puresprout opened this issue Nov 20, 2024 · 0 comments

Comments

@puresprout
Copy link

puresprout commented Nov 20, 2024

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

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

No branches or pull requests

1 participant