aahnik / tgcf

The ultimate tool to automate custom telegram message forwarding. Live-syncer, Auto-poster, backup-bot, cloner, chat-forwarder, duplicator, ... Call it whatever you like! tgcf can fulfill your custom needs.
https://github.com/aahnik/tgcf/wiki
MIT License
1.34k stars 795 forks source link

Setting Port Number #584

Open uwedisch opened 6 months ago

uwedisch commented 6 months ago

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.

25gabriel-cmyk commented 6 months ago

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.

uwedisch commented 6 months ago

Where in the configuration? What parameters to provide?

poliandro commented 6 months ago

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

25gabriel-cmyk commented 6 months ago

@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

uwedisch commented 6 months ago

@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?

djfaizp commented 2 months ago

@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

Cyberwayn3 commented 1 month ago

Anyone get this to work using docker images?

djfaizp commented 1 month ago

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

uwedisch commented 4 days ago

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