tejado / telegram-nearby-map

Discover the location of nearby Telegram users 📡🌍
GNU General Public License v3.0
1.04k stars 149 forks source link

Need to get rid of CLI auth in favor of UI auth #33

Closed danteblank closed 11 months ago

danteblank commented 2 years ago

Hey, I decided to pack your app in Docker, and I achieved it with no problem, but the only thing really annoying me is that CLI authorization to Telegram. Is there the way to make it up from UI?

Here is my Dockerfile to pack it:

FROM node:16.3.0-buster-slim as base

FROM base as builder
RUN apt update
RUN apt install unzip wget -y
RUN mkdir /install
WORKDIR /install
RUN wget https://github.com/tejado/telegram-nearby-map/archive/refs/heads/main.zip
RUN unzip -d /install ./main.zip

FROM base
RUN mkdir /app
WORKDIR /app
COPY --from=builder /install/telegram-nearby-map-main /app
RUN rm package-lock.json
RUN apt update && apt upgrade -y
RUN apt install python3 python3-dev make build-essential -y
RUN npm install
ENTRYPOINT ["npm"]
CMD ["start"]

But I got to start my docker-compose like that:

version: "3"
services:
  telegram_maps:
    image: map:latest
    entrypoint: sleep
    command: infinity
    volumes:
      - ./data/config.js:/app/config.js
    ports:
      - 3000:3000
    restart: always

As you may see, I start with sleep infinity to start the app by hands, authorize and only then I can use it. It would be cool if you could do the UI auth, so anyone can use your tool out of the box with just DOCKER installed.

tejado commented 2 years ago

Hi @danteblank There might be options offered by tdlib to do this without the console, but they are not yet implemented in telegram-nearby-map. Feel free to provide a PR for it. A good starting point could be https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1set_authentication_phone_number.html