Closed 4n70w4 closed 4 years ago
I clean TELEGRAM_API_ID
and TELEGRAM_API_HASH
from .env
and run:
php server.php --docker --port=9500 --session=session
Starting MadelineProto...
You did not define a valid API ID/API hash. Do you want to define it now manually, or automatically? (m/a)
Note that you can also provide the API parameters directly in the code using the settings: https://docs.madelineproto.xyz/docs/SETTINGS.html#settingsapp_infoapi_id
Your choice (m/a): [2020-08-09 14:37:47] [warning]
TelegramApiServer ready.
Number of sessions: 1.
[2020-08-09 14:37:47] [debug] Starting
[2020-08-09 14:37:47] [warning] Running in production with assertions enabled is not recommended; it has a negative impacton performance. Disable assertions in php.ini (zend.assertions = -1) for best performance or set the debug mode option to hide this warning.
[2020-08-09 14:37:47] [debug] Started
[2020-08-09 14:37:47] [info] Listening on http://0.0.0.0:9500/
Authorizing session: session
Press enter
Enter a phone number that is already registered on Telegram: +7XXXXXXX
Enter the verification code you received in telegram: XXXXXX
I recieve verification code but after submit code also nothing happens.
For docker you need to fill .env.docker file. .env file id used when you run composer version without docker.
Sometimes readline questions followed by log messages, so you need to read few lines before. On your second message you got question:
You did not define a valid API ID/API hash. Do you want to define it now manually, or automatically? (m/a)
You need to enter 'm', and press enter (if you not define app_id and app_hash in .env.docker).
Then enter phone, enter code and password(if you have 2fa enabled).
Then you can check your accounts: curl "http://127.0.0.1:9500/system/getSessionList"
If its authorized, then you save your session (some times its not saved automatically): curl "http://127.0.0.1:9500/api/serialize"
Then you can end your setup with ctrl+c, exit from docker shell and restart docker container: docker-compose restart teleram-api-server
After that you can send requests to 127.0.0.1:9503
You can write me in telegram: https://t.me/xtrime You from Moscow? We can speak russian :)
Thanks for answers.
My contents of .env
and .env.docker
are identical.
For the experiment, I created a new Ubuntu 18 virtual machine on Vultr (analogue of the digital ocean). And everything worked out. In 5-10 minutes everything was installed, started and worked.
The problems that I described above were in docker on Windows 10. I tried docker over Hyper-V and over WSL2.
Nothing happens on "Authorizing session: session".
But https://github.com/unreal4u/telegram-api works in docker on Windows.
In the coming days, I will try again to reproduce it on Windows, and if there are any questions, I will contact you via telegram.
Thanks for report. Ill check tomorrow in docker for mac. I want to mention tg.i-c-a.su uses docker version, but i used existing session file when i was migrating to docker.
I guess i know what caused your issue! I forgot to update readme after last feature.
Correct command to add new session in docker: php server.php -p=9500 -s=session --docker -e=.env.docker
I will change readme now.
Hi! I run in docker:
And nothing happens even after 10 minutes.
In mysql 4 empty tables:
I see empty file
sessions/session.madeline.ipc
.Proxy works: