tgcf icon indicating copy to clipboard operation
tgcf copied to clipboard

Setting Port Number

Open uwedisch opened this issue 1 year ago • 9 comments

Is your feature request related to a problem? Please describe. When someone has several instances of tgcf running on the same machine the instances grab the next free port, beginning with 8501.

Describe the solution you'd like I'd like to have the option to set the port number that tgcf binds to.

Describe alternatives you've considered Starting several instances with one script is not practial. Using Docker for several instances is also not practical because every instance has more than 2 GB data.

Additional context Running several instances on the same machine is most practial from the point of ressources, but not predictable in relation of the port number a tgcf instance is using.

uwedisch avatar Mar 29 '24 00:03 uwedisch

I run three instances of TGCF on the same machine, each with a different port and using a different Python virtual environment without any issues. TGCF 1 runs on the default Streamlit port, 8501, while TGCF 2 and 3 run on my chosen ports, which i configured by changing the default Streamlit port in the Streamlit configuration.

25gabriel-cmyk avatar Mar 30 '24 21:03 25gabriel-cmyk

Where in the configuration? What parameters to provide?

uwedisch avatar Mar 30 '24 22:03 uwedisch

Why do you run 3 instances? Do you use 3 different api_id and api_hash?

ghost avatar Mar 31 '24 11:03 ghost

@uwedisch Find the streamlit configuration on /your-TGCF-directory/.venv/lib/python3.~/site-packages/streamlit/config.py

Screenshot 2024-03-31 215042

Change the default value to any port of your choice and restart your TGCF

@poliandro Yes, i run three different TGCF instances, each serving a different purpose, on the same machine/VPS with three different TG APIs and hashes

25gabriel-cmyk avatar Mar 31 '24 15:03 25gabriel-cmyk

@uwedisch Find the streamlit configuration on /your-TGCF-directory/.venv/lib/python3.~/site-packages/streamlit/config.py

Screenshot 2024-03-31 215042

Change the default value to any port of your choice and restart your TGCF

What is about updates when config.py receiving changes because of changed package? Are getting these changes and my changes merged?

uwedisch avatar Mar 31 '24 18:03 uwedisch

@uwedisch Find the streamlit configuration on /your-TGCF-directory/.venv/lib/python3.~/site-packages/streamlit/config.py

Screenshot 2024-03-31 215042

Change the default value to any port of your choice and restart your TGCF

@poliandro Yes, i run three different TGCF instances, each serving a different purpose, on the same machine/VPS with three different TG APIs and hashes

I'm using docker I can't these settings

djfaizp avatar Jul 09 '24 09:07 djfaizp

Anyone get this to work using docker images?

Cyberwayn3 avatar Aug 24 '24 14:08 Cyberwayn3

i was manage to make it work but now i have built my own because it's more reliable and act more like human

djfaizp avatar Aug 24 '24 15:08 djfaizp

I'm also using Docker with my own image for two containers.

uwedisch avatar Sep 28 '24 23:09 uwedisch