Skip to content

Commit

Permalink
better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
litnialex committed Apr 1, 2024
1 parent 58455cb commit eb2b066
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 108 deletions.
8 changes: 3 additions & 5 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@



<link rel="icon" href="/assets/images/favicon.png">
<link rel="icon" href="/favicon.ico">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-9.5.15">


Expand Down Expand Up @@ -83,8 +83,7 @@
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="/index.html" title="Telegram Proxybot" class="md-header__button md-logo" aria-label="Telegram Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="/logo.png" alt="logo">

</a>
<label class="md-header__button md-icon" for="__drawer">
Expand Down Expand Up @@ -252,8 +251,7 @@
<label class="md-nav__title" for="__drawer">
<a href="/index.html" title="Telegram Proxybot" class="md-nav__button md-logo" aria-label="Telegram Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="/logo.png" alt="logo">

</a>
Telegram Proxybot
Expand Down
34 changes: 18 additions & 16 deletions Telegram-Bot-Flask.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@



<link rel="icon" href="assets/images/favicon.png">
<link rel="icon" href="favicon.ico">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-9.5.15">


Expand Down Expand Up @@ -92,8 +92,7 @@
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="index.html" title="Telegram Proxybot" class="md-header__button md-logo" aria-label="Telegram Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="logo.png" alt="logo">

</a>
<label class="md-header__button md-icon" for="__drawer">
Expand Down Expand Up @@ -261,8 +260,7 @@
<label class="md-nav__title" for="__drawer">
<a href="index.html" title="Telegram Proxybot" class="md-nav__button md-logo" aria-label="Telegram Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="logo.png" alt="logo">

</a>
Telegram Proxybot
Expand Down Expand Up @@ -481,33 +479,37 @@


<h1 id="run-as-a-flask-application">Run as a Flask application</h1>
<p>To run proxybot as a <a href="https://flask.palletsprojects.com/en/latest/">Flask application</a> you will need a valid (may be self-signed) SSL certificate for HTTPS.</p>
<p>To run proxybot as a <a href="https://flask.palletsprojects.com/en/latest/">Flask application</a> you will need a valid SSL certificate for HTTPS, which may be a self-signed certificate.</p>
<p>In example below we are creating a self-signed certificate valid for 10 years,
and later it will be used in <code>setWebhook</code> method.</p>
<pre><code>HOST=proxybot.example.com
<pre><code class="language-bash">HOST=proxybot.example.com
openssl req -newkey rsa:2048 -sha256 -nodes -keyout ssl/privkey.pem -x509 -days 3650 -out ssl/cert.pem -subj &quot;/CN=${HOST}&quot;
</code></pre>
<p><code>HOST</code> variable must contain a real IP address or a fully qualified domain name used to reach the application.</p>
<p>If SSL certificate and key are not present in ./ssl foder, Flask will launch and listen on port 8080 without HTTPS. You can then use a reverse proxy like <code>nginx</code> to provide HTTPS.</p>
<p><code>HOST</code> variable must contain a real IP address or a fully qualified domain name for reaching the application from Telegram network.</p>
<p>If SSL certificate and key are not found in ./ssl folder application will launch anycase, but will accept HTTP at port 8080.
You must then use then another frontend web-server, like nginx, to accept HTTPS requests from Telegram network and pass them to the application.</p>
<h2 id="run-with-docker">Run with Docker</h2>
<p>This command will launch pre-built proxybot docker container.</p>
<pre><code>TELEGRAM_ID=1234123123
<pre><code class="language-bash">TELEGRAM_ID=1234123123
DB_URI=&quot;mongodb+srv://***:**********@cluster0._______.mongodb.net/&quot;
docker run --rm -p 8080:8080 -p 8443:8443 -v ./ssl:/app/ssl \
-e TELEGRAM_ID=$TELEGRAM_ID -e DB_URI=$DB_URI litnialex/proxybot
</code></pre>
<h2 id="run-with-docker-compose">Run with Docker Compose</h2>
<p>You may choose to build <code>proxybot</code> container locally, as well as to start a standard <code>mongodb</code> container and set <code>DB_URI=mongodb://mongodb</code> for <code>proxybot</code>. Check <code>docker-compose.yml</code> for details.</p>
<p>You may choose to build <code>proxybot</code> container locally, as well as to start a standard <code>mongodb</code> container and set <code>DB_URI=mongodb://mongodb</code>. Check <code>docker-compose.yml</code> in <a href="https://github.com/litnialex/telegram-proxybot">repository</a> root folder for details.</p>
<p>Provide your variables in <code>.env</code> file.
Check <code>.env.example</code> for the list of all accepted vars and their default values. Launch with command: <code>docker compose up</code></p>
Check <code>.env.example</code> for the list of all accepted vars and their default values.</p>
<p>Launch with command: </p>
<pre><code class="language-bash">docker compose up
</code></pre>
<h2 id="register-the-webhook">Register the webhook</h2>
<p>The Telegram bot API method <code>setWebhook</code> must be called to start receiving updates from Telegram.</p>
<pre><code>TOKEN=123456789:NeotobrAfMymceuwackTeunLiudsudjocoi
<pre><code class="language-bash">TOKEN=123456789:NeotobrAfMymceuwackTeunLiudsudjocoi
curl -F &quot;url=${HOST}:8443/bot${TOKEN}&quot; -F certificate=@ssl/cert.pem https://api.telegram.org/bot${TOKEN}/setWebhook
</code></pre>
<p>Aditionally, you may define an API_SECRET variable to prevent unauthorized webhook requests.
In this case, add <code>-F secret_token=${API_SECRET}</code> in last command.</p>
<p>You may run multiple bots at with the same application.
<p>Additionally, you may define an API_SECRET variable to prevent unauthorized webhook calls.
For that, define AP_SECRET variable and add <code>-F secret_token=${API_SECRET}</code> in last command.</p>
<p>You may run multiple bots within the same application.
Just repeat last step for each of your bots.</p>


