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

Add fully functional and tested cloud deploy buttons #65

Merged
merged 10 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .do/deploy.template.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
spec:
name: tgcf

services:
- name: worker

github:
repo: aahnik/tgcf
branch: main
deploy_on_push: false
dockerfile_path: Dockerfile

dockerfile_path: Dockerfile

envs:
- key: API_ID
value: someval
type: SECRET
scope: RUN_TIME

- key: API_HASH
value: someval
type: SECRET
scope: RUN_TIME

- key: SESSION_STRING
value: someval
type: SECRET
scope: RUN_TIME

- key: MODE
scope: RUN_TIME

- key: TGCF_CONFIG
value: someval
type: SECRET
scope: RUN_TIME

80 changes: 41 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ The ultimate tool to automate telegram message forwarding.

The *key features* are:

1. Two [modes of operation](https://github.com/aahnik/tgcf/wiki/Past-vs-Live-modes-explained)
1. Two **[modes of operation](https://github.com/aahnik/tgcf/wiki/Past-vs-Live-modes-explained)**
are _past_ or _live_ for dealing with either existing or upcoming messages.
2. Supports [signing in](https://github.com/aahnik/tgcf/wiki/Signing-in-with-a-bot-or-user-account)
2. Supports **[login](https://github.com/aahnik/tgcf/wiki/Signing-in-with-a-bot-or-user-account)**
with both telegram _bot_ account as well as _user_ account.
3. Custom [Filtering](https://github.com/aahnik/tgcf/wiki/How-to-use-filters-%3F)
of messages based on whitelist or blacklist.
4. Modification of messages like [Text Replacement](https://github.com/aahnik/tgcf/wiki/Text-Replacement-feature-explained),
[Watermarking](https://github.com/aahnik/tgcf/wiki/How-to-use--watermarking-%3F),
[OCR](https://github.com/aahnik/tgcf/wiki/You-can-do-OCR-!) etc.
5. Detailed **[documentation📖](https://github.com/aahnik/tgcf/wiki)** +
Video tutorial + Fast help in [discussion forum💬](https://github.com/aahnik/tgcf/discussions).
6. If you are a python developer, writing [plugins🔌](https://github.com/aahnik/tgcf/wiki/How-to-write-a-plugin-for-tgcf-%3F)
3. Custom **[filter]() [replace]() [watermark]() [ocr]()** and whatever you need !
4. Detailed **[docs 📚](https://github.com/aahnik/tgcf/wiki)** +
Video tutorial + Fast help in **[discussion forum 😎](https://github.com/aahnik/tgcf/discussions)**.
5. If you are a python developer, writing **[plugins 🔌](https://github.com/aahnik/tgcf/wiki/How-to-write-a-plugin-for-tgcf-%3F)**
is like stealing candy from a baby.

What are you waiting for? Star 🌟 the repo and click Watch 🕵 to recieve updates.
Expand All @@ -53,17 +49,19 @@ A youtube video is coming soon. [Subscribe](https://www.youtube.com/channel/UCcE
> **Note:** Make sure you have Python 3.8 or above installed.
Go to [python.org](https://python.org) to download python.

Click on your platform of choice for a more detailed guide.

| Platform | Supported |
| -------- | :-------: |
| Windows | ✅ |
| [Windows](https://github.com/aahnik/tgcf/wiki/Run-tgcf-on-Windows) | ✅ |
| Mac | ✅ |
| Linux | ✅ |
| [Android](https://github.com/aahnik/tgcf/wiki/Run-on-Android-using-Termux) | ✅ |

If you are familiar with **Docker**, you may [go that way](https://github.com/aahnik/tgcf/wiki/Install-and-run-using-docker)
for an easier life.

Open your terminal (command prompt) and run the following commands.
Open your terminal and run the following commands.

```shell
pip install --upgrade tgcf
Expand Down Expand Up @@ -91,51 +89,55 @@ An `yaml` file to configure how `tgcf` behaves.
### Start `tgcf` ✨

In your terminal, just run `tgcf live` or `tgcf past` to start `tgcf`.
It will prompt you to enter your phone no. or bot token, when you run it
for the first time.

For more details run `tgcf --help` or [read docs](https://github.com/aahnik/tgcf/wiki/CLI-Usage).

## Run on cloud 🌩️
## Run on Cloud 🌩️

Deploying to a cloud server is an easier alternative if you cannot install
on your own machine.
Cloud servers are very reliable and great for running `tgcf` in live mode.
Cloud servers are very reliable and great for running `tgcf` in live mode
for a long time.

When you are deploying on a cloud platform, you can configure `tgcf`
using [environment variables](https://github.com/aahnik/tgcf/wiki/Environment-Variables).
The contents of [`tgcf.config.yml`](https://github.com/aahnik/tgcf/wiki/How-to-configure-tgcf-%3F)
can be put inside the environment variable called `TGCF_CONFIG`.
<!-- markdownlint-disable -->

You may click on the platform name *(left coloumn)* to learn more about the
deployment process. Clicking on the "deploy" button *(right coloumn)* will
directly deploy the application to that platform.
| Platform | Pros | Cons |
| ------------------------------------------------------------ | ----------------------- | --------------------------- |
| <a href="https://github.com/aahnik/tgcf/wiki/Deploy-to-Heroku"> <img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" width=155></a> | free for 450 hr/mo | can't use tgcf in past mode |
| <a href="https://github.com/aahnik/tgcf/wiki/Deploy-to-Digital-Ocean"> <img src="https://www.deploytodo.com/do-btn-blue.svg" alt="Deploy to DO" width=220></a> | speed and reliability | starts from $5/mo |
| <a href="https://github.com/aahnik/tgcf/wiki/Run-for-free-on-Gitpod"> <img src="https://gitpod.io/button/open-in-gitpod.svg" alt="Run on Gitpod" width=160></a> | easily edit config file | only 50 hr/mo free |

<!-- markdownlint-disable -->

<br>
**Other options**

| Platform | One click deploy |
| ------------------------------------------------------------ | :----------------------------------------------------------: |
| [Heroku](https://github.com/aahnik/tgcf/wiki/Deploy-to-Heroku) | <a href="https://heroku.com/deploy?template=https://github.com/aahnik/tgcf"> <img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" width=155></a> |
| [Digital Ocean](https://github.com/aahnik/tgcf/wiki/Deploy-to-Digital-Ocean) | <a href="https://cloud.digitalocean.com/apps/new?repo=https://github.com/aahnik/tgcf/tree/main"> <img src="https://www.deploytodo.com/do-btn-blue.svg" alt="Deploy to DO" width=220></a> |
| [Google Cloud](https://github.com/aahnik/tgcf/wiki/Run-on-Google-Cloud) | <a href="https://deploy.cloud.run/?git_repo=https://github.com/aahnik/tgcf.git"> <img src="https://deploy.cloud.run/button.svg" alt="Run on Google Cloud" width=210></a> |
| [Gitpod](https://github.com/aahnik/tgcf/wiki/Run-for-free-on-Gitpod) | <a href="https://gitpod.io/#https://github.com/aahnik/tgcf"> <img src="https://gitpod.io/button/open-in-gitpod.svg" alt="Run on Gitpod" width=160></a> |
- [Python Anywhere](https://github.com/aahnik/tgcf/wiki/Run-on-PythonAnywhere)
- [Google Cloud Run](https://github.com/aahnik/tgcf/wiki/Run-on-Google-Cloud)
- Scheduled using [GitHub Actions](https://github.com/aahnik/tgcf/wiki/Run-tgcf-in-past-mode-periodically)

<br>
<!-- markdownlint-enable -->

If you need to run `tgcf` in past mode periodically, then you may set a cron job
in your computer or use [GitHub Actions](https://github.com/aahnik/tgcf/wiki/Run-tgcf-in-past-mode-periodically)
to run a scheduled workflow.
<!-- markdownlint-enable -->

## Getting Help 💁🏻

- First of all [read the wiki](https://github.com/aahnik/tgcf/wiki)
and [watch](https://www.youtube.com/channel/UCcEbN0d8iLTB6ZWBE_IDugg) the videos.
- If you still have doubts, you can try searching your problem in discussion
forum or the issue tracker.
and [watch the videos](https://www.youtube.com/channel/UCcEbN0d8iLTB6ZWBE_IDugg)
to get started.
- Search your problem everywhere !
- Feel free to ask your questions in the [Discussion forum](https://github.com/aahnik/tgcf/discussions/new).
- For reporting bugs or requesting a feature please use the [issue tracker](https://github.com/aahnik/tgcf/issues/new)
for this repo.

Please do not send me direct messages on Telegram.
(Exception: Sponsors can message me anytime)
## Contributing 🙏

PRs most welcome! Read the [contributing guidelines](/.github/CONTRIBUTING.md) to get started.

Also read:

- [How to write a plugin for tgcf](https://github.com/aahnik/tgcf/wiki/How-to-write-a-plugin-for-tgcf-%3F)
- [Package management with Poetry](https://python-poetry.org/docs/)
- [Telethon documentation](https://docs.telethon.dev/en/latest/)

If you are not a developer, you may also contribute financially to
incentivise the development of any custom feature you need.
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: tgcf

description: Forward Telegram messages from source to destination using tgcf periodically

runs:
using: docker
image: Dockerfile
11 changes: 11 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
"description": "Put the contents of tgcf.config.yml here",
"value": "",
"required": false
},
"MODE":{
"description": "The mode you want to run tgcf past/live",
"value": "",
"required": false

},
"SESSION_STRING":{
"description": "After you login into your telegram account, put the session string.",
"value": "",
"required": false
}
}
}
Loading