Expand Down
14 changes: 4 additions & 10 deletions Telegram-Bot-Serverless.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<link rel="next" href="Telegram-Bot-Flask.html">


<link rel="icon" href="assets/images/favicon.png">
<link rel="icon" href="favicon.ico">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-9.5.15">


Expand Down Expand Up @@ -94,8 +94,7 @@
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="index.html" title="Telegram Proxybot" class="md-header__button md-logo" aria-label="Telegram Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="logo.png" alt="logo">

</a>
<label class="md-header__button md-icon" for="__drawer">
Expand Down Expand Up @@ -263,8 +262,7 @@
<label class="md-nav__title" for="__drawer">
<a href="index.html" title="Telegram Proxybot" class="md-nav__button md-logo" aria-label="Telegram Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="logo.png" alt="logo">

</a>
Telegram Proxybot
Expand Down Expand Up @@ -456,18 +454,14 @@ <h1 id="run-proxybot-as-a-serverless-function">Run proxybot as a serverless func
--set-env-vars=TELEGRAM_ID=$TELEGRAM_ID,DB_URI=$DB_URI \
--source=proxybot/ proxybot
</code></pre>
<p>This command, run from the repository root folder, will upload contents of <code>proxybot</code> subfolder as a function named <code>proxybot</code>.</p>
<p>This command, run from the <a href="https://github.com/litnialex/telegram-proxybot">repository</a> root folder, will upload contents of <code>proxybot</code> subfolder as a function named <code>proxybot</code>.</p>
<h2 id="register-the-webhook">Register the webhook</h2>
<p>The Telegram bot API method <code>setWebhook</code> must be called to start receiving updates from Telegram.</p>
<pre><code>CLOUD_URL=https://***********.cloudfunctions.net/proxybot
TOKEN=123456789:NeotobrAfMymceuwackTeunLiudsudjocoi
curl -F &quot;url=${CLOUD_URL}/bot${TOKEN}&quot; https://api.telegram.org/bot${TOKEN}/setWebhook
</code></pre>
<p>Replace <code>TELEGRAM_ID</code>, <code>DB_URI</code>, <code>REGION</code>, <code>CLOUD_URL</code>, <code>TOKEN</code> variable values with your data.</p>
<p>Aditionally, you may define an API_SECRET variable to prevent unauthorized webhook requests.
In this case, add <code>-F secret_token=${API_SECRET}</code> when calling <code>curl</code> command.</p>
<p>You may run multiple bots at with the same function.
Just repeat the step to register webhook for each of your bots.</p>



Expand Down
Binary file added favicon.ico
Binary file not shown.
51 changes: 24 additions & 27 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<link rel="next" href="Telegram-Bot-Serverless.html">


<link rel="icon" href="assets/images/favicon.png">
<link rel="icon" href="favicon.ico">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-9.5.15">


Expand Down Expand Up @@ -74,7 +74,7 @@
<div data-md-component="skip">


<a href="#run-proxybot-as-a-service" class="md-skip">
<a href="#use-proxybot-as-a-service" class="md-skip">
Skip to content
</a>

Expand All @@ -92,8 +92,7 @@
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="index.html" title="Telegram Proxybot" class="md-header__button md-logo" aria-label="Telegram Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="logo.png" alt="logo">

</a>
<label class="md-header__button md-icon" for="__drawer">
Expand Down Expand Up @@ -261,8 +260,7 @@
<label class="md-nav__title" for="__drawer">
<a href="index.html" title="Telegram Proxybot" class="md-nav__button md-logo" aria-label="Telegram Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="logo.png" alt="logo">

</a>
Telegram Proxybot
Expand Down Expand Up @@ -331,9 +329,9 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#run-proxybot-as-a-service" class="md-nav__link">
<a href="#use-proxybot-as-a-service" class="md-nav__link">
<span class="md-ellipsis">
Run proxybot as a service
Use proxybot as a service
</span>
</a>

Expand All @@ -358,9 +356,9 @@
</li>

<li class="md-nav__item">
<a href="#support" class="md-nav__link">
<a href="#feedback" class="md-nav__link">
<span class="md-ellipsis">
Support
Feedback
</span>
</a>

Expand Down Expand Up @@ -439,9 +437,9 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#run-proxybot-as-a-service" class="md-nav__link">
<a href="#use-proxybot-as-a-service" class="md-nav__link">
<span class="md-ellipsis">
Run proxybot as a service
Use proxybot as a service
</span>
</a>

Expand All @@ -466,9 +464,9 @@
</li>

<li class="md-nav__item">
<a href="#support" class="md-nav__link">
<a href="#feedback" class="md-nav__link">
<span class="md-ellipsis">
Support
Feedback
</span>
</a>

Expand All @@ -495,29 +493,28 @@
<h1>Home</h1>

<p>Proxybot is a <a href="https://www.telegram.org">Telegram</a> bot which forwards all incoming messages to the owner or into a telegram group, specified by the owner.
This group can also be a supergroup with threads.</p>
This group can also be a supergroup with topics.</p>
<p>Replies are done simply texting back in the chat. Such messages always go to the last contact in that chat.
Of course you can select any message and reply to that specific message.</p>
<p>Sound, video and any other media formats supported by Telegram can be proxied in this manner.</p>
<p>Proxybot provides privacy in public communications in Telegram while using personal accounts,
and allows to handle incoming messages in teams.</p>
<h2 id="run-proxybot-as-a-service">Run proxybot as a service</h2>
Of course, you can reply to any specific message in chat history by pressing "Reply" link in that message.</p>
<p>Voice-messages, video-messages, files and any other media format supported by Telegram can be proxied in this manner.</p>
<p><em>Proxybot assists teams and individuals in managing public communications through their personal Telegram accounts.</em></p>
<h2 id="use-proxybot-as-a-service">Use proxybot as a service</h2>
<p>This bot: <a href="https://t.me/InitProxybot">@InitProxybot</a> can launch your proxybot in the cloud within seconds.</p>
<p>This is offered as a service from proxybot developer with an annual subscription fee of $20.</p>
<p>You get 4 months of free usage for the first proxybot, prepay is not required.</p>
<p><em>So, it's extremely easy to start using proxybot.</em></p>
<p>You get 4 months of free usage, prepay is not required.</p>
<p><em>It's extremely easy to start using proxybot.</em></p>
<h2 id="launch-by-your-own">Launch by your own</h2>
<p>Proxybot can be launched as a <a href="Telegram-Bot-Serverless.html">serverless function</a> or as a <a href="Telegram-Bot-Flask.html">Flask applicaiton</a>.</p>
<p>In this case you will need to provide a valid MongoDB connection,
<p>Proxybot can be launched as a <a href="Telegram-Bot-Serverless.html">serverless function</a> or as a <a href="Telegram-Bot-Flask.html">Flask application</a>.</p>
<p>In this case you will need to provide a valid MongoDB connection.
You may start with <a href="https://www.mongodb.com/docs/atlas/">MongoDB Atlas</a> free tier.</p>
<p><code>TELEGRAM_ID</code> variable must contain the ID of the Telegram account assigned "proxybot owner" privilege, and only this account will be able to control bot via commands.
If you want to find out your telegram ID ask <a href="https://t.me/my_id_bot">@my_id_bot </a></p>
<h2 id="security-considerations">Security considerations</h2>
<p>Proxybot is designed with respect to personal privacy and security in mind.
It is a 100% Open Source software dedicated to the public domain.</p>
<p><code>TOKEN</code> value is not stored anywhere in the database. Proxybot receives it as a part of the webhook URL and uses it only untill finishing handling the incoming request.</p>
<h2 id="support">Support</h2>
<p>If you have any questions or need help, please contact me in Telegram <a href="https://t.me/devproxybot">@devproxybot</a></p>
<p><code>TOKEN</code> value is not stored anywhere in the database. Proxybot receives it as a part of the webhook URL and uses it only until finishing handling the incoming request.</p>
<h2 id="feedback">Feedback</h2>
<p>Contact <a href="https://t.me/devproxybot">@devproxybot</a> for any questions or feedback.</p>



Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions ru/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@



<link rel="icon" href="/assets/images/favicon.png">
<link rel="icon" href="/favicon.ico">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-9.5.15">


Expand Down Expand Up @@ -83,8 +83,7 @@
<nav class="md-header__inner md-grid" aria-label="Верхний колонтитул">
<a href="/index.html" title="Телеграм Proxybot" class="md-header__button md-logo" aria-label="Телеграм Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="/logo.png" alt="logo">

</a>
<label class="md-header__button md-icon" for="__drawer">
Expand Down Expand Up @@ -252,8 +251,7 @@
<label class="md-nav__title" for="__drawer">
<a href="/index.html" title="Телеграм Proxybot" class="md-nav__button md-logo" aria-label="Телеграм Proxybot" data-md-component="logo">


<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
<img src="/logo.png" alt="logo">

</a>
Телеграм Proxybot
Expand Down
Loading

0 comments on commit eb2b066

Please sign in to comment